You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
1.8 KiB

11 years ago
<?php
/*
* Created on 07.03.2009
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
if (!function_exists('getTechniqueAttributeName')) {
function getTechniqueAttributeName($attribute) {
switch ($attribute) {
case 's_hp_cur':
case 'e_hp_cur':
case 's_hp_max':
case 'e_hp_max':
11 years ago
return 'hp';
case 's_mp_cur':
case 'e_mp_cur':
case 's_mp_max':
case 'e_mp_max':
11 years ago
return 'mp';
case 's_str':
case 'e_str':
11 years ago
return 'starke';
case 's_def':
case 'e_def':
11 years ago
return 'verteidigung';
case 's_spd':
case 'e_spd':
11 years ago
return 'speed';
default:
return '';
}
}
}
################### Spieler 1
if ($technick1['type'] == 'generic') {
$k_mp[0] = $k_mp[0] - $technick1['mp'];
if ($k_mp[0] >= 0) {
$options = json_decode($technick1['options'], true);
$statChange_Char1[] = $options;
foreach ($statChange_Char1 as &$attacke) {
foreach ($attacke as &$stat) {
if(is_array($stat)) {
$stat['maxdauer'] = $stat['dauer'];
$stat['wert'] = $technick1[getTechniqueAttributeName($stat['attribut'])];
}
}
}
} else {
$schaden_1 = 'Technik Fehlgeschlagen';
$k_mp[0] = 0;
}
$aktion_AV1[$x] = 'nein';
}
################### Spieler 2
if ($technick2['type'] == 'generic') {
$k_mp[1] = $k_mp[1] - $technick2['mp'];
if ($k_mp[1] >= 0) {
$options = json_decode($technick2['options'], true);
$statChange_Char2[] = $options;
foreach ($statChange_Char2 as &$attacke) {
foreach ($attacke as &$stat) {
if(is_array($stat)) {
$stat['maxdauer'] = $stat['dauer'];
11 years ago
$stat['wert'] = $technick2[getTechniqueAttributeName($stat['attribut'])];
}
}
}
} else {
$schaden_2 = 'Technik Fehlgeschlagen';
$k_mp[1] = 0;
}
$aktion_AV2[$x] = 'nein';
}