public static void CreateTracer(this HediffComp_InnerShine comp) { comp.Tracer = new List <InnerShineRecord>(); if (comp.Props.HasRawShinePool) { foreach (InnerShineItem ISI in comp.Props.innerShinePool) { comp.Tracer.Add(new InnerShineRecord(ISI)); } } if (comp.Props.HasShineDefPool) { foreach (InnerShineDef ISD in comp.Props.innerShineDefPool) { comp.Tracer.Add(new InnerShineRecord(ISD.item)); } } if (comp.MyDebug) { int i = 0; foreach (InnerShineRecord ISR in comp.Tracer) { Log.Warning(i.ToString("00") + "=>" + ISR.Dump); i++; } } }
public static InnerShineItem RetrieveISI(this HediffComp_InnerShine comp, string label) { if (comp.Props.HasRawShinePool) { if (comp.Props.innerShinePool.Where(i => i.label == label).FirstOrFallback() is InnerShineItem ISI) { return(ISI); } } if (comp.Props.HasShineDefPool) { if (comp.Props.innerShineDefPool.Where(i => i.item.label == label).FirstOrFallback() is InnerShineDef ISD) { return(ISD.item); } } return(null); }
public static void SelfDestroy(this HediffComp_InnerShine comp) { comp.parent.Severity = 0; comp.Pawn.health.RemoveHediff(comp.parent); }