aboutsummaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authoralexichi <alexbankai96@gmail.com>2016-05-07 10:13:20 +0200
committeralexichi <alexbankai96@gmail.com>2016-05-07 10:13:20 +0200
commitee02581b7fabd087fc4056bda739c88656fbca14 (patch)
tree576b71b4f9d80a6a38d68d4754de9c63c44e9b3f /inc
parentf171811a44364f605712aff1ca0808bfe570ef6e (diff)
downloadcandybox-ee02581b7fabd087fc4056bda739c88656fbca14.tar.gz
candybox-ee02581b7fabd087fc4056bda739c88656fbca14.tar.bz2
candybox-ee02581b7fabd087fc4056bda739c88656fbca14.tar.xz
candybox-ee02581b7fabd087fc4056bda739c88656fbca14.zip
add the display of the perso characteristics below the title
Diffstat (limited to 'inc')
-rw-r--r--inc/perso.inc12
1 files changed, 9 insertions, 3 deletions
diff --git a/inc/perso.inc b/inc/perso.inc
index 075f8ae..4fb05ef 100644
--- a/inc/perso.inc
+++ b/inc/perso.inc
@@ -1,8 +1,8 @@
<?php
function sendPerso() {
- if(!empty($_SESSION["perso"]))
- return $_SESSION["perso"];
- else return false;
+ if(empty($_SESSION["perso"]))
+ initPerso();
+ return $_SESSION["perso"];
}
function updatePerso(){
@@ -14,4 +14,10 @@ function updatePerso(){
$_SESSION["perso"]["lv"] = $lv;
}
+function initPerso(){
+ $_SESSION["perso"]["hp"] = 5;
+ $_SESSION["perso"]["xp"] = 0;
+ $_SESSION["perso"]["lv"] = 3;
+}
+
?>