From 5b203a417c4fe159ee7c55618827fc13983ed0ce Mon Sep 17 00:00:00 2001 From: Scoppio Date: Sun, 17 Nov 2024 09:01:47 -0300 Subject: [PATCH] feat: added nuke drawing for player commited war crimes --- megamek/src/megamek/common/weapons/AreaEffectHelper.java | 5 +++++ megamek/src/megamek/server/totalwarfare/TWGameManager.java | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/megamek/src/megamek/common/weapons/AreaEffectHelper.java b/megamek/src/megamek/common/weapons/AreaEffectHelper.java index 8b035f8b6e9..857cfd8f4a2 100644 --- a/megamek/src/megamek/common/weapons/AreaEffectHelper.java +++ b/megamek/src/megamek/common/weapons/AreaEffectHelper.java @@ -727,6 +727,11 @@ public static DamageFalloff calculateDamageFallOff(AmmoType ammo, int attackingB */ public static void doNuclearExplosion(Entity entity, Coords coords, int nukeType, Vector vPhaseReport, TWGameManager gameManager) { + + // this +1 is necessary because the drawNuke method subtracts 1 from them + int[] nukeArgs = { coords.getX() + 1, coords.getY() + 1}; + gameManager.drawNukeHitOnBoard(nukeArgs); + NukeStats nukeStats = getNukeStats(nukeType); if (nukeStats == null) { diff --git a/megamek/src/megamek/server/totalwarfare/TWGameManager.java b/megamek/src/megamek/server/totalwarfare/TWGameManager.java index 2c68435c25a..46c7177c10a 100644 --- a/megamek/src/megamek/server/totalwarfare/TWGameManager.java +++ b/megamek/src/megamek/server/totalwarfare/TWGameManager.java @@ -20513,7 +20513,8 @@ void resolveScheduledOrbitalBombardments() { getvPhaseReport().add(r); } - private void drawNukeHitOnBoard(int[] nukeArgs) { + public void drawNukeHitOnBoard(int[] nukeArgs) { + // Turns out this object can be used here var nuke = new OrbitalBombardment.Builder().x(nukeArgs[0] - 1).y(nukeArgs[1] -1).radius(4).damage(0).build(); var allCoords = nuke.getAllAffectedCoords();