Ejemplo n.º 1
0
 public override void MapComponentTick()
 {
     RestaurantUtility.OnTick();
     // Don't tick everything at once
     if ((GenTicks.TicksGame + map.uniqueID) % 500 == 0)
     {
         stock.RareTick();
     }
     if ((GenTicks.TicksGame + map.uniqueID) % 500 == 250)
     {
         orders.RareTick();
     }
     //Log.Message($"Stock: {stock.Select(s => s.def.label).ToCommaList(true)}");
     if ((GenTicks.TicksGame + map.uniqueID) % 500 == 300)
     {
         RareTick();
     }
 }
Ejemplo n.º 2
0
        public static T FailOnDangerous <T>(this T f, Danger maxDanger) where T : IJobEndable
        {
            JobCondition OnRegionDangerous()
            {
                Pawn pawn  = f.GetActor();
                var  check = RestaurantUtility.IsRegionDangerous(pawn, maxDanger, pawn.GetRegion());

                if (!check)
                {
                    return(JobCondition.Ongoing);
                }
                Log.Message($"{pawn.NameShortColored} failed {pawn.CurJobDef.label} because of danger ({pawn.GetRegion().DangerFor(pawn)})");
                return(JobCondition.Incompletable);
            }

            f.AddEndCondition(OnRegionDangerous);
            return(f);
        }