pickMissileTarget

open fun pickMissileTarget(missile: MissileAPI, seeks: MagicTargeting.targetSeeking, maxRange: Integer, searchCone: Integer, fighterWeight: Integer, frigateWeight: Integer, destroyerWeight: Integer, cruiserWeight: Integer, capitalWeight: Integer): ShipAPI

Select a proper target from a missile

Return

ShipAPI target

Parameters

missile

The missile concerned.

seeks

Does the missile find a random target or tries to hit the ship's one?

NO_RANDOM, If the launching ship has a valid target within arc, the missile will pursue it. If there is no target, it will check for an unselected cursor target within arc. If there is none, it will pursue its closest valid threat within arc.

LOCAL_RANDOM, If the ship has a target, the missile will pick a random valid threat around that one. If the ship has none, the missile will pursue a random valid threat around the cursor, or itself. Can produce strange behavior if used with a limited search cone.

FULL_RANDOM, The missile will always seek a random valid threat within arc around itself.

IGNORE_SOURCE, The missile will pick the closest target of interest. Useful for custom MIRVs.

maxRange

Range in which the missile seek a target in game units.

searchCone

Angle in which the missile will seek the target. Set to 360 or more to ignore.

fighterWeight

Target priority, set to 0 to ignore that class. Other values only used for random targeting.

frigateWeight

Target priority, set to 0 to ignore that class. Other values only used for random targeting.

destroyerWeight

Target priority, set to 0 to ignore that class. Other values only used for random targeting.

cruiserWeight

Target priority, set to 0 to ignore that class. Other values only used for random targeting.

capitalWeight

Target priority, set to 0 to ignore that class. Other values only used for random targeting.