Class PhysicalInfo

java.lang.Object
megamek.client.bot.princess.PhysicalInfo

public class PhysicalInfo extends Object
Since:
12/18/13 1:29 PM
  • Constructor Details

    • PhysicalInfo

      protected PhysicalInfo(Princess owner)
      For unit testing.
  • Method Details

    • getExpectedDamage

      public double getExpectedDamage()
    • buildAction

      protected PhysicalAttackAction buildAction(PhysicalAttackType attackType, int shooterId, Targetable target)
      Builds a new PhysicalAttackAction from the given parameters.
      Parameters:
      attackType - The PhysicalAttackType of 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(since="0.51.0", forRemoval=true) public PhysicalOption 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

      public Entity getShooter()
    • setShooter

      public void setShooter(Entity shooter)
    • getTarget

      public Targetable getTarget()
    • setTarget

      public void setTarget(Targetable target)
    • getAction

      public PhysicalAttackAction getAction()
    • setAction

      public void setAction(PhysicalAttackAction action)
    • getAttackType

      public PhysicalAttackType getAttackType()
    • setAttackType

      public void setAttackType(PhysicalAttackType attackType)
    • getHitData

      public ToHitData getHitData()
    • setHitData

      public void setHitData(ToHitData hitData)
    • 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

      protected void setDamageDirection(EntityState targetState, Coords shooterCoords)
    • 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)