majin has changed

main
hecht 11 years ago
parent f9d25f6163
commit 4228218e0e

@ -6,58 +6,98 @@
* *
*/ */
defineIfNotDefined('MAJIN_DIVIDENT', 10);
####################Majin SPIELER 1 ####################Majin SPIELER 1
if($technick1['type'] == "majin") { if($technick1['type'] == "majin") {
$k_mp[0] = $k_mp[0] - $technick1['mp']; $k_mp[0] = $k_mp[0] - $technick1['mp'];
if($k_mp[0] < 0) { if($k_mp[0] < 0) {
$schaden_1 = "Majin Verwandlung fehlgeschlagen"; $schaden_1 = "Majin Verwandlung fehlgeschlagen";
$aktion_AV1[$x] = "nein"; $aktion_AV1[$x] = "nein";
$k_mp[0] = 0; $k_mp[0] = 0;
} else { } else {
$options = json_decode($technick1['options'], true);
// options is now an array with following input possible ...
// 'attribute' => array('strength', 'defense', 'speed')
// Place handling here depending on the options
$k_starke[1] = $k_starke[1] * ($technick1['starke'] / MAJIN_DIVIDENT);
$k_speed[1] = $k_speed[1] * ($technick1['speed'] / MAJIN_DIVIDENT);
$k_ver[1] = $k_ver[1] * ($technick1['verteidigung'] / MAJIN_DIVIDENT);
$alt_hp = $k_hp[1];
$my_dmg = 0;
foreach( $options['attribute'] as $attr ) {
if($attr == 'strength') {
$my_dmg += $k_starke[1] / 2;
} else if($attr == 'defense') {
$my_dmg += $k_ver[1] / 2;
} else if($attr == 'speed') {
$my_dmg += $k_speed[1] / 2;
}
}
$k_hp[1] = round($k_hp[1] - $my_dmg);
$schaden_1 = "$technick1[name]";
$schaden_2 = $alt_hp - $k_hp[1];
if($alt_hp < $k_hp[1]) { $k_hp[1] = $alt_hp; $schaden_2 = 0; }
$k_starke[1] = $k_starke[1] * ($technick1['starke']-0.5); $aktion_AV1[$x] = "nein";
$k_speed[1] = $k_speed[1] * ($technick1['speed']-0.5); $aktion_AV2[$x] = "nein";
$k_ver[1] = $k_ver[1] * ($technick1['verteidigung']-0.5); $aussetzten_runde = 1;
}}
$alt_hp = $k_hp[1]; ####################Majin SPIELER 2
$k_hp[1] = round($k_hp[1] - ($k_starke[1] / 2)); if($technick2['type'] == "majin") {
$schaden_1 = "$technick1[name]"; $k_mp[1] = $k_mp[1] - $technick2['mp'];
$schaden_2 = $alt_hp - $k_hp[1]; if($k_mp[1] < 0) {
$schaden_2 = "Majin Verwandlung fehlgeschlagen";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
$options = json_decode($technick2['options'], true);
if($alt_hp < $k_hp[1]) { $k_hp[1] = $alt_hp; $schaden_2 = 0; } // options is now an array with following input possible ...
// 'attribute' => array('strength', 'defense', 'speed')
$aktion_AV1[$x] = "nein"; // Place handling here depending on the options
$aktion_AV2[$x] = "nein";
$aussetzten_runde = 1;
}}
####################Majin SPIELER 2 $k_starke[0] = $k_starke[0] * ($technick2['starke'] / MAJIN_DIVIDENT);
$k_speed[0] = $k_speed[0] * ($technick2['speed'] / MAJIN_DIVIDENT);
$k_ver[0] = $k_ver[0] * ($technick2['verteidigung'] / MAJIN_DIVIDENT);
if($technick2['type'] == "majin") { $alt_hp = $k_hp[0];
$k_mp[1] = $k_mp[1] - $technick2['mp'];
if($k_mp[1] < 0) {
$schaden_2 = "Majin Verwandlung fehlgeschlagen";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
$k_starke[0] = $k_starke[0] * ($technick2['starke']-0.5); $my_dmg = 0;
$k_speed[0] = $k_speed[0] * ($technick2['speed']-0.5);
$k_ver[0] = $k_ver[0] * ($technick2['verteidigung']-0.5);
$alt_hp = $k_hp[0]; foreach( $options['attribute'] as $attr ) {
if($attr == 'strength') {
$my_dmg += $k_starke[0] / 2;
} else if($attr == 'defense') {
$my_dmg += $k_ver[0] / 2;
} else if($attr == 'speed') {
$my_dmg += $k_speed[0] / 2;
}
}
$k_hp[0] = round($k_hp[0] - ($k_starke[0] / 2)); $k_hp[0] = round($k_hp[0] - $my_dmg);
$schaden_2 = "$technick2[name]"; $schaden_2 = "$technick2[name]";
$schaden_1 = $alt_hp - $k_hp[0]; $schaden_1 = $alt_hp - $k_hp[0];
if($alt_hp < $k_hp[0]) { $k_hp[0] = $alt_hp; $schaden_1 = 0; } if($alt_hp < $k_hp[0]) { $k_hp[0] = $alt_hp; $schaden_1 = 0; }
$aktion_AV1[$x] = "nein"; $aktion_AV1[$x] = "nein";
$aktion_AV2[$x] = "nein"; $aktion_AV2[$x] = "nein";
$aussetzten_runde = 1; $aussetzten_runde = 1;
}} }}
?> ?>

Loading…
Cancel
Save