-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstats.php
44 lines (44 loc) · 1.01 KB
/
stats.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
$hp = 10;
$mp = 10;
if(!empty($_GET['hp'])) $hp = $_GET['hp'];
if(!empty($_GET['mp'])) $mp = $_GET['mp'];
$races = array("Elf","Orc","Human");
$classes = array("Mage","Warrior","Archer");
foreach($races as $race) {
foreach($classes as $class) {
$hpmult = 1;
$mpmult = 1;
switch ($race) {
case 'Elf':
$hpmult -= 0.15;
$mpmult += 0.3;
break;
case 'Orc':
$hpmult += 0.3;
$mpmult -= 0.15;
break;
case 'Human':
$hpmult += 0.1;
$mpmult += 0.1;
break;
}
switch ($class) {
case 'Mage':
$hpmult -= 0.15;
$mpmult += 0.3;
break;
case 'Warrior':
$hpmult += 0.3;
$mpmult -= 0.15;
break;
case 'Archer':
$hpmult += 0.1;
$mpmult += 0.1;
break;
}
echo $race . " " . $class . " - HP: " . floor($hp*$hpmult) . " MP: " . floor($mp*$mpmult) . "<br>";
}
echo "<br>";
}
?>