示例#1
0
        public static bool Notify_DamageTaken(Pawn_JobTracker __instance, DamageInfo dinfo)
        {
            Job curJob = __instance.curJob;

            if (curJob == null)
            {
                return(false);
            }
            JobDriver curDriver = __instance.curDriver;

            if (curDriver == null)
            {
                return(false);
            }
            curDriver.Notify_DamageTaken(dinfo);
            Job curJob2 = __instance.curJob;

            if (curJob2 != curJob || !dinfo.Def.ExternalViolenceFor(__instance.pawn) || (!dinfo.Def.canInterruptJobs || curJob2.playerForced) || Find.TickManager.TicksGame < __instance.lastDamageCheckTick + 180)
            {
                return(false);
            }
            Thing instigator = dinfo.Instigator;

            if (curJob2.def.checkOverrideOnDamage != CheckJobOverrideOnDamageMode.Always && (curJob2.def.checkOverrideOnDamage != CheckJobOverrideOnDamageMode.OnlyIfInstigatorNotJobTarget || __instance.curJob.AnyTargetIs((LocalTargetInfo)instigator)))
            {
                return(false);
            }
            __instance.lastDamageCheckTick = Find.TickManager.TicksGame;
            __instance.CheckForJobOverride();
            return(false);
        }