Class InjurySPAUtility

java.lang.Object
mekhq.campaign.personnel.medical.InjurySPAUtility

public class InjurySPAUtility extends Object
  • Constructor Details

    • InjurySPAUtility

      public InjurySPAUtility()
  • Method Details

    • adjustInjuriesAndFatigueForSPAs

      public static int adjustInjuriesAndFatigueForSPAs(Person person, boolean isUseInjuryFatigue, int fatigueRate, int injuries)
      Adjusts the number of injuries for a person based on their Special Pilot Abilities (SPAs) and optionally updates their fatigue.

      If the person has the "Glass Jaw" flaw (but not both "Glass Jaw" and "Toughness"), the number of injuries is doubled. If the person has the "Toughness" ability (but not both "Glass Jaw" and "Toughness"), the number of injuries is reduced to 75% (rounded up). If both traits are present, no adjustment is made.

      If isUseInjuryFatigue is true, the method also increases the person's fatigue by fatigueRate multiplied by the (possibly modified) number of injuries.

      Parameters:
      person - the Person whose injuries and fatigue are to be adjusted
      isUseInjuryFatigue - whether to apply fatigue increase based on injuries
      fatigueRate - the rate at which fatigue increases per injury
      injuries - the base number of injuries before adjustments
      Returns:
      the adjusted number of injuries after applying SPAs
      Since:
      0.50.07