public static void Patch_Pawn_GetGizmos_Postfix(
            ref Pawn __instance,
            ref IEnumerable <Gizmo> __result)
        {
            if (__instance.health == null || !((HediffSet)((Pawn_HealthTracker)__instance.health).hediffSet).HasHediff(MFHediffDefOf.MFBastionHigh, false) || Find.get_Selector().get_NumSelected() != 1)
            {
                return;
            }
            ShieldHediff firstHediffOfDef = ((HediffSet)((Pawn_HealthTracker)__instance.health).hediffSet).GetFirstHediffOfDef(MFHediffDefOf.MFBastionHigh, false) as ShieldHediff;

            __result = (IEnumerable <Gizmo>)CollectionExtensions.Add <Gizmo>((IEnumerable <M0>)__result, (M0) new Gizmo_ShieldHediff()
            {
                shield = firstHediffOfDef
            });
        }
        // Token: 0x0600002B RID: 43 RVA: 0x00002B34 File Offset: 0x00000D34
        public static bool Patch_Pawn_PreApplyDamage_Prefix(ref Pawn __instance, ref DamageInfo dinfo, out bool absorbed)
        {
            bool flag  = dinfo.Def != DamageDefOf.SurgicalCut && dinfo.Def != DamageDefOf.ExecutionCut && dinfo.Def != DamageDefOf.EMP && dinfo.Def != DamageDefOf.Stun;
            bool flag2 = flag && __instance.health != null && __instance.health.hediffSet.HasHediff(MFHediffDefOf.MFBastionHigh, false);

            if (flag2)
            {
                ShieldHediff shieldHediff = __instance.health.hediffSet.GetFirstHediffOfDef(MFHediffDefOf.MFBastionHigh, false) as ShieldHediff;
                bool         flag3        = shieldHediff != null;
                if (flag3)
                {
                    bool broken = shieldHediff.broken;
                    if (broken)
                    {
                        shieldHediff.ResetBrokenCooldown();
                    }
                    else
                    {
                        bool flag4 = shieldHediff.AbsorbDamage(dinfo);
                        bool flag5 = flag4;
                        if (flag5)
                        {
                            bool broken2 = shieldHediff.broken;
                            if (broken2)
                            {
                                SoundDefOf.EnergyShield_Broken.PlayOneShot(new TargetInfo(__instance.Position, __instance.Map, false));
                                MoteMaker.MakeStaticMote(GenThing.TrueCenter(__instance), __instance.Map, ThingDefOf.Mote_ExplosionFlash, 12f);
                            }
                            else
                            {
                                SoundDefOf.EnergyShield_AbsorbDamage.PlayOneShot(new TargetInfo(__instance.Position, __instance.Map, false));
                                MoteMaker.MakeStaticMote(GenThing.TrueCenter(__instance), __instance.Map, ThingDefOf.Mote_ExplosionFlash, 6f);
                            }
                            bool flag6 = !shieldHediff.broken;
                            if (flag6)
                            {
                                shieldHediff.ResetHitCooldown();
                            }
                            absorbed = true;
                            return(false);
                        }
                    }
                }
            }
            absorbed = false;
            return(true);
        }
        // Token: 0x0600002A RID: 42 RVA: 0x00002AB8 File Offset: 0x00000CB8
        public static void Patch_Pawn_GetGizmos_Postfix(ref Pawn __instance, ref IEnumerable <Gizmo> __result)
        {
            bool flag = __instance.health != null && __instance.health.hediffSet.HasHediff(MFHediffDefOf.MFBastionHigh, false);

            if (flag)
            {
                bool flag2 = Find.Selector.NumSelected == 1;
                if (flag2)
                {
                    ShieldHediff shield = __instance.health.hediffSet.GetFirstHediffOfDef(MFHediffDefOf.MFBastionHigh, false) as ShieldHediff;
                    __result = CollectionExtensions.AddItem <Gizmo>(__result, new Gizmo_ShieldHediff
                    {
                        shield = shield
                    });
                }
            }
        }