From: <bar...@us...> - 2017-05-08 05:34:02
|
Revision: 1597 http://sourceforge.net/p/mekwars/code/1597 Author: barukkhazad Date: 2017-05-08 05:33:59 +0000 (Mon, 08 May 2017) Log Message: ----------- update bv costs for PR, IM skills, and associated tooltips Modified Paths: -------------- trunk/history.txt trunk/src/admin/dialog/FactionConfigurationDialog.java trunk/src/admin/dialog/serverConfigDialogs/PilotSkillsModPanel.java trunk/src/server/campaign/DefaultServerOptions.java trunk/src/server/campaign/pilot/skills/IronManSkill.java trunk/src/server/campaign/pilot/skills/PainResistanceSkill.java Modified: trunk/history.txt =================================================================== --- trunk/history.txt 2017-05-07 19:29:06 UTC (rev 1596) +++ trunk/history.txt 2017-05-08 05:33:59 UTC (rev 1597) @@ -1,5 +1,7 @@ VERSION HISTORY: ---------------- ++ bv calc mods for some pilot skills (PR,IM) ++ updated help menu's pilot skill descriptions 0.6.0.x + Bug: activity jobs not being stopped after games. R Released Server v0.6.0.2 @@ -21,7 +23,7 @@ + Implemented the Christmas gift program See http://www.mekwars.org/wiki/index.php/Christmas_Season for more information -+ bv calc mods for some pilot skills ++ bv calc mods for some pilot skills (WS,GL,GB,GM) + new MegaMek v0.41.24-MW20161013-f18015c $ Released Server, Ded, Client v0.6.0.1 *********************************** Modified: trunk/src/admin/dialog/FactionConfigurationDialog.java =================================================================== --- trunk/src/admin/dialog/FactionConfigurationDialog.java 2017-05-07 19:29:06 UTC (rev 1596) +++ trunk/src/admin/dialog/FactionConfigurationDialog.java 2017-05-08 05:33:59 UTC (rev 1597) @@ -1908,13 +1908,13 @@ baseTextField = new JTextField(5); SkillModSpring.add(new JLabel("Pain Resistance BV Mod", SwingConstants.TRAILING)); - baseTextField.setToolTipText("<html>Base BV mod for Pain Resistance<br>a base BV increase, and this would be applied for<br>every ammo critical or<br>Gauss weapon the unit has"); + baseTextField.setToolTipText("<html>Base BV % multiplier for Pain Resistance. Use integer value.<br>Example: Use 5 to add 5% base bv to modified bv. Doubles if unit has CASE/CASE II."); baseTextField.setName("PainResistanceBaseBVMod"); SkillModSpring.add(baseTextField); - + baseTextField = new JTextField(5); SkillModSpring.add(new JLabel("Iron Man BV Mod", SwingConstants.TRAILING)); - baseTextField.setToolTipText("<html>Base BV mod for Iron Man<br>a base BV increase, and this would be applied for<br>every ammo critical or<br>Gauss weapon the unit has"); + baseTextField.setToolTipText("<html>Base BV % multiplier for Iron Man. Use integer value.<br>Example: Use 5 to add 5% base bv to modified bv. Only adds BV if unit has CASE/CASE II. No cost if pilot has PR."); baseTextField.setName("IronManBaseBVMod"); SkillModSpring.add(baseTextField); Modified: trunk/src/admin/dialog/serverConfigDialogs/PilotSkillsModPanel.java =================================================================== --- trunk/src/admin/dialog/serverConfigDialogs/PilotSkillsModPanel.java 2017-05-07 19:29:06 UTC (rev 1596) +++ trunk/src/admin/dialog/serverConfigDialogs/PilotSkillsModPanel.java 2017-05-08 05:33:59 UTC (rev 1597) @@ -63,13 +63,13 @@ baseTextField = new PilotSkillTextField(5); SkillModSpring.add(new JLabel("PR BV Mod", SwingConstants.TRAILING)); - baseTextField.setToolTipText("<html>Base BV mod for Pain Resistance<br>a base BV increase, and this would be applied for<br>every ammo critical or<br>Gauss weapon the unit has"); + baseTextField.setToolTipText("<html>Base BV % multiplier for Pain Resistance. Use integer value.<br>Example: Use 5 to add 5% base bv to modified bv. Doubles if unit has CASE/CASE II."); baseTextField.setName("PainResistanceBaseBVMod"); SkillModSpring.add(baseTextField); - + baseTextField = new PilotSkillTextField(5); SkillModSpring.add(new JLabel("IM BV Mod", SwingConstants.TRAILING)); - baseTextField.setToolTipText("<html>Base BV mod for Iron Man<br>a base BV increase, and this would be applied for<br>every ammo critical or<br>Gauss weapon the unit has"); + baseTextField.setToolTipText("<html>Base BV % multiplier for Iron Man. Use integer value.<br>Example: Use 5 to add 5% base bv to modified bv. Only adds BV if unit has CASE/CASE II. No cost if pilot has PR."); baseTextField.setName("IronManBaseBVMod"); SkillModSpring.add(baseTextField); Modified: trunk/src/server/campaign/DefaultServerOptions.java =================================================================== --- trunk/src/server/campaign/DefaultServerOptions.java 2017-05-07 19:29:06 UTC (rev 1596) +++ trunk/src/server/campaign/DefaultServerOptions.java 2017-05-08 05:33:59 UTC (rev 1597) @@ -841,8 +841,8 @@ defaults.setProperty("SellDirectAssaultAeroPrice", "0"); // Level 3 MaxTech Pilot Skill BV Mods. - defaults.setProperty("PainResistanceBaseBVMod", "50"); - defaults.setProperty("IronManBaseBVMod", "50"); + defaults.setProperty("PainResistanceBaseBVMod", "5"); + defaults.setProperty("IronManBaseBVMod", "5"); defaults.setProperty("DodgeManeuverBaseBVMod", "50"); defaults.setProperty("ManeuveringAceBaseBVMod", "50"); defaults.setProperty("ManeuveringAceSpeedRating", "5"); Modified: trunk/src/server/campaign/pilot/skills/IronManSkill.java =================================================================== --- trunk/src/server/campaign/pilot/skills/IronManSkill.java 2017-05-07 19:29:06 UTC (rev 1596) +++ trunk/src/server/campaign/pilot/skills/IronManSkill.java 2017-05-08 05:33:59 UTC (rev 1597) @@ -22,7 +22,7 @@ import megamek.common.AmmoType; import megamek.common.Entity; -import megamek.common.Mounted; +import megamek.common.Mech; import server.campaign.CampaignMain; import server.campaign.SHouse; import server.campaign.pilot.SPilot; @@ -81,37 +81,26 @@ @Override public int getBVMod(Entity unit, SPilot pilot){ - int amountOfAmmo = 0; int IronManBVBaseMod = CampaignMain.cm.getIntegerConfig("IronManBaseBVMod"); if ( pilot.getSkills().has(PilotSkill.PainResistanceSkillID) ) { return 0; } - - for ( Mounted ammoType : unit.getAmmo() ){ - - if ( ammoType.getUsableShotsLeft() <= 0 ) { - continue; - } - - AmmoType ammo = (AmmoType)ammoType.getType(); - if ( (ammo.getAmmoType() == AmmoType.T_GAUSS) || - (ammo.getAmmoType() == AmmoType.T_GAUSS_HEAVY) || - (ammo.getAmmoType() == AmmoType.T_GAUSS_LIGHT) ) { - continue; - } - - amountOfAmmo++; + //BK - changing PR costs to % of bv for CASE/CASEII units, 0 for other units + //this is because in Megamek, IM reduces pilot hits from 2 to 1 for any ammo explosion + //The previous IM costs were 30 or 40 per ammo bin which is silly if you have no + //CASE (mek gets gutted anyways). PainResistance and IM do not stack so this costs 0 if the pilot also has PR + boolean b = false; + if (unit instanceof Mech) { //BK - this section of code is tested! ty STK9A + Mech m = (Mech)unit; + b = m.hasCASEIIAnywhere(); } + if(unit.hasCase() || b) { + return (int) (unit.calculateBattleValue(false, true) * IronManBVBaseMod/100); + } else { + return 0; + } - for (Mounted weapon : unit.getWeaponList()){ - if ( weapon.getName().indexOf("Gauss Rifle") != -1 ) { - amountOfAmmo++; - } - } - - return amountOfAmmo * IronManBVBaseMod; - } } Modified: trunk/src/server/campaign/pilot/skills/PainResistanceSkill.java =================================================================== --- trunk/src/server/campaign/pilot/skills/PainResistanceSkill.java 2017-05-07 19:29:06 UTC (rev 1596) +++ trunk/src/server/campaign/pilot/skills/PainResistanceSkill.java 2017-05-08 05:33:59 UTC (rev 1597) @@ -18,9 +18,8 @@ import java.util.Iterator; -import megamek.common.AmmoType; import megamek.common.Entity; -import megamek.common.Mounted; +import megamek.common.Mech; import server.campaign.CampaignMain; import server.campaign.SHouse; import server.campaign.pilot.SPilot; @@ -28,7 +27,7 @@ import common.MegaMekPilotOption; import common.Unit; import common.campaign.pilot.Pilot; - +import common.CampaignData; /** * @author Helge Richter */ @@ -73,67 +72,37 @@ @Override public int getBVMod(Entity unit) { - int amountOfAmmo = 0; + //BK - changing PR costs to % of bv, doubled for CASE/CASEII units + //this is because in Megamek, PR gives +1 on any KO roll (hidden modifier) and reduces pilot hits from 2 to 1 for any ammo explosion + //The previous PR costs were 30 or 40 per ammo bin which is silly if you have no + //CASE (mek gets gutted anyways) and silly if you have nothing to explode (free +1 on KO rolls) int PainResistanceBVBaseMod = CampaignMain.cm.getIntegerConfig("PainResistanceBaseBVMod"); - - Iterator<Mounted> ammoList = unit.getAmmo().iterator(); - while (ammoList.hasNext()) { - Mounted ammoType = ammoList.next(); - - if (ammoType.getUsableShotsLeft() <= 0) { - continue; - } - - AmmoType ammo = (AmmoType) ammoType.getType(); - if ((ammo.getAmmoType() == AmmoType.T_GAUSS) || (ammo.getAmmoType() == AmmoType.T_GAUSS_HEAVY) || (ammo.getAmmoType() == AmmoType.T_GAUSS_LIGHT)) { - continue; - } - - amountOfAmmo++; + boolean b = false; + if (unit instanceof Mech) { //BK - this section of code is tested! ty STK9A + Mech m = (Mech)unit; + b = m.hasCASEIIAnywhere(); } - - Iterator<Mounted> weaponsList = unit.getWeapons(); - while (weaponsList.hasNext()) { - Mounted weapon = weaponsList.next(); - if (weapon.getName().indexOf("Gauss Rifle") != -1) { - amountOfAmmo++; - } - } - return amountOfAmmo * PainResistanceBVBaseMod; - + if(unit.hasCase() || b) { + return (int) (2 * unit.calculateBattleValue(false, true) * PainResistanceBVBaseMod/100); + } else { + return (int) (unit.calculateBattleValue(false, true) * PainResistanceBVBaseMod/100); + } } @Override public int getBVMod(Entity unit, SPilot p) { - int amountOfAmmo = 0; + //BK repeat of comments in getBVMod(Entity unit) SHouse house = CampaignMain.cm.getHouseFromPartialString(p.getCurrentFaction()); int PainResistanceBVBaseMod = house.getIntegerConfig("PainResistanceBaseBVMod"); - - Iterator<Mounted> ammoList = unit.getAmmo().iterator(); - while (ammoList.hasNext()) { - Mounted ammoType = ammoList.next(); - - if (ammoType.getUsableShotsLeft() <= 0) { - continue; - } - - AmmoType ammo = (AmmoType) ammoType.getType(); - if ((ammo.getAmmoType() == AmmoType.T_GAUSS) || (ammo.getAmmoType() == AmmoType.T_GAUSS_HEAVY) || (ammo.getAmmoType() == AmmoType.T_GAUSS_LIGHT)) { - continue; - } - - amountOfAmmo++; + boolean b = false; + if (unit instanceof Mech) { + Mech m = (Mech)unit; + b = m.hasCASEIIAnywhere(); } - - Iterator<Mounted> weaponsList = unit.getWeapons(); - while (weaponsList.hasNext()) { - Mounted weapon = weaponsList.next(); - if (weapon.getName().indexOf("Gauss Rifle") != -1) { - amountOfAmmo++; - } - } - return amountOfAmmo * PainResistanceBVBaseMod; - + if(unit.hasCase() || b) { + return (int) (2 * unit.calculateBattleValue(false, true) * PainResistanceBVBaseMod/100); + } else { + return (int) (unit.calculateBattleValue(false, true) * PainResistanceBVBaseMod/100); + } } - } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |