瀏覽代碼

money et level

master
heuzef 10 年之前
父節點
當前提交
c0998d347e
共有 12 個文件被更改,包括 58 次插入100 次删除
  1. +12
    -1
      css/ecomonde.css
  2. +0
    -18
      medias/c0f08ae603e364cb554fe71c9fc94ffd/Afyaka.xml
  3. +4
    -2
      medias/c0f08ae603e364cb554fe71c9fc94ffd/Derpy.xml
  4. +0
    -18
      medias/c0f08ae603e364cb554fe71c9fc94ffd/Heuzef.xml
  5. +0
    -18
      medias/c0f08ae603e364cb554fe71c9fc94ffd/Tyrek.xml
  6. +0
    -18
      medias/c0f08ae603e364cb554fe71c9fc94ffd/Zycheron.xml
  7. +2
    -0
      medias/default/player.xml
  8. +0
    -18
      medias/default/player3.xml
  9. +1
    -1
      new_player.php
  10. +16
    -0
      play/action.php
  11. +15
    -5
      play/gamers.php
  12. +8
    -1
      play/index.php

+ 12
- 1
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;


+ 0
- 18
medias/c0f08ae603e364cb554fe71c9fc94ffd/Afyaka.xml 查看文件

@@ -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>

medias/default/player2.xml → medias/c0f08ae603e364cb554fe71c9fc94ffd/Derpy.xml 查看文件

@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<response>
<entry>
<nom>player2</nom>
<nom>Derpy</nom>
<level>3</level>
<hp>10</hp>
<xp>20</xp>
<xp>0</xp>
<money>2</money>
<ecos>
<verte>0</verte>
<bleue>0</bleue>

+ 0
- 18
medias/c0f08ae603e364cb554fe71c9fc94ffd/Heuzef.xml 查看文件

@@ -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>

+ 0
- 18
medias/c0f08ae603e364cb554fe71c9fc94ffd/Tyrek.xml 查看文件

@@ -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>

+ 0
- 18
medias/c0f08ae603e364cb554fe71c9fc94ffd/Zycheron.xml 查看文件

@@ -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>

medias/default/player1.xml → medias/default/player.xml 查看文件

@@ -2,8 +2,10 @@
<response>
<entry>
<nom>player1</nom>
<level>0</level>
<hp>10</hp>
<xp>20</xp>
<money>0</money>
<ecos>
<verte>0</verte>
<bleue>0</bleue>

+ 0
- 18
medias/default/player3.xml 查看文件

@@ -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>

+ 1
- 1
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');



+ 16
- 0
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;
}


+ 15
- 5
play/gamers.php 查看文件

@@ -14,9 +14,22 @@ foreach($xml->entry as $entry) {
<div class="panel panel-<?php echo $entry->trans; ?>">
<div class="panel-heading">
<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>
</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>&nbsp;<strong><?php echo $entry->money; ?></strong></h3>
</div>
<div class="col-lg-4">
<h3><i class="ionicons ion-heart" style="color:red;";></i>&nbsp;<strong><?php echo $entry->hp; ?></strong></h3>
</div>
@@ -26,10 +39,7 @@ foreach($xml->entry as $entry) {
</div>
<div class="row">
<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 class="col-lg-4">
<?php button_modif_hp("hp_moins", $entry->nom, "-"); ?><?php button_modif_hp("hp_plus", $entry->nom, "+"); ?>


+ 8
- 1
play/index.php 查看文件

@@ -71,7 +71,10 @@
?>

<?php
// fonctions
function button_modif_level($nom_parametre, $nom_perso, $texte_bouton)
{
echo '<form action="action.php?'.$nom_parametre.'&amp;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)
{
echo '<form action="action.php?'.$nom_parametre.'&amp;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.'&amp;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.'&amp;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)
{
echo '<form action="action.php?'.$nom_parametre.'&amp;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>';


Loading…
取消
儲存