From bd18903e13adc78a28a8ea2cb46ab13805d4c00f Mon Sep 17 00:00:00 2001 From: deathride58 Date: Wed, 11 Oct 2017 18:03:58 -0400 Subject: [PATCH 1/3] eh it works --- code/citadel/cit_crewobjectives.dm | 12 +++++------ code/controllers/subsystem/ticker.dm | 21 +++++++++++++++---- .../modules/mob/dead/new_player/new_player.dm | 2 +- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/code/citadel/cit_crewobjectives.dm b/code/citadel/cit_crewobjectives.dm index 90a655b622..5a5d0b2384 100644 --- a/code/citadel/cit_crewobjectives.dm +++ b/code/citadel/cit_crewobjectives.dm @@ -1,6 +1,6 @@ /datum/controller/subsystem/ticker/proc/generate_crew_objectives() for(var/datum/mind/crewMind in SSticker.minds) - if(prob(2) && !issilicon(crewMind.current) && !jobban_isbanned(crewMind, "Syndicate") && GLOB.miscreants_allowed && ROLE_MISCREANT in crewMind.current.client.prefs.be_special) + if(prob(5) && !issilicon(crewMind.current) && !jobban_isbanned(crewMind, "Syndicate") && GLOB.miscreants_allowed && ROLE_MISCREANT in crewMind.current.client.prefs.be_special) generate_miscreant_objectives(crewMind) else if(CONFIG_GET(flag/allow_crew_objectives)) @@ -16,7 +16,8 @@ return if(!crewMind.assigned_role) return - var/list/validobjs = get_valid_crew_objs(ckey(crewMind.assigned_role)) + var/list/validobjs = crewobjjobs["[ckey(crewMind.assigned_role)]"] + //var/list/validobjs = get_valid_crew_objs(ckey(crewMind.assigned_role)) if(!validobjs || !validobjs.len) return var/selectedObj = pick(validobjs) @@ -28,15 +29,14 @@ to_chat(crewMind, "As a part of Nanotrasen's anti-tide efforts, you have been assigned an optional objective. It will be checked at the end of the shift. Performing traitorous acts in pursuit of your objective may result in termination of your employment.") to_chat(crewMind, "Your optional objective: [newObjective.explanation_text]") -/datum/controller/subsystem/ticker/proc/get_valid_crew_objs(var/job = "")//taken from old hippie with adjustments - var/list/objpaths = typesof(/datum/objective/crew) +/*/datum/controller/subsystem/ticker/proc/get_valid_crew_objs(var/job = "")//taken from old hippie with adjustments var/list/objlist = list() - for(var/hoorayhackyshit in objpaths) + for(var/hoorayhackyshit in crewobjlist) var/datum/objective/crew/obj = hoorayhackyshit //dm is not a sane language in any way, shape, or form. var/list/availableto = splittext(initial(obj.jobs),",") if(job in availableto) objlist += obj - return objlist + return objlist*/ /datum/objective/crew/ var/jobs = "" diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 02a9808f48..34e20ceee9 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -66,6 +66,11 @@ SUBSYSTEM_DEF(ticker) var/modevoted = FALSE //Have we sent a vote for the gamemode? + //Crew Objective/Miscreant stuff + var/list/crewobjlist = list() + var/list/crewobjjobs = list() + var/list/miscreantobjlist = list() + /datum/controller/subsystem/ticker/Initialize(timeofday) load_mode() @@ -87,7 +92,7 @@ SUBSYSTEM_DEF(ticker) var/list/provisional_title_music = flist("config/title_music/sounds/") var/list/music = list() var/use_rare_music = prob(1) - + for(var/S in provisional_title_music) var/lower = lowertext(S) var/list/L = splittext(lower,"+") @@ -115,12 +120,20 @@ SUBSYSTEM_DEF(ticker) if(byond_sound_formats[ext]) continue music -= S - + if(isemptylist(music)) music = world.file2list(ROUND_START_MUSIC_LIST, "\n") login_music = pick(music) + crewobjlist = typesof(/datum/objective/crew) + miscreantobjlist = typesof(/datum/objective/miscreant) + for(var/hoorayhackyshit in crewobjlist) + var/datum/objective/crew/obj = hoorayhackyshit //dm is not a sane language in any way, shape, or form. + var/list/availableto = splittext(initial(obj.jobs),",") + for(var/job in availableto) + crewobjjobs["[job]"] += list(obj) + if(!GLOB.syndicate_code_phrase) GLOB.syndicate_code_phrase = generate_code_phrase() if(!GLOB.syndicate_code_response) @@ -519,11 +532,11 @@ SUBSYSTEM_DEF(ticker) if(!crewMind.current || !crewMind.objectives.len) continue for(var/datum/objective/miscreant/MO in crewMind.objectives) - miscreants += "[crewMind.current.real_name] (Played by: [crewMind.key])
Objective: [MO.explanation_text] (Optional)
" + miscreants += "[crewMind.current.real_name] (Played by: [crewMind.key])
Objective: [MO.explanation_text] (Optional)" for(var/datum/objective/crew/CO in crewMind.objectives) if(CO.check_completion()) to_chat(crewMind.current, "
Your optional objective: [CO.explanation_text] Success!") - successfulCrew += "[crewMind.current.real_name] (Played by: [crewMind.key])
Objective: [CO.explanation_text] Success! (Optional)
" + successfulCrew += "[crewMind.current.real_name] (Played by: [crewMind.key])
Objective: [CO.explanation_text] Success! (Optional)" else to_chat(crewMind.current, "
Your optional objective: [CO.explanation_text] Failed.") diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index b692ab2d32..1eb4ced083 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -375,7 +375,7 @@ if(GLOB.highlander) to_chat(humanc, "THERE CAN BE ONLY ONE!!!") humanc.make_scottish() - if(prob(2) && !issilicon(humanc) && !jobban_isbanned(humanc.mind, "Syndicate") && GLOB.miscreants_allowed && ROLE_MISCREANT in humanc.client.prefs.be_special) + if(prob(5) && !issilicon(humanc) && !jobban_isbanned(humanc.mind, "Syndicate") && GLOB.miscreants_allowed && ROLE_MISCREANT in humanc.client.prefs.be_special) SSticker.generate_miscreant_objectives(humanc.mind) else if(CONFIG_GET(flag/allow_crew_objectives)) From 1a3b0c6528c5627b7f5193382008d9848a709ae1 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Wed, 11 Oct 2017 18:07:08 -0400 Subject: [PATCH 2/3] applies optimizations to miscreants --- code/citadel/cit_miscreants.dm | 2 +- code/controllers/subsystem/ticker.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/citadel/cit_miscreants.dm b/code/citadel/cit_miscreants.dm index e658fad097..ec5ff0156f 100644 --- a/code/citadel/cit_miscreants.dm +++ b/code/citadel/cit_miscreants.dm @@ -11,7 +11,7 @@ return if(jobban_isbanned(crewMind, "Syndicate")) return - var/list/objectiveTypes = typesof(/datum/objective/miscreant) - /datum/objective/miscreant + var/list/objectiveTypes = miscreantobjlist if(!objectiveTypes.len) return var/selectedType = pick(objectiveTypes) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 34e20ceee9..2b3d1f9887 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -127,7 +127,7 @@ SUBSYSTEM_DEF(ticker) login_music = pick(music) crewobjlist = typesof(/datum/objective/crew) - miscreantobjlist = typesof(/datum/objective/miscreant) + miscreantobjlist = (typesof(/datum/objective/miscreant) - /datum/objective/miscreant) for(var/hoorayhackyshit in crewobjlist) var/datum/objective/crew/obj = hoorayhackyshit //dm is not a sane language in any way, shape, or form. var/list/availableto = splittext(initial(obj.jobs),",") From 2a46696e5547b79f50775b6b9efb8330162dede2 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Wed, 11 Oct 2017 18:26:10 -0400 Subject: [PATCH 3/3] cleans up comments --- code/citadel/cit_crewobjectives.dm | 10 ---------- code/controllers/subsystem/ticker.dm | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/code/citadel/cit_crewobjectives.dm b/code/citadel/cit_crewobjectives.dm index 5a5d0b2384..6afa92af65 100644 --- a/code/citadel/cit_crewobjectives.dm +++ b/code/citadel/cit_crewobjectives.dm @@ -17,7 +17,6 @@ if(!crewMind.assigned_role) return var/list/validobjs = crewobjjobs["[ckey(crewMind.assigned_role)]"] - //var/list/validobjs = get_valid_crew_objs(ckey(crewMind.assigned_role)) if(!validobjs || !validobjs.len) return var/selectedObj = pick(validobjs) @@ -29,15 +28,6 @@ to_chat(crewMind, "As a part of Nanotrasen's anti-tide efforts, you have been assigned an optional objective. It will be checked at the end of the shift. Performing traitorous acts in pursuit of your objective may result in termination of your employment.") to_chat(crewMind, "Your optional objective: [newObjective.explanation_text]") -/*/datum/controller/subsystem/ticker/proc/get_valid_crew_objs(var/job = "")//taken from old hippie with adjustments - var/list/objlist = list() - for(var/hoorayhackyshit in crewobjlist) - var/datum/objective/crew/obj = hoorayhackyshit //dm is not a sane language in any way, shape, or form. - var/list/availableto = splittext(initial(obj.jobs),",") - if(job in availableto) - objlist += obj - return objlist*/ - /datum/objective/crew/ var/jobs = "" explanation_text = "Yell on the development discussion channel on Citadels discord if this ever shows up. Something just broke here, dude" diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 2b3d1f9887..25e54aed64 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -128,7 +128,7 @@ SUBSYSTEM_DEF(ticker) crewobjlist = typesof(/datum/objective/crew) miscreantobjlist = (typesof(/datum/objective/miscreant) - /datum/objective/miscreant) - for(var/hoorayhackyshit in crewobjlist) + for(var/hoorayhackyshit in crewobjlist) //taken from old Hippie's "job2obj" proc with adjustments. var/datum/objective/crew/obj = hoorayhackyshit //dm is not a sane language in any way, shape, or form. var/list/availableto = splittext(initial(obj.jobs),",") for(var/job in availableto)