diff --git a/ag/gm/gm_seite.php b/ag/gm/gm_seite.php index 836e2ce..1e4e86b 100644 --- a/ag/gm/gm_seite.php +++ b/ag/gm/gm_seite.php @@ -224,7 +224,7 @@ if(checkLoginData($_SESSION['user'],$_SESSION['password'])){ } else if($_REQUEST['choose'] == 'logout'){ logout(); } else if($_REQUEST['choose'] == 'attacken'){ - displayAttackenMenu($_REQUEST['action'], $_REQUEST['attackname'], $_REQUEST['attackid'], $_REQUEST['depth'], $_REQUEST['name'], $_REQUEST['starke'], $_REQUEST['verteidigung'], $_REQUEST['speed'], $_REQUEST['hp'], $_REQUEST['mp'], $_REQUEST['rassen'], $_REQUEST['level'], $_REQUEST['geld'], $_REQUEST['type'], $_REQUEST['info'], $_REQUEST['req_atk'], $_REQUEST['req_lvl'], $_REQUEST['Frucht'], $_REQUEST['runden'], $_REQUEST['maxlvl']); + displayAttackenMenu($_REQUEST['action'], $_REQUEST['attackname'], $_REQUEST['attackid'], $_REQUEST['depth'], $_REQUEST['name'], $_REQUEST['starke'], $_REQUEST['verteidigung'], $_REQUEST['speed'], $_REQUEST['hp'], $_REQUEST['mp'], $_REQUEST['rassen'], $_REQUEST['level'], $_REQUEST['geld'], $_REQUEST['options'], $_REQUEST['type'], $_REQUEST['info'], $_REQUEST['req_atk'], $_REQUEST['req_lvl'], $_REQUEST['Frucht'], $_REQUEST['runden'], $_REQUEST['maxlvl']); } else if($_REQUEST['choose'] == 'bann'){ displayBannOptions($_REQUEST['action'], $_REQUEST['username'],$_REQUEST['opfer'],$_REQUEST['gamebann'],$_REQUEST['shoutbann'],$_REQUEST['forenbann'],$_REQUEST['anonid']); } else if($_REQUEST['choose'] == 'items'){ @@ -267,4 +267,4 @@ if(checkLoginData($_SESSION['user'],$_SESSION['password'])){ displayLogin(); } -?> \ No newline at end of file +?> diff --git a/ag/gm/include/attacken.inc.php b/ag/gm/include/attacken.inc.php index 75855b9..46d368c 100644 --- a/ag/gm/include/attacken.inc.php +++ b/ag/gm/include/attacken.inc.php @@ -8,7 +8,7 @@ */ ?>
Options: | +'> + | +|
Info: | ";
+ echo "Attacke konnte nicht erstellt werden, syntax för options ist nicht korrekt!";
+ echo displayHistoryBackLink();
+ return;
+ }
+
if($Frucht != 0){
- $sql = 'INSERT into attacken set name = \''.$attackname.'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = '.$Frucht.', runden = '.$runden.', maxlvl = '.$maxlvl;
+ $sql = 'INSERT into attacken set name = \''.$attackname.'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = '.$Frucht.', runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.addslashes($options).'\'';
} else {
- $sql = 'INSERT into attacken set name = \''.$attackname.'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', runden = '.$runden.', maxlvl = '.$maxlvl;
+ $sql = 'INSERT into attacken set name = \''.$attackname.'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.addslashes($options).'\'';
+ }
+ //echo $sql.' '; + if(!mysql_query($sql)){ + echo "Fehler beim Erstellen der Attacke: Überprüfe deine Eingabe und melde erst DANACH dieses Statement einem Entwickler => $sql"; + return; } - echo $sql.' '; - mysql_query($sql); logaction('Attacke '.$attackname.' wurde erstellt!'); ?> Attacke sollte nun erstellt sein!! @@ -399,20 +416,32 @@ sicher?? "; + echo "Attacke konnte nicht erstellt werden, syntax för options ist nicht korrekt!"; + echo displayHistoryBackLink(); + return; + } + if($Frucht != 0){ - $sql = 'UPDATE attacken set name = \''.htmlspecialchars(urldecode($attackname)).'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = '.$Frucht.', runden = '.$runden.', maxlvl = '.$maxlvl.' where id = '.$attackid; + $sql = 'UPDATE attacken set name = \''.htmlspecialchars(urldecode($attackname)).'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = '.$Frucht.', runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.$options.'\' where id = '.$attackid; } else { - $sql = 'UPDATE attacken set name = \''.htmlspecialchars(urldecode($attackname)).'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = NULL, runden = '.$runden.', maxlvl = '.$maxlvl.' where id = '.$attackid; + $sql = 'UPDATE attacken set name = \''.htmlspecialchars(urldecode($attackname)).'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = NULL, runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.$options.'\' where id = '.$attackid; } if($row['name'] != $attackname){ mysql_query('Update lernen set name = \''.$attackname.'\' WHERE at_id ='.$attackid); } - // echo 'Debugnachricht: '.$sql.' '; - mysql_query($sql); + //echo 'Debugnachricht: '.$sql.' '; + if(!mysql_query($sql)){ + echo "Fehler beim Editieren der Attacke: Überprüfe deine Eingabe und melde erst DANACH dieses Statement einem Entwickler => $sql"; + return; + } logaction('Attacke mit dem jetzigen Namen '.$attackname.' wurde editiert!'); ?> @@ -425,4 +454,4 @@ function editAttack($attackname, $attackid, $Frucht, $starke, $verteidigung, $sp } -?> \ No newline at end of file +?> diff --git a/ag/include/kampf/majin.php b/ag/include/kampf/majin.php index b69fac6..6a32f11 100644 --- a/ag/include/kampf/majin.php +++ b/ag/include/kampf/majin.php @@ -6,6 +6,9 @@ * */ +defineIfNotDefined('MAJIN_DIVIDENT', 10); + + ####################Majin SPIELER 1 if($technick1['type'] == "majin") { @@ -15,16 +18,33 @@ if($technick1['type'] == "majin") { $aktion_AV1[$x] = "nein"; $k_mp[0] = 0; } else { - - $multiplikator = $technick1['starke'] / 10; + $options = php_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] * $multiplikator; - $k_speed[1] = $k_speed[1] * $multiplikator; - $k_ver[1] = $k_ver[1] * $multiplikator; + + $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]; - $k_hp[1] = round($k_hp[1] - ($k_starke[1] / 2)); + $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]; @@ -44,15 +64,32 @@ if($technick1['type'] == "majin") { $aktion_AV2[$x] = "nein"; $k_mp[1] = 0; } else { - $multiplikator = $technick2['starke'] / 10; - - $k_starke[0] = $k_starke[0] * $multiplikator; - $k_speed[0] = $k_speed[0] * $multiplikator; - $k_ver[0] = $k_ver[0] * $multiplikator; + $options = php_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[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); $alt_hp = $k_hp[0]; - $k_hp[0] = round($k_hp[0] - ($k_starke[0] / 2)); + $my_dmg = 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] - $my_dmg); $schaden_2 = "$technick2[name]"; $schaden_1 = $alt_hp - $k_hp[0]; @@ -63,4 +100,4 @@ if($technick1['type'] == "majin") { $aussetzten_runde = 1; }} - ?> \ No newline at end of file + ?> diff --git a/ag/info/attacken.php b/ag/info/attacken.php index eb963c6..4e5a607 100644 --- a/ag/info/attacken.php +++ b/ag/info/attacken.php @@ -65,6 +65,11 @@ function showAttDetails($at_id) { Type |
|
+ Options |
+ + | |
Info |