From 6e518db51adaa16414b387eedd9bcbef3f7a2159 Mon Sep 17 00:00:00 2001 From: WeaverofBrokenThreads Date: Sun, 22 May 2016 18:04:08 +0200 Subject: [PATCH 1/3] Balance & Fixes Fixed balance on weapons, so that they are more 1:1 ratio with defense. Adjusted shields and war horses. Removed a potential exploit fix, which interfered with recalling soldiers from Knights who ran off, but prevented players from recalling their own troops. --- .../SiteBundle/Controller/ActionsController.php | 5 +++-- .../DataFixtures/ORM/LoadEquipmentData.php | 17 +++++++++-------- src/BM2/SiteBundle/Service/Economy.php | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/BM2/SiteBundle/Controller/ActionsController.php b/src/BM2/SiteBundle/Controller/ActionsController.php index fea4c01..8278f1b 100644 --- a/src/BM2/SiteBundle/Controller/ActionsController.php +++ b/src/BM2/SiteBundle/Controller/ActionsController.php @@ -943,8 +943,9 @@ public function assignedAction(Request $request) { if ($soldier->getCharacter() && $soldier->getCharacter()->isInBattle()) continue; if ($soldier->getCharacter() && $soldier->getCharacter()->isDoingAction('military.regroup')) continue; // FIXME: can't recall from your own estates or characters, but there should also be a message: - if ($soldier->getCharacter() && $soldier->getCharacter()->getUser() == $character->getUser()) continue; - if ($soldier->getBase() && $soldier->getBase()->getOwner() && $soldier->getBase()->getOwner()->getUser() == $character->getUser()) continue; + //if ($soldier->getCharacter() && $soldier->getCharacter()->getUser() == $character->getUser()) continue; + //if ($soldier->getBase() && $soldier->getBase()->getOwner() && $soldier->getBase()->getOwner()->getUser() == $character->getUser()) continue; + // Currently interferes with recalling soldiers from Knights who accept offers and run off. if ($soldier->getAssignedSince() == -1) { $days = 0; diff --git a/src/BM2/SiteBundle/DataFixtures/ORM/LoadEquipmentData.php b/src/BM2/SiteBundle/DataFixtures/ORM/LoadEquipmentData.php index 86f61f1..9620fdf 100644 --- a/src/BM2/SiteBundle/DataFixtures/ORM/LoadEquipmentData.php +++ b/src/BM2/SiteBundle/DataFixtures/ORM/LoadEquipmentData.php @@ -12,12 +12,12 @@ class LoadEquipmentData extends AbstractFixture implements OrderedFixtureInterface { private $equipment = array( - 'axe' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 10, 'defense' => 0, 'train' => 20, 'resupply' => 20, 'provider' => 'Blacksmith', 'trainer' => 'Training Ground', 'icon' => 'items/streitaxt2.png'), - 'spear' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 20, 'defense' => 0, 'train' => 30, 'resupply' => 30, 'provider' => 'Blacksmith', 'trainer' => 'Training Ground', 'icon' => 'items/spear2.png'), - 'pike' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 30, 'defense' => 0, 'train' => 50, 'resupply' => 60, 'provider' => 'Weaponsmith', 'trainer' => 'Guardhouse', 'icon' => 'items/hellebarde2.png'), - 'mace' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 35, 'defense' => 0, 'train' => 60, 'resupply' =>100, 'provider' => 'Weaponsmith', 'trainer' => 'Barracks', 'icon' => 'items/hellebarde2.png'), - 'sword' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 45, 'defense' => 0, 'train' => 80, 'resupply' =>250, 'provider' => 'Bladesmith', 'trainer' => 'Barracks', 'icon' => 'items/schwert2.png'), - 'broadsword' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 50, 'defense' => 0, 'train' => 90, 'resupply' =>350, 'provider' => 'Bladesmith', 'trainer' => 'Garrison', 'icon' => 'items/claymore2.png'), + 'axe' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 15, 'defense' => 0, 'train' => 20, 'resupply' => 20, 'provider' => 'Blacksmith', 'trainer' => 'Training Ground', 'icon' => 'items/streitaxt2.png'), + 'spear' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 35, 'defense' => 0, 'train' => 30, 'resupply' => 30, 'provider' => 'Blacksmith', 'trainer' => 'Training Ground', 'icon' => 'items/spear2.png'), + 'pike' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 50, 'defense' => 0, 'train' => 50, 'resupply' => 60, 'provider' => 'Weaponsmith', 'trainer' => 'Guardhouse', 'icon' => 'items/hellebarde2.png'), + 'mace' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 65, 'defense' => 0, 'train' => 60, 'resupply' =>100, 'provider' => 'Weaponsmith', 'trainer' => 'Barracks', 'icon' => 'items/hellebarde2.png'), + 'sword' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 85, 'defense' => 0, 'train' => 80, 'resupply' =>250, 'provider' => 'Bladesmith', 'trainer' => 'Barracks', 'icon' => 'items/schwert2.png'), + 'broadsword' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 95, 'defense' => 0, 'train' => 90, 'resupply' =>350, 'provider' => 'Bladesmith', 'trainer' => 'Garrison', 'icon' => 'items/claymore2.png'), 'shortbow' => array('type' => 'weapon', 'ranged' => 40, 'melee' => 0, 'defense' => 0, 'train' => 50, 'resupply' => 50, 'provider' => 'Bowyer', 'trainer' => 'Archery Range', 'icon' => 'items/shortbow2.png'), 'crossbow' => array('type' => 'weapon', 'ranged' => 60, 'melee' => 0, 'defense' => 0, 'train' => 60, 'resupply' => 75, 'provider' => 'Bowyer', 'trainer' => 'Archery Range', 'icon' => 'items/armbrust2.png'), @@ -31,9 +31,10 @@ class LoadEquipmentData extends AbstractFixture implements OrderedFixtureInterfa 'plate armour' => array('type' => 'armour', 'ranged' => 0, 'melee' => 0, 'defense' => 80, 'train' => 80, 'resupply' =>500, 'provider' => 'Heavy Armourer', 'trainer' => 'Wood Castle', 'icon' => 'items/plattenpanzer2.png'), 'horse' => array('type' => 'equipment', 'ranged' => 0, 'melee' => 20, 'defense' => 20, 'train' => 60, 'resupply' =>300, 'provider' => 'Stables', 'trainer' => 'Barracks', 'icon' => 'items/packpferd2.png'), - 'war horse' => array('type' => 'equipment', 'ranged' => 0, 'melee' => 25, 'defense' => 30, 'train' =>100, 'resupply' =>800, 'provider' => 'Royal Mews', 'trainer' => 'Wood Castle', 'icon' => 'items/warhorse2.png'), - 'shield' => array('type' => 'equipment', 'ranged' => 0, 'melee' => 0, 'defense' => 25, 'train' => 40, 'resupply' => 40, 'provider' => 'Carpenter', 'trainer' => 'Guardhouse', 'icon' => 'items/shield2.png'), + 'war horse' => array('type' => 'equipment', 'ranged' => 0, 'melee' => 35, 'defense' => 40, 'train' =>100, 'resupply' =>800, 'provider' => 'Royal Mews', 'trainer' => 'Wood Castle', 'icon' => 'items/warhorse2.png'), + 'shield' => array('type' => 'equipment', 'ranged' => 0, 'melee' => 0, 'defense' => 30, 'train' => 40, 'resupply' => 40, 'provider' => 'Carpenter', 'trainer' => 'Guardhouse', 'icon' => 'items/shield2.png'), 'javelin' => array('type' => 'equipment', 'ranged' => 65, 'melee' => 10, 'defense' => 0, 'train' => 40, 'resupply' => 35, 'provider' => 'Weaponsmith', 'trainer' => 'Guardhouse', 'icon' => 'items/javelin2.png'), + // Why does Javelin have a melee bonus? 'short sword' => array('type' => 'equipment', 'ranged' => 0, 'melee' => 10, 'defense' => 5, 'train' => 40, 'resupply' => 50, 'provider' => 'Bladesmith', 'trainer' => 'Barracks', 'icon' => 'items/kurzschwert2.png'), ); diff --git a/src/BM2/SiteBundle/Service/Economy.php b/src/BM2/SiteBundle/Service/Economy.php index d75bc5c..9ec42fd 100644 --- a/src/BM2/SiteBundle/Service/Economy.php +++ b/src/BM2/SiteBundle/Service/Economy.php @@ -559,7 +559,7 @@ public function ResourceProduction(Settlement $settlement, ResourceType $resourc $georesource->setBuildingsBonus(round($building_bonus*100)); } else { $building_resource = $georesource->getBuildingsBase(); - $building_bonus = $georesource->getBuildingsBonus()/100; + $building_bonus = $georesource->getBuildingsBonus()/10; } } $baseresource += $building_resource; From c6a554dda78edeab50d0ab26eb80d70b56973599 Mon Sep 17 00:00:00 2001 From: WeaverofBrokenThreads Date: Sat, 4 Jun 2016 02:48:52 +0200 Subject: [PATCH 2/3] Update Fixed missing Armoured Archer and Bonus calculation in economy. --- .../SiteBundle/Controller/ActionsController.php | 5 ++--- .../DataFixtures/ORM/LoadEquipmentData.php | 15 +++++++-------- src/BM2/SiteBundle/Entity/Soldier.php | 3 ++- src/BM2/SiteBundle/Service/Economy.php | 4 ++-- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/BM2/SiteBundle/Controller/ActionsController.php b/src/BM2/SiteBundle/Controller/ActionsController.php index 8278f1b..a1beb2b 100644 --- a/src/BM2/SiteBundle/Controller/ActionsController.php +++ b/src/BM2/SiteBundle/Controller/ActionsController.php @@ -943,9 +943,8 @@ public function assignedAction(Request $request) { if ($soldier->getCharacter() && $soldier->getCharacter()->isInBattle()) continue; if ($soldier->getCharacter() && $soldier->getCharacter()->isDoingAction('military.regroup')) continue; // FIXME: can't recall from your own estates or characters, but there should also be a message: - //if ($soldier->getCharacter() && $soldier->getCharacter()->getUser() == $character->getUser()) continue; - //if ($soldier->getBase() && $soldier->getBase()->getOwner() && $soldier->getBase()->getOwner()->getUser() == $character->getUser()) continue; - // Currently interferes with recalling soldiers from Knights who accept offers and run off. + // if ($soldier->getCharacter() && $soldier->getCharacter()->getUser() == $character->getUser()) continue; + // if ($soldier->getBase() && $soldier->getBase()->getOwner() && $soldier->getBase()->getOwner()->getUser() == $character->getUser()) continue; if ($soldier->getAssignedSince() == -1) { $days = 0; diff --git a/src/BM2/SiteBundle/DataFixtures/ORM/LoadEquipmentData.php b/src/BM2/SiteBundle/DataFixtures/ORM/LoadEquipmentData.php index 9620fdf..28fdaf5 100644 --- a/src/BM2/SiteBundle/DataFixtures/ORM/LoadEquipmentData.php +++ b/src/BM2/SiteBundle/DataFixtures/ORM/LoadEquipmentData.php @@ -12,12 +12,12 @@ class LoadEquipmentData extends AbstractFixture implements OrderedFixtureInterface { private $equipment = array( - 'axe' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 15, 'defense' => 0, 'train' => 20, 'resupply' => 20, 'provider' => 'Blacksmith', 'trainer' => 'Training Ground', 'icon' => 'items/streitaxt2.png'), - 'spear' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 35, 'defense' => 0, 'train' => 30, 'resupply' => 30, 'provider' => 'Blacksmith', 'trainer' => 'Training Ground', 'icon' => 'items/spear2.png'), - 'pike' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 50, 'defense' => 0, 'train' => 50, 'resupply' => 60, 'provider' => 'Weaponsmith', 'trainer' => 'Guardhouse', 'icon' => 'items/hellebarde2.png'), + 'axe' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 10, 'defense' => 0, 'train' => 20, 'resupply' => 20, 'provider' => 'Blacksmith', 'trainer' => 'Training Ground', 'icon' => 'items/streitaxt2.png'), + 'spear' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 20, 'defense' => 0, 'train' => 30, 'resupply' => 30, 'provider' => 'Blacksmith', 'trainer' => 'Training Ground', 'icon' => 'items/spear2.png'), + 'pike' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 40, 'defense' => 0, 'train' => 50, 'resupply' => 60, 'provider' => 'Weaponsmith', 'trainer' => 'Guardhouse', 'icon' => 'items/hellebarde2.png'), 'mace' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 65, 'defense' => 0, 'train' => 60, 'resupply' =>100, 'provider' => 'Weaponsmith', 'trainer' => 'Barracks', 'icon' => 'items/hellebarde2.png'), - 'sword' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 85, 'defense' => 0, 'train' => 80, 'resupply' =>250, 'provider' => 'Bladesmith', 'trainer' => 'Barracks', 'icon' => 'items/schwert2.png'), - 'broadsword' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 95, 'defense' => 0, 'train' => 90, 'resupply' =>350, 'provider' => 'Bladesmith', 'trainer' => 'Garrison', 'icon' => 'items/claymore2.png'), + 'sword' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 75, 'defense' => 0, 'train' => 80, 'resupply' =>250, 'provider' => 'Bladesmith', 'trainer' => 'Barracks', 'icon' => 'items/schwert2.png'), + 'broadsword' => array('type' => 'weapon', 'ranged' => 0, 'melee' => 90, 'defense' => 0, 'train' => 90, 'resupply' =>350, 'provider' => 'Bladesmith', 'trainer' => 'Garrison', 'icon' => 'items/claymore2.png'), 'shortbow' => array('type' => 'weapon', 'ranged' => 40, 'melee' => 0, 'defense' => 0, 'train' => 50, 'resupply' => 50, 'provider' => 'Bowyer', 'trainer' => 'Archery Range', 'icon' => 'items/shortbow2.png'), 'crossbow' => array('type' => 'weapon', 'ranged' => 60, 'melee' => 0, 'defense' => 0, 'train' => 60, 'resupply' => 75, 'provider' => 'Bowyer', 'trainer' => 'Archery Range', 'icon' => 'items/armbrust2.png'), @@ -31,10 +31,9 @@ class LoadEquipmentData extends AbstractFixture implements OrderedFixtureInterfa 'plate armour' => array('type' => 'armour', 'ranged' => 0, 'melee' => 0, 'defense' => 80, 'train' => 80, 'resupply' =>500, 'provider' => 'Heavy Armourer', 'trainer' => 'Wood Castle', 'icon' => 'items/plattenpanzer2.png'), 'horse' => array('type' => 'equipment', 'ranged' => 0, 'melee' => 20, 'defense' => 20, 'train' => 60, 'resupply' =>300, 'provider' => 'Stables', 'trainer' => 'Barracks', 'icon' => 'items/packpferd2.png'), - 'war horse' => array('type' => 'equipment', 'ranged' => 0, 'melee' => 35, 'defense' => 40, 'train' =>100, 'resupply' =>800, 'provider' => 'Royal Mews', 'trainer' => 'Wood Castle', 'icon' => 'items/warhorse2.png'), - 'shield' => array('type' => 'equipment', 'ranged' => 0, 'melee' => 0, 'defense' => 30, 'train' => 40, 'resupply' => 40, 'provider' => 'Carpenter', 'trainer' => 'Guardhouse', 'icon' => 'items/shield2.png'), + 'war horse' => array('type' => 'equipment', 'ranged' => 0, 'melee' => 25, 'defense' => 30, 'train' =>100, 'resupply' =>800, 'provider' => 'Royal Mews', 'trainer' => 'Wood Castle', 'icon' => 'items/warhorse2.png'), + 'shield' => array('type' => 'equipment', 'ranged' => 0, 'melee' => 0, 'defense' => 25, 'train' => 40, 'resupply' => 40, 'provider' => 'Carpenter', 'trainer' => 'Guardhouse', 'icon' => 'items/shield2.png'), 'javelin' => array('type' => 'equipment', 'ranged' => 65, 'melee' => 10, 'defense' => 0, 'train' => 40, 'resupply' => 35, 'provider' => 'Weaponsmith', 'trainer' => 'Guardhouse', 'icon' => 'items/javelin2.png'), - // Why does Javelin have a melee bonus? 'short sword' => array('type' => 'equipment', 'ranged' => 0, 'melee' => 10, 'defense' => 5, 'train' => 40, 'resupply' => 50, 'provider' => 'Bladesmith', 'trainer' => 'Barracks', 'icon' => 'items/kurzschwert2.png'), ); diff --git a/src/BM2/SiteBundle/Entity/Soldier.php b/src/BM2/SiteBundle/Entity/Soldier.php index 36c189c..2004c16 100644 --- a/src/BM2/SiteBundle/Entity/Soldier.php +++ b/src/BM2/SiteBundle/Entity/Soldier.php @@ -150,7 +150,8 @@ public function getVisualSize() { case 'light cavalry': case 'heavy cavalry': return 4; case 'mounted archer': return 3; - case 'archer': return 2; + case 'armoured archer': return 3; + case 'archer': return 2; case 'heavy infantry': return 3; case 'medium infantry': return 2; case 'light infantry': diff --git a/src/BM2/SiteBundle/Service/Economy.php b/src/BM2/SiteBundle/Service/Economy.php index 9ec42fd..b3d63f5 100644 --- a/src/BM2/SiteBundle/Service/Economy.php +++ b/src/BM2/SiteBundle/Service/Economy.php @@ -556,7 +556,7 @@ public function ResourceProduction(Settlement $settlement, ResourceType $resourc if ($force_recalc) { list($building_resource, $building_bonus) = $this->ResourceFromBuildings($settlement, $resource, $baseresource); $georesource->setBuildingsBase($building_resource); - $georesource->setBuildingsBonus(round($building_bonus*100)); + $georesource->setBuildingsBonus(round($building_bonus*10)); } else { $building_resource = $georesource->getBuildingsBase(); $building_bonus = $georesource->getBuildingsBonus()/10; @@ -627,7 +627,7 @@ public function ResourceFromBuildings(Settlement $settlement, ResourceType $reso $base += $result->getProvidesOperation(); $bonus+= $result->getProvidesOperationBonus(); } - return array($base, 1.0+($bonus/100)); + return array($base, 1.0+($bonus/10)); } public function ResourceDemand(Settlement $settlement, ResourceType $resource, $split_results=false) { From 1e90266de35511d3323ca041cbc9efb2fb03300b Mon Sep 17 00:00:00 2001 From: WeaverofBrokenThreads Date: Fri, 15 Jul 2016 19:34:14 +0200 Subject: [PATCH 3/3] Update Economy.php --- src/BM2/SiteBundle/Service/Economy.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BM2/SiteBundle/Service/Economy.php b/src/BM2/SiteBundle/Service/Economy.php index b3d63f5..c9f3668 100644 --- a/src/BM2/SiteBundle/Service/Economy.php +++ b/src/BM2/SiteBundle/Service/Economy.php @@ -556,10 +556,10 @@ public function ResourceProduction(Settlement $settlement, ResourceType $resourc if ($force_recalc) { list($building_resource, $building_bonus) = $this->ResourceFromBuildings($settlement, $resource, $baseresource); $georesource->setBuildingsBase($building_resource); - $georesource->setBuildingsBonus(round($building_bonus*10)); + $georesource->setBuildingsBonus(round($building_bonus*50)); } else { $building_resource = $georesource->getBuildingsBase(); - $building_bonus = $georesource->getBuildingsBonus()/10; + $building_bonus = $georesource->getBuildingsBonus()/50; } } $baseresource += $building_resource; @@ -627,7 +627,7 @@ public function ResourceFromBuildings(Settlement $settlement, ResourceType $reso $base += $result->getProvidesOperation(); $bonus+= $result->getProvidesOperationBonus(); } - return array($base, 1.0+($bonus/10)); + return array($base, 1.0+($bonus/50)); } public function ResourceDemand(Settlement $settlement, ResourceType $resource, $split_results=false) {