@@ -221,7 +221,7 @@ | |||||
border-bottom-color: #8128B5; | border-bottom-color: #8128B5; | ||||
} | } | ||||
#des { | |||||
#dice { | |||||
float: left; | float: left; | ||||
width: 24px; | width: 24px; | ||||
height: 24px; | height: 24px; | ||||
@@ -236,6 +236,17 @@ | |||||
color: black; | color: black; | ||||
} | } | ||||
.level { | |||||
float: left; | |||||
width: 26px; | |||||
height: 24px; | |||||
font-weight: bold; | |||||
font-size: 18px; | |||||
text-align:center; | |||||
background: #000; | |||||
color: white; | |||||
} | |||||
.p_light { | .p_light { | ||||
text-align: center; | text-align: center; | ||||
padding: 5px; | padding: 5px; | ||||
@@ -1,18 +0,0 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<response> | |||||
<entry> | |||||
<nom>Afyaka</nom> | |||||
<hp>10</hp> | |||||
<xp>20</xp> | |||||
<ecos> | |||||
<verte>0</verte> | |||||
<bleue>0</bleue> | |||||
<jaune>0</jaune> | |||||
<rouge>0</rouge> | |||||
<blanche>5</blanche> | |||||
<noire>0</noire> | |||||
</ecos> | |||||
<trans>light</trans> | |||||
<notes>...</notes> | |||||
</entry> | |||||
</response> |
@@ -1,9 +1,11 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
<response> | <response> | ||||
<entry> | <entry> | ||||
<nom>player2</nom> | |||||
<nom>Derpy</nom> | |||||
<level>3</level> | |||||
<hp>10</hp> | <hp>10</hp> | ||||
<xp>20</xp> | |||||
<xp>0</xp> | |||||
<money>2</money> | |||||
<ecos> | <ecos> | ||||
<verte>0</verte> | <verte>0</verte> | ||||
<bleue>0</bleue> | <bleue>0</bleue> |
@@ -1,18 +0,0 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<response> | |||||
<entry> | |||||
<nom>Heuzef</nom> | |||||
<hp>10</hp> | |||||
<xp>20</xp> | |||||
<ecos> | |||||
<verte>0</verte> | |||||
<bleue>0</bleue> | |||||
<jaune>0</jaune> | |||||
<rouge>0</rouge> | |||||
<blanche>0</blanche> | |||||
<noire>0</noire> | |||||
</ecos> | |||||
<trans>default</trans> | |||||
<notes>...</notes> | |||||
</entry> | |||||
</response> |
@@ -1,18 +0,0 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<response> | |||||
<entry> | |||||
<nom>Tyrek</nom> | |||||
<hp>10</hp> | |||||
<xp>200</xp> | |||||
<ecos> | |||||
<verte>0</verte> | |||||
<bleue>0</bleue> | |||||
<jaune>0</jaune> | |||||
<rouge>0</rouge> | |||||
<blanche>0</blanche> | |||||
<noire>0</noire> | |||||
</ecos> | |||||
<trans>default</trans> | |||||
<notes>...</notes> | |||||
</entry> | |||||
</response> |
@@ -1,18 +0,0 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<response> | |||||
<entry> | |||||
<nom>Zycheron</nom> | |||||
<hp>10</hp> | |||||
<xp>20</xp> | |||||
<ecos> | |||||
<verte>0</verte> | |||||
<bleue>3</bleue> | |||||
<jaune>0</jaune> | |||||
<rouge>0</rouge> | |||||
<blanche>0</blanche> | |||||
<noire>5</noire> | |||||
</ecos> | |||||
<trans>dark</trans> | |||||
<notes>...</notes> | |||||
</entry> | |||||
</response> |
@@ -2,8 +2,10 @@ | |||||
<response> | <response> | ||||
<entry> | <entry> | ||||
<nom>player1</nom> | <nom>player1</nom> | ||||
<level>0</level> | |||||
<hp>10</hp> | <hp>10</hp> | ||||
<xp>20</xp> | <xp>20</xp> | ||||
<money>0</money> | |||||
<ecos> | <ecos> | ||||
<verte>0</verte> | <verte>0</verte> | ||||
<bleue>0</bleue> | <bleue>0</bleue> |
@@ -1,18 +0,0 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<response> | |||||
<entry> | |||||
<nom>player3</nom> | |||||
<hp>10</hp> | |||||
<xp>20</xp> | |||||
<ecos> | |||||
<verte>0</verte> | |||||
<bleue>0</bleue> | |||||
<jaune>0</jaune> | |||||
<rouge>0</rouge> | |||||
<blanche>0</blanche> | |||||
<noire>0</noire> | |||||
</ecos> | |||||
<trans>default</trans> | |||||
<notes>...</notes> | |||||
</entry> | |||||
</response> |
@@ -2,7 +2,7 @@ | |||||
include "header.php"; | include "header.php"; | ||||
$player_name=$_POST['player_name']; | $player_name=$_POST['player_name']; | ||||
$player_xp=$_POST['player_xp']; | $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'); | $xml = simplexml_load_file('./medias/'.$hash.'/'.$player_name.'.xml'); | ||||
@@ -11,6 +11,14 @@ if (isset($_GET['entry'])) { | |||||
$xml = simplexml_load_file('../medias/'.$hash.'/'.$nom_modif.'.xml'); | $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) { | if (isset($_GET['hp_plus']) && $xml->entry->hp<10) { | ||||
$xml->entry->hp++; | $xml->entry->hp++; | ||||
} | } | ||||
@@ -31,6 +39,14 @@ if (isset($_GET['xp_plusplus']) && $xml->entry->xp<99989) { | |||||
$xml->entry->xp+=10; | $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) { | if (isset($_GET['xp_moinsmoins']) && $xml->entry->xp>9) { | ||||
$xml->entry->xp-=10; | $xml->entry->xp-=10; | ||||
} | } | ||||
@@ -14,9 +14,22 @@ foreach($xml->entry as $entry) { | |||||
<div class="panel panel-<?php echo $entry->trans; ?>"> | <div class="panel panel-<?php echo $entry->trans; ?>"> | ||||
<div class="panel-heading"> | <div class="panel-heading"> | ||||
<div class="row"> | <div class="row"> | ||||
<div class="col-lg-4"> | |||||
<div class="col-lg-3"> | |||||
<?php button_modif_level("level_down", $entry->nom, "<i class='ionicons ion-arrow-graph-down-left'></i>"); ?> | |||||
<span class="level"><?php echo $entry->level; ?></span> | |||||
<?php button_modif_level("level_up", $entry->nom, "<i class='ionicons ion-arrow-graph-up-right'></i>"); ?> | |||||
</div> | |||||
<div class="col-lg-7"> | |||||
<h2><strong><?php echo $entry->nom; ?></strong></h2> | <h2><strong><?php echo $entry->nom; ?></strong></h2> | ||||
</div> | </div> | ||||
<div class="col-lg-1"> | |||||
<?php trans("trans_dark", $entry->nom, "#8128B5"); ?><?php trans("trans_light", $entry->nom, "#ADDFFF"); ?><?php trans("trans_default", $entry->nom, "#AAA"); ?> | |||||
</div> | |||||
</div> | |||||
<div class="row"> | |||||
<div class="col-lg-4"> | |||||
<h3><i class="ionicons ion-egg" style="color:brown;";></i> <strong><?php echo $entry->money; ?></strong></h3> | |||||
</div> | |||||
<div class="col-lg-4"> | <div class="col-lg-4"> | ||||
<h3><i class="ionicons ion-heart" style="color:red;";></i> <strong><?php echo $entry->hp; ?></strong></h3> | <h3><i class="ionicons ion-heart" style="color:red;";></i> <strong><?php echo $entry->hp; ?></strong></h3> | ||||
</div> | </div> | ||||
@@ -26,10 +39,7 @@ foreach($xml->entry as $entry) { | |||||
</div> | </div> | ||||
<div class="row"> | <div class="row"> | ||||
<div class="col-lg-4"> | <div class="col-lg-4"> | ||||
<a href="index.php"><div id="des"><?php echo rand(1, 6); ?></div></a> | |||||
<?php trans("trans_dark", $entry->nom, "#8128B5"); ?> | |||||
<?php trans("trans_light", $entry->nom, "#ADDFFF"); ?> | |||||
<?php trans("trans_default", $entry->nom, "#AAA"); ?> | |||||
<?php button_modif_money("money_moins", $entry->nom, "-"); ?><?php button_modif_money("money_plus", $entry->nom, "+"); ?> | |||||
</div> | </div> | ||||
<div class="col-lg-4"> | <div class="col-lg-4"> | ||||
<?php button_modif_hp("hp_moins", $entry->nom, "-"); ?><?php button_modif_hp("hp_plus", $entry->nom, "+"); ?> | <?php button_modif_hp("hp_moins", $entry->nom, "-"); ?><?php button_modif_hp("hp_plus", $entry->nom, "+"); ?> | ||||
@@ -71,7 +71,10 @@ | |||||
?> | ?> | ||||
<?php | <?php | ||||
// fonctions | |||||
function button_modif_level($nom_parametre, $nom_perso, $texte_bouton) | |||||
{ | |||||
echo '<form action="action.php?'.$nom_parametre.'&entry='.$nom_perso.'" method="post"><button type="submit" class="btn btn-default btn-xs" style="float:left;">'.$texte_bouton.'</button></form>'; | |||||
} | |||||
function button_modif_hp($nom_parametre, $nom_perso, $texte_bouton) | function button_modif_hp($nom_parametre, $nom_perso, $texte_bouton) | ||||
{ | { | ||||
echo '<form action="action.php?'.$nom_parametre.'&entry='.$nom_perso.'" method="post"><button type="submit" class="btn btn-default btn-xs" style="float:left;">'.$texte_bouton.'</button></form>'; | echo '<form action="action.php?'.$nom_parametre.'&entry='.$nom_perso.'" method="post"><button type="submit" class="btn btn-default btn-xs" style="float:left;">'.$texte_bouton.'</button></form>'; | ||||
@@ -80,6 +83,10 @@ | |||||
{ | { | ||||
echo '<form action="action.php?'.$nom_parametre.'&entry='.$nom_perso.'" method="post"><button type="submit" class="btn btn-default btn-xs" style="float:left;">'.$texte_bouton.'</button></form>'; | echo '<form action="action.php?'.$nom_parametre.'&entry='.$nom_perso.'" method="post"><button type="submit" class="btn btn-default btn-xs" style="float:left;">'.$texte_bouton.'</button></form>'; | ||||
} | } | ||||
function button_modif_money($nom_parametre, $nom_perso, $texte_bouton) | |||||
{ | |||||
echo '<form action="action.php?'.$nom_parametre.'&entry='.$nom_perso.'" method="post"><button type="submit" class="btn btn-default btn-xs" style="float:left;">'.$texte_bouton.'</button></form>'; | |||||
} | |||||
function trans($nom_parametre, $nom_perso, $couleur) | function trans($nom_parametre, $nom_perso, $couleur) | ||||
{ | { | ||||
echo '<form action="action.php?'.$nom_parametre.'&entry='.$nom_perso.'" method="post"><button type="submit" class="btn btn-default btn-xs" style="float:right;"><i class="ionicons ion-fireball" style="color:'.$couleur.'";></i></button></form>'; | echo '<form action="action.php?'.$nom_parametre.'&entry='.$nom_perso.'" method="post"><button type="submit" class="btn btn-default btn-xs" style="float:right;"><i class="ionicons ion-fireball" style="color:'.$couleur.'";></i></button></form>'; | ||||