Package megamek.client.bot.princess
Class ArtilleryTargetingControl
java.lang.Object
megamek.client.bot.princess.ArtilleryTargetingControl
This class handles the creation of firing plans for indirect-fire artillery and other weapons that get used during
the targeting phase.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculateDamageValue(int damage, Coords coords, Entity shooter, Game game, Princess owner) Worker function that calculates the total damage that would be done if a shot with the given damage value would hit the target coordinates.doublecalculateDamageValue(int damage, HexTarget hexTarget, Entity shooter, Game game, Princess owner) Wrapper for calculateDamageValue that accounts for leading with artillery shots by accounting for both the original target hexTarget and the computed target hexTarget in damage calculations.calculateIndirectArtilleryPlan(Entity shooter, Game game, Princess owner) Calculate an indirect artillery "fire plan", taking into account the possibility of rotating the torso or turret: if no attack is possible with the current facing (e.g.static doubleevaluateIncomingArtilleryDamage(Coords coords, Princess operator) Function that calculates the potential damage if an artillery attack were to land on target.voidClears out all cached elements in preparation for a new targeting phase.
-
Constructor Details
-
ArtilleryTargetingControl
public ArtilleryTargetingControl()
-
-
Method Details
-
calculateDamageValue
public double calculateDamageValue(int damage, HexTarget hexTarget, Entity shooter, Game game, Princess owner) Wrapper for calculateDamageValue that accounts for leading with artillery shots by accounting for both the original target hexTarget and the computed target hexTarget in damage calculations. -
calculateDamageValue
public double calculateDamageValue(int damage, Coords coords, Entity shooter, Game game, Princess owner) Worker function that calculates the total damage that would be done if a shot with the given damage value would hit the target coordinates. Caches computation results to avoid repeat -
initializeForTargetingPhase
public void initializeForTargetingPhase()Clears out all cached elements in preparation for a new targeting phase. -
calculateIndirectArtilleryPlan
Calculate an indirect artillery "fire plan", taking into account the possibility of rotating the torso or turret: if no attack is possible with the current facing (e.g. an ordered fire mission hex is out of arc), the valid secondary facing changes are tried and the first one that produces attacks is used. The resulting plan includes the necessary torso twist action.- Parameters:
shooter- Entity doing the shootinggame- The currentGameowner- Princess pointer- Returns:
- Firing plan
-
evaluateIncomingArtilleryDamage
Function that calculates the potential damage if an artillery attack were to land on target.
-