73 lines
2.6 KiB
PHP
73 lines
2.6 KiB
PHP
<?php
|
|
// Default values
|
|
$maxLevel = isset($_POST['max_level']) ? (int)$_POST['max_level'] : 100;
|
|
$startXp = isset($_POST['start_xp']) ? (int)$_POST['start_xp'] : 5;
|
|
$multiplier = isset($_POST['multiplier']) ? (float)$_POST['multiplier'] : 1.12;
|
|
|
|
$output = "";
|
|
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
$currentXpRequirement = $startXp;
|
|
$totalXp = 0;
|
|
$xpLevels = [];
|
|
|
|
for ($i = 0; $i < $maxLevel; $i++) {
|
|
$xpLevels[] = "ExperiencePointsForLevel[" . $i . "]=" . round($totalXp);
|
|
// Calculate next jump
|
|
$totalXp += $currentXpRequirement;
|
|
$currentXpRequirement *= $multiplier;
|
|
}
|
|
|
|
$overrideLine = "LevelExperienceRampOverrides=(" . implode(",", $xpLevels) . ")";
|
|
$maxExpLine = "OverrideMaxExperiencePointsPlayer=" . round($totalXp);
|
|
|
|
$output = "[/Script/ShooterGame.ShooterGameMode]\n" . $overrideLine . "\n" . $maxExpLine;
|
|
}
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>ASA Level Curve Generator</title>
|
|
<link rel="stylesheet" href="css/gen.css">
|
|
</head>
|
|
<body>
|
|
|
|
<div class="container">
|
|
<h5><a href="https://gen.mxdev.ovh">Back to Gen. List</a></h5>
|
|
<h1>ASA Level Generator</h1>
|
|
<h2>Language: HTML / PHP</h2>
|
|
<h4>Developper: mikx</h4>
|
|
<h4>Sources: <a href="https://mxgit.ovh/mikx/MxGen/src/branch/main/arksalc">MxGit</a></h4>
|
|
<h5>Version: 0.1.0</h5>
|
|
</div>
|
|
<br><br>
|
|
<div class="container">
|
|
<form method="post">
|
|
<div class="form-group">
|
|
<label>Max Level</label>
|
|
<input type="number" name="max_level" value="<?php echo $maxLevel; ?>">
|
|
<div class="desc">Total levels attainable by the player.</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Starting XP (Level 1 to 2)</label>
|
|
<input type="number" name="start_xp" value="<?php echo $startXp; ?>">
|
|
<div class="desc">The XP required for the very first level up.</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Exponential Multiplier</label>
|
|
<input type="number" step="0.01" name="multiplier" value="<?php echo $multiplier; ?>">
|
|
<div class="desc">How much harder each level gets (1.10 to 1.15 recommended).</div>
|
|
</div>
|
|
<button type="submit">Generate INI Code</button>
|
|
</form>
|
|
|
|
<?php if ($output): ?>
|
|
<label style="margin-top:20px;">Copy into your <b>Game.ini</b>:</label>
|
|
<textarea readonly><?php echo htmlspecialchars($output); ?></textarea>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|