|
|
@ -8,47 +8,49 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
if (!function_exists('getVariableName')) {
|
|
|
|
if (!function_exists('getVariableName')) {
|
|
|
|
function getVariableName($attribute, $char, $pos) {
|
|
|
|
function getVariableName($attribute, $pos) {
|
|
|
|
switch($attribute) {
|
|
|
|
switch($attribute) {
|
|
|
|
case 'hp_cur':
|
|
|
|
case 's_hp_cur':
|
|
|
|
|
|
|
|
case 'e_hp_cur':
|
|
|
|
return 'k_hp';
|
|
|
|
return 'k_hp';
|
|
|
|
case 'hp_max':
|
|
|
|
case 's_hp_max':
|
|
|
|
if($char == 'self') {
|
|
|
|
if($pos == 1) {
|
|
|
|
if($pos == 1) {
|
|
|
|
return 'k_hp1';
|
|
|
|
return 'k_hp1';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return 'k_hp2';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if($pos == 1) {
|
|
|
|
return 'k_hp2';
|
|
|
|
return 'k_hp2';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return 'k_hp1';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 'mp_cur':
|
|
|
|
case 'e_hp_max':
|
|
|
|
|
|
|
|
if($pos == 1) {
|
|
|
|
|
|
|
|
return 'k_hp2';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return 'k_hp1';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case 's_mp_cur':
|
|
|
|
|
|
|
|
case 'e_mp_cur':
|
|
|
|
return 'k_mp';
|
|
|
|
return 'k_mp';
|
|
|
|
|
|
|
|
case 's_mp_max':
|
|
|
|
|
|
|
|
if($pos == 1) {
|
|
|
|
|
|
|
|
return 'k_mp1';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return 'k_mp2';
|
|
|
|
|
|
|
|
}
|
|
|
|
case 'mp_max':
|
|
|
|
case 'mp_max':
|
|
|
|
if($char == 'self') {
|
|
|
|
if($pos == 1) {
|
|
|
|
if($pos == 1) {
|
|
|
|
return 'k_mp2';
|
|
|
|
return 'k_mp1';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return 'k_mp2';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if($pos == 1) {
|
|
|
|
return 'k_mp1';
|
|
|
|
return 'k_mp2';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return 'k_mp1';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 'str':
|
|
|
|
case 's_str':
|
|
|
|
|
|
|
|
case 'e_str':
|
|
|
|
return 'k_starke';
|
|
|
|
return 'k_starke';
|
|
|
|
case 'def':
|
|
|
|
case 's_def':
|
|
|
|
|
|
|
|
case 'e_def':
|
|
|
|
return 'k_ver';
|
|
|
|
return 'k_ver';
|
|
|
|
case 'spd':
|
|
|
|
case 's_spd':
|
|
|
|
|
|
|
|
case 'e_spd':
|
|
|
|
return 'k_speed';
|
|
|
|
return 'k_speed';
|
|
|
|
case 'heal':
|
|
|
|
case 'e_heal':
|
|
|
|
|
|
|
|
case 's_heal':
|
|
|
|
return 'tmp_hp';
|
|
|
|
return 'tmp_hp';
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return '';
|
|
|
|
return '';
|
|
|
@ -57,13 +59,15 @@ if (!function_exists('getVariableName')) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!function_exists('getCharVariable')) {
|
|
|
|
if (!function_exists('getCharVariable')) {
|
|
|
|
function getCharVariable($attribute, $char, $pos) {
|
|
|
|
function getCharVariable($attribute, $pos) {
|
|
|
|
switch ($attribute) {
|
|
|
|
switch ($attribute) {
|
|
|
|
case 'hp_max':
|
|
|
|
case 's_hp_max':
|
|
|
|
case 'mp_max':
|
|
|
|
case 'e_hp_max':
|
|
|
|
|
|
|
|
case 's_mp_max':
|
|
|
|
|
|
|
|
case 'e_mp_max':
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
if($char == 'self') {
|
|
|
|
if($attribute[0] == 's') {
|
|
|
|
return $pos - 1;
|
|
|
|
return $pos - 1;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return 2 - $pos;
|
|
|
|
return 2 - $pos;
|
|
|
@ -89,37 +93,35 @@ if (!function_exists('processStatChanges')) {
|
|
|
|
$statsCounter = 0;
|
|
|
|
$statsCounter = 0;
|
|
|
|
foreach ($attacke as $attKey => &$stat) {
|
|
|
|
foreach ($attacke as $attKey => &$stat) {
|
|
|
|
if(is_array($stat)) {
|
|
|
|
if(is_array($stat)) {
|
|
|
|
//echo '<br>'.print_r($stat);
|
|
|
|
echo '<br>'.print_r($stat);
|
|
|
|
//echo '<br>dauer: '.$stat['dauer'].'/'.$stat['maxdauer'];
|
|
|
|
//echo '<br>dauer: '.$stat['dauer'].'/'.$stat['maxdauer'];
|
|
|
|
//echo '<br>wert: '.$stat['dauer'];
|
|
|
|
//echo '<br>wert: '.$stat['dauer'];
|
|
|
|
//echo '<br>operator: ';
|
|
|
|
//echo '<br>operator: ';
|
|
|
|
//echo '<br>wert: '.$stat['wert'];
|
|
|
|
//echo '<br>wert: '.$stat['wert'];
|
|
|
|
//echo '<br>attribut: '.getVariableName($stat['attribut'], $stat['char'], $charPos).' ('.$stat['attribut'].')';
|
|
|
|
//echo '<br>variabel-index: '.getCharVariable($stat['attribut'], $charPos);
|
|
|
|
//echo '<br>value: '.$GLOBALS['kampf'][getVariableName($stat['attribut'], $stat['char'], $charPos)][getCharVariable($stat['attribut'], $stat['char'], $charPos)];
|
|
|
|
//echo '<br>attribut: '.getVariableName($stat['attribut'], $charPos).' ('.$stat['attribut'].')';
|
|
|
|
//echo '<br>zAttribut: '.getVariableName($stat['zattribut'], $stat['char'], $charPos).' ('.$stat['zattribut'].')';
|
|
|
|
//echo '<br>value: '.$GLOBALS['kampf'][getVariableName($stat['attribut'], $charPos)][getCharVariable($stat['attribut'], $charPos)];
|
|
|
|
// echo '<br>value: '.$GLOBALS['kampf'][getVariableName($stat['zattribut'], $stat['char'], $charPos)][getCharVariable($stat['zattribut'], $stat['char'], $charPos)];
|
|
|
|
//echo '<br>zAttribut: '.getVariableName($stat['zattribut'], $charPos).' ('.$stat['zattribut'].')';
|
|
|
|
|
|
|
|
//echo '<br>value: '.$GLOBALS['kampf'][getVariableName($stat['zattribut'], $charPos)][getCharVariable($stat['zattribut'], $charPos)];
|
|
|
|
$statsCounter++;
|
|
|
|
$statsCounter++;
|
|
|
|
$attributWert = &$GLOBALS['kampf'][getVariableName($stat['attribut'], $stat['char'], $charPos)][getCharVariable($stat['attribut'], $stat['char'], $charPos)];
|
|
|
|
$attributWert = &$GLOBALS['kampf'][getVariableName($stat['attribut'], $charPos)][getCharVariable($stat['attribut'], $charPos)];
|
|
|
|
if($stat['attribut'] != $stat['zattribut']) {
|
|
|
|
if($stat['attribut'] != $stat['zattribut']) {
|
|
|
|
$zAttributWert = &$GLOBALS['kampf'][getVariableName($stat['zattribut'], $stat['char'], $charPos)][getCharVariable($stat['zattribut'], $stat['char'], $charPos)];
|
|
|
|
$zAttributWert = &$GLOBALS['kampf'][getVariableName($stat['zattribut'], $charPos)][getCharVariable($stat['zattribut'], $charPos)];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$zAttributWert = &$attributWert;
|
|
|
|
$zAttributWert = &$attributWert;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '<br>operator: "'.$stat['operator'].'"';
|
|
|
|
if(($stat['wirkung'] == 'always' || $stat['dauer'] == $stat['maxdauer']) && ($stat['unblockbar'] || !$GLOBALS['kampf']['aussetzen'])) {
|
|
|
|
if(($stat['wirkung'] == 'always' || $stat['dauer'] == $stat['maxdauer']) && ($stat['unblockbar'] || !$GLOBALS['kampf']['aussetzen'])) {
|
|
|
|
switch ($stat['operator']) {
|
|
|
|
switch ($stat['operator']) {
|
|
|
|
case '+':
|
|
|
|
case '+':
|
|
|
|
//echo '+<br>';
|
|
|
|
|
|
|
|
$stat['akk_schaden'] += getCalculatedValue($stat['formel'], $stat['wert'], $attributWert);
|
|
|
|
$stat['akk_schaden'] += getCalculatedValue($stat['formel'], $stat['wert'], $attributWert);
|
|
|
|
$zAttributWert += getCalculatedValue($stat['formel'], $stat['wert'], $attributWert);
|
|
|
|
$zAttributWert += getCalculatedValue($stat['formel'], $stat['wert'], $attributWert);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case '-':
|
|
|
|
case '-':
|
|
|
|
//echo '-<br>';
|
|
|
|
|
|
|
|
$stat['akk_schaden'] -= getCalculatedValue($stat['formel'], $stat['wert'], $attributWert);
|
|
|
|
$stat['akk_schaden'] -= getCalculatedValue($stat['formel'], $stat['wert'], $attributWert);
|
|
|
|
$zAttributWert -= getCalculatedValue($stat['formel'], $stat['wert'], $attributWert);
|
|
|
|
$zAttributWert -= getCalculatedValue($stat['formel'], $stat['wert'], $attributWert);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case '*':
|
|
|
|
case '*':
|
|
|
|
//echo '*<br>';
|
|
|
|
|
|
|
|
//vorherigen wert merken um später gegen rechnen zu können
|
|
|
|
//vorherigen wert merken um später gegen rechnen zu können
|
|
|
|
$tmp_wert = $attributWert;
|
|
|
|
$tmp_wert = $attributWert;
|
|
|
|
//echo 'tmp_wert: '.$tmp_wert.'<br>';
|
|
|
|
//echo 'tmp_wert: '.$tmp_wert.'<br>';
|
|
|
@ -127,46 +129,46 @@ if (!function_exists('processStatChanges')) {
|
|
|
|
$stat['akk_schaden'] += $attributWert - $tmp_wert;
|
|
|
|
$stat['akk_schaden'] += $attributWert - $tmp_wert;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case '/':
|
|
|
|
case '/':
|
|
|
|
//echo '/<br>';
|
|
|
|
|
|
|
|
//vorherigen wert merken um später gegen rechnen zu können
|
|
|
|
//vorherigen wert merken um später gegen rechnen zu können
|
|
|
|
$tmp_wert = $attributWert;
|
|
|
|
$tmp_wert = $attributWert;
|
|
|
|
//echo 'tmp_wert: '.$tmp_wert.'<br>';
|
|
|
|
//echo 'tmp_wert: '.$tmp_wert.'<br>';
|
|
|
|
$zAttributWert /= getCalculatedValue($stat['formel'], $stat['wert'], $attributWert);
|
|
|
|
$zAttributWert /= getCalculatedValue($stat['formel'], $stat['wert'], $attributWert);
|
|
|
|
$stat['akk_schaden'] += $attributWert - $tmp_wert;
|
|
|
|
$stat['akk_schaden'] += $attributWert - $tmp_wert;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
echo '<br>kein operator gefunden!';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//echo '<br>ber. value: '.$zAttributWert;
|
|
|
|
//echo '<br>ber. value: '.$zAttributWert;
|
|
|
|
//echo '<br>akk_schaden: '.$stat['akk_schaden'].'<br>';
|
|
|
|
//echo '<br>akk_schaden: '.$stat['akk_schaden'].'<br>';
|
|
|
|
//echo 'Varname: '.getVariableName($stat['attribut'], $stat['char']).'<br>';
|
|
|
|
//echo 'Varname: '.getVariableName($stat['attribut'], $charPos).'<br>';
|
|
|
|
//echo 'Vartyp: '.getCharVariable($stat['attribut'], $stat['attribut']).'<br>';
|
|
|
|
//echo 'Schaden: '.getCalculatedValue($stat['schaden'], $stat['wert'], $attributWert).'<br>';
|
|
|
|
//echo 'Schaden: '.getCalculatedValue($stat['schaden'], $stat['wert'], $stat['attribut']).'<br>';
|
|
|
|
|
|
|
|
//echo '<br>zattribut: '.$stat['zattribut'];
|
|
|
|
//echo '<br>zattribut: '.$stat['zattribut'];
|
|
|
|
|
|
|
|
|
|
|
|
if(getVariableName($stat['zattribut'], $stat['char'], $charPos) == 'tmp_hp') {
|
|
|
|
if(getVariableName($stat['zattribut'], $charPos) == 'tmp_hp') {
|
|
|
|
//hier extra den weiteren parameter für healkonter setzen
|
|
|
|
//hier extra den weiteren parameter für healkonter setzen
|
|
|
|
$index = 3;
|
|
|
|
$index = 3;
|
|
|
|
if($charPos == 1) {
|
|
|
|
if($charPos == 1) {
|
|
|
|
if($stat['char'] == 'self') {
|
|
|
|
if($stat['zattribut'][0] == 's') {
|
|
|
|
$index = 3;
|
|
|
|
$index = 3;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$index = 2;
|
|
|
|
$index = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if($stat['char'] == 'self') {
|
|
|
|
if($stat['zattribut'][0] == 's') {
|
|
|
|
$index = 2;
|
|
|
|
$index = 2;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$index = 3;
|
|
|
|
$index = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$GLOBALS['kampf'][getVariableName($stat['zattribut'], $stat['char'], $charPos)][$index] = true;
|
|
|
|
$GLOBALS['kampf'][getVariableName($stat['zattribut'], $charPos)][$index] = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$stat['dauer']--;
|
|
|
|
$stat['dauer']--;
|
|
|
|
if($stat['dauer'] < 1) {
|
|
|
|
if($stat['dauer'] < 1) {
|
|
|
|
if($stat['wiederherstellbar'] == true) {
|
|
|
|
if($stat['wiederherstellbar'] == true) {
|
|
|
|
//echo 'resette stat '.$stat['attribut'].' um den wert '.$stat['akk_schaden'].'<br>';
|
|
|
|
//echo 'resette stat '.$zAttributWert.' um den wert '.$stat['akk_schaden'].'<br>';
|
|
|
|
$zAttributWert -= $stat['akk_schaden'];
|
|
|
|
$zAttributWert -= $stat['akk_schaden'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$statsCounter--;
|
|
|
|
$statsCounter--;
|
|
|
|