aboutsummaryrefslogtreecommitdiffstats
path: root/inc/dungeon.inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc/dungeon.inc')
-rw-r--r--inc/dungeon.inc16
1 files changed, 12 insertions, 4 deletions
diff --git a/inc/dungeon.inc b/inc/dungeon.inc
index 81e2ba7..ebe74b7 100644
--- a/inc/dungeon.inc
+++ b/inc/dungeon.inc
@@ -21,12 +21,12 @@ function generateMonster(){
}
function initDungeon() {
- $_SESSION["dungeon"] = true;
+ $_SESSION["dungeon"]["access"] = true;
}
function sendDungeon() {
if(!empty($_SESSION["dungeon"]))
- return generateMonster();
+ return $_SESSION["dungeon"];
else return false;
}
@@ -43,14 +43,22 @@ function buildDungeon() {
}
function launchDungeon(){
+ $f= $_POST["floor"];
$dungeon=generateMonster();
- $opponent = $dungeon["monsters"]["floor1"];
+ $opponent = $dungeon["monsters"]["floor".$f];
echo json_encode($opponent);
}
+function sendDungeonProgress(){
+ $f= $_POST["floor"];
+ $nb=$_POST["mob"];
+ $_SESSION["dungeon"]["flat"] = $f;
+ $_SESSION["dungeon"]["mob"] = $nb;
+}
+
+
function exitDungeon(){
$_SESSION["dungeon"] = false;
- echo json_encode(array("a" => 7));//Cette ligne ne sert qu'à contourner l'erreur créé à cause de sendRequest. A revoir.
}
?>