aboutsummaryrefslogtreecommitdiffstats
path: root/inc/perso.inc
blob: 0362d8c588727078ac34da2ce73dfcf410d64b34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
function sendPerso() {
	if(empty($_SESSION["perso"]))
		initPerso();
	return $_SESSION["perso"];
}

function updatePerso(){
	$hp = $_POST["hp"];
	$xp = $_POST["xp"];
	$lv = $_POST["lv"];
	$_SESSION["perso"]["hp"] = $hp;
	$_SESSION["perso"]["xp"] = intval($xp);
	$_SESSION["perso"]["lv"] = $lv;
}

function initPerso(){
	$_SESSION["perso"]["hp"] = 5;
	$_SESSION["perso"]["xp"] = 0;
	$_SESSION["perso"]["lv"] = 3;
}

?>