-
Notifications
You must be signed in to change notification settings - Fork 3
Disliked in Faction
This thought worker class causes stages to become active when the pawn is disliked by spawned pawns on the same map in the same faction:
<workerClass>EBSGFramework.ThoughtWorker_DislikedInFaction</workerClass>
<modExtensions>
<li Class="EBSGFramework.EBSGThoughtExtension">
</li>
</modExtensions>
If you don't include the extension, the worker will still function. Without the things from the extension, it will make the thought active at the first stage if the pawn is disliked by anyone (opinion below, but not including, 0), and active at the second stage (if there is a second stage) if nobody dislikes them. If you do include the extension in your code, these are the options available:
- maxOpinion : Default (0) : The point where the faction pawn is deemed to be disliking the thought have. This check is value exclusive, meaning if you set it to -10, then any pawn with an opinion of -10 or higher will not be included in the count
- curve : A simple curve which uses the left point for the number of pawns that dislike the thought haver, and the right number for the stage that is active past that threshold. 0 means the thought is disabled, 1 the first item on the list, 2 the second item, etc.
- For example,
<li>(3,2)</li>means that once at least 3 pawns dislike the haver, the second stage on the list will be active, assuming there isn't a point after that which would be active - The code rounds the curve results where it can so you don't need to specify the stage where each count is active (i.e. having a (3,2) and a (5,3) means that if 4 pawns dislike the haver, the thought will use the second stage), but skipping stages or going backwards can result in unexpected results (i.e. (3,3) and (5,2) will use the second stage with 4 pawns disliking the haver unless you include a (4,3) in between them)
- For example,
For the purposes of these examples, this is the gene used. It doesn't have any sort of special code in it, but if you want to experiment with stuff you should copy and paste it into your code to make the process easier:
<GeneDef>
<defName>SocialObsession</defName>
<label>socially obsessed</label>
<description>This pawn is very happy when people at least tolerate them, but get sad when anyone dislikes them.</description>
<iconPath>UI/Icons/Genes/Gene_HairColor</iconPath>
<displayCategory>Mood</displayCategory>
</GeneDef>
This first example involves the least amount of stuff. If any spawned pawn on the same map and in the same faction as the gene carrier has an opinion below 0, the carrier receives -8 mood. Otherwise, they gain +10 mood. If the second stage is removed, the thought only becomes active when someone dislikes the pawn:
<ThoughtDef>
<defName>SocialObsession</defName>
<thoughtClass>Thought_Situational</thoughtClass>
<workerClass>EBSGFramework.ThoughtWorker_DislikedInFaction</workerClass>
<validWhileDespawned>true</validWhileDespawned>
<requiredGenes>
<li>SocialObsession</li>
</requiredGenes>
<stages>
<li>
<label>socially obsessed</label>
<description>Someone doesn't like me, and now I'm sad.</description>
<baseMoodEffect>-8</baseMoodEffect>
</li>
<li>
<label>socially obsessed</label>
<description>We are all a happy group here with no conflicts.</description>
<baseMoodEffect>10</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
This example makes the pawn happier the more of the fellow spawned faction members on the map hate them. If at least 2 pawns have under -20 opinion of the pawn, they gain 2 mood. Once it reaches 5, the mood increases to 5, and at 20 it increases to 20. The thought is not active if there aren't at least 2 pawns with -20 opinion of the pawn:
<ThoughtDef>
<defName>SocialObsession</defName>
<thoughtClass>Thought_Situational</thoughtClass>
<workerClass>EBSGFramework.ThoughtWorker_DislikedInFaction</workerClass>
<validWhileDespawned>true</validWhileDespawned>
<requiredGenes>
<li>SocialObsession</li>
</requiredGenes>
<stages>
<li>
<label>socially obsessed</label>
<description>Their anger makes me happy in ways I can't quite explain.</description>
<baseMoodEffect>2</baseMoodEffect>
</li>
<li>
<label>socially obsessed</label>
<description>Anger leads to hate, hate leads to funny.</description>
<baseMoodEffect>5</baseMoodEffect>
</li>
<li>
<label>socially obsessed</label>
<description>Get rage baited idiots.</description>
<baseMoodEffect>20</baseMoodEffect>
</li>
</stages>
<modExtensions>
<li Class="EBSGFramework.EBSGThoughtExtension">
<maxOpinion>-20</maxOpinion>
<curve>
<points>
<li>(0,0)</li>
<li>(2,1)</li>
<li>(5,2)</li>
<li>(10,3)</li>
</points>
</curve>
</li>
</modExtensions>
</ThoughtDef>
- 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