Hello everyone,
Maybe this subject is already discuss on the forum / google, but I'm french and I think I don't have correct key words to find it :/
I already have done some mods (CustomStack) and I know how to find a ThingDef with a specific property :
But now, i'm trying to find ThingDef with a property in a sublist, and I don't find how to do. In my case, I'm trying to find all ThingDef which has a <stages><li>baseMoodEffect>0</baseMoodEffect></li></stages>.
Here an example of ThingDef to find :
Thanks for your help !
Maybe this subject is already discuss on the forum / google, but I'm french and I think I don't have correct key words to find it :/
I already have done some mods (CustomStack) and I know how to find a ThingDef with a specific property :
Code Select
foreach (ThingDef thingDef in DefDatabase<ThingDef>.AllDefs)
{
if (thingDef.stackLimit > 1)
{
...
}
}
But now, i'm trying to find ThingDef with a property in a sublist, and I don't find how to do. In my case, I'm trying to find all ThingDef which has a <stages><li>baseMoodEffect>0</baseMoodEffect></li></stages>.
Here an example of ThingDef to find :
Code Select
<ThoughtDef ParentName="DeathMemory">
<defName>KnowGuestExecuted</defName>
<durationDays>6</durationDays>
<nullifyingTraits>
<li>Psychopath</li>
<li>Bloodlust</li>
</nullifyingTraits>
<stages>
<li>
<label>justified execution</label>
<description>A guilty prisoner or guest was executed. It was justified, but still sad.</description>
<baseMoodEffect>0</baseMoodEffect>
</li>
<li>
<label>someone was euthanized</label>
<!-- generic humane -->
<description>A prisoner or guest was euthanized. It was humane, but still sad.</description>
<baseMoodEffect>0</baseMoodEffect>
</li>
<li>
<label>someone was executed</label>
<!-- generic brutal -->
<description>A prisoner or guest was killed in cold blood. It seemed a bit evil.</description>
<baseMoodEffect>0</baseMoodEffect>
</li>
<li>
<label>someone was organ-murdered</label>
<!-- died because of organ harvesting -->
<description>A prisoner or guest died because the colony took body parts from him. It's horrible.</description>
<baseMoodEffect>0</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
Thanks for your help !