1) Listening to WeaponFired as a Java AI seems to never produce any results.
2) Documentation says that "This AI event is sent when certain weapons are fired. For performance reasons, it is not possible to send this event for all weapons. Therefore, it is currently only sent for manuall-fire weapons like for example the TA Commanders D-Gun or the Nuke.".
3) Code seems to say that WeaponFired is fired for every shot in a salvo, without checking for manualFire, and is sent to the AI which controls the team's units:
Code: Select all
Weapon.cpp:512 (in UpdateSalvo, unconditionally)
owner->commandAI->WeaponFired(this, searchForNewTarget);
CommandAI.cpp:1544 (in WeaponFired, unconditionally)
eoh->WeaponFired(*owner, *(weapon->weaponDef));
EngineOutHandler.cpp:477 (in WeaponFired, unconditionally)
DO_FOR_TEAM_SKIRMISH_AIS(WeaponFired(unitId, defId), teamId);