Browse Source

ajout fonction heal

master
heuzef 9 years ago
parent
commit
83c1019c51
2 changed files with 10 additions and 3 deletions
  1. +3
    -3
      medias/c0f08ae603e364cb554fe71c9fc94ffd/derpy.xml
  2. +7
    -0
      play/action.php

+ 3
- 3
medias/c0f08ae603e364cb554fe71c9fc94ffd/derpy.xml View File

@@ -2,14 +2,14 @@
<response>
<entry>
<nom>derpy</nom>
<level>0</level>
<hp>10</hp>
<level>2</level>
<hp>13</hp>
<xp>0</xp>
<money>0</money>
<attack>0</attack>
<defense>0</defense>
<ecos>
<verte>1</verte>
<verte>0</verte>
<bleue>0</bleue>
<jaune>1</jaune>
<rouge>3</rouge>


+ 7
- 0
play/action.php View File

@@ -19,6 +19,13 @@ if (isset($_GET['level_down']) && $xml->entry->level>0) {
$xml->entry->level--;
}
if (isset($_GET['heal']) && $xml->entry->hp<20 && $xml->entry->ecos->verte>0) {
$lvl=$xml->entry->level;
$hp=$xml->entry->hp;
$xml->entry->hp=$hp+2+$lvl;
$xml->entry->ecos->verte--;
}
if (isset($_GET['hp_plus']) && $xml->entry->hp<20) {
$xml->entry->hp++;
}


Loading…
Cancel
Save