Package megamek.client.bot.princess
Class PhysicalInfo
java.lang.Object
megamek.client.bot.princess.PhysicalInfo
- Since:
- 12/18/13 1:29 PM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PhysicalAttackActionbuildAction(PhysicalAttackType attackType, int shooterId, Targetable target) Builds a newPhysicalAttackActionfrom the given parameters.Deprecated, for removal: This API element is subject to removal in a future version.intdoubledoubledoubledoubleReturns the expected number of crew hits this attack inflicts: the head's share of the resolved hit-location table times the probability to hit.doubledoubledoubledoubleprotected voidinitDamage(PhysicalAttackType physicalAttackType, EntityState shooterState, EntityState targetState, boolean guess, Game game) Helper function to determine damage and criticalSlotsvoidsetAction(PhysicalAttackAction action) voidsetAttackType(PhysicalAttackType attackType) voidsetDamageDirection(int damageDirection) protected voidsetDamageDirection(EntityState targetState, Coords shooterCoords) voidsetExpectedCriticals(double expectedCriticals) voidsetExpectedDamageOnHit(double expectedDamageOnHit) voidsetExpectedPilotHits(double expectedPilotHits) voidsetHitData(ToHitData hitData) voidsetKillProbability(double killProbability) voidsetMaxDamage(double maxDamage) voidsetProbabilityToHit(double probabilityToHit) voidsetShooter(Entity shooter) voidsetTarget(Targetable target) voidsetUtility(double utility)
-
Constructor Details
-
PhysicalInfo
For unit testing.
-
-
Method Details
-
getExpectedDamage
public double getExpectedDamage() -
buildAction
protected PhysicalAttackAction buildAction(PhysicalAttackType attackType, int shooterId, Targetable target) Builds a newPhysicalAttackActionfrom the given parameters.- Parameters:
attackType- ThePhysicalAttackTypeof the attack.shooterId- The ID of the attacking unit.target- The unit being attacked.- Returns:
- The resulting
PhysicalAttackType.
-
initDamage
protected void initDamage(PhysicalAttackType physicalAttackType, EntityState shooterState, EntityState targetState, boolean guess, Game game) Helper function to determine damage and criticalSlots -
getAsPhysicalOption
Deprecated, for removal: This API element is subject to removal in a future version.Current bot code requires physical attacks to be given as 'physical option'. This does the necessary conversion -
getShooter
-
setShooter
-
getTarget
-
setTarget
-
getAction
-
setAction
-
getAttackType
-
setAttackType
-
getHitData
-
setHitData
-
getProbabilityToHit
public double getProbabilityToHit() -
setProbabilityToHit
public void setProbabilityToHit(double probabilityToHit) -
getMaxDamage
public double getMaxDamage() -
setMaxDamage
public void setMaxDamage(double maxDamage) -
getExpectedDamageOnHit
public double getExpectedDamageOnHit() -
setExpectedDamageOnHit
public void setExpectedDamageOnHit(double expectedDamageOnHit) -
getDamageDirection
public int getDamageDirection() -
setDamageDirection
public void setDamageDirection(int damageDirection) -
setDamageDirection
-
getExpectedCriticals
public double getExpectedCriticals() -
setExpectedCriticals
public void setExpectedCriticals(double expectedCriticals) -
getKillProbability
public double getKillProbability() -
setKillProbability
public void setKillProbability(double killProbability) -
getExpectedPilotHits
public double getExpectedPilotHits()Returns the expected number of crew hits this attack inflicts: the head's share of the resolved hit-location table times the probability to hit. Any head hit wounds the pilot regardless of armor, so this is nonzero exactly when the attack resolves on a table that can reach the head.- Returns:
- the expected crew hits from this attack
-
setExpectedPilotHits
public void setExpectedPilotHits(double expectedPilotHits) -
getUtility
public double getUtility() -
setUtility
public void setUtility(double utility)
-