-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexplore.php
210 lines (167 loc) · 5.35 KB
/
explore.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<?php
require_once 'includes.php';
global $DB;
redirect_if_action($user);
$type = get_team($user);
$r = explore($user);
if($r == "land") {
$facebook->redirect("$facebook_canvas_url/found_land.php");
}
else if($r == "bottle") {
$facebook->redirect("$facebook_canvas_url/index.php?msg=bottle");
}
else if($r == "parrot") {
$facebook->redirect("$facebook_canvas_url/index.php?msg=parrot");
}
else if($r== "ship") {
$facebook->redirect("$facebook_canvas_url/found_ship.php");
}
else if($r== "found_merchant_ship") {
$facebook->redirect("$facebook_canvas_url/found_merchant_ship.php");
}
else if($r== "bomb") {
$facebook->redirect("$facebook_canvas_url/throw_bomb.php");
}
else if($r== "seamonster") {
$facebook->redirect("$facebook_canvas_url/found_disturbance.php");
}
if($_REQUEST['sent'] == "1") {
$msg = "Yer Pirate invitations have been sent!";
}
if($_REQUEST['msg'] == "send-limit") {
$msg = "Your requests were not sent. You're over the limit for today. Try again later. :(";
}
//allow bad things to happen since this is only explore page
$ship_image_blue = get_ship_image_and_weather($type, $user, false);
$dangerMsg = processes_weather_effects($user, $ship_image_blue);
$converted = false;
if($dangerMsg != "" and get_health($user) <= 0) {
$enemy = random_enemy($type);
$w = ucwords($enemy);
update_team($user, $enemy);
$dangerMsg = "Bad weather has destroyed your ship!<br>You are fished out by $w pirates and you become one of them.";
$converted = true;
$type = get_team($user);
}
$in = $_REQUEST['i'];
if(isset($in)) {
$facebook->redirect("$facebook_canvas_url/install.php?i=$in");
}
//print_r($user);
$user_in_db = is_user_in_db($user);
if($user_in_db ==0) {
$facebook->redirect("$facebook_canvas_url/install.php");
}
print dashboard();
$team = $type;
$coins = get_coin_total($user);
$buried_coins = get_coin_total_buried($user);
$health=get_health($user);
$my_level=get_level($user);
?>
<?php if($msg):?>
<fb:success>
<fb:message><?php echo $msg; ?></fb:message>
</fb:success>
<?php endif; ?>
<?php if($dangerMsg) { ?>
<center>
<fb:error>
<fb:message><?php echo $dangerMsg; ?></fb:message>
</fb:error>
</center>
<?php } else { ?>
<center>
<h1>You went sailing</h1>
</center>
<h2 style="text-align:center">ocean as far as the eye can see...</h2>
<?php } ?>
<br>
<center>
<table width="90%" cellspacing="0" cellpadding="3">
<tr>
<td width='30%'><h5 style="text-align:left">Level <?php echo $my_level; echo " " . ucwords($team); ?> Pirate</h5></td>
<td width='30%'><h5 style="text-align:center">Hit Points: <?php echo $health; ?></h5></td>
<td width='30%'><h5 style="text-align:right">Coins: <?php echo number_format($coins); ?> Buried: <?php echo number_format($buried_coins); ?></h5></td>
</tr>
</table>
<table style="background-color: #3B5998; border: 1px solid black; text-align: center; color: #FFFFFF; margin-top:0px; padding:10px" width="90%" border="0">
<tr>
<td width='30%'><center>
<?php
$userMiles = get_miles_traveled($user);
$milesMax = get_max_miles($user);
if($userMiles >= $milesMax and $dangerMsg == "") {
print get_too_many_miles_msg($user);
} else { ?>
<div id='harborcontainer' style='width:180px'>
<a style='color:#FFFFFF' <?php href('harbor.php'); ?> >
<span style="font-size:125%"><- <?php echo $type; ?> harbor </span>
<?php
echo "<br>$userMiles miles away<br>";
if($ship_image_blue == $barbary_stormycloud or $ship_image_blue == $barbary_stormycloud or $ship_image_blue == $barbary_stormycloud)
{
echo "warning clouds sighted<br>return to harbor!";
}
else {
echo "(get ship upgrades!)";
}
?>
</a>
</div>
</center>
</td>
<td width='30%' style="text-align:center">
<?php image($ship_image_blue); ?>
</td>
<td width='30%'>
<center>
<br><br>
<?php if($converted == false) { ?>
<?php $ra = rand(1,4); ?>
<?php if ($ra == 1): ?>
<div id = 'explorecontainer' style='width:180px'>
<a style="color:#FFFFFF" <?php href('explore.php'); ?> >
<span style="font-size:125%">explore a little further -></span><br>
(adventure, treasure, danger)</a>
</div>
<?php elseif($ra == 2): ?>
<div id = 'explorecontainer' style='width:180px'>
<a style="color:#FFFFFF" <?php href('explore.php'); ?> >
<span style="font-size:125%">row, row, row yer boat -></span><br>
(arrrrrrrr......)</a>
</div>
<?php elseif($ra == 3): ?>
<div id = 'explorecontainer' style='width:180px'>
<a style="color:#FFFFFF" <?php href('explore.php', '?d=north'); ?> >
<span style="font-size:125%">explore north</span> </a>
<br><br><br><br>
<a style="color:#FFFFFF" <?php href('explore.php', '?d=south'); ?>>
<span style="font-size:125%">explore south</span> </a>
</div>
<?php elseif(true): ?>
<div id='explorecontainer' style='width:180px'>
<a style="color:#FFFFFF" <?php href('explore.php', '?d=north'); ?>>
<span style="font-size:125%">keep exploring</span> </a>
</div>
<?php endif; ?>
<?php } } ?>
</center>
</td>
</tr>
</table>
<table width="90%" cellspacing="0" cellpadding="3">
<tr><td colspan='2' style="text-align:center;"><h5><?php echo get_pirate_tip(); ?></h5></td></tr>
</table><br>
<?php
if($userMiles >= $milesMax and $dangerMsg == "") {
?>
<fb:iframe src="CHANGEME/ads/?site=pirates&user=<?php echo $user; ?>'" style="border:0px;" width="626" height="80" scrolling="no" frameborder="0"/>
<?php
require_once 'footer_nolinks.php';
}
else {
require_once 'bottom_links.php';
require_once 'footer.php';
}
?>