|
|
|
@ -18,7 +18,7 @@ include_once (ROOT_PATH . '/include/arena.inc.php');
|
|
|
|
|
function convertLearnIDToAttackID (array $learnids, $char_id) {
|
|
|
|
|
$result = array();
|
|
|
|
|
$sql = 'SELECT id, at_id FROM lernen WHERE id IN ('.implode(',', $learnids).') AND besitzer = ' . $char_id;
|
|
|
|
|
// echo $sql .'<br>';
|
|
|
|
|
// echo $sql .'<br>';
|
|
|
|
|
$qry = mysql_query($sql);
|
|
|
|
|
while($row = mysql_fetch_assoc($qry)) {
|
|
|
|
|
for($i=0;$i<count($learnids);$i++) {
|
|
|
|
@ -58,7 +58,7 @@ function calculateFight(array $char1, array $char2) {
|
|
|
|
|
// readout the attacks of fighter one
|
|
|
|
|
|
|
|
|
|
$k_attacke1 = convertLearnIDToAttackID(explode(',', $chara_1['attacken']), $chara_1['id']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//aktuelle hp Spieler 1[0] Spieler 2[1]
|
|
|
|
|
$k_hp[0] = round($k_hp1[0]);
|
|
|
|
|
$k_mp[0] = round($k_mp1[0]);
|
|
|
|
@ -67,7 +67,7 @@ function calculateFight(array $char1, array $char2) {
|
|
|
|
|
$k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1['aufgeben'];
|
|
|
|
|
|
|
|
|
|
################## Init Kaempfer 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//aktuelle hp [0] max hp [1]
|
|
|
|
|
$k_hp2 = explode(',', $chara_2['hp']);
|
|
|
|
|
$k_mp2 = explode(',', $chara_2['mp']);
|
|
|
|
@ -103,7 +103,7 @@ function calculateFight(array $char1, array $char2) {
|
|
|
|
|
$kombined = array_merge($k_attacke1, $k_attacke2);
|
|
|
|
|
if(count($kombined) > 0) {
|
|
|
|
|
$sql = 'SELECT * FROM attacken WHERE id IN(' .implode(',', $kombined) . ')';
|
|
|
|
|
// echo $sql .'<br>';
|
|
|
|
|
// echo $sql .'<br>';
|
|
|
|
|
$qry = mysql_query($sql);
|
|
|
|
|
|
|
|
|
|
$attack_data = array();
|
|
|
|
@ -152,8 +152,14 @@ function calculateFight(array $char1, array $char2) {
|
|
|
|
|
|
|
|
|
|
////// MUSS SO BLEIBEN WICHTIG
|
|
|
|
|
$aussetzten_runde = '';
|
|
|
|
|
//Diese Variablen speichern den Wert um wieviel HP geheilt wird damit wir falls nötig diesen durch Healkonter
|
|
|
|
|
//in Schaden umwandeln können
|
|
|
|
|
$tmp_hp[0] = 0;
|
|
|
|
|
$tmp_hp[1] = 0;
|
|
|
|
|
//Diese Werte sind wichtig, damit wir wissen ob eine Heal-Attacke eingesetzt wurde und wir die HP falls sie das
|
|
|
|
|
//Maximum überschreiten zurücksetzen müssen
|
|
|
|
|
$tmp_hp[2] = false;
|
|
|
|
|
$tmp_hp[3] = false;
|
|
|
|
|
##################################MP, SSJ Verwandlungen, HP, Koerper Tausch Technicken
|
|
|
|
|
include (ROOT_PATH . '/include/kampf/majin.php');
|
|
|
|
|
|
|
|
|
@ -176,7 +182,7 @@ function calculateFight(array $char1, array $char2) {
|
|
|
|
|
include (ROOT_PATH . '/include/kampf/hpmp.php');
|
|
|
|
|
//Als letztes um alle HP-Attacken zu kontern (in $tmp_hp gespeichert)
|
|
|
|
|
include (ROOT_PATH . '/include/kampf/konter_heal.php');
|
|
|
|
|
//Nach Konterheal, damit überstehende HP bleibt
|
|
|
|
|
//Nach Konterheal, damit überstehende HP bleibt
|
|
|
|
|
include (ROOT_PATH . '/include/kampf/tausch.php');
|
|
|
|
|
//include "kampf/summon.php";
|
|
|
|
|
}
|
|
|
|
@ -237,9 +243,9 @@ function calculateFight(array $char1, array $char2) {
|
|
|
|
|
$metaData['winner'] = $chara_2['id'];
|
|
|
|
|
}
|
|
|
|
|
} else if($k_hp[0] < $k_aufgabe[0]) { // char1 is about to surrender
|
|
|
|
|
$metaData['winner'] = $chara_2['id'];
|
|
|
|
|
$metaData['winner'] = $chara_2['id'];
|
|
|
|
|
} else {
|
|
|
|
|
$metaData['winner'] = $chara_1['id'];
|
|
|
|
|
$metaData['winner'] = $chara_1['id'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$metaData['rounds'] = $rundenArray;
|
|
|
|
|