-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrpg.php
90 lines (81 loc) · 2.14 KB
/
rpg.php
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
//Tell where the includes are.
define ('INCLUDE_DIR','include/');
require_once INCLUDE_DIR.'errorlog.php';
//Prepare the error trapping functions
require_once INCLUDE_DIR.'errorlog.php';
$dummy=null;
#Globals
require_once INCLUDE_DIR.'paths.php';
#HTML scritps
require_once INCLUDE_DIR.'html/html_fight.php';
#Prep the game objects.
require_once INCLUDE_DIR.'fight.php';
require_once INCLUDE_DIR.'fight_store.php';
require_once INCLUDE_DIR.'jobs.php';
require_once INCLUDE_DIR.'items.php';
require_once INCLUDE_DIR.'abilities.php';
require_once INCLUDE_DIR.'personalities.php';
#AI for the monsters
require_once INCLUDE_DIR.'ai.php';
#We may need the javascript file stack.
require_once INCLUDE_DIR.'html/html_javascript.php';
#Do LOGIN stuff :)
require_once 'common_auth.php';
$userid=authenticate_login('/auth/login.php');
$auth=get_auth();
$auth->add_membership($userid,'dse');
redirect_on_hold($userid,'dse','on_hold.php','../index.php');
//Check for party completeness
/* OLD WAY
if(!isset($_SESSION['prefight']))
{
header('Location: proc_fight.php');
exit;
}
*/
//New way!
if(isset($_SESSION['fightid']))
$fightid=$_SESSION['fightid'];
else
$fightid=0;
$fight_store=new FIGHT_STORE();
$result=$fight_store->get_fight($userid,$fightid);
if($result==false)
{
header('Location: pick_team.php');
exit;
}
extract($result);
if($active=="no")
{
header('Location: proc_fight.php');
exit;
}
if (is_null($player_party)) {
echo 'There is no player party.<br>';
require_once INCLUDE_DIR.'team_store.php';
$team_store = new TEAM_STORE();
foreach ($fight->parties as $party)
{
foreach ($party->teams as $id=>$members)
{
$team = $team_store->get_team($id);
var_dump($team);
echo '<hr>';
if ($team->playerid == $userid)
{
$player_party = $party;
$teamid = $id;
}
}
}
if (is_null($player_party))
{
var_dump($result);
exit;
}
}
$_SESSION['fightid']=$fightid;
html_combat($fightid, $fight, $player_party, $teamid);
?>