diff options
Diffstat (limited to 'inc/guild.inc')
-rw-r--r-- | inc/guild.inc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/inc/guild.inc b/inc/guild.inc new file mode 100644 index 0000000..4ca0262 --- /dev/null +++ b/inc/guild.inc @@ -0,0 +1,30 @@ +<?php + +function createGuild(){ + if($_SESSION["mine"]["gold"] >= 50 && !isset($_SESSION["guild"])){ + $_SESSION["guild"]= array("miners" => 1); + $_SESSION["mine"]["gold"] -= 50; + echo "Guild has been successfully created"; + } + else{ + echo "g"; + } +} + +function hireMiner(){ + if(!isset($_SESSION["guild"])){ + echo "you need to create a guild first"; + } + if($_SESSION["mine"]["gold"] >= 20 && isset($_SESSION["guild"])){ + $_SESSION["guild"]["miners"]++; + $_SESSION["mine"]["gold"] -= 20; + $_SESSION["mine"]["miners"] = $_SESSION["guild"]["miners"]; + $mine = $_SESSION["mine"]; + echo $mine["gold"] +","+ $mine["miners"]; + } +} + +//function buy($obj,$prix){} + + +?> |