display the attack names :)

main
hecht 13 years ago
parent 2c671598f8
commit 8154c070c6

@ -0,0 +1,23 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$GLOBALS['attack_buffered'] = array ();
function getAttack($attack_id, $buffer = TRUE) {
if(!is_numeric($attack_id)) {
// backwards compatibility!!
return array('name' => 'Normaler Kick');
}
if(!isset($GLOBALS['attack_buffered'][$attack_id])) {
$GLOBALS['attack_buffered'][$attack_id] = mysql_fetch_assoc(mysql_query('SELECT * FROM attacken WHERE id = ' . $attack_id));
}
return $GLOBALS['attack_buffered'][$attack_id];
}
?>

@ -7,6 +7,8 @@
*
*/
include_once(ROOT_PATH.'/include/attacke.inc.php');
function displayCharTable($charbild, $charname, $starke, $ver, $speed, $ausdauer, $glueck = -1, $hp_akt, $hp_max, $mp_akt, $mp_max ){
?>
@ -51,14 +53,28 @@ function displayAttacks($attacke1, $schaden1, $attacke2, $schaden2){
<tr>
<td width="50%">
<span class="stats">Technik:</span>
<span class="statvals"><?php echo $attacke1; ?></span>
<span class="statvals"><?php
if(is_numeric($attacke1) || $attacke1 === NULL) {
$atk = getAttack($attacke1);
echo $atk['name'];
} else {
echo $attacke1;
}
?></span>
<br><br>
<span class="stats">Schaden:</span>
<span class="statvals"><?php echo $schaden1; ?></span>
</td>
<td width="50%">
<span class="stats">Technik:</span>
<span class="statvals"><?php echo $attacke2; ?></span>
<span class="statvals"><?php
if(is_numeric($attacke2)|| $attacke2 === NULL) {
$atk = getAttack($attacke2);
echo $atk['name'];
} else {
echo $attacke2;
}
?></span>
<br><br>
<span class="stats">Schaden:</span>
<span class="statvals"><?php echo $schaden2; ?></span>

Loading…
Cancel
Save