Merge pull request #3307 from deathride58/crewobjtweaksgalore

Crew Obj & Miscreant system optimizations and tweaks
This commit is contained in:
LetterJay
2017-10-12 07:16:13 -04:00
committed by GitHub
4 changed files with 21 additions and 18 deletions
+2 -12
View File
@@ -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,7 @@
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)]"]
if(!validobjs || !validobjs.len)
return
var/selectedObj = pick(validobjs)
@@ -28,16 +28,6 @@
to_chat(crewMind, "<B>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. <font color=red>Performing traitorous acts in pursuit of your objective may result in termination of your employment.</font></B>")
to_chat(crewMind, "<B>Your optional objective:</B> [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)
var/list/objlist = list()
for(var/hoorayhackyshit in objpaths)
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"
+1 -1
View File
@@ -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)
+17 -4
View File
@@ -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,7 +120,7 @@ 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)
@@ -123,6 +128,14 @@ SUBSYSTEM_DEF(ticker)
login_music = "config/title_music/sounds/[pick(music)]"
crewobjlist = typesof(/datum/objective/crew)
miscreantobjlist = (typesof(/datum/objective/miscreant) - /datum/objective/miscreant)
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)
crewobjjobs["[job]"] += list(obj)
if(!GLOB.syndicate_code_phrase)
GLOB.syndicate_code_phrase = generate_code_phrase()
if(!GLOB.syndicate_code_response)
@@ -521,11 +534,11 @@ SUBSYSTEM_DEF(ticker)
if(!crewMind.current || !crewMind.objectives.len)
continue
for(var/datum/objective/miscreant/MO in crewMind.objectives)
miscreants += "<B>[crewMind.current.real_name]</B> (Played by: <B>[crewMind.key]</B>)<BR><B>Objective</B>: [MO.explanation_text] <font color='grey'>(Optional)</font><BR>"
miscreants += "<B>[crewMind.current.real_name]</B> (Played by: <B>[crewMind.key]</B>)<BR><B>Objective</B>: [MO.explanation_text] <font color='grey'>(Optional)</font>"
for(var/datum/objective/crew/CO in crewMind.objectives)
if(CO.check_completion())
to_chat(crewMind.current, "<br><B>Your optional objective</B>: [CO.explanation_text] <font color='green'><B>Success!</B></font>")
successfulCrew += "<B>[crewMind.current.real_name]</B> (Played by: <B>[crewMind.key]</B>)<BR><B>Objective</B>: [CO.explanation_text] <font color='green'><B>Success!</B></font> <font color='grey'>(Optional)</font><BR>"
successfulCrew += "<B>[crewMind.current.real_name]</B> (Played by: <B>[crewMind.key]</B>)<BR><B>Objective</B>: [CO.explanation_text] <font color='green'><B>Success!</B></font> <font color='grey'>(Optional)</font>"
else
to_chat(crewMind.current, "<br><B>Your optional objective</B>: [CO.explanation_text] <font color='red'><B>Failed.</B></font>")
@@ -375,7 +375,7 @@
if(GLOB.highlander)
to_chat(humanc, "<span class='userdanger'><i>THERE CAN BE ONLY ONE!!!</i></span>")
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))