aboutsummaryrefslogtreecommitdiffstats
path: root/inc/guild.inc
blob: 5ede1f65f1f4e3ab0861856e2ef5b0c9e6134357 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

function createGuild(){
	if($_SESSION["mine"]["gold"] >= 150){
		$_SESSION["guild"]= array("miners" => 1);
		$_SESSION["mine"]["gold"] -= 150;
		echo "Guild has been successfully created";
	}
	else{
		echo "Not enough money";
	}
}

function hireMiner(){
	if(!isset($_SESSION["guild"])){
		echo "<p>you need to create a guild first"; 
	}
	if($_SESSION["mine"]["gold"] >= 40){
		$_SESSION["guild"]["miners"]++;
		$_SESSION["mine"]["gold"] -= 40;
		$_SESSION["mine"]["miners"] = $_SESSION["guild"]["miners"];
		$mine = $_SESSION["mine"];
		$guild = $_SESSION["guild"];
		echo $mine["gold"];
		echo $mine["miners"];
	}
}

?>