aboutsummaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authoralexichi <alexbankai96@gmail.com>2016-05-03 10:33:27 +0200
committeralexichi <alexbankai96@gmail.com>2016-05-03 10:33:27 +0200
commitadd9d3248a5adc02b071a301005c6f11195f7f7b (patch)
treedb841c7347bcda24335718fa4f4d33397e0ade8c /inc
parent556adda68fe99e3a88f59803aa9bd8892e4d34cf (diff)
downloadcandybox-add9d3248a5adc02b071a301005c6f11195f7f7b.tar.gz
candybox-add9d3248a5adc02b071a301005c6f11195f7f7b.tar.bz2
candybox-add9d3248a5adc02b071a301005c6f11195f7f7b.tar.xz
candybox-add9d3248a5adc02b071a301005c6f11195f7f7b.zip
add dungeon client side to display it when reload
Diffstat (limited to 'inc')
-rw-r--r--inc/craftmine.inc4
-rw-r--r--inc/dungeon.inc6
2 files changed, 9 insertions, 1 deletions
diff --git a/inc/craftmine.inc b/inc/craftmine.inc
index 33a28d7..0d6a445 100644
--- a/inc/craftmine.inc
+++ b/inc/craftmine.inc
@@ -2,12 +2,14 @@
require_once("mine.inc");
require_once("shop.inc");
+require_once("dungeon.inc");
function sendCraftMine() {
$data = array("gold" => sendMine(),
"shop" => sendShop(),
"inventory" => Inventory::sendContent(),
- "miners" => sendMiners()
+ "miners" => sendMiners(),
+ "dungeon" => sendDungeon(),
);
echo json_encode($data);
}
diff --git a/inc/dungeon.inc b/inc/dungeon.inc
index 8c26c92..81e2ba7 100644
--- a/inc/dungeon.inc
+++ b/inc/dungeon.inc
@@ -24,6 +24,12 @@ function initDungeon() {
$_SESSION["dungeon"] = true;
}
+function sendDungeon() {
+ if(!empty($_SESSION["dungeon"]))
+ return generateMonster();
+ else return false;
+}
+
function buildDungeon() {
$dungeon=generateMonster();
if(!empty($_SESSION["dungeon"])) {