erdelf / AlienRaces

Rimworld mod alien race framework
MIT License
103 stars 69 forks source link

Race-specific overrides for StatPart_Age #102

Closed Aelanna closed 7 months ago

Aelanna commented 7 months ago

Allows for races to override the curves used by StatPart_Age on a race-by-race basis. This affects the following vanilla and official DLC StatDefs:

WorkSpeedGlobal ShootingAccuracyChildFactor MarketValue MeleeHitChance AimingDelayFactor ImmunityGainSpeed ArrestSuccessChance

Usage would be as follows, with the human defaults shown:

<generalSettings>
  <ageStatOverrides>
    <WorkSpeedGlobal>
      <useBiologicalYears>true</useBiologicalYears>
      <curve>
        <points>
          <li>(4,0.2)</li>
          <li>(12,0.8)</li>
          <li>(18,1)</li>
        </points>
      </curve>
    </WorkSpeedGlobal>
    <!-- This one requires a MayRequire because the stat itself is Biotech-specific -->
    <ShootingAccuracyChildFactor MayRequire="Ludeon.RimWorld.Biotech">
      <useBiologicalYears>true</useBiologicalYears>
      <curve>
        <points>
          <li>(4,0.95)</li> 
          <li>(12,0.98)</li>
          <li>(13,1)</li>
        </points>
      </curve>
    </ShootingAccuracyChildFactor>
    <MarketValue>
      <useBiologicalYears>true</useBiologicalYears>
      <curve>
        <points>
          <li>(3,0.5)</li>
          <li>(13,0.9)</li>
          <li>(18,1)</li>
        </points>
      </curve>
    </MarketValue>
    <MeleeHitChance>
      <useBiologicalYears>true</useBiologicalYears>
      <curve>
        <points>
          <li>(4,0.05)</li>
          <li>(12,0.8)</li>
          <li>(13,1)</li>
        </points>
      </curve>
    </MeleeHitChance>
    <AimingDelayFactor>
      <useBiologicalYears>true</useBiologicalYears>
      <curve>
        <points>
          <li>(4,1.8)</li>
          <li>(12,1.1)</li>
          <li>(13,1)</li>
        </points>
      </curve>
    </AimingDelayFactor>
    <!-- This is the only stat that doesn't use biological years by default because it's used for non-humanlike pawns -->
    <ImmunityGainSpeed>
      <curve>
        <points>
          <li>(0.65,1)</li>
          <li>(0.8,0.95)</li>
          <li>(1.0,0.9)</li>
          <li>(1.2,0.8)</li>
          <li>(1.5,0.5)</li>
        </points>
      </curve>
    </ImmunityGainSpeed>
    <ArrestSuccessChance>
      <useBiologicalYears>true</useBiologicalYears>
      <curve>
        <points>
          <li>(3, 0.05)</li>
          <li>(13, 0.8)</li>
          <li>(18, 1)</li>
        </points>
      </curve>
    </ArrestSuccessChance>
  </ageStatOverrides>
</generalSettings>

Screenshot shown shows a single-point override that disables age-based penalties for work speed: image