public static bool Prefix(JukeboxInstance __instance) { if (string.IsNullOrEmpty(__instance.file) || !Jukebox.HasFile(__instance._file)) { __instance.SwitchTrack(true); } if (__instance.isControlling && Jukebox.isStartingOrPlaying) { MainPatch.isPaused = !Jukebox.paused; Jukebox.paused = !Jukebox.paused; } else if (__instance.ConsumePower()) { Jukebox.Play(__instance); Jukebox.TrackInfo info = Jukebox.GetInfo(__instance.file); __instance.SetLabel(info.label); __instance.SetLength(info.length); MainPatch.isPlaying = true; MainPatch.isPaused = false; } else { __instance.SetLabel(Language.main.Get("JukeboxNoPower")); } if (StoryGoalManager.main.IsAlanOnboard()) { StoryGoal.Execute("Log_Alan_Aside_JukeboxMusic", Story.GoalType.PDA, true, false); } return(false); }
public override void Process(StoryEventSend packet) { switch (packet.Type) { case StoryEventSend.EventType.PDA: case StoryEventSend.EventType.RADIO: case StoryEventSend.EventType.ENCYCLOPEDIA: case StoryEventSend.EventType.STORY: using (packetSender.Suppress <StoryEventSend>()) using (packetSender.Suppress <PDALogEntryAdd>()) { StoryGoal.Execute(packet.Key, packet.Type.ToUnity()); } break; case StoryEventSend.EventType.EXTRA: ExecuteExtraEvent(packet.Key); break; case StoryEventSend.EventType.PDA_EXTRA: PDALog.entries.Remove(packet.Key); StoryGoal.Execute(packet.Key, Story.GoalType.PDA); break; } }
static bool Prefix(StoryGoalScheduler __instance) { StoryGoalManager.main.PulsePendingMessages(); for (int i = __instance.schedule.Count - 1; i >= 0; i--) { ScheduledGoal scheduledGoal = __instance.schedule[i]; if (scheduledGoal.goalType == Story.GoalType.Radio) { __instance.schedule[i] = __instance.schedule[__instance.schedule.Count - 1]; __instance.schedule.RemoveAt(__instance.schedule.Count - 1); StoryGoal.Execute(scheduledGoal.goalKey, scheduledGoal.goalType); } } return(true); }
public override void Process(StoryEventSend packet) { switch (packet.StoryEventType) { case StoryEventType.PDA: case StoryEventType.Radio: case StoryEventType.Encyclopedia: case StoryEventType.Story: StoryGoal.Execute(packet.Key, (Story.GoalType)packet.StoryEventType); break; case StoryEventType.Extra: ExecuteExtraEvent(packet.Key); break; } }
public override void Process(StoryEventSend packet) { switch (packet.StoryEventType) { case StoryEventType.PDA: case StoryEventType.RADIO: case StoryEventType.ENCYCLOPEDIA: case StoryEventType.STORY: using (NitroxServiceLocator.LocateService <IPacketSender>().Suppress <StoryEventSend>()) { StoryGoal.Execute(packet.Key, (Story.GoalType)packet.StoryEventType); } break; case StoryEventType.EXTRA: ExecuteExtraEvent(packet.Key); break; } }
public override void Process(StoryEventSend packet) { switch (packet.StoryEventType) { case StoryEventType.PDA: case StoryEventType.Radio: case StoryEventType.Encyclopedia: case StoryEventType.Story: using (NitroxServiceLocator.LocateService <IPacketSender>().Suppress <StoryEventSend>()) { StoryGoal.Execute(packet.Key, (Story.GoalType)packet.StoryEventType); } break; case StoryEventType.Extra: ExecuteExtraEvent(packet.Key); break; } }