-
Notifications
You must be signed in to change notification settings - Fork 3
Disableable Hediffs
SmArtKar edited this page Apr 28, 2023
·
4 revisions
Using HediffCompProperties_DisableOnDamage you can disable hediffs upon the owner being damaged. Main use of this is to make implants that disable upon being hit with EMP. Upon triggering, original hediff would be temporary removed and "stored" in a new replacementDef hediff. Upon that hediff being destroyed, the original would be restored.
public class HediffCompProperties_DisableOnDamage : HediffCompProperties
{
// Def of a hediff that will replace this hediff upon being disabled
public HediffDef replacementDef;
// Minimal amount of damage required to disable the hediff
public float minDamage = 0f;
// After what time the hediff should be reenabled. When set to -1, parent hediff will only be reenabled when the replacement hediff is disabled
public int disabledDurationTicks = -1;
// When set to true, disabled duration will be increased even when the hediff is already disabled
public bool increaseDisabledDuration = true;
// When set, disabledDurationTicks will be replaced by values from this curve with X being the amount of damage dealt
public SimpleCurve durationScaling;
// Only works when increaseDisabledDuration is set to true. When activated, damage taken when the hediff is already disabled will be added to the timer. When not, timer will simply be set to the supposed duration (if it's above current remaining duration)
public bool accumulateDuration = true;
// White and black lists for damageDefs. Defaults to all damage defs
public List<DamageDef> damageDefWhitelist;
public List<DamageDef> damageDefBlacklist;
}replacementDef must contain HediffCompProperties_HediffRestorer comp that acts as a temporary holder.
- Stats
- Gene Templates
- Pawn Group Utility
- Under Group Combat Pressure Think Node
- Min Prey Body Size
- Modular Things
- Gene Locked Recipes and Buildings
- Additional Gene Drops
- Angle Based Shotguns
- Following ("Running") Beams
- Pawn Turret Extensions
- Damage Modification
- Advanced Tools
- Shockwave Attacks
- Miniguns
- Elite Shot
- AOE Hediff Explosion Projectiles
- Frag Grenades
- Cooldown Graphics
- Scatter Things Ability
- Abilities on Equipment
- Burst Projectile Abilities
- Reloadable Abilities
- Shockwave Ability
- Projectile Comps
- Projectile Impact Effects
- Projectile Trails
- Bouncy Projectiles
- Spawner Projectiles
- Roof Collapse Projectiles
- Scattershot Projectiles
- Custom Body Graphic For Apparel
- Multi Layered Apparel Graphics
- Advanced Equipment Shields
- Equipment with Prerequisites
- Advanced Armor
- Gene-based Apparel Textures
- Gene Locked Equipment
- Additional Apparel Graphics Comps
- Hediff Giver Extension
- Bomb Hediff Comp
- Remove On Severity Comp
- Renderable Hediffs
- Shield Hediffs
- Armored Hediffs
- Disableable Hediffs
- Modular Hediffs
- Hediffs with Prerequisites
- Singular Hediff Abilities
- Hediff On Damage
- Additional Hediff Graphics Comps
- Caching
- IArmored
- IDamageResponse
- IRenderable
- IStageOverride
- IStatModifier
- IProjectile
- IPreventEquip
- IHediffGraphicGiver and IEquippableGraphicGiver
- IDamageModifier
- IColorSelector
- IBodyModifier