From 74c6a6da279adab9d80e13171f5b8d905a46e790 Mon Sep 17 00:00:00 2001 From: iopietro Date: Sun, 23 Sep 2018 16:30:45 +0200 Subject: [PATCH] Additions +Started the war simulator refactoring --- a2b.php | 220 ------------ .../gpack/travian_default/lang/en/compact.css | 10 +- src/Lang/en.php | 5 + templates/simulator/att_2.tpl | 171 --------- templates/simulator/att_3.tpl | 171 --------- .../simulator/{att_1.tpl => attacker.tpl} | 0 .../{res_a1.tpl => attackerResults.tpl} | 0 templates/simulator/def_2.tpl | 129 ------- templates/simulator/def_3.tpl | 129 ------- templates/simulator/def_4.tpl | 121 ------- .../simulator/{def_1.tpl => defender.tpl} | 0 .../{def_end.tpl => defenderInfo.tpl} | 0 .../{res_d1.tpl => defenderResults.tpl} | 0 templates/simulator/res_1.tpl | 85 ----- templates/simulator/res_2.tpl | 85 ----- templates/simulator/res_3.tpl | 86 ----- templates/simulator/res_4.tpl | 86 ----- templates/simulator/res_a2.tpl | 61 ---- templates/simulator/res_a3.tpl | 64 ---- templates/simulator/res_d2.tpl | 60 ---- templates/simulator/res_d3.tpl | 65 ---- templates/simulator/res_d4.tpl | 67 ---- templates/simulator/return.tpl | 340 ------------------ templates/simulator/targets.tpl | 59 +++ templates/village/buildings/16.tpl | 2 +- templates/village/buildings/22.tpl | 2 +- .../buildings/{ => academy}/research.tpl | 0 .../buildings/rallyPoint/simulator.tpl | 3 + warsim.php | 198 ---------- 29 files changed, 74 insertions(+), 2145 deletions(-) delete mode 100644 a2b.php delete mode 100644 templates/simulator/att_2.tpl delete mode 100644 templates/simulator/att_3.tpl rename templates/simulator/{att_1.tpl => attacker.tpl} (100%) rename templates/simulator/{res_a1.tpl => attackerResults.tpl} (100%) delete mode 100644 templates/simulator/def_2.tpl delete mode 100644 templates/simulator/def_3.tpl delete mode 100644 templates/simulator/def_4.tpl rename templates/simulator/{def_1.tpl => defender.tpl} (100%) rename templates/simulator/{def_end.tpl => defenderInfo.tpl} (100%) rename templates/simulator/{res_d1.tpl => defenderResults.tpl} (100%) delete mode 100644 templates/simulator/res_1.tpl delete mode 100644 templates/simulator/res_2.tpl delete mode 100644 templates/simulator/res_3.tpl delete mode 100644 templates/simulator/res_4.tpl delete mode 100644 templates/simulator/res_a2.tpl delete mode 100644 templates/simulator/res_a3.tpl delete mode 100644 templates/simulator/res_d2.tpl delete mode 100644 templates/simulator/res_d3.tpl delete mode 100644 templates/simulator/res_d4.tpl delete mode 100644 templates/simulator/return.tpl create mode 100644 templates/simulator/targets.tpl rename templates/village/buildings/{ => academy}/research.tpl (100%) create mode 100644 templates/village/buildings/rallyPoint/simulator.tpl delete mode 100644 warsim.php diff --git a/a2b.php b/a2b.php deleted file mode 100644 index 700772eb..00000000 --- a/a2b.php +++ /dev/null @@ -1,220 +0,0 @@ -pageLoadTimeStart(); - -// ################################################################################ -// # -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## -// # --------------------------------------------------------------------------- ## -// # Filename a2b.php ## -// # Developed by: Dzoki ## -// # License: TravianX Project ## -// # Copyright: TravianX (c) 2010-2011. All rights reserved. ## -// # ## -// ################################################################################ - -use TravianZ\Utils\AccessLogger; - -include_once ("GameEngine/Village.php"); -AccessLogger::logRequest(); - -//Check if a rally point has already been built -if($village->resarray['f39'] == 0){ - header("Location: dorf2.php"); - exit(); -} - -if(isset($_GET['newdid'])){ - $_SESSION['wid'] = $_GET['newdid']; - if(isset($_GET['w'])){ - header("Location: ".$_SERVER['PHP_SELF']."?w=".$_GET['w']); - exit(); - }else if(isset($_GET['r'])){ - header("Location: ".$_SERVER['PHP_SELF']."?r=".$_GET['r']); - exit(); - }else if(isset($_GET['o'])){ - header("Location: ".$_SERVER['PHP_SELF']."?o=".$_GET['o']); - exit(); - }else if(isset($_GET['z'])){ - header("Location: ".$_SERVER['PHP_SELF']."?z=".$_GET['z']); - exit(); - }else if($_GET['id'] > 0){ - header("Location: ".$_SERVER['PHP_SELF']); - exit(); - } -} -else $building->procBuild($_GET); - -if(isset($_GET['id'])) $id = preg_replace("/[^a-zA-Z0-9_-]/", "", $_GET['id']); -if(isset($_GET['w'])) $w = preg_replace("/[^a-zA-Z0-9_-]/", "", $_GET['w']); -if(isset($_GET['r'])) $r = preg_replace("/[^a-zA-Z0-9_-]/", "", $_GET['r']); -if(isset($_GET['delprisoners'])){ - $delprisoners = preg_replace("/[^a-zA-Z0-9_-]/", "", $_GET['delprisoners']); -} -if(isset($_GET['o'])){ - $o = preg_replace("/[^a-zA-Z0-9_-]/", "", $_GET['o']); - $oid = preg_replace("/[^a-zA-Z0-9_-]/", "", $_GET['z']); - $too = $database->getOasisField($oid, "conqured"); - if($too == 0){ - $disabledr = "disabled=disabled"; - $disabled = "disabled=disabled"; - }else{ - $disabledr = ""; - if($session->sit == 0) $disabled = ""; - else $disabled = "disabled=disabled"; - } - $checked = "checked=checked"; -}else{ - if($session->sit == 0) $disabled = ""; - else $disabled = "disabled=disabled"; -} -$process = $units->procUnits($_POST); -?> - - - - -<?php - -echo SERVER_NAME.' - Send Troops'?> - - - - - - - - - - - - - gpack == null || GP_ENABLE == false){ - echo " - - "; - }else{ - echo " - - "; - } - - ?> - - - - - -
- -
- -
- -
-getEnforceArray($w, 0); - if($enforce['vref'] == $village->wid){ - $to = $database->getVillage($enforce['from']); - $ckey = $w; - include("templates/sendUnits/sendBack.tpl"); - }else{ - include("Templates/a2b/units_".$session->tribe.".tpl"); - include("templates/sendUnits/search.tpl"); - } -}else if(isset($r)){ - $enforce = $database->getEnforceArray($r, 0); - $enforceoasis = $database->getOasisEnforceArray($r, 0); - if($enforce['from'] == $village->wid || $enforceoasis['conqured'] == $village->wid){ - $to = $database->getVillage($enforce['from']); - $ckey = $r; - include("templates/sendUnits/sendBack.tpl"); - }else{ - include ("Templates/a2b/units_".$session->tribe.".tpl"); - include("templates/sendUnits/search.tpl"); - } -}else if(isset($delprisoners) && !empty($delprisoners)) $units->deletePrisoners($delprisoners); -else{ - if(isset($process['0'])){ - $coor = $database->getCoor($process['0']); - include("templates/sendUnits/attack.tpl"); - }else{ - include("Templates/a2b/units_".$session->tribe.".tpl"); - include("templates/sendUnits/search.tpl"); - } -} -?> - -
-
-
-
-
- -
-
-
- -
- -
-
-
- pageLoadTimeEnd() - $start_timer) * 1000); - -?> ms
-
-
-
-
- - - diff --git a/assets/gpack/travian_default/lang/en/compact.css b/assets/gpack/travian_default/lang/en/compact.css index 72cb8e09..d5d321ca 100644 --- a/assets/gpack/travian_default/lang/en/compact.css +++ b/assets/gpack/travian_default/lang/en/compact.css @@ -3000,19 +3000,19 @@ div.plus table#gold_features { div.plus table.plusFunctions { margin-bottom: 25px; } -div.warsim table#select { +div.gid16 table#select { margin-top: 10px; } -div.warsim table#attacker { +div.gid16 table#attacker { float: left; } -div.warsim table#defender { +div.gid16 table#defender { float: right; } -div.warsim table.fill_in { +div.gid16 table.fill_in { margin-bottom: 15px; } -div.warsim table.results { +div.gid16 table.results { margin-top: 15px; } div.banned_cn table { diff --git a/src/Lang/en.php b/src/Lang/en.php index ce837e5a..75953c87 100755 --- a/src/Lang/en.php +++ b/src/Lang/en.php @@ -686,6 +686,11 @@ define("PASSWORD_SENT", "If the email address exists, a new password has been se define("PASSWORD_SET_SUCCESS", "The password was set successfully."); define("NEW_PASSWORD_ERROR", "Invalid code, password or the password has already been set."); +//SIMULATOR +define("ATTACKER","Attacker"); +define("DEFENDER","Defender"); +define("TYPE_OF_ATTACK","Type of attack"); + //BEER FEST define("BEER_FEST","Beer fest"); define("CELEBRATION","Celebration"); diff --git a/templates/simulator/att_2.tpl b/templates/simulator/att_2.tpl deleted file mode 100644 index 151c83ad..00000000 --- a/templates/simulator/att_2.tpl +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
Attacker
Teutons
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Clubswinger - - Clubswinger - - - - -
- - Spearman - - Spearman - - - - - -
- Axeman - - Axeman - - - - -
- Scout - - Scout - - - - - -
- Paladin - - - Paladin - - - - -
- Teutonic Knight - - - Teutonic Knight - - - - -
- Ram - - Ram - - - - - -
- Catapult - - Catapult - - - - - -
- Chief - - Chief - - - -
- Settler - - Settler - - - -
-
Other
- - - - - - - - - - - - - - - - - - - - - - - - - - -
PopulationPopulationgetValue('ew1'); ?>" maxlength="5" title="Number Population" />
catapult targetLvl catapult targetgetValue('kata'); ?>" maxlength="2" title="Lvl Catapult Target" />
HeroHero (off bonus)getValue('h_off_bonus'); ?>" maxlength="4" title="Hero (off bonus)" />
HeroHero (fighting strength)getValue('h_off'); ?>" maxlength="5" title="Hero (fighting strength)" />
-
diff --git a/templates/simulator/att_3.tpl b/templates/simulator/att_3.tpl deleted file mode 100644 index 37d5c0eb..00000000 --- a/templates/simulator/att_3.tpl +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
Attacker
Gauls
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Phalanx - - Phalanx - - - - -
- - Swordsman - - Swordsman - - - - - -
- Pathfinder - - Pathfinder - - - - -
- Theutates Thunder - - Theutates Thunder - - - - - -
- Druidrider - - - Druidrider - - - - -
- Haeduan - - - Haeduan - - - - -
- Ram - - Ram - - - - - -
- Trebuchet - - Trebuchet - - - - - -
- Chieftain - - Chieftain - - - -
- Settler - - Settler - - - -
-
Other
- - - - - - - - - - - - - - - - - - - - - - - - - - -
PopulationPopulationgetValue('ew1'); ?>" maxlength="5" title="Number Population" />
catapult targetLvl catapult targetgetValue('kata'); ?>" maxlength="2" title="Lvl Catapult Target" />
HeroHero (off bonus)getValue('h_off_bonus'); ?>" maxlength="4" title="Hero (off bonus)" />
HeroHero (fighting strength)getValue('h_off'); ?>" maxlength="5" title="Hero (fighting strength)" />
-
diff --git a/templates/simulator/att_1.tpl b/templates/simulator/attacker.tpl similarity index 100% rename from templates/simulator/att_1.tpl rename to templates/simulator/attacker.tpl diff --git a/templates/simulator/res_a1.tpl b/templates/simulator/attackerResults.tpl similarity index 100% rename from templates/simulator/res_a1.tpl rename to templates/simulator/attackerResults.tpl diff --git a/templates/simulator/def_2.tpl b/templates/simulator/def_2.tpl deleted file mode 100644 index a6ed8d42..00000000 --- a/templates/simulator/def_2.tpl +++ /dev/null @@ -1,129 +0,0 @@ - - - - Teutons - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Clubswinger - - Clubswinger - - - - -
- - Spearman - - Spearman - - - - - -
- Axeman - - Axeman - - - - -
- Scout - - Scout - - - - - -
- Paladin - - - Paladin - - - - -
- Teutonic Knight - - - Teutonic Knight - - - - -
- Ram - - Ram - - - - - -
- Catapult - - Catapult - - - - - -
- Chief - - Chief - - - -
- Settler - - Settler - - - -
- - - diff --git a/templates/simulator/def_3.tpl b/templates/simulator/def_3.tpl deleted file mode 100644 index 5e5c7407..00000000 --- a/templates/simulator/def_3.tpl +++ /dev/null @@ -1,129 +0,0 @@ - - - - Gauls - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Phalanx - - Phalanx - - - - -
- - Swordsman - - Swordsman - - - - - -
- Pathfinder - - Pathfinder - - - - -
- Theutates Thunder - - Theutates Thunder - - - - - -
- Druidrider - - - Druidrider - - - - -
- Haeduan - - - Haeduan - - - - -
- Ram - - Ram - - - - - -
- Trebuchet - - Trebuchet - - - - - -
- Chieftain - - Chieftain - - - -
- Settler - - Settler - - - -
- - - diff --git a/templates/simulator/def_4.tpl b/templates/simulator/def_4.tpl deleted file mode 100644 index 8d10fa2a..00000000 --- a/templates/simulator/def_4.tpl +++ /dev/null @@ -1,121 +0,0 @@ - - - Nature - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Rat - - Rat - - - -
- Spider - - Spider - - - -
- Snake - - Snake - - - -
- Bat - - Bat - - - -
- Wild Boar - - Wild Boar - - - -
- Wolf - - Wolf - - - -
- Bear - - Bear - - - -
- Crocodile - - Crocodile - - - -
- Tiger - - Tiger - - - -
- Elephant - - Elephant - - - -
- - - diff --git a/templates/simulator/def_1.tpl b/templates/simulator/defender.tpl similarity index 100% rename from templates/simulator/def_1.tpl rename to templates/simulator/defender.tpl diff --git a/templates/simulator/def_end.tpl b/templates/simulator/defenderInfo.tpl similarity index 100% rename from templates/simulator/def_end.tpl rename to templates/simulator/defenderInfo.tpl diff --git a/templates/simulator/res_d1.tpl b/templates/simulator/defenderResults.tpl similarity index 100% rename from templates/simulator/res_d1.tpl rename to templates/simulator/defenderResults.tpl diff --git a/templates/simulator/res_1.tpl b/templates/simulator/res_1.tpl deleted file mode 100644 index ba6d9c20..00000000 --- a/templates/simulator/res_1.tpl +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - -
- Defender - - Legionnaire - - - Praetorian - - Imperian - - Equites Legati - - Equites Imperatoris - - - Equites Caesaris - - Battering Ram - - Fire Catapult - - Senator - - Settler - -
- Troops - - 0 - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 -
- Casualties - - 0 - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 -
\ No newline at end of file diff --git a/templates/simulator/res_2.tpl b/templates/simulator/res_2.tpl deleted file mode 100644 index f595106e..00000000 --- a/templates/simulator/res_2.tpl +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - -
- Defender - - - Clubswinger - - Spearman - - Axeman - - Scout - - Paladin - - - Teutonic Knight - - Ram - - Catapult - - Chief - - - Settler -
- Troops - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 - - 0 -
- Casualties - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 - - 0 -
\ No newline at end of file diff --git a/templates/simulator/res_3.tpl b/templates/simulator/res_3.tpl deleted file mode 100644 index 55cb1b9a..00000000 --- a/templates/simulator/res_3.tpl +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - -
- Defender - - Phalanx - - Swordsman - - Pathfinder - - - Theutates Thunder - - Druidrider - - Haeduan - - Ram - - Trebuchet - - - Chieftain - - Settler -
- - Troops - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 -
- Casualties - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 -
\ No newline at end of file diff --git a/templates/simulator/res_4.tpl b/templates/simulator/res_4.tpl deleted file mode 100644 index e6609219..00000000 --- a/templates/simulator/res_4.tpl +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - -
- Defender - - Rat - - - Spider - - Snake - - Bat - - Wild Boar - - Wolf - - - Bear - - Crocodile - - Tiger - - Elephant -
- - Troops - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 -
- Casualties - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 -
\ No newline at end of file diff --git a/templates/simulator/res_a2.tpl b/templates/simulator/res_a2.tpl deleted file mode 100644 index 8dae3386..00000000 --- a/templates/simulator/res_a2.tpl +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Attacker - - - Clubswinger - - Spearman - - Axeman - - Scout - - Paladin - - Teutonic Knight - - Ram - - Catapult - - Chief - - Settler -
- Troops - getValue('a1_1')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_1');} ?>getValue('a1_2')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_2');} ?>getValue('a1_3')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_3');} ?>getValue('a1_4')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_4');} ?>getValue('a1_5')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_5');} ?>getValue('a1_6')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_6');} ?>getValue('a1_7')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_7');} ?>getValue('a1_8')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_8');} ?>getValue('a1_9')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_9');} ?>getValue('a1_10')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_10');} ?>
- Casualties - getValue('a1_1')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_2')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_3')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_4')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_5')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_6')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_7')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_8')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_9')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_10')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>
diff --git a/templates/simulator/res_a3.tpl b/templates/simulator/res_a3.tpl deleted file mode 100644 index ea8c954c..00000000 --- a/templates/simulator/res_a3.tpl +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Attacker - - Phalanx - - Swordsman - - Pathfinder - - Theutates Thunder - - Druidrider - - Haeduan - - Ram - - Trebuchet - - Chieftain - - Settler -
- - Troops - getValue('a1_1')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_1');} ?>getValue('a1_2')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_2');} ?>getValue('a1_3')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_3');} ?>getValue('a1_4')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_4');} ?>getValue('a1_5')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_5');} ?>getValue('a1_6')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_6');} ?>getValue('a1_7')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_7');} ?>getValue('a1_8')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_8');} ?>getValue('a1_9')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_9');} ?>getValue('a1_10')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a1_10');} ?>
- Casualties - getValue('a1_1')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_2')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_3')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_4')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_5')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_6')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_7')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_8')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_9')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>getValue('a1_10')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][1]);} ?>
diff --git a/templates/simulator/res_d2.tpl b/templates/simulator/res_d2.tpl deleted file mode 100644 index d0693156..00000000 --- a/templates/simulator/res_d2.tpl +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Defender - - Clubswinger - - Spearman - - Axeman - - Scout - - Paladin - - Teutonic Knight - - Ram - - Catapult - - Chief - - Settler -
- Troops - getValue('a2_11')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_11');} ?>getValue('a2_12')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_12');} ?>getValue('a2_13')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_13');} ?>getValue('a2_14')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_14');} ?>getValue('a2_15')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_15');} ?>getValue('a2_16')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_16');} ?>getValue('a2_17')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_17');} ?>getValue('a2_18')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_18');} ?>getValue('a2_19')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_19');} ?>getValue('a2_20')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_20');} ?>
- Casualties - getValue('a2_11')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_12')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_13')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_14')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_15')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_16')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_17')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_18')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_19')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_20')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>
diff --git a/templates/simulator/res_d3.tpl b/templates/simulator/res_d3.tpl deleted file mode 100644 index 5823ff3d..00000000 --- a/templates/simulator/res_d3.tpl +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Defender - - Phalanx - - Swordsman - - Pathfinder - - Theutates Thunder - - Druidrider - - Haeduan - - Ram - - Trebuchet - - Chieftain - - Settler -
- - Troops - getValue('a2_21')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_21');} ?>getValue('a2_22')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_22');} ?>getValue('a2_23')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_23');} ?>getValue('a2_24')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_24');} ?>getValue('a2_25')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_25');} ?>getValue('a2_26')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_26');} ?>getValue('a2_27')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_27');} ?>getValue('a2_28')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_28');} ?>getValue('a2_29')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_29');} ?>getValue('a2_30')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_30');} ?>
- Casualties - getValue('a2_21')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_22')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_23')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_24')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_25')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_26')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_27')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_28')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_29')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_30')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>
diff --git a/templates/simulator/res_d4.tpl b/templates/simulator/res_d4.tpl deleted file mode 100644 index 5d97ac8a..00000000 --- a/templates/simulator/res_d4.tpl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Defender - - Rat - - - Spider - - Snake - - Bat - - Wild Boar - - Wolf - - - Bear - - Crocodile - - Tiger - - Elephant -
- - Troops - getValue('a2_31')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_31');} ?>getValue('a2_32')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_32');} ?>getValue('a2_33')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_33');} ?>getValue('a2_34')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_34');} ?>getValue('a2_35')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_35');} ?>getValue('a2_36')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_36');} ?>getValue('a2_37')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_37');} ?>getValue('a2_38')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_38');} ?>getValue('a2_39')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_39');} ?>getValue('a2_40')) { echo "class=\"none\">0"; }else{ echo ">".$form->getValue('a2_40');} ?>
- Casualties - getValue('a2_31')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_32')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_33')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_34')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_35')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_36')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_37')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_38')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_39')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>getValue('a2_40')) { echo "class=\"none\">0"; }else{ echo ">".$dead = round($troops * $_POST['result'][2]);} ?>
diff --git a/templates/simulator/return.tpl b/templates/simulator/return.tpl deleted file mode 100644 index 988508b7..00000000 --- a/templates/simulator/return.tpl +++ /dev/null @@ -1,340 +0,0 @@ -
- - - - - - - - - - -
- Agresor - - Legionario - - - Pretoriano - - Imperano - - Equites Legati - - Equites Imperatoris - - - Equites Caesaris - - Carnero - - Catapulta de fuego - - Senador - - Colono - -
- Tropas - - 1 - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 -
- Pérdidas - - 1 - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 -
- - - - - - - - - - -
- Defensor - - - Legionario - - Pretoriano - - Imperano - - Equites Legati - - Equites Imperatoris - - - Equites Caesaris - - Carnero - - Catapulta de fuego - - Senador - - - Colono -
- Tropas - - 1 - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 - - 0 -
- Pérdidas - - 0 - - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 - - 0 -
- - - - - - - - - - - - - -
- Defensor - - Luchador de Porra - - Lancero - - Luchador de Hacha - - - Emisario - - Paladín - - Jinete Teutón - - Ariete - - Catapulta - - - Cabecilla - - Colono -
- - Tropas - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 -
- Pérdidas - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 -
- - - - - - - - - - - -
- Defensor - - Falange - - - Luchador de Espada - - Batidor - - Rayo de Teutates - - Jinete Druida - - Jinete Eduo - - - Carnero de madera - - Catapulta de guerra - - Cacique - - Colono -
- Tropas - - 0 - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 -
- Pérdidas - - 0 - - 0 - - - 0 - - 0 - - 0 - - 0 - - 0 - - 0 - - - 0 - - 0 -
- diff --git a/templates/simulator/targets.tpl b/templates/simulator/targets.tpl new file mode 100644 index 00000000..4a983b3c --- /dev/null +++ b/templates/simulator/targets.tpl @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + +
{$smarty.const.ATTACKER}{$smarty.const.DEFENDER}{$smarty.const.TYPE_OF_ATTACK}
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +

+ +

\ No newline at end of file diff --git a/templates/village/buildings/16.tpl b/templates/village/buildings/16.tpl index a77f8a09..21b0fad2 100644 --- a/templates/village/buildings/16.tpl +++ b/templates/village/buildings/16.tpl @@ -5,7 +5,7 @@ {elseif $parameters['t'] == 1} {include file=$smarty.const.TEMPLATES_DIR|cat:'village/buildings/rallyPoint/sendUnits.tpl'} {elseif $parameters['t'] == 2} - {include file=$smarty.const.TEMPLATES_DIR|cat:'simulator/.tpl'} + {include file=$smarty.const.TEMPLATES_DIR|cat:'village/buildings/rallyPoint/simulator.tpl'} {elseif $parameters['t'] == 3} {include file=$smarty.const.TEMPLATES_DIR|cat:'village/buildings/rallyPoint/goldClub.tpl'} {/if} diff --git a/templates/village/buildings/22.tpl b/templates/village/buildings/22.tpl index d32e6430..87624a57 100644 --- a/templates/village/buildings/22.tpl +++ b/templates/village/buildings/22.tpl @@ -1,6 +1,6 @@ {if $villageBuildings[$parameters['id']]['level'] > 0} -{include file={$smarty.const.TEMPLATES_DIR}|cat:'/village/buildings/research.tpl'} +{include file={$smarty.const.TEMPLATES_DIR}|cat:'/village/buildings/academy/research.tpl'} {else} {$smarty.const.RESEARCH_COMMENCE_ACADEMY}
diff --git a/templates/village/buildings/research.tpl b/templates/village/buildings/academy/research.tpl similarity index 100% rename from templates/village/buildings/research.tpl rename to templates/village/buildings/academy/research.tpl diff --git a/templates/village/buildings/rallyPoint/simulator.tpl b/templates/village/buildings/rallyPoint/simulator.tpl new file mode 100644 index 00000000..81d0fb51 --- /dev/null +++ b/templates/village/buildings/rallyPoint/simulator.tpl @@ -0,0 +1,3 @@ + + {include file=$smarty.const.TEMPLATES_DIR|cat:'simulator/targets.tpl'} +
\ No newline at end of file diff --git a/warsim.php b/warsim.php deleted file mode 100644 index 9a406761..00000000 --- a/warsim.php +++ /dev/null @@ -1,198 +0,0 @@ -pageLoadTimeStart(); - -################################################################################# -## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## -## --------------------------------------------------------------------------- ## -## Filename warsim.php ## -## Developed by: Dzoki ## -## License: TravianX Project ## -## Copyright: TravianX (c) 2010-2011. All rights reserved. ## -## ## -################################################################################# - -use App\Utils\AccessLogger; - -include_once("GameEngine/Village.php"); -AccessLogger::logRequest(); - -$battle->procSim($_POST); -?> - - - - <?php echo SERVER_NAME ?> - Combat Simulator - - - - - - - - - - - - gpack == null || GP_ENABLE == false) { - echo " - - "; - } else { - echo " - - "; - } - ?> - - - - - -
- -
-
- -
- -
-

Combat simulator

-
-tribe; - include("Templates/Simulator/res_a".$tribe.".tpl"); - foreach($target as $tar) { - include("Templates/Simulator/res_d".$tar.".tpl"); - } - echo "

Type of attack: "; - echo $form->getValue('ktyp') == 0 ? "Normal" : "Raid"; - echo "

"; - echo "

"; - if (isset($_POST['result'][7]) && isset($_POST['result'][8])){ - if ($form->getValue('ktyp') == 1) { - echo "Hint: The ram does not work during a raid.
"; - }elseif ($_POST['result'][7] == 0){ - echo "Damage done by ram: from level ".$form->getValue('walllevel')." to level 0

"; - }elseif ($_POST['result'][7] == $_POST['result'][8]){ - echo "Damage done by ram: from level ".$form->getValue('walllevel')." to level ".$form->getValue('walllevel')."

"; - }else{ - echo "Damage done by ram: from level ".$form->getValue('walllevel')." to level ".$_POST['result'][7]."

"; - } - } - - if (isset($_POST['result'][3]) && isset($_POST['result'][4])){ - if ($form->getValue('ktyp') == 1) { - echo "Hint: The catapult does not shoot during a raid.

"; - }elseif ($_POST['result'][3] == 0){ - echo "Damage done by catapult: from level ".$form->getValue('kata')." to level 0

"; - }elseif ($_POST['result'][3] == $_POST['result'][4]){ - echo "Damage done by catapult: from level ".$form->getValue('kata')." to level ".$form->getValue('kata')."

"; - }else{ - echo "Damage done by catapult: from level ".$form->getValue('kata')." to level ".$_POST['result'][3]."

"; - } - } -} - -if (!empty($_GET['target'])) { - // this only works for Nature, as GET links like this one will come from an oasis - if (!$_GET['target'] != 4) { - $_GET['target'] = 4; - } - - // fill-in session value-array data - foreach ($_GET as $key => $value) { - if ($key[0] === 'u' && is_numeric($value)) { - $form->setValue('a2_' . substr($key, 1), $value); - } - } - - -} - -$target = isset($_POST['target'])? $_POST['target'] : (!empty($_GET['target']) ? array((int) $_GET['target']) : array()); -$tribe = isset($_POST['mytribe'])? $_POST['mytribe'] : $session->tribe; -if(count($target) > 0) { - include("Templates/Simulator/att_".preg_replace("/[^a-zA-Z0-9_-]/","",$tribe).".tpl"); - echo " - - - - - - "; - foreach($target as $tar) { - include("Templates/Simulator/def_".$tar.".tpl"); - } - include("templates/simulator/def_end.tpl"); - echo "
"; -} -?> -
- Defender -
- - - - - - - - -
AttackerDefenderType of attack
-
-
- -
-
- -
-
- -
-
- -
- -
- -

-
-
-



- -
-
-
- -
- - -
-
-
- pageLoadTimeEnd()-$start_timer)*1000); -?> ms - -
-
-
-
- -
- -