From d541d11a15f6f3e8312eb2cdac4b16c53ccb5e66 Mon Sep 17 00:00:00 2001 From: Jack Edge Date: Sat, 5 Jan 2019 13:04:49 +0000 Subject: [PATCH] Less special-casing for loving sprinkles and fancy security drinks --- code/__DEFINES/traits.dm | 1 + code/modules/food_and_drinks/food/snacks_pastry.dm | 2 +- code/modules/jobs/job_types/captain.dm | 5 ++--- code/modules/jobs/job_types/civilian.dm | 2 ++ code/modules/jobs/job_types/civilian_chaplain.dm | 1 + code/modules/jobs/job_types/job.dm | 5 +++++ code/modules/jobs/job_types/security.dm | 5 +++++ .../modules/reagents/chemistry/reagents/alcohol_reagents.dm | 6 ++++-- code/modules/reagents/chemistry/reagents/food_reagents.dm | 4 ++-- 9 files changed, 23 insertions(+), 8 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 18c7885a9c8..e8f04a19d6a 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -65,6 +65,7 @@ #define TRAIT_ABDUCTOR_TRAINING "abductor-training" #define TRAIT_ABDUCTOR_SCIENTIST_TRAINING "abductor-scientist-training" #define TRAIT_SURGEON "surgeon" +#define TRAIT_LAW_ENFORCEMENT_METABOLISM "law-enforcement-metabolism" //non-mob traits #define TRAIT_PARALYSIS "paralysis" //Used for limb-based paralysis, where replacing the limb will fix it diff --git a/code/modules/food_and_drinks/food/snacks_pastry.dm b/code/modules/food_and_drinks/food/snacks_pastry.dm index 9821823041e..f42e26b4907 100644 --- a/code/modules/food_and_drinks/food/snacks_pastry.dm +++ b/code/modules/food_and_drinks/food/snacks_pastry.dm @@ -35,7 +35,7 @@ if(last_check_time + 50 < world.time) if(ishuman(M)) var/mob/living/carbon/human/H = M - if(H.mind && H.mind.assigned_role == "Security Officer" && !H.has_trait(TRAIT_AGEUSIA)) + if(H.has_trait(TRAIT_LAW_ENFORCEMENT_METABOLISM && !H.has_trait(TRAIT_AGEUSIA)) to_chat(H,"I love this taste!") H.adjust_disgust(-5 + -2.5 * fraction) GET_COMPONENT_FROM(mood, /datum/component/mood, H) diff --git a/code/modules/jobs/job_types/captain.dm b/code/modules/jobs/job_types/captain.dm index b56a31fc79b..dcf8b0f2e5a 100755 --- a/code/modules/jobs/job_types/captain.dm +++ b/code/modules/jobs/job_types/captain.dm @@ -23,12 +23,11 @@ Captain paycheck = PAYCHECK_COMMAND paycheck_department = ACCOUNT_SEC + mind_traits = list(TRAIT_DISK_VERIFIER) + /datum/job/captain/get_access() return get_all_accesses() -/datum/job/captain/after_spawn(mob/living/H, mob/M, latejoin = FALSE) - H.mind.add_trait(TRAIT_DISK_VERIFIER, JOB_TRAIT) - /datum/job/captain/announce(mob/living/carbon/human/H) ..() SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, .proc/minor_announce, "Captain [H.real_name] on deck!")) diff --git a/code/modules/jobs/job_types/civilian.dm b/code/modules/jobs/job_types/civilian.dm index 1f6a981027e..bbd7a561071 100644 --- a/code/modules/jobs/job_types/civilian.dm +++ b/code/modules/jobs/job_types/civilian.dm @@ -21,6 +21,7 @@ Clown /datum/job/clown/after_spawn(mob/living/carbon/human/H, mob/M) + . = ..() H.apply_pref_name("clown", M.client) /datum/outfit/job/clown @@ -177,6 +178,7 @@ Lawyer minimal_access = list(ACCESS_LAWYER, ACCESS_COURT, ACCESS_SEC_DOORS) paycheck = PAYCHECK_EASY paycheck_department = ACCOUNT_CIV + mind_traits = list(TRAIT_LAW_ENFORCEMENT_METABOLISM) /datum/outfit/job/lawyer diff --git a/code/modules/jobs/job_types/civilian_chaplain.dm b/code/modules/jobs/job_types/civilian_chaplain.dm index 12c9d5be391..fe256b734a7 100644 --- a/code/modules/jobs/job_types/civilian_chaplain.dm +++ b/code/modules/jobs/job_types/civilian_chaplain.dm @@ -22,6 +22,7 @@ Chaplain /datum/job/chaplain/after_spawn(mob/living/H, mob/M) + . = ..() if(H.mind) H.mind.isholy = TRUE diff --git a/code/modules/jobs/job_types/job.dm b/code/modules/jobs/job_types/job.dm index 59ea5c00fc4..63537eafe44 100644 --- a/code/modules/jobs/job_types/job.dm +++ b/code/modules/jobs/job_types/job.dm @@ -55,10 +55,15 @@ var/paycheck = PAYCHECK_MINIMAL var/paycheck_department = ACCOUNT_CIV + var/list/mind_traits // Traits added to the mind of the mob assigned this job + //Only override this proc //H is usually a human unless an /equip override transformed it /datum/job/proc/after_spawn(mob/living/H, mob/M, latejoin = FALSE) //do actions on H but send messages to M as the key may not have been transferred_yet + if(mind_traits) + for(var/t in mind_traits) + H.mind.add_trait(t, JOB_TRAIT) /datum/job/proc/announce(mob/living/carbon/human/H) if(head_announce) diff --git a/code/modules/jobs/job_types/security.dm b/code/modules/jobs/job_types/security.dm index 1914ef2a9cb..dc7524ce60b 100644 --- a/code/modules/jobs/job_types/security.dm +++ b/code/modules/jobs/job_types/security.dm @@ -25,6 +25,7 @@ Head of Security exp_type_department = EXP_TYPE_SECURITY outfit = /datum/outfit/job/hos + mind_traits = list(TRAIT_LAW_ENFORCEMENT_METABOLISM) access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_COURT, ACCESS_WEAPONS, ACCESS_MECH_SECURITY, ACCESS_FORENSICS_LOCKERS, ACCESS_MORGUE, ACCESS_MAINT_TUNNELS, ACCESS_ALL_PERSONAL_LOCKERS, @@ -94,6 +95,7 @@ Warden minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_MECH_SECURITY, ACCESS_COURT, ACCESS_WEAPONS, ACCESS_MINERAL_STOREROOM) //SEE /DATUM/JOB/WARDEN/GET_ACCESS() paycheck = PAYCHECK_HARD paycheck_department = ACCOUNT_SEC + mind_traits = list(TRAIT_LAW_ENFORCEMENT_METABOLISM) /datum/job/warden/get_access() var/list/L = list() @@ -149,6 +151,7 @@ Detective minimal_access = list(ACCESS_SEC_DOORS, ACCESS_FORENSICS_LOCKERS, ACCESS_MORGUE, ACCESS_MAINT_TUNNELS, ACCESS_MECH_SECURITY, ACCESS_COURT, ACCESS_BRIG, ACCESS_WEAPONS, ACCESS_MINERAL_STOREROOM) paycheck = PAYCHECK_MEDIUM paycheck_department = ACCOUNT_SEC + mind_traits = list(TRAIT_LAW_ENFORCEMENT_METABOLISM) /datum/outfit/job/detective name = "Detective" @@ -204,6 +207,7 @@ Security Officer minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_COURT, ACCESS_WEAPONS, ACCESS_MECH_SECURITY, ACCESS_MINERAL_STOREROOM) //BUT SEE /DATUM/JOB/OFFICER/GET_ACCESS() paycheck = PAYCHECK_HARD paycheck_department = ACCOUNT_SEC + mind_traits = list(TRAIT_LAW_ENFORCEMENT_METABOLISM) /datum/job/officer/get_access() var/list/L = list() @@ -213,6 +217,7 @@ Security Officer GLOBAL_LIST_INIT(available_depts, list(SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, SEC_DEPT_SCIENCE, SEC_DEPT_SUPPLY)) /datum/job/officer/after_spawn(mob/living/carbon/human/H, mob/M) + . = ..() // Assign department security var/department if(M && M.client && M.client.prefs) diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 5e058aa2f26..4eb0f5c10cc 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -1479,7 +1479,8 @@ All effects don't start immediately, but rather get worse over time; the rate is glass_desc = "An intimidating and lawful beverage dares you to violate the law and make its day. Still can't drink it on duty, though." /datum/reagent/consumable/ethanol/quadruple_sec/on_mob_life(mob/living/carbon/M) - if(M.mind && M.mind.assigned_role in list("Security Officer", "Detective", "Head of Security", "Warden", "Lawyer")) //Securidrink in line with the screwderiver for engineers or nothing for mimes. + //Securidrink in line with the Screwdriver for engineers or Nothing for mimes + if(M.has_trait(TRAIT_LAW_ENFORCEMENT_METABOLISM)) M.heal_bodypart_damage(1, 1) M.adjustBruteLoss(-2,0) . = 1 @@ -1498,7 +1499,8 @@ All effects don't start immediately, but rather get worse over time; the rate is glass_desc = "Now you are become law, destroyer of clowns." /datum/reagent/consumable/ethanol/quintuple_sec/on_mob_life(mob/living/carbon/M) - if(M.mind && M.mind.assigned_role in list("Security Officer", "Detective", "Head of Security", "Warden", "Lawyer")) //Securidrink in line with the screwderiver for engineers or nothing for mimes but STRONG.. + //Securidrink in line with the Screwdriver for engineers or Nothing for mimes but STRONG.. + if(M.has_trait(TRAIT_LAW_ENFORCEMENT_METABOLISM)) M.heal_bodypart_damage(2,2,2) M.adjustBruteLoss(-5,0) M.adjustOxyLoss(-5,0) diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 8b14cc11442..9c0f83d9d61 100755 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -410,7 +410,7 @@ taste_description = "childhood whimsy" /datum/reagent/consumable/sprinkles/on_mob_life(mob/living/carbon/M) - if(ishuman(M) && M.job in list("Security Officer", "Head of Security", "Detective", "Warden")) + if(M.has_trait(TRAIT_LAW_ENFORCEMENT_METABOLISM)) M.heal_bodypart_damage(1,1, 0) . = 1 ..() @@ -708,4 +708,4 @@ else if(prob(25)) //scp13 optimization M.electrocute_act(rand(10,15), "Liquid Electricity in their body", 1) //lmao at the newbs who eat energy bars playsound(M, "sparks", 50, 1) - return ..() \ No newline at end of file + return ..()