diff --git a/code/game/gamemodes/wizard/rightandwrong.dm b/code/game/gamemodes/wizard/rightandwrong.dm index 04b837c7d0a..5c6e9ff06f7 100644 --- a/code/game/gamemodes/wizard/rightandwrong.dm +++ b/code/game/gamemodes/wizard/rightandwrong.dm @@ -136,16 +136,10 @@ /mob/proc/summonevents() if(events) //if there isn't something is very wrong - if(!events.wizardmode) //lets get this party started - events.control = list() //out with the old - for(var/type in typesof(/datum/round_event_control/wizard) - /datum/round_event_control/wizard) //in with the new - var/datum/round_event_control/wizard/W = new type() - if(!W.typepath) - continue //don't want this one! leave it for the garbage collector - events.control += W //add it to the list of all events (controls) + if(!events.wizardmode) + events.toggleWizardmode() events.frequency_lower = 600 //1 minute lower bound events.frequency_upper = 3000 //5 minutes upper bound - events.wizardmode = 1 events.reschedule() else //Speed it up diff --git a/code/modules/events/event.dm b/code/modules/events/event.dm index 20ec857ef56..ca9c11ec386 100644 --- a/code/modules/events/event.dm +++ b/code/modules/events/event.dm @@ -15,7 +15,10 @@ var/holidayID //string which should match the events.holiday variable if you wish this event to be holiday-specific //anything with a (non-null) holidayID which does not match holiday, cannot run. + var/wizardevent = 0 +/datum/round_event_control/wizard + wizardevent = 1 /datum/round_event_control/proc/runEvent() if(!ispath(typepath,/datum/round_event)) diff --git a/code/modules/events/event_manager.dm b/code/modules/events/event_manager.dm index 41196389a01..c2035b0e378 100644 --- a/code/modules/events/event_manager.dm +++ b/code/modules/events/event_manager.dm @@ -21,8 +21,10 @@ var/datum/controller/event/events for(var/type in typesof(/datum/round_event_control)) var/datum/round_event_control/E = new type() - if(!E.typepath || E.typepath in typesof(/datum/round_event/wizard/)) + if(!E.typepath) continue //don't want this one! leave it for the garbage collector + if(E.wizardevent && !wizardmode) + E.weight = 0 control += E //add it to the list of all events (controls) reschedule() getHoliday() @@ -254,3 +256,10 @@ var/datum/controller/event/events holiday = "Friday the 13th" world.update_status() + +/datum/controller/event/proc/toggleWizardmode() + wizardmode = !wizardmode + for(var/datum/round_event_control/E in control) + E.weight = initial(E.weight) + if((E.wizardevent && !wizardmode) || (!E.wizardevent && wizardmode)) + E.weight = 0 \ No newline at end of file