|
|
@ -256,14 +256,14 @@ function calculateFight(array $char1, array $char2) {
|
|
|
|
$rundenArray[] = $runde;
|
|
|
|
$rundenArray[] = $runde;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(($k_hp[0] > $k_aufgabe[0] && $k_hp[1] > $k_aufgabe[1]) || ($k_hp[0] < $k_aufgabe[0] && $k_hp[1] < $k_aufgabe[1])) {
|
|
|
|
if(($k_hp[0] > $k_aufgabe[0] && $k_hp[1] > $k_aufgabe[1]) || ($k_hp[0] <= $k_aufgabe[0] && $k_hp[1] <= $k_aufgabe[1])) {
|
|
|
|
// Both are above or both are below their limit to surrender?
|
|
|
|
// Both are above or both are below their limit to surrender?
|
|
|
|
if($k_hp[0] >= $k_hp[1]) { // If even the creator wins ;)
|
|
|
|
if($k_hp[0] >= $k_hp[1]) { // If even the creator wins ;)
|
|
|
|
$metaData['winner'] = $chara_1['id'];
|
|
|
|
$metaData['winner'] = $chara_1['id'];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$metaData['winner'] = $chara_2['id'];
|
|
|
|
$metaData['winner'] = $chara_2['id'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if($k_hp[0] < $k_aufgabe[0]) { // char1 is about to surrender
|
|
|
|
} else if($k_hp[0] <= $k_aufgabe[0]) { // char1 is about to surrender
|
|
|
|
$metaData['winner'] = $chara_2['id'];
|
|
|
|
$metaData['winner'] = $chara_2['id'];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$metaData['winner'] = $chara_1['id'];
|
|
|
|
$metaData['winner'] = $chara_1['id'];
|
|
|
@ -292,4 +292,4 @@ function calculateExperience(array $char1, array $char2, $winner, $factor) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|