public static void TaskProduce(object i) { DishType temp = DishType.DishEmpty; for (; ;) { if (Timer.Time.GameTime() < TimeSpan.FromMinutes(10)) { temp = (DishType)Program.Random.Next((int)DishType.TomatoFriedEgg, (int)DishType.SpicedPot); } else { temp = (DishType)Program.Random.Next((int)DishType.TomatoFriedEgg, (int)DishType.SpicedPot + 1); } if (temp == DishType.DishSize1) { continue; } break; } AddTask(temp); RemoveTaskTimer.Add((o, e) => { RemoveTask(temp); }, (uint)Configs[temp.ToString()]["TaskTime"]); //需要广播产生的任务 //感觉只需要广播任务的产生,而任务被完成以及任务因过时而gg都不用广播,需要玩家自己把握? }
public static void TaskProduce(object? i) { DishType temp = DishType.DishEmpty; for (; ; ) { if (Timer.Time.GameTime() > TimeSpan.FromMinutes(5) && SpicedPotNum > 0) { temp = (DishType)Program.Random.Next((int)DishType.CookedRice, (int)DishType.SpicedPot + 1); if(temp== DishType.SpicedPot) SpicedPotNum--; } else temp = (DishType)Program.Random.Next((int)DishType.CookedRice, (int)DishType.SpicedPot); if (temp == DishType.DishSize1) continue; break; } AddTask(temp); RemoveTaskTimer.Add((o, e) => { RemoveTask(temp); }, (uint)Configs(temp.ToString(), "TaskTime")); //需要广播产生的任务 //感觉只需要广播任务的产生,而任务被完成以及任务因过时而gg都不用广播,需要玩家自己把握? }