Skip to content

Instantly share code, notes, and snippets.

@Neceros
Created April 16, 2020 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Neceros/979c403dcc75cc14442f135505181876 to your computer and use it in GitHub Desktop.
Save Neceros/979c403dcc75cc14442f135505181876 to your computer and use it in GitHub Desktop.
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