diff --git a/megamek/docs/history.txt b/megamek/docs/history.txt index ee630c330c8..907d4b8e7dc 100644 --- a/megamek/docs/history.txt +++ b/megamek/docs/history.txt @@ -21,6 +21,9 @@ MEGAMEK VERSION HISTORY: + PR #6216: Add additional board auto tags + PR #6208: Megamek side of MekHQ CombatMaths PR #5155 + PR #6230: Allow fleeing at end of movement ++ Fix #3018: Fixes Battle Armor Plasma Rifles not applying TacOps Optional Rules ++ Fix #3827: Fixes target's side's ECM not effecting sensor spottingFixes ++ Fix: Disable Simultaneous Movement due to numerous issues 0.50.01 (2024-11-10 1800 UTC) + PR #5962, #5964, #5966, #5974, #5931, #5983, #6154, #6159: Internal code changes (TWGameManager, extract processMovement, allow more classes for InputFilter, Victory, move test scenarios to testresources), diff --git a/megamek/src/megamek/common/AmmoType.java b/megamek/src/megamek/common/AmmoType.java index ce6db0e7700..3ba85d60c2c 100644 --- a/megamek/src/megamek/common/AmmoType.java +++ b/megamek/src/megamek/common/AmmoType.java @@ -4399,7 +4399,8 @@ private static AmmoType createISLB10XAmmo() { .setTechRating(RATING_E) .setAvailability(RATING_E, RATING_F, RATING_D, RATING_C) .setISAdvancement(2590, 2595, 3040, 2840, 3035) - .setISApproximate(false, false, false, false, false).setPrototypeFactions(F_TH) + .setISApproximate(false, false, false, false, true) + .setPrototypeFactions(F_TH) .setProductionFactions(F_TH).setReintroductionFactions(F_FS); return ammo; } diff --git a/megamek/src/megamek/common/Compute.java b/megamek/src/megamek/common/Compute.java index 00548e05787..c95a0f74f92 100644 --- a/megamek/src/megamek/common/Compute.java +++ b/megamek/src/megamek/common/Compute.java @@ -5094,10 +5094,14 @@ public static int getSensorRangeBracket(Entity ae, Targetable target, if (ae.getGame().getOptions().booleanOption(OptionsConstants.ADVANCED_METAL_CONTENT)) { check += sensor.getModForMetalContent(ae, te); } + + check += sensor.getModForTargetECM(te, allECMInfo); + } // ECM bubbles check += sensor.getModForECM(ae, allECMInfo); + return Compute.getSensorBracket(check); } @@ -6639,7 +6643,7 @@ public static int directBlowBADamage(double damage, int damageType, case WeaponType.WEAPON_PLASMA: // If the target is fire-resistant BA, damage is normal if (!target.isFireResistant()) { - damage = 1 + Compute.d6(1); + damage = 2 + Compute.d6(1); } break; } diff --git a/megamek/src/megamek/common/ComputeECM.java b/megamek/src/megamek/common/ComputeECM.java index b81853348b1..f2d2686ec52 100644 --- a/megamek/src/megamek/common/ComputeECM.java +++ b/megamek/src/megamek/common/ComputeECM.java @@ -517,4 +517,29 @@ public static ArrayList computeAllEntitiesECMInfo( } return worstECMEffects; } + + /** + * Returns the total friendly ECM effects on the supplied unit. + * + * @param affectedEntity The entity to check. + * @param allEcmInfo + * @return + */ + public static @Nullable ECMInfo getFriendlyECMEffects(Entity affectedEntity, @Nullable List allEcmInfo){ + if (allEcmInfo == null) { + allEcmInfo = computeAllEntitiesECMInfo(affectedEntity.getGame().getEntitiesVector()); + } + + Coords entityPosition = affectedEntity.getPosition(); + + ECMInfo affectedInfo = new ECMInfo(0, 0, affectedEntity.getOwner(), entityPosition); + for (ECMInfo ecmInfo : allEcmInfo) { + // Is the ECMInfo in range of this position? + int dist = entityPosition.distance(ecmInfo.getPos()); + if (dist <= ecmInfo.getRange()) { + affectedInfo.addAlliedECMEffects(ecmInfo); + } + } + return affectedInfo; + } } diff --git a/megamek/src/megamek/common/Sensor.java b/megamek/src/megamek/common/Sensor.java index c7a78b3ce26..89bbcd4cd0d 100644 --- a/megamek/src/megamek/common/Sensor.java +++ b/megamek/src/megamek/common/Sensor.java @@ -438,6 +438,26 @@ public int getModForECM(Entity en, List allECMInfo) { Coords pos = en.getPosition(); ECMInfo ecmInfo = ComputeECM.getECMEffects(en, pos, pos, true, allECMInfo); + return getECMSensorRangeModifier(ecmInfo); + } + + /** + * Computes the sensor check modifier for ECM. + * + * @param targetEntity + * @param allECMInfo A collection of ECMInfo for all entities, this value + * can be null and it will be computed when it's + * needed, however passing in the pre-computed + * collection is much faster + * @return + */ + public int getModForTargetECM(Entity targetEntity, List allECMInfo) { + // how many ECM fields are affecting the target entity? + ECMInfo ecmInfo = ComputeECM.getFriendlyECMEffects(targetEntity, allECMInfo); + return getECMSensorRangeModifier(ecmInfo); + } + + public int getECMSensorRangeModifier(ECMInfo ecmInfo){ double ecm, ecmAngel; ecm = ecmAngel = 0; if (ecmInfo != null) { diff --git a/megamek/src/megamek/common/options/GameOptions.java b/megamek/src/megamek/common/options/GameOptions.java index 56875bb6c21..a61247d238f 100755 --- a/megamek/src/megamek/common/options/GameOptions.java +++ b/megamek/src/megamek/common/options/GameOptions.java @@ -286,7 +286,7 @@ public synchronized void initialize() { addOption(initiative, OptionsConstants.INIT_PROTOS_MOVE_MULTI, false); addOption(initiative, OptionsConstants.INIT_INF_PROTO_MOVE_MULTI, 3); addOption(initiative, OptionsConstants.INIT_SIMULTANEOUS_DEPLOYMENT, false); - addOption(initiative, OptionsConstants.INIT_SIMULTANEOUS_MOVEMENT, false); + //addOption(initiative, OptionsConstants.INIT_SIMULTANEOUS_MOVEMENT, false); addOption(initiative, OptionsConstants.INIT_SIMULTANEOUS_TARGETING, false); addOption(initiative, OptionsConstants.INIT_SIMULTANEOUS_FIRING, false); addOption(initiative, OptionsConstants.INIT_SIMULTANEOUS_PHYSICAL, false); diff --git a/megamek/src/megamek/common/weapons/prototypes/CLERLaserMediumPrototype.java b/megamek/src/megamek/common/weapons/prototypes/CLERLaserMediumPrototype.java index 56340b70560..f2ca37c05cc 100644 --- a/megamek/src/megamek/common/weapons/prototypes/CLERLaserMediumPrototype.java +++ b/megamek/src/megamek/common/weapons/prototypes/CLERLaserMediumPrototype.java @@ -25,9 +25,10 @@ public class CLERLaserMediumPrototype extends LaserWeapon { public CLERLaserMediumPrototype() { super(); - name = "Prototype ER Medium Laser"; + name = "Prototype ER Medium Laser (CP)"; setInternalName("CLERMediumLaserPrototype"); - shortName = "ER Medium Laser (P)"; + shortName = "ER Medium Laser (CP)"; + addLookupName("Prototype ER Medium Laser"); heat = 5; damage = 5; shortRange = 4; diff --git a/megamek/src/megamek/common/weapons/prototypes/CLERLaserSmallPrototype.java b/megamek/src/megamek/common/weapons/prototypes/CLERLaserSmallPrototype.java index 48467b66b7e..bdfcd8b6783 100644 --- a/megamek/src/megamek/common/weapons/prototypes/CLERLaserSmallPrototype.java +++ b/megamek/src/megamek/common/weapons/prototypes/CLERLaserSmallPrototype.java @@ -25,9 +25,10 @@ public class CLERLaserSmallPrototype extends LaserWeapon { public CLERLaserSmallPrototype() { super(); - name = "Prototype ER Small Laser"; + name = "Prototype ER Small Laser (CP)"; setInternalName("CLERSmallLaserPrototype"); - shortName = "ER Small Laser (P)"; + shortName = "ER Small Laser (CP)"; + addLookupName("Prototype ER Small Laser"); heat = 2; damage = 3; shortRange = 2; @@ -57,7 +58,7 @@ public CLERLaserSmallPrototype() { .setPrototypeFactions(F_CSJ) .setStaticTechLevel(SimpleTechLevel.EXPERIMENTAL); } - + @Override public boolean isAlphaStrikePointDefense() { return true;