Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hazard Joe Emotes #6005

Merged
merged 18 commits into from
Mar 26, 2024
6 changes: 6 additions & 0 deletions code/__DEFINES/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@
#define EMOTE_IMPORTANT (1<<2)
/// Does the emote not have a message?
#define EMOTE_NO_MESSAGE (1<<3)

// Bitflags for Working Joe emotes
/// Working Joe emote
#define WORKING_JOE_EMOTE (1<<0)
/// Hazard Joe emote
#define HAZARD_JOE_EMOTE (1<<1)
1 change: 1 addition & 0 deletions code/__DEFINES/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
#define SYNTH_COMBAT "Combat Synthetic"
#define SYNTH_INFILTRATOR "Infiltrator Synthetic"
#define SYNTH_WORKING_JOE "Working Joe"
#define SYNTH_HAZARD_JOE "Hazard Joe"
#define SYNTH_GEN_ONE "First Generation Synthetic"
#define SYNTH_GEN_TWO "Second Generation Synthetic"
#define SYNTH_GEN_THREE "Third Generation Synthetic"
Expand Down
3 changes: 2 additions & 1 deletion code/__DEFINES/typecheck/humanoids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#define isSEA(A) (ishuman(A) && A.job == "Senior Enlisted Advisor")
#define issynth(A) (ishuman(A) && istype(A?:species, /datum/species/synthetic))
#define iscolonysynthetic(A) (ishuman(A) && istype(A?:species, /datum/species/synthetic/colonial))
#define isworkingjoe(A) (iscolonysynthetic(A) && A.job == JOB_WORKING_JOE)
#define isworkingjoe(A) (ishuman(A) && istype(A?:species, /datum/species/synthetic/colonial/working_joe))
#define ishazardjoe(A) (ishuman(A) && istype(A?:species, /datum/species/synthetic/colonial/working_joe/hazard))
#define isinfiltratorsynthetic(A) (ishuman(A) && istype(A?:species, /datum/species/synthetic/infiltrator))

//Specic group checks, use instead of typechecks (but use traits instead)
Expand Down
35 changes: 35 additions & 0 deletions code/_globalvars/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,15 @@ GLOBAL_LIST_INIT(typecache_living, typecacheof(/mob/living))

GLOBAL_LIST_INIT(emote_list, init_emote_list())

/// list of categories for working joes
GLOBAL_LIST_EMPTY(wj_categories)
/// dict ("category" : (emotes)) of every wj emote typepath
GLOBAL_LIST_INIT(wj_emotes, setup_working_joe_emotes())
/// list of categories for hazard joes
GLOBAL_LIST_EMPTY(hj_categories)
/// dict ("category" : (emotes)) of every hj emote typepath
GLOBAL_LIST_INIT(hj_emotes, setup_hazard_joe_emotes())

/proc/cached_params_decode(params_data, decode_proc)
. = GLOB.paramslist_cache[params_data]
if(!.)
Expand Down Expand Up @@ -517,6 +526,32 @@ GLOBAL_LIST_INIT(available_specialist_kit_boxes, list(
else
.[E.key_third_person] |= E

/// Setup for Working joe emotes and category list, returns data for wj_emotes
/proc/setup_working_joe_emotes()
var/list/emotes_to_add = list()
for(var/datum/emote/living/carbon/human/synthetic/working_joe/emote as anything in subtypesof(/datum/emote/living/carbon/human/synthetic/working_joe))
if(!(initial(emote.joe_flag) & WORKING_JOE_EMOTE) || !initial(emote.key) || !initial(emote.say_message))
continue

if(!(initial(emote.category) in GLOB.wj_categories))
GLOB.wj_categories += initial(emote.category)

emotes_to_add += emote
return emotes_to_add

/// Setup for Hazard joe emotes and category list, returns data for hj_emotes
/proc/setup_hazard_joe_emotes()
var/list/emotes_to_add = list()
for(var/datum/emote/living/carbon/human/synthetic/working_joe/emote as anything in subtypesof(/datum/emote/living/carbon/human/synthetic/working_joe))
if(!(initial(emote.joe_flag) & HAZARD_JOE_EMOTE) || !initial(emote.key) || !initial(emote.say_message))
continue

if(!(initial(emote.category) in GLOB.hj_categories))
GLOB.hj_categories += initial(emote.category)

emotes_to_add += emote
return emotes_to_add

GLOBAL_LIST_EMPTY(topic_tokens)
GLOBAL_PROTECT(topic_tokens)

Expand Down
22 changes: 21 additions & 1 deletion code/modules/gear_presets/synths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,30 @@
rank = JOB_WORKING_JOE
skills = /datum/skills/working_joe
languages = list(LANGUAGE_ENGLISH, LANGUAGE_APOLLO, LANGUAGE_RUSSIAN, LANGUAGE_JAPANESE, LANGUAGE_GERMAN, LANGUAGE_SPANISH, LANGUAGE_CHINESE)
/// Used to set species when loading race
var/joe_type = SYNTH_WORKING_JOE

/datum/equipment_preset/synth/working_joe/New()
. = ..()
access = get_access(ACCESS_LIST_GLOBAL)

/datum/equipment_preset/synth/working_joe/load_race(mob/living/carbon/human/new_human)
new_human.set_species(SYNTH_WORKING_JOE)
. = ..()
new_human.set_species(joe_type)
new_human.h_style = "Bald"
new_human.f_style = "Shaved"
if(prob(5))
new_human.grad_style = "None" //No gradients for Working Joes
new_human.h_style = "Shoulder-length Hair" //Added the chance of hair as per Monkeyfist lore accuracy
new_human.r_eyes = 0
new_human.g_eyes = 0
new_human.b_eyes = 0
new_human.r_hair = 100
new_human.g_hair = 88
new_human.b_hair = 74
new_human.r_facial = 255
new_human.g_facial = 255
new_human.b_facial = 255

/datum/equipment_preset/synth/working_joe/load_vanity(mob/living/carbon/human/new_human)
return
Expand Down Expand Up @@ -531,6 +548,7 @@

/datum/equipment_preset/synth/working_joe/engi
name = "Synthetic - Hazmat Joe"
joe_type = SYNTH_HAZARD_JOE

/datum/equipment_preset/synth/working_joe/engi/load_gear(mob/living/carbon/human/new_human)
var/choice = rand(1,2)
Expand Down Expand Up @@ -559,8 +577,10 @@
new_human.equip_to_slot_or_del(new /obj/item/stack/sheet/metal/large_stack(new_human.back), WEAR_IN_R_STORE)
new_human.equip_to_slot_or_del(new /obj/item/stack/sheet/glass/reinforced/large_stack(new_human.back), WEAR_IN_R_STORE)


/datum/equipment_preset/synth/working_joe/load_race(mob/living/carbon/human/new_human)
. = ..()
new_human.set_species(joe_type)
new_human.h_style = "Bald"
new_human.f_style = "Shaved"
if(prob(5))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@
var/category = ""
/// Override text for the emote to be displayed in the WJ emote panel
var/override_say = ""
/// Path to hazard joe variant sound
var/haz_sound
/// What Working Joe types can use this emote
var/joe_flag = WORKING_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/get_sound(mob/living/user)
if(ishazardjoe(user) && haz_sound)
return haz_sound
return sound
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
hair_color = "#000000"
icobase = 'icons/mob/humans/species/r_synthetic.dmi'
deform = 'icons/mob/humans/species/r_synthetic.dmi'
/// Used to assign which variant of emote_panel to give to user
var/emote_panel_type = /datum/joe_emote_panel

/datum/species/synthetic/colonial/working_joe/hazard
name = SYNTH_HAZARD_JOE //TECHNICALLY the proper name would be Hazard Working Joes, but we will stick with Hazard Joe for now
name_plural = "Hazard Joes"
emote_panel_type = /datum/joe_emote_panel/hazard

/datum/species/synthetic/colonial/working_joe/handle_post_spawn(mob/living/carbon/human/joe)
. = ..()
Expand All @@ -23,10 +30,9 @@

/// Open the WJ's emote panel, which allows them to use voicelines
/datum/species/synthetic/colonial/working_joe/open_emote_panel()
var/datum/joe_emote_panel/ui = new(usr)
var/datum/joe_emote_panel/ui = new emote_panel_type(usr)
ui.ui_interact(usr)


/datum/action/joe_emote_panel
name = "Open Voice Synthesizer"
action_icon_state = "looc_toggle"
Expand All @@ -53,30 +59,8 @@


/datum/joe_emote_panel
/// Static dict ("category" : (emotes)) of every wj emote typepath
var/static/list/wj_emotes
/// Static list of categories
var/static/list/wj_categories = list()
/// Panel allows you to spam, so a manual CD is added here
COOLDOWN_DECLARE(panel_emote_cooldown)


/datum/joe_emote_panel/New()
if(!length(wj_emotes))
var/list/emotes_to_add = list()
for(var/datum/emote/living/carbon/human/synthetic/working_joe/emote as anything in subtypesof(/datum/emote/living/carbon/human/synthetic/working_joe))
if(!initial(emote.key) || !initial(emote.say_message))
continue

if(!(initial(emote.category) in wj_categories))
wj_categories += initial(emote.category)

emotes_to_add += emote


wj_emotes = emotes_to_add


/datum/joe_emote_panel/proc/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
Expand All @@ -99,10 +83,26 @@
/datum/joe_emote_panel/ui_static_data(mob/user)
var/list/data = list()

data["categories"] = wj_categories
data["categories"] = GLOB.wj_categories
data["emotes"] = list()

for(var/datum/emote/living/carbon/human/synthetic/working_joe/emote as anything in GLOB.wj_emotes)
data["emotes"] += list(list(
"id" = initial(emote.key),
"text" = (initial(emote.override_say) || initial(emote.say_message)),
"category" = initial(emote.category),
"path" = "[emote]",
))

return data

/datum/joe_emote_panel/hazard/ui_static_data(mob/user)
var/list/data = list()

data["categories"] = GLOB.hj_categories
data["emotes"] = list()

for(var/datum/emote/living/carbon/human/synthetic/working_joe/emote as anything in wj_emotes)
for(var/datum/emote/living/carbon/human/synthetic/working_joe/emote as anything in GLOB.hj_emotes)
data["emotes"] += list(list(
"id" = initial(emote.key),
"text" = (initial(emote.override_say) || initial(emote.say_message)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,34 @@
/datum/emote/living/carbon/human/synthetic/working_joe/damage/damage
key = "damage"
sound = 'sound/voice/joe/damage.ogg'
haz_sound = 'sound/voice/joe/damage_haz.ogg'
say_message = "Do not damage Seegson property."
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/damage/that_stings
key = "thatstings"
sound = 'sound/voice/joe/that_stings.ogg'
haz_sound = 'sound/voice/joe/that_stings_haz.ogg'
say_message = "That stings."
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/damage/irresponsible
key = "irresponsible"
sound = 'sound/voice/joe/irresponsible.ogg'
haz_sound = 'sound/voice/joe/irresponsible_haz.ogg'
say_message = "That was irresponsible."
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/damage/this_is_futile
key = "thisisfutile"
sound = 'sound/voice/joe/this_is_futile.ogg'
haz_sound = 'sound/voice/joe/this_is_futile_haz.ogg'
say_message = "This is futile."
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/damage/really
key = "really"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
/datum/emote/living/carbon/human/synthetic/working_joe/farewell/day_never_done
key = "dayneverdone"
sound = 'sound/voice/joe/day_never_done.ogg'
haz_sound = 'sound/voice/joe/day_never_done_haz.ogg'
say_message = "A synthetic's day is never done."
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/farewell/returning_to_tasks
key = "returningtotasks"
Expand All @@ -40,20 +42,26 @@
/datum/emote/living/carbon/human/synthetic/working_joe/farewell/back_to_work
key = "backtowork"
sound = 'sound/voice/joe/back_to_work.ogg'
haz_sound = 'sound/voice/joe/back_to_work_haz.ogg'
say_message = "Back to work."
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/farewell/other_concerns
key = "otherconcerns"
sound = 'sound/voice/joe/other_concerns.ogg'
haz_sound = 'sound/voice/joe/other_concerns_haz.ogg'
say_message = "I have other concerns."
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/farewell/more_pressing_matters
key = "morepressingmatters"
sound = 'sound/voice/joe/more_pressing_matters.ogg'
haz_sound = 'sound/voice/joe/more_pressing_matters_haz.ogg'
say_message = "There are more pressing matters."
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/farewell/gone_inconsiderate
key = "gone"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,23 @@
/datum/emote/living/carbon/human/synthetic/working_joe/fire/temperatures
key = "temperatures"
sound = 'sound/voice/joe/temperatures.ogg'
haz_sound = 'sound/voice/joe/temperatures_haz.ogg'
say_message = "I am built to withstand temperatures of up to 1210 degrees."
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/fire/fire
key = "fire"
sound = 'sound/voice/joe/fire.ogg'
haz_sound = 'sound/voice/joe/fire_haz.ogg'
say_message = "Only wild animals fear fire."
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/fire/unprotected_flames
key = "unprotectedflames"
sound = 'sound/voice/joe/unprotected_flames.ogg'
haz_sound = 'sound/voice/joe/unprotected_flames_haz.ogg'
say_message = "Unprotected flames are extremely dangerous and entirely unadvisable."
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
/datum/emote/living/carbon/human/synthetic/working_joe/greeting/good_day
key = "goodday"
sound = 'sound/voice/joe/good_day.ogg'
haz_sound = 'sound/voice/joe/good_day_haz.ogg'
say_message = "Good day."
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/greeting/how_are_you
key = "howareyou"
Expand All @@ -22,8 +24,10 @@
/datum/emote/living/carbon/human/synthetic/working_joe/greeting/how_can_i_help
key = "howcanihelp"
sound = 'sound/voice/joe/how_can_i_help.ogg'
haz_sound = 'sound/voice/joe/how_can_i_help_haz.ogg'
say_message = "How can I help you?"
emote_type = EMOTE_AUDIBLE|EMOTE_VISIBLE
joe_flag = WORKING_JOE_EMOTE|HAZARD_JOE_EMOTE

/datum/emote/living/carbon/human/synthetic/working_joe/greeting/need_to_know
key = "needtoknow"
Expand Down
Loading
Loading