From c0998d347e27cf58e305ca1aaeaa21b5fd619dc7 Mon Sep 17 00:00:00 2001 From: heuzef Date: Sat, 30 Aug 2014 17:36:08 +0200 Subject: [PATCH] money et level --- css/ecomonde.css | 13 ++++++++++++- medias/c0f08ae603e364cb554fe71c9fc94ffd/Afyaka.xml | 18 ------------------ medias/c0f08ae603e364cb554fe71c9fc94ffd/Derpy.xml | 20 ++++++++++++++++++++ medias/c0f08ae603e364cb554fe71c9fc94ffd/Heuzef.xml | 18 ------------------ medias/c0f08ae603e364cb554fe71c9fc94ffd/Tyrek.xml | 18 ------------------ medias/c0f08ae603e364cb554fe71c9fc94ffd/Zycheron.xml | 18 ------------------ medias/default/player.xml | 20 ++++++++++++++++++++ medias/default/player1.xml | 18 ------------------ medias/default/player2.xml | 18 ------------------ medias/default/player3.xml | 18 ------------------ new_player.php | 2 +- play/action.php | 16 ++++++++++++++++ play/gamers.php | 20 +++++++++++++++----- play/index.php | 9 ++++++++- 14 files changed, 92 insertions(+), 134 deletions(-) delete mode 100755 medias/c0f08ae603e364cb554fe71c9fc94ffd/Afyaka.xml create mode 100644 medias/c0f08ae603e364cb554fe71c9fc94ffd/Derpy.xml delete mode 100755 medias/c0f08ae603e364cb554fe71c9fc94ffd/Heuzef.xml delete mode 100755 medias/c0f08ae603e364cb554fe71c9fc94ffd/Tyrek.xml delete mode 100755 medias/c0f08ae603e364cb554fe71c9fc94ffd/Zycheron.xml create mode 100755 medias/default/player.xml delete mode 100755 medias/default/player1.xml delete mode 100755 medias/default/player2.xml delete mode 100755 medias/default/player3.xml diff --git a/css/ecomonde.css b/css/ecomonde.css index 31ca463..c1b9b64 100755 --- a/css/ecomonde.css +++ b/css/ecomonde.css @@ -221,7 +221,7 @@ border-bottom-color: #8128B5; } -#des { +#dice { float: left; width: 24px; height: 24px; @@ -236,6 +236,17 @@ color: black; } +.level { + float: left; + width: 26px; + height: 24px; + font-weight: bold; + font-size: 18px; + text-align:center; + background: #000; + color: white; +} + .p_light { text-align: center; padding: 5px; diff --git a/medias/c0f08ae603e364cb554fe71c9fc94ffd/Afyaka.xml b/medias/c0f08ae603e364cb554fe71c9fc94ffd/Afyaka.xml deleted file mode 100755 index b9b4d89..0000000 --- a/medias/c0f08ae603e364cb554fe71c9fc94ffd/Afyaka.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Afyaka - 10 - 20 - - 0 - 0 - 0 - 0 - 5 - 0 - - light - ... - - diff --git a/medias/c0f08ae603e364cb554fe71c9fc94ffd/Derpy.xml b/medias/c0f08ae603e364cb554fe71c9fc94ffd/Derpy.xml new file mode 100644 index 0000000..a8cd0a4 --- /dev/null +++ b/medias/c0f08ae603e364cb554fe71c9fc94ffd/Derpy.xml @@ -0,0 +1,20 @@ + + + + Derpy + 3 + 10 + 0 + 2 + + 0 + 0 + 0 + 0 + 0 + 0 + + default + ... + + diff --git a/medias/c0f08ae603e364cb554fe71c9fc94ffd/Heuzef.xml b/medias/c0f08ae603e364cb554fe71c9fc94ffd/Heuzef.xml deleted file mode 100755 index c6a2038..0000000 --- a/medias/c0f08ae603e364cb554fe71c9fc94ffd/Heuzef.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Heuzef - 10 - 20 - - 0 - 0 - 0 - 0 - 0 - 0 - - default - ... - - diff --git a/medias/c0f08ae603e364cb554fe71c9fc94ffd/Tyrek.xml b/medias/c0f08ae603e364cb554fe71c9fc94ffd/Tyrek.xml deleted file mode 100755 index 76949a5..0000000 --- a/medias/c0f08ae603e364cb554fe71c9fc94ffd/Tyrek.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Tyrek - 10 - 200 - - 0 - 0 - 0 - 0 - 0 - 0 - - default - ... - - diff --git a/medias/c0f08ae603e364cb554fe71c9fc94ffd/Zycheron.xml b/medias/c0f08ae603e364cb554fe71c9fc94ffd/Zycheron.xml deleted file mode 100755 index 3c2b5fc..0000000 --- a/medias/c0f08ae603e364cb554fe71c9fc94ffd/Zycheron.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Zycheron - 10 - 20 - - 0 - 3 - 0 - 0 - 0 - 5 - - dark - ... - - diff --git a/medias/default/player.xml b/medias/default/player.xml new file mode 100755 index 0000000..351c27c --- /dev/null +++ b/medias/default/player.xml @@ -0,0 +1,20 @@ + + + + player1 + 0 + 10 + 20 + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + + default + ... + + diff --git a/medias/default/player1.xml b/medias/default/player1.xml deleted file mode 100755 index d6e00bf..0000000 --- a/medias/default/player1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - player1 - 10 - 20 - - 0 - 0 - 0 - 0 - 0 - 0 - - default - ... - - diff --git a/medias/default/player2.xml b/medias/default/player2.xml deleted file mode 100755 index ff44a9b..0000000 --- a/medias/default/player2.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - player2 - 10 - 20 - - 0 - 0 - 0 - 0 - 0 - 0 - - default - ... - - diff --git a/medias/default/player3.xml b/medias/default/player3.xml deleted file mode 100755 index 1526738..0000000 --- a/medias/default/player3.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - player3 - 10 - 20 - - 0 - 0 - 0 - 0 - 0 - 0 - - default - ... - - diff --git a/new_player.php b/new_player.php index 737a49f..e1175ea 100755 --- a/new_player.php +++ b/new_player.php @@ -2,7 +2,7 @@ include "header.php"; $player_name=$_POST['player_name']; $player_xp=$_POST['player_xp']; -copy("medias/default/player1.xml", "medias/".$hash."/".$player_name.".xml"); +copy("medias/default/player.xml", "medias/".$hash."/".$player_name.".xml"); $xml = simplexml_load_file('./medias/'.$hash.'/'.$player_name.'.xml'); diff --git a/play/action.php b/play/action.php index 9882f28..99b9b49 100755 --- a/play/action.php +++ b/play/action.php @@ -11,6 +11,14 @@ if (isset($_GET['entry'])) { $xml = simplexml_load_file('../medias/'.$hash.'/'.$nom_modif.'.xml'); +if (isset($_GET['level_up']) && $xml->entry->level<3) { + $xml->entry->level++; +} + +if (isset($_GET['level_down']) && $xml->entry->level>0) { + $xml->entry->level--; +} + if (isset($_GET['hp_plus']) && $xml->entry->hp<10) { $xml->entry->hp++; } @@ -31,6 +39,14 @@ if (isset($_GET['xp_plusplus']) && $xml->entry->xp<99989) { $xml->entry->xp+=10; } +if (isset($_GET['money_moins']) && $xml->entry->money>0) { + $xml->entry->money--; +} + +if (isset($_GET['money_plus']) && $xml->entry->money<99989) { + $xml->entry->money+=1; +} + if (isset($_GET['xp_moinsmoins']) && $xml->entry->xp>9) { $xml->entry->xp-=10; } diff --git a/play/gamers.php b/play/gamers.php index 2226dd4..3bd5f0d 100755 --- a/play/gamers.php +++ b/play/gamers.php @@ -14,9 +14,22 @@ foreach($xml->entry as $entry) {
-
+
+ nom, ""); ?> + level; ?> + nom, ""); ?> +
+

nom; ?>

+
+ nom, "#8128B5"); ?>nom, "#ADDFFF"); ?>nom, "#AAA"); ?> +
+
+
+
+

 money; ?>

+

 hp; ?>

@@ -26,10 +39,7 @@ foreach($xml->entry as $entry) {
-
- nom, "#8128B5"); ?> - nom, "#ADDFFF"); ?> - nom, "#AAA"); ?> + nom, "-"); ?>nom, "+"); ?>
nom, "-"); ?>nom, "+"); ?> diff --git a/play/index.php b/play/index.php index a265227..6e2d25d 100755 --- a/play/index.php +++ b/play/index.php @@ -71,7 +71,10 @@ ?> '; + } function button_modif_hp($nom_parametre, $nom_perso, $texte_bouton) { echo '
'; @@ -80,6 +83,10 @@ { echo '
'; } + function button_modif_money($nom_parametre, $nom_perso, $texte_bouton) + { + echo '
'; + } function trans($nom_parametre, $nom_perso, $couleur) { echo '
';