just a quick uncomment cause some just run and wonder why it dose nothing
[travianx.git] / warsim.php
blob6e4688cbc7de8f714dd9f4dd1a6df598c576e61d
1 <?php
3 #################################################################################
4 ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
5 ## --------------------------------------------------------------------------- ##
6 ## Filename warsim.php ##
7 ## Developed by: Dzoki ##
8 ## License: TravianX Project ##
9 ## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
10 ## ##
11 #################################################################################
14 include("GameEngine/Village.php");
15 $start = $generator->pageLoadTimeStart();
16 $battle->procSim($_POST);
18 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19 <html>
20 <head>
21 <title><?php echo SERVER_NAME ?></title>
22 <link REL="shortcut icon" HREF="favicon.ico"/>
23 <meta http-equiv="cache-control" content="max-age=0" />
24 <meta http-equiv="pragma" content="no-cache" />
25 <meta http-equiv="expires" content="0" />
26 <meta http-equiv="imagetoolbar" content="no" />
27 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
28 <script src="mt-full.js?0faaa" type="text/javascript"></script>
29 <script src="unx.js?0faaa" type="text/javascript"></script>
30 <script src="new.js?0faaa" type="text/javascript"></script>
31 <link href="<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7c" rel="stylesheet" type="text/css" />
32 <link href="<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7c" rel="stylesheet" type="text/css" />
33 <?php
34 if($session->gpack == null || GP_ENABLE == false) {
35 echo "
36 <link href='".GP_LOCATE."travian.css?e21d2' rel='stylesheet' type='text/css' />
37 <link href='".GP_LOCATE."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
38 } else {
39 echo "
40 <link href='".$session->gpack."travian.css?e21d2' rel='stylesheet' type='text/css' />
41 <link href='".$session->gpack."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
44 <script type="text/javascript">
46 window.addEvent('domready', start);
47 </script>
48 </head>
51 <body class="v35 ie ie8">
52 <div class="wrapper">
53 <img style="filter:chroma();" src="img/x.gif" id="msfilter" alt="" />
54 <div id="dynamic_header">
55 </div>
56 <?php include("Templates/header.tpl"); ?>
57 <div id="mid">
58 <?php include("Templates/menu.tpl"); ?>
59 <div id="content" class="warsim">
60 <h1>Combat simulator</h1>
61 <!--<form action="warsim.php" method="post">
62 <?php /*
63 if(isset($_POST['result'])) {
64 $target = isset($_POST['target'])? $_POST['target'] : array();
65 $tribe = isset($_POST['mytribe'])? $_POST['mytribe'] : $session->tribe;
66 include("Templates/Simulator/res_a".$tribe.".tpl");
67 foreach($target as $tar) {
68 include("Templates/Simulator/res_d".$tar.".tpl");
70 echo "<p>Type of attack: <b>";
71 echo $form->getValue('ktyp') == 0? "Normal" : "Raid";
72 echo "</b></p>";
73 if (isset($_POST['result'][3])&&isset($_POST['result'][4])){
74 if ($_POST['result'][4]>$_POST['result'][3]){
75 echo "Building destroid";
76 }elseif ($_POST['result'][4]==0){
77 echo "The building isn't destroid";
78 }else{
79 $demolish=$_POST['result'][4]/$_POST['result'][3];
80 //$Katalife=round($_POST['result'][4]-($_POST['result'][4]*$_POST['result'][1]));
81 //$totallvl = round($form->getValue('kata')-($form->getValue('kata') * $demolish));
82 $totallvl = round(sqrt(pow(($form->getValue('kata')+0.5),2)-($_POST['result'][4]*8)));
83 echo "<p>Damage done by catapult: from level <b>".$form->getValue('kata')."</b> to level <b>".$totallvl."</b></p>";
87 $target = isset($_POST['target'])? $_POST['target'] : array();
88 $tribe = isset($_POST['mytribe'])? $_POST['mytribe'] : $session->tribe;
89 if(count($target) > 0) {
90 include("Templates/Simulator/att_".$tribe.".tpl");
91 echo "<table id=\"defender\" class=\"fill_in\" cellpadding=\"1\" cellspacing=\"1\">
93 <thead>
94 <tr>
95 <th>
96 Defender <span class=\"small\"></span>
97 </th>
98 </tr>
99 </thead>";
100 foreach($target as $tar) {
101 include("Templates/Simulator/def_".$tar.".tpl");
103 include("Templates/Simulator/def_end.tpl");
104 echo "<div class=\"clear\"></div>";
107 <table id="select" cellpadding="1" cellspacing="1">
108 <thead><tr>
109 <td>Attacker</td>
110 <td>Defender</td>
111 <td>Type of attack</td>
112 </tr></thead>
113 <tbody><tr>
114 <td>
115 <label><input class="radio" type="radio" name="a1_v" value="1" <?php if($tribe == 1) { echo "checked"; } ?>> Romans</label><br/>
116 <label><input class="radio" type="radio" name="a1_v" value="2" <?php if($tribe == 2) { echo "checked"; } ?>> Teutons</label><br/>
117 <label><input class="radio" type="radio" name="a1_v" value="3" <?php if($tribe == 3) { echo "checked"; } ?>> Gauls</label>
118 </td><td>
119 <label><input class="check" type="checkbox" name="a2_v1" value="1" <?php if(in_array(1,$target)) { echo "checked"; } ?>> Romans</label><br/>
121 <label><input class="check" type="checkbox" name="a2_v2" value="1" <?php if(in_array(2,$target)) { echo "checked"; } ?>> Teutons</label><br/>
122 <label><input class="check" type="checkbox" name="a2_v3" value="1" <?php if(in_array(3,$target)) { echo "checked"; } ?>> Gauls</label><br/>
123 <label><input class="check" type="checkbox" name="a2_v4" value="1" <?php if(in_array(4,$target)) { echo "checked"; } ?>> Nature</label>
124 </td><td>
125 <label><input class="radio" type="radio" name="ktyp" value="0" <?php if($form->getValue('ktyp') == 0 || $form->getValue('ktyp') == "") { echo "checked"; } ?>> normal</label><br/>
127 <label><input class="radio" type="radio" name="ktyp" value="1" <?php if($form->getValue('ktyp') == 1) { echo "checked"; } ?>> raid</label><br/>
128 <label><input type="hidden" name="uid" value="<?php echo $session->uid; ?>"></label>
129 </td>
130 </tr></tbody>
131 </table>
133 <p class="btn"><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>
134 </form>-->
135 This is not working. We keep you up to date!
136 </div>
137 <div id="side_info">
138 <?php
139 include("Templates/quest.tpl");
140 include("Templates/news.tpl");
141 include("Templates/multivillage.tpl");
142 include("Templates/links.tpl");
144 </div>
145 <div class="clear"></div>
146 </div>
147 <div class="footer-stopper"></div>
148 <div class="clear"></div>
150 <?php
151 include("Templates/footer.tpl");
152 include("Templates/res.tpl");
154 <div id="stime">
155 <div id="ltime">
156 <div id="ltimeWrap">
157 Calculated in <b><?php
158 echo round(($generator->pageLoadTimeEnd()-$start)*1000);
159 ?></b> ms
161 <br />Server time: <span id="tp1" class="b"><?php echo date('H:i:s'); ?></span>
162 </div>
163 </div>
164 </div>
166 <div id="ce"></div>
167 </body>
168 </html>