Exemple #1
0
        public static bool Prefix(Pawn __instance, ref int __result, X2_ThingDef_AIRobot ___def2, WorkTypeDef workTypeDef)
        {
            if (___def2 == null)
            {
                return(true);
            }

            __result = __instance.workSettings.GetPriority(workTypeDef);

            //var robot = __instance as X2_AIRobot;

            //if (__instance.ThingID == "RPP_Bot_Omni_V923240")
            //    Log.Message($@"work priority for {__instance.Name} for {workTypeDef.defName} priority {__result} tags:{___def2.robotWorkTags}--{workTypeDef.workTags} canwork:{robot.CanDoWorkType(workTypeDef)}");
            return(false);
        }
        public static bool Prefix(X2_ThingDef_AIRobot __instance, ref WorkTags ___robotWorkTagsInt, ref WorkTags __result)
        {
            if (___robotWorkTagsInt == WorkTags.None && __instance.robotWorkTypes.Count > 0)
            {
                foreach (X2_ThingDef_AIRobot.RobotWorkTypes robotWorkType in __instance.robotWorkTypes)
                {
                    ___robotWorkTagsInt |= robotWorkType.workTypeDef.workTags;
                }

                ___robotWorkTagsInt &= ~(WorkTags.AllWork | WorkTags.Commoner | WorkTags.ManualDumb | WorkTags.ManualSkilled);
//                Log.Message($"{__instance.defName}   result {___robotWorkTagsInt}");
            }

            __result = ___robotWorkTagsInt;
            return(false);
        }