-
Notifications
You must be signed in to change notification settings - Fork 344
Implement DNI, EI Interface, and Damage Interrupt Circuit support #7948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for DNI Cockpit Modifications, EI Interface, and Damage Interrupt Circuit across save/load, validation, and unit readouts, and wires intro-date checks to game-year–based availability.
Changes:
- Marks DNI and DIC with correct static tech levels and treats DNI/EI as retrofittable in intro-year validation logic.
- Extends BLK save/load to persist slotless equipment (LOC_NONE) across multiple unit types, and updates viewer/TRO templates to show cockpit mods on non-‘Mek units.
- Introduces explicit game-year handling in
ITechManager.isLegal()andTestEntity.hasIncorrectIntroYear(), with new unit tests covering save/load and game-year validation.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| megamek/src/megamek/common/equipment/MiscType.java | Sets static tech levels for DNI (Advanced) and DIC (Experimental) to match their intended rules levels. |
| megamek/src/megamek/common/interfaces/ITechManager.java | Changes isLegal to use getGameYear() for intro/extinction checks and tech-era lookup, aligning legality with configured game year. |
| megamek/src/megamek/common/verifier/TestEntity.java | Adds a gameYear field with getter/setter and updates hasIncorrectIntroYear to use either the explicit game year or Entity.getTechLevelYear(), and to skip both DNI and EI as retrofittable. |
| megamek/src/megamek/common/loaders/BLKFile.java | Introduces BLK_SLOTLESS_EQUIPMENT tag plus loadSlotlessEquipment and updates getBlock to persist/load slotless equipment like cockpit mods. |
| megamek/src/megamek/common/loaders/BLKVTOLFile.java | Calls loadSlotlessEquipment so VTOL BLKs restore slotless cockpit mods. |
| megamek/src/megamek/common/loaders/BLKTankFile.java | Calls loadSlotlessEquipment so combat vehicle BLKs restore slotless cockpit mods. |
| megamek/src/megamek/common/loaders/BLKSupportVTOLFile.java | Calls loadSlotlessEquipment to reload slotless mods on support VTOLs. |
| megamek/src/megamek/common/loaders/BLKSupportTankFile.java | Calls loadSlotlessEquipment to reload slotless mods on support ground vehicles. |
| megamek/src/megamek/common/loaders/BLKLargeSupportTankFile.java | Calls loadSlotlessEquipment for large support tank BLKs. |
| megamek/src/megamek/common/loaders/BLKFixedWingSupportFile.java | Calls loadSlotlessEquipment for fixed-wing support aircraft BLKs. |
| megamek/src/megamek/common/loaders/BLKConvFighterFile.java | Calls loadSlotlessEquipment for conventional fighter BLKs. |
| megamek/src/megamek/common/loaders/BLKBattleArmorFile.java | Calls loadSlotlessEquipment for battle armor BLKs so slotless cockpit mods are reloaded. |
| megamek/src/megamek/common/loaders/BLKAeroSpaceFighterFile.java | Calls loadSlotlessEquipment for aerospace fighter BLKs. |
| megamek/src/megamek/client/ui/entityreadout/ReadoutUtils.java | Adjusts hideMisc to always show DNI, EI, and DIC even when mounted in LOC_NONE. |
| megamek/src/megamek/common/templates/VehicleTROView.java | Overrides skipMount to hide CASE/armor/structure at LOC_NONE while displaying cockpit mods in vehicle TROs. |
| megamek/src/megamek/common/templates/SupportVeeTROView.java | Same skipMount override for support vehicles so cockpit mods are visible in TROs. |
| megamek/src/megamek/common/templates/BattleArmorTROView.java | Refines equipment filtering so BA LOC_NONE DNI/EI cockpit mods are shown while other slotless items remain hidden. |
| megamek/src/megamek/common/templates/AeroTROView.java | Adds skipMount override so aerospace/conventional fighters show cockpit mods but hide CASE/armor/structure at LOC_NONE. |
| megamek/unittests/megamek/common/CockpitModificationTest.java | Adds MTF and BLK round-trip tests verifying that DNI, EI, and DIC are preserved on Meks and DNI on Tanks. |
| megamek/unittests/megamek/common/verifier/TestEntityGameYearValidationTest.java | Adds tests for TestMek game-year getter/setter and for treating DNI/EI as retrofittable in intro-year validation, based on entity year vs explicit game year. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
megamek/unittests/megamek/common/verifier/TestEntityGameYearValidationTest.java
Outdated
Show resolved
Hide resolved
megamek/unittests/megamek/common/verifier/TestEntityGameYearValidationTest.java
Outdated
Show resolved
Hide resolved
megamek/unittests/megamek/common/verifier/TestEntityGameYearValidationTest.java
Outdated
Show resolved
Hide resolved
|
Here are some pre-made test units of the various classes. |
1283178 to
e2233e7
Compare
- Add DNI Cockpit Modification (IS, Advanced) for Meks, BA, CV, SV, Fighters - Add Enhanced Imaging (EI) Interface (Clan, Experimental) for Meks and BA - Add Damage Interrupt Circuit (IS, Experimental) for Meks only - Fix tech levels: DNI stays Advanced, DIC stays Experimental - Add BLK file save/load for slotless (LOC_NONE) equipment - Fix Unit Viewer to display cockpit modifications for all unit types - Add game year support in ITechManager.isLegal() and TestEntity validation - Mark DNI and EI as retrofittable equipment (skipped in intro year validation) - Add unit tests for save/load and game year validation Co-Authored-By: Claude Opus 4.5 <[email protected]>
e2233e7 to
95868e4
Compare
mek.getCockpit() can return null CriticalSlot entries when cockpit slots haven't been initialized yet (e.g., during cockpit type changes in MegaMekLab). Added null filter before checking isArmored(). Fixes regression from 6bee6ab (Mark armored interface cockpit as invalid) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Summary
Adds core support loading and improvements to validating for three cockpit modification equipment types: DNI Cockpit Modification (IS, Advanced), Enhanced Imaging (EI) Interface (Clan, Experimental), and Damage Interrupt Circuit (IS, Experimental). Also adds game year validation support for equipment availability.
Requires: MegaMekLab PR
Implement-DNI-EI-DIC-UIfor full UI functionality.Changes
Files Changed
MiscType.java- Tech level fixes for DNI and DICITechManager.java- Game year support in isLegal()TestEntity.java- Game year field and validation supportBLKFile.java- Slotless equipment save/load methodsBLK*File.java(10 files) - Load slotless equipment for each unit typeReadoutUtils.java- Show cockpit mods in Unit Viewer*TROView.java(4 files) - TRO display for cockpit modsCockpitModificationTest.java- Unit tests for save/loadTestEntityGameYearValidationTest.java- Unit tests for game year validationTesting
(IS/Clan)