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. ##
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">
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" />
34 if($session->gpack
== null || GP_ENABLE
== false) {
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' />";
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
);
51 <body
class="v35 ie ie8">
53 <img style
="filter:chroma();" src
="img/x.gif" id
="msfilter" alt
="" />
54 <div id
="dynamic_header">
56 <?php
include("Templates/header.tpl"); ?
>
58 <?php
include("Templates/menu.tpl"); ?
>
59 <div id
="content" class="warsim">
60 <h1
>Combat simulator
</h1
>
61 <!--<form action
="warsim.php" method
="post">
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";
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";
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\">
96 Defender <span class=\"small\"></span>
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">
111 <td
>Type of attack
</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
>
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
>
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
>
133 <p
class="btn"><input type
="image" value
="ok" name
="s1" id
="btn_ok" class="dynamic_img" src
="img/x.gif" alt
="OK" /></p
>
135 This is not working
. We keep you up to date
!
139 include("Templates/quest.tpl");
140 include("Templates/news.tpl");
141 include("Templates/multivillage.tpl");
142 include("Templates/links.tpl");
145 <div
class="clear"></div
>
147 <div
class="footer-stopper"></div
>
148 <div
class="clear"></div
>
151 include("Templates/footer.tpl");
152 include("Templates/res.tpl");
157 Calculated in
<b
><?php
158 echo round(($generator->pageLoadTimeEnd()-$start)*1000);
161 <br
/>Server time
: <span id
="tp1" class="b"><?php
echo date('H:i:s'); ?
></span
>