public static void Pawn_GizmosFromHediffComps(Pawn __instance, ref IEnumerable <Gizmo> __result) { if (__instance == null) { Log.Warning("HediffGizmosFromComps cannot access Apparel."); return; } if (__result == null) { Log.Warning("HediffGizmosFromComps creating new list."); return; } // Find all comps on the apparel. If any have gizmos, add them to the result returned from apparel already (typically empty set). List <Gizmo> l = new List <Gizmo>(__result); for (int o = 0; o < AdeptusHediffUtility.ShieldHediffs.Count; o++) { HediffWithComps item = __instance.health.hediffSet.GetFirstHediffOfDef(AdeptusHediffUtility.ShieldHediffs[o]) as HediffWithComps; if (item != null) { if (item.TryGetCompFast <HediffComp_Shield>() is HediffComp_Shield _Shield) { foreach (Gizmo gizmo in _Shield.GetShieldGizmos()) { l.Add(gizmo); } } } } __result = l; }
// Token: 0x06004CA7 RID: 19623 RVA: 0x0023A424 File Offset: 0x00238824 public static bool IsPermanent(this Hediff hd) { HediffWithComps hediffWithComps = hd as HediffWithComps; if (hediffWithComps == null) { return(false); } HediffComp_GetsPermanent hediffComp_GetsPermanent = hediffWithComps.TryGetCompFast <HediffComp_GetsPermanent>(); return(hediffComp_GetsPermanent != null && hediffComp_GetsPermanent.IsPermanent); }
// Token: 0x06004CA8 RID: 19624 RVA: 0x0023A458 File Offset: 0x00238858 public static bool FullyImmune(this Hediff hd) { HediffWithComps hediffWithComps = hd as HediffWithComps; if (hediffWithComps == null) { return(false); } HediffComp_Immunizable hediffComp_Immunizable = hediffWithComps.TryGetCompFast <HediffComp_Immunizable>(); return(hediffComp_Immunizable != null && hediffComp_Immunizable.FullyImmune); }
// Token: 0x06004CA6 RID: 19622 RVA: 0x0023A3F0 File Offset: 0x002387F0 public static bool IsTended(this Hediff hd) { HediffWithComps hediffWithComps = hd as HediffWithComps; if (hediffWithComps == null) { return(false); } HediffComp_TendDuration hediffComp_TendDuration = hediffWithComps.TryGetCompFast <HediffComp_TendDuration>(); return(hediffComp_TendDuration != null && hediffComp_TendDuration.IsTended); }