-
Notifications
You must be signed in to change notification settings - Fork 3
Duplicate Pawn
This ability comp duplicates a pawn, with options for things like adding hediffs, changing the gender, or using the caster's faction instead of the targets if different:
<comps>
<li Class="EBSGFramework.CompProperties_AbilityDuplicatePawn">
</li>
</comps>
These are the options available:
- count : Default (1~1) : How many duplicates to spawn
- duplicateCaster : Default (False) : Causes the ability to duplicate the caster instead of the target
- keepName : Default (True) : If False, this ensures that the new pawn will have a different name from the source pawn
- gender : The options are None (no static gender, flip between male and female), Female, and Male. If not added to the comp, the new pawn's gender will be the same as the source
- randomGender : Default (False) : If True, the new pawn's gender is randomly chosen, with whatever you have in gender being ignored
- keepNameOnGenderChange : Default (False) : If True and gender is being used, this ensures that the changing of the gender won't cause the name to also change
- relation : The PawnRelationDef to give the new pawn, with the source as the other pawn. If left as empty, no relation will be created
- casterRelation : The PawnRelationDef to give the new pawn, with the caster as the other pawn. If left as empty, no relation will be created. If the caster is the source and relation is in use, both PawnRelationDefs will be added
- useCasterFaction : Default (True) : If the source's faction is different from the caster's, then the new pawn(s) will have the caster's faction instead of the target's if this is True. For obvious reasons, this doesn't matter if duplicateCaster is True
- hediffsToGive : A special list of items that gives hediffs to the new pawn(s) (using the same method as Give Multiple Hediffs, for those familiar with that comp), with these as the options in each li:
- hediffDef : Each desired hediff will require its own list item
- chance : Default (1) : The chance of the hediffDef actually applying
- onlyBrain : Default (false) : Instead of applying to the entire body, it applies the hediff to the brain
- bodyParts : A list of body parts to apply the hediff to. Overrides onlyBrain
- applyToSelf : Default (false) : Applies this hediff to the caster, regardless of the selected target. This is only really useful if there is supposed to be some effect on the caster that scales based on how many pawns were actually created
- applyToTarget : Default (true) : Applies this hediff to the target. Usually no reason to set this to false due to the below node
- onlyApplyToSelf : Default (false) : Equivalent to setting applyToTarget to false, and applyToSelf to true, just does both in a single node. This is only really useful if there is supposed to be some effect on the caster that scales based on how many pawns were actually created
- skipExisting : Default (False) : If true and the pawn already has the hediff on all of the parts, then this hediff is skipped. If the hediff is only on some parts, the comp will still add the hediff to those parts
- replaceExisting : Default (False) : If true and the pawn already has the hediff, that hediff is removed (can trigger this comp on that hediff), and a new version of it is added
- severity : Default (1) : The severity to give, or add to the existing one if replaceExisting and skipExisting are false. If a range of values is given instead of a singular value, then a random number in that range is used for the severity. If this number is less than or equal to 0, the li is skipped unless replaceExisting is true, in which case the hediffDef is removed
Note : It is possible to make the duplicates temporary by giving them a hediff with HediffCompProperties_DisappearsAndKills and Destroy on Death, but due to how death notifications are handled by Rimworld, there isn't any good way to ensure that pawns won't become sad and want a funeral for the temporary copy. I have not yet found any sort of toggle in pawn code that lets the game know that the pawn in question isn't worth having a funeral over
This example just causes a duplicate of the targeted pawn to appear, with no special effects:
<AbilityDef>
<defName>DuplicatePerson</defName>
<label>duplicate person</label>
<description>duplicate person.</description>
<iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
<casterMustBeCapableOfViolence>false</casterMustBeCapableOfViolence>
<cooldownTicksRange>60</cooldownTicksRange>
<hostile>false</hostile>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<range>30</range>
<warmupTime>0.5</warmupTime>
<requireLineOfSight>False</requireLineOfSight>
<targetParams>
<canTargetAnimals>false</canTargetAnimals>
<canTargetBuildings>false</canTargetBuildings>
<canTargetMechs>false</canTargetMechs>
<canTargetSubhumans>false</canTargetSubhumans>
<canTargetLocations>false</canTargetLocations>
<canTargetSelf>True</canTargetSelf>
</targetParams>
</verbProperties>
<comps>
<li Class="EBSGFramework.CompProperties_AbilityDuplicatePawn" />
</comps>
</AbilityDef>
This example creates 2-4 copies of the caster and assigns them random genders
<AbilityDef>
<defName>WTF</defName>
<label>WTF</label>
<description>Some would say you're beside yourself. Others would have no clue what's going on.</description>
<iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
<casterMustBeCapableOfViolence>false</casterMustBeCapableOfViolence>
<cooldownTicksRange>60</cooldownTicksRange>
<hostile>false</hostile>
<targetRequired>False</targetRequired>
<statBases>
<Ability_Duration>42</Ability_Duration>
</statBases>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<range>-1</range>
<warmupTime>0.5</warmupTime>
<requireLineOfSight>False</requireLineOfSight>
<targetParams>
<canTargetAnimals>false</canTargetAnimals>
<canTargetBuildings>false</canTargetBuildings>
<canTargetMechs>false</canTargetMechs>
<canTargetSubhumans>false</canTargetSubhumans>
<canTargetLocations>false</canTargetLocations>
<canTargetSelf>True</canTargetSelf>
</targetParams>
</verbProperties>
<comps>
<li Class="EBSGFramework.CompProperties_AbilityDuplicatePawn">
<duplicateCaster>True</duplicateCaster>
<count>2~4</count>
<randomGender>True</randomGender>
</li>
</comps>
</AbilityDef>
- Ability Validator
- Add Things To Inventory
- Alter Genes
- Alter Xenotype (Ability)
- Blood Drain
- Blast Attacks
- Burst Attacks
- Change Faction
- Change Gender
- Change Ideology
- Change Traits
- Change Weather
- Charge Battery
- Create Items
- Create Linked Hediffs
- Deal Damage
- Destroy Corpse
- Destroy Filth
- Destroy Items
- Duplicate Pawn
- Fly to Map Tile
- Give Multiple Hediffs
- Instant Death
- Launch Projectile Burst
- Learn Skill
- Long Distance Teleport
- Love the Caster
- Offset Needs Ability
- Orbital Strike
- Push Target
- Reloadable Abilities
- Remove Multiple Hediffs
- Remove Things From Inventory
- Spawn Humanlike (Ability)
- Spawn Pawn Kinds
- Spew
- Stop Mental Break (No Psychic)
- Toggle Hediff
- Trigger Game Condition
- Abilities From Other Genes
- Additional Fertility by Age
- Additional Lovin' Results
- Aging Xenotype
- Biome Genes
- Butchery Changing Genes
- Coma Rest Genes
- Conflicting Genes
- Customizable Bloodclotting
- Damage Modifying Stats Extension
- EBSG Body
- Equip Restrict
- Evolving Genes
- Fertility by Age
- Gender by Age
- Genetic Romance Chance
- Hediff Adder
- Hediff on Consumption
- Hediffs at Age
- Hide Inactive
- Hive Mind Genes
- Inactive at Age
- Ingestible Dependency Genes
- Mutating Genes
- Pregnancy Replacing Genes
- Random Periodic Interaction
- Removed at Age
- Skill Changing Genes
- Spawn Age Limiter
- Thoughts on Down from Gene
- Vanishing Genes
- Various Conditional Stat Affecters
- Aging Hediff
- Alter Xenotype (Hediff)
- Attach Mote
- Create Items
- Create Other Hediffs
- Damage on Removal
- Damage Over Time
- Destroy on Death
- Display Severity
- Flip Gender Periodically
- Gender by Age Hediff
- Gene Randomizer
- Give Abilities at Severities
- Give Hediff to Killer
- Give Hediffs to Non-Allies
- Give Other Hediff Periodically
- Hediff on Kill
- Hediff While Moving
- Hediffs on Removal
- Hediffs While Drafted
- Hediffs While in Severity Ranges
- Hemogen on Kill
- Hemogen Regeneration
- Make Hediff Invisible at Stage
- Memory on Kill
- Modular Hediffs
- Multiple Lives
- Name Color Hediff
- Remove at Severities
- Remove/Damage Parts
- Remove on Faction Change
- Remove When Damaged
- Severity Change per Attack
- Severity Change When Hit
- Severity Per Day by Genes
- Severity per Interval by Terrain
- Shield Hediff
- Skill Change Hediffs
- Spawn Humanlike
- Spawn Pawn Kind on Removal
- Temporary Faction
- Temporary Genes
- Temporary Ideology
- Temporary Relation
- Terrain Cost Override
- Tiered Regeneration
- Various Explosion Hediff Comps
- Severity Setters
- Faction Bond
- Severity by Age
- Severity by Colony Genes
- Severity by Colony Wealth
- Severity by Equipped
- Severity by Gender
- Severity by Genes
- Severity by Light Level
- Severity by Map
- Severity by Mental State
- Severity by Nearby Pawns
- Severity by Need Level
- Severity by Other Hediff Severities
- Severity by Time of Day
- Severity When Downed
- Add or Append Hediff on Ingest
- Alter Genes on Ingest
- Alter Genes on Use
- Alter Xenotype on Ingest
- Alter Xenotype on Use
- Alter Xenotype on Use by Severity
- Damage Modifying Stats Extension
- Equip Restrict
- Flexible Entity Releaser
- Gatherer Spot
- Give Hediff Based on Severity
- Hediff on Damage
- Limited Charges
- Need Charger Buildings
- Projectile Impact Effects
- Random Shot
- Regenerating Things
- Shield Equipment
- Sleep Caskets
- Spawn Baby Thing Comp
- Turret Roof Blocked
- Weapon Trait Extension
- Desired Genes Precept
- Disliked in Faction
- Gene in Colony Mood Precept
- Gene in Colony Mood Toggle Precept
- Opinions About Genes
- People in the Colony
- Random Opinion
- Thought Mood by Hediff Severity
- Thought Multiplying Genes
- Thoughts About Water
- Xenophilobic Thoughts
- The Genes
- Resource Packs
- Craving and Overcharge Hediffs
- Resource Using Abilities
- Converting Resources
- Special DRG Abilities
- Special DRG Hediffs