Skip to content

Instantly share code, notes, and snippets.

@Neceros

Neceros/.cs

Created Apr 16, 2020
Embed
What would you like to do?
error
using RimWorld;
using System.Collections.Generic;
using System.Linq;
using Verse;
namespace LeafLikeLife
{
[StaticConstructorOnStartup]
public static class LLLStartUp
{
static LLLStartUp()
{
// Loads right before main menu
LLLUtility.UpdatedAllChanges();
}
}
public class LLLUtility
{
public static void UpdatedAllChanges()
{
//DefDatabase<HediffDef>.GetNamed("SmokeleafHigh").stages[0].capMods[0].offset = LLLModSettings.amountPenaltyConsciousness;
HediffDef.Named("SmokeleafHigh").stages.Where((HediffStage stage) => stage.capMods.Any((PawnCapacityModifier mod) => mod.capacity == PawnCapacityDefOf.Consciousness)).First().capMods.Where((PawnCapacityModifier mod) => mod.capacity == PawnCapacityDefOf.Consciousness).First().offset = LLLModSettings.amountPenaltyConsciousness;
CompProperties_Drug comDrug = ThingDef.Named("SmokeleafJoint").comps[0] as CompProperties_Drug;
comDrug.addictiveness = LLLModSettings.amountAddictiveness;
comDrug.minToleranceToAddict = LLLModSettings.amountToleranceToAddict;
HediffGiver_RandomDrugEffect hediffAsthma = HediffDef.Named("SmokeleafTolerance").hediffGivers[0] as HediffGiver_RandomDrugEffect;
HediffGiver_RandomDrugEffect hediffCancer = HediffDef.Named("SmokeleafTolerance").hediffGivers[1] as HediffGiver_RandomDrugEffect;
hediffAsthma.baseMtbDays = LLLModSettings.amountAsthmaDaysChance;
hediffCancer.baseMtbDays = LLLModSettings.amountCancerDaysChance;
ThoughtDef.Named("SmokeleafWithdrawal").stages[1].baseMoodEffect = LLLModSettings.amountPenaltyWithdrawal;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment