MrxSurgicalStrike
Module: mrxsurgicalstrike.lua
Overview
MrxSurgicalStrike is a free satellite-designated precision bomb β effectively a no-cost variant of MrxSatelliteGuidedBomb (it even shares that moduleβs name; see the warning below). The player targets through the satellite mini-game, a jet flies in and drops one "Smart Bomb Projectile" on the mark. It inherits from MrxSupport and designates with MrxSupportDesignatorSatellite.
Inheritance
- Inherits from:
MrxSupport - Imports:
MrxSupportDesignatorSatellite
Instance pattern
Same class-factory pattern as MrxSupport, not per-uGuid β Create(oSelf, uPlayerGuid) builds a new table via setmetatable/__index, exactly like its parent. No OnActivate/Awake, no tInstance registry. It tracks the following key fields:
oDesignator: The designator satellite used for target designation.uOwner: The GUID of the player who owns this support system.sRecruit: The recruit type required for this support.sModuleName: The name of the module.sDeliveryVehicle: The delivery vehicle used for the airstrike.uDeliveryVehicle: The GUID of the delivery vehicle.sBomb: The bomb projectile used.uBomb: The GUID of the bomb projectile.uJet: The GUID of the jet performing the airstrike.uTarget: The GUID of the target.tBombs: A table to track spawned bombs.
Functions
Create(oSelf, uPlayerGuid)
Builds the instance. Creates a MrxSupportDesignatorSatellite, calls oDesignator:SetCost(0) (free β the defining difference from the paid MrxSatelliteGuidedBomb), sets mini-game sectors {{45,90},{152,203},{270,315}} (wider/easier bands than the paid version), recruit "Pilot", and copies sDeliveryVehicle/sBomb from the prototype. The module-level default sBomb = "Smart Bomb Projectile".
CreatecallsoNewSupport:SetModuleName("MrxSatelliteGuidedBomb"), not"MrxSurgicalStrike". The module identifies itself to the network/support layer as the guided-bomb module. This is almost certainly a copy-paste fromMrxSatelliteGuidedBombthat was never renamed β confirmed in source, not an error in this page. It matters if you key any logic offGetModuleName().
DesignationCallback(oSelf)
Runs on satellite-designation complete. Flies the delivery jet in with Airstrike.Flyby (using oSelf.uDeliveryVehicle, callback DropBomb, jet stored in oSelf.uJet), then plays a random Misha freeplay-support line via MrxSupport.PlayAirstrikeVO.
DropBomb(oSelf)
Reads the target, computes a normalized heading, and drops one bomb with Airstrike.SpawnOrdnance using oSelf.uBomb at velocity scale 110, "impact" detonation, callback BombExplodes with index 1. Stored in oSelf.tBombs[1]. (Note oSelf.uTarget = uGuid reads a uGuid that is never assigned in this function, so itβs set to nil β a decompile artifact.)
BombExplodes(oSelf, nIndex)
Impact callback. Reads the bombβs position and, if valid, spawns "Explosion (Grenade)" there via Pg.Spawn.
FinalExplosion(oSelf)
Would spawn "Explosion (C4)" at oSelf.uSpawnedBomb. Dead code in this module β nothing here sets oSelf.uSpawnedBomb (it uses tBombs[] instead) and nothing calls FinalExplosion. Present but unreachable as written.
Events
No event subscriptions. DesignationCallback is the satellite designatorβs completion callback (via MrxSupport:Commence); DropBomb/BombExplodes are flyby-arrival and ordnance-impact callbacks. No Event.Create/TimerRelative.
Module constants & tunables
sBomb = "Smart Bomb Projectile"β module-level global (settable per-instance since itβs notlocal).- Satellite cost:
0(free), set viaSetCost(0)inCreate. - Mini-game sectors:
{{45,90},{152,203},{270,315}}β three wide success bands. - Recruit:
"Pilot". - Bomb velocity scale:
110; explosion effect:"Explosion (Grenade)".
Notes for modders
- This is the free/easy sibling of
MrxSatelliteGuidedBomb; the code is nearly identical apart fromSetCost(0), the wider sectors, the"Pilot"recruit, and the added"Explosion (Grenade)"inBombExplodes. - Because
sBombis a non-localglobal, you can reassignoInstance.sBombto change the payload before firing β see Airstrike. - The mismatched module name (
"MrxSatelliteGuidedBomb") is worth remembering before you build any per-module routing.