public void doMagic(bool playedToday) { Game1.player.forceTimePass = true; Game1.playSound("stardrop"); if (Game1.timeOfDay < 2400) { Task.Run(() => CcTime.TimeSkip((Game1.timeOfDay).ToString(), false)); } }
public void callTimeSkip() { Game1.playSound("coin"); if (Game1.timeOfDay < config.maxskip) { CcTime.TimeSkip(Game1.timeOfDay < (config.maxskip - config.skiptime) ? (Game1.timeOfDay + config.skiptime).ToString() : config.maxskip.ToString(), false); } Game1.playSound("coin"); canSleep = true; Game1.currentLocation.lastQuestionKey = "Sleep"; Game1.currentLocation.answerDialogue(new Response("Yes", "Yes")); canSleep = false; }
public override void Entry(IModHelper helper) { config = helper.ReadConfig <Config>(); if (config.skiptime > 18) { config.skiptime = 18; } if (config.skiptime < 1) { config.skiptime = 1; } helper.WriteConfig(config); PyTK.Events.PyTimeEvents.BeforeSleepEvents += (s, e) => { if (!Game1.IsMultiplayer && !canSleep) { e.Response.responseKey = "No"; Game1.playSound("coin"); if (Game1.timeOfDay >= 2400) { return; } Task.Run(() => { CcTime.TimeSkip(Math.Min((config.skiptime * 100) + Game1.timeOfDay, 2400), () => { canSleep = true; Game1.playSound("coin"); Game1.currentLocation.lastQuestionKey = "Sleep"; Game1.currentLocation.answerDialogue(new Response("Yes", "Yes")); canSleep = false; Game1.hudMessages.Clear(); });; }); } }; helper.Events.GameLoop.GameLaunched += (s, e) => SetUpConfigMenu(); }
public void doMagic(bool playedToday) { Game1.player.forceTimePass = true; Game1.playSound("stardrop"); STime time = STime.CURRENT + (STime.HOUR * 3); int timeInt = (time.hour * 100 + time.minute * 10); if (timeInt > 2600) { timeInt = 2600; } if (Game1.timeOfDay < 2600) { Task.Run(() => { try { CcTime.TimeSkip(timeInt.ToString(), false); } catch { } }); } }