Xenophilobic Thoughts - KonradHeinser/EBSGFramework GitHub Wiki
This thought worker allows you to make xenophilic and xenophobic thoughts. Below I have the basic code used for this worker. It is important to note that the opinionOfAllOthers is required, or the worker changes into normal Opinions About Genes:
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<workerClass>EBSGFramework.ThoughtWorker_Gene_GeneSocial</workerClass>
<modExtensions>
<li Class="EBSGFramework.EBSGThoughtExtension">
<opinionOfAllOthers>True</opinionOfAllOthers>
</li>
</modExtensions>
These are the tags available for the worker:
- requiredGenes : If this is not empty, the pawn must have any one of these genes to gain the opinion about anyone. This is not to be confused with the vanilla requiredGenes, which requires the pawn have all genes on the list to apply. In fact, both should be usable at the same time
- nullifyingGenes : If the target has any of these genes, the pawn won't have an opinion of them. If this is attached to a gene, that gene needs to be included on this list to make it work properly
- xenophilobic : Default (True) : When deciding on opinions of all others, nullify the thought if the other is the same xenotype. This is to allow xenotypes to use the same xenophile/xenophobe gene without having it included in the nullifyingGenes list
- relatedGenes : A list of genes that causes the pawn to only have pawns with any one of these genes
- compoundingHatred : Default (False) : Named as such because this was initially for negative opinions, this causes the thought stage to increase based on how many of the relatedGenes are present. If you aren't using relatedGenes, or only have one relatedGene, then this should remain false. The first stage is used if the target has none of the relatedGenes, and for each found gene, the worker will try to add one more stage
- For example, if you have a ThoughtDef with 5 stages and 7 genes to check. A target that only has 2 of those genes will activate stage 3, while a target with all 7 will activate stage 5 (the maximum stage). If they have none of the genes, stage 1 is used
Note: This worker doesn't require you use the requiredGenes tag from the extension. Any method used for requiring something, like requiredTraits, should also work to restrict who experiences the thought.
This example creates a basic gene where the pawn likes every pawn that is of a different xenotype than themselves:
<ThoughtDef>
<defName>Xenophile</defName>
<thoughtClass>Thought_SituationalSocial</thoughtClass>
<workerClass>EBSGFramework.ThoughtWorker_Gene_GeneSocial</workerClass>
<validWhileDespawned>true</validWhileDespawned>
<developmentalStageFilter>Baby, Child, Adult</developmentalStageFilter>
<requiredGenes>
<li>Xenophile</li>
</requiredGenes>
<stages>
<li>
<label>xenophile</label>
<baseOpinionOffset>10</baseOpinionOffset>
</li>
</stages>
<modExtensions>
<li Class="EBSGFramework.EBSGThoughtExtension">
<opinionOfAllOthers>True</opinionOfAllOthers>
</li>
</modExtensions>
</ThoughtDef>