From b39ae815f314d26b2847d91afa1babb3556ce252 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Fri, 13 Dec 2019 16:12:04 +0100 Subject: [PATCH] Porting several quirks code updates. --- code/__HELPERS/cmp.dm | 20 ++++- code/__HELPERS/unsorted.dm | 10 ++- .../subsystem/processing/quirks.dm | 30 +++++--- code/controllers/subsystem/ticker.dm | 4 +- code/datums/components/mood.dm | 9 --- code/datums/datacore.dm | 2 +- code/datums/datumvars.dm | 26 +++++++ code/datums/traits/good.dm | 20 +++++ code/datums/traits/negative.dm | 13 +++- code/datums/traits/neutral.dm | 6 +- code/modules/client/preferences.dm | 75 ++++++++----------- code/modules/client/preferences_savefile.dm | 11 --- code/modules/hydroponics/grown/replicapod.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 1 + code/modules/mob/living/status_procs.dm | 30 ++++---- .../chemistry/reagents/other_reagents.dm | 2 +- 16 files changed, 163 insertions(+), 98 deletions(-) diff --git a/code/__HELPERS/cmp.dm b/code/__HELPERS/cmp.dm index f7131e63fa..4a86f57fcd 100644 --- a/code/__HELPERS/cmp.dm +++ b/code/__HELPERS/cmp.dm @@ -95,4 +95,22 @@ GLOBAL_VAR_INIT(cmp_field, "name") return sorttext(A.sample_object.name, B.sample_object.name) /proc/cmp_numbered_displays_name_dsc(datum/numbered_display/A, datum/numbered_display/B) - return sorttext(B.sample_object.name, A.sample_object.name) \ No newline at end of file + return sorttext(B.sample_object.name, A.sample_object.name) + +/proc/cmp_quirk_asc(datum/quirk/A, datum/quirk/B) + var/a_sign = num2sign(initial(A.value) * -1) + var/b_sign = num2sign(initial(B.value) * -1) + + // Neutral traits go last. + if(a_sign == 0) + a_sign = 2 + if(b_sign == 0) + b_sign = 2 + + var/a_name = initial(A.name) + var/b_name = initial(B.name) + + if(a_sign != b_sign) + return a_sign - b_sign + else + return sorttext(b_name, a_name) \ No newline at end of file diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 9abe42ea8e..29f5331fd3 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1548,4 +1548,12 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) /proc/CallAsync(datum/source, proctype, list/arguments) set waitfor = FALSE - return call(source, proctype)(arglist(arguments)) \ No newline at end of file + return call(source, proctype)(arglist(arguments)) + +/proc/num2sign(numeric) + if(numeric > 0) + return 1 + else if(numeric < 0) + return -1 + else + return 0 diff --git a/code/controllers/subsystem/processing/quirks.dm b/code/controllers/subsystem/processing/quirks.dm index 4af54b8c70..f96690126a 100644 --- a/code/controllers/subsystem/processing/quirks.dm +++ b/code/controllers/subsystem/processing/quirks.dm @@ -12,27 +12,40 @@ PROCESSING_SUBSYSTEM_DEF(quirks) var/list/quirk_names_by_path = list() var/list/quirk_points = list() //Assoc. list of quirk names and their "point cost"; positive numbers are good traits, and negative ones are bad var/list/quirk_objects = list() //A list of all quirk objects in the game, since some may process + var/list/quirk_blacklist = list() //A list a list of quirks that can not be used with each other. Format: list(quirk1,quirk2),list(quirk3,quirk4) /datum/controller/subsystem/processing/quirks/Initialize(timeofday) if(!quirks.len) SetupQuirks() + quirk_blacklist = list(list("Blind","Nearsighted"),list("Jolly","Depression","Apathetic"),list("Ageusia","Deviant Tastes"),list("Ananas Affinity","Ananas Aversion")) return ..() /datum/controller/subsystem/processing/quirks/proc/SetupQuirks() - for(var/V in subtypesof(/datum/quirk)) +// Sort by Positive, Negative, Neutral; and then by name + var/list/quirk_list = sortList(subtypesof(/datum/quirk), /proc/cmp_quirk_asc) + + for(var/V in quirk_list) var/datum/quirk/T = V quirks[initial(T.name)] = T quirk_points[initial(T.name)] = initial(T.value) quirk_names_by_path[T] = initial(T.name) /datum/controller/subsystem/processing/quirks/proc/AssignQuirks(mob/living/user, client/cli, spawn_effects, roundstart = FALSE, datum/job/job, silent = FALSE, mob/to_chat_target) - GenerateQuirks(cli) - var/list/quirks = cli.prefs.character_quirks.Copy() + var/badquirk = FALSE + var/list/my_quirks = cli.prefs.all_quirks.Copy() var/list/cut - if(job && job.blacklisted_quirks) + if(job?.blacklisted_quirks) cut = filter_quirks(quirks, job) - for(var/V in quirks) - user.add_quirk(V, spawn_effects) + for(var/V in my_quirks) + var/datum/quirk/Q = quirks[V] + if(Q) + user.add_quirk(Q, spawn_effects) + else + stack_trace("Invalid quirk \"[V]\" in client [cli.ckey] preferences") + cli.prefs.all_quirks -= V + badquirk = TRUE + if(badquirk) + cli.prefs.save_character() if(!silent && LAZYLEN(cut)) to_chat(to_chat_target || user, "All of your non-neutral character quirks have been cut due to these quirks conflicting with your job assignment: [english_list(cut)].") @@ -85,8 +98,3 @@ PROCESSING_SUBSYSTEM_DEF(quirks) quirks -= i return cut - -/datum/controller/subsystem/processing/quirks/proc/GenerateQuirks(client/user) - if(user.prefs.character_quirks.len) - return - user.prefs.character_quirks = user.prefs.all_quirks diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 6f619fef0b..890725fbb1 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -384,8 +384,8 @@ SUBSYSTEM_DEF(ticker) captainless=0 if(player.mind.assigned_role != player.mind.special_role) SSjob.EquipRank(N, player.mind.assigned_role, 0) - if(CONFIG_GET(flag/roundstart_traits) && ishuman(N.new_character)) - SSquirks.AssignQuirks(N.new_character, N.client, TRUE, TRUE, SSjob.GetJob(player.mind.assigned_role), FALSE, N) + if(CONFIG_GET(flag/roundstart_traits) && ishuman(N.new_character)) + SSquirks.AssignQuirks(N.new_character, N.client, TRUE, TRUE, SSjob.GetJob(player.mind.assigned_role), FALSE, N) CHECK_TICK if(captainless) for(var/mob/dead/new_player/N in GLOB.player_list) diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index a0e6f97de0..2ecd77546d 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -150,15 +150,6 @@ if(9) setSanity(sanity+0.4, maximum=SANITY_GREAT) - if(HAS_TRAIT(owner, TRAIT_DEPRESSION)) - if(prob(0.05)) - add_event(null, "depression", /datum/mood_event/depression) - clear_event(null, "jolly") - if(HAS_TRAIT(owner, TRAIT_JOLLY)) - if(prob(0.05)) - add_event(null, "jolly", /datum/mood_event/jolly) - clear_event(null, "depression") - HandleNutrition(owner) /datum/component/mood/proc/setSanity(amount, minimum=SANITY_INSANE, maximum=SANITY_NEUTRAL)//I'm sure bunging this in here will have no negative repercussions. diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 60bb24c8c2..cf33fa3633 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -255,7 +255,7 @@ M.fields["alg_d"] = "No allergies have been detected in this patient." M.fields["cdi"] = "None" M.fields["cdi_d"] = "No diseases have been diagnosed at the moment." - M.fields["notes"] = "No notes." + M.fields["notes"] = H.get_trait_string(medical) medical += M //Security Record diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index e44134f01f..feac1de972 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -1398,3 +1398,29 @@ var/mob/living/carbon/human/H = locate(href_list["copyoutfit"]) in GLOB.carbon_list if(istype(H)) H.copy_outfit() + else if(href_list["modquirks"]) + if(!check_rights(R_SPAWN)) + return + + var/mob/living/carbon/human/H = locate(href_list["modquirks"]) in GLOB.mob_list + if(!istype(H)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") + return + + var/list/options = list("Clear"="Clear") + for(var/x in subtypesof(/datum/quirk)) + var/datum/quirk/T = x + var/qname = initial(T.name) + options[H.has_quirk(T) ? "[qname] (Remove)" : "[qname] (Add)"] = T + + var/result = input(usr, "Choose quirk to add/remove","Quirk Mod") as null|anything in options + if(result) + if(result == "Clear") + for(var/datum/quirk/q in H.roundstart_quirks) + H.remove_quirk(q.type) + else + var/T = options[result] + if(H.has_quirk(T)) + H.remove_quirk(T) + else + H.add_quirk(T,TRUE) diff --git a/code/datums/traits/good.dm b/code/datums/traits/good.dm index 09a4f0b060..15ac70a2c7 100644 --- a/code/datums/traits/good.dm +++ b/code/datums/traits/good.dm @@ -8,12 +8,14 @@ mob_trait = TRAIT_ALCOHOL_TOLERANCE gain_text = "You feel like you could drink a whole keg!" lose_text = "You don't feel as resistant to alcohol anymore. Somehow." + medical_record_text = "Patient demonstrates a high tolerance for alcohol." /datum/quirk/apathetic name = "Apathetic" desc = "You just don't care as much as other people. That's nice to have in a place like this, I guess." value = 1 mood_quirk = TRUE + medical_record_text = "Patient was administered the Apathy Evaluation Scale but did not bother to complete it." /datum/quirk/apathetic/add() var/datum/component/mood/mood = quirk_holder.GetComponent(/datum/component/mood) @@ -42,6 +44,7 @@ mob_trait = TRAIT_EMPATH gain_text = "You feel in tune with those around you." lose_text = "You feel isolated from others." + medical_record_text = "Patient is highly perceptive of and sensitive to social cues, or may possibly have ESP. Further testing needed." /datum/quirk/freerunning name = "Freerunning" @@ -50,6 +53,7 @@ mob_trait = TRAIT_FREERUNNING gain_text = "You feel lithe on your feet!" lose_text = "You feel clumsy again." + medical_record_text = "Patient scored highly on cardio tests." /datum/quirk/friendly name = "Friendly" @@ -59,6 +63,7 @@ gain_text = "You want to hug someone." lose_text = "You no longer feel compelled to hug others." mood_quirk = TRUE + medical_record_text = "Patient demonstrates low-inhibitions for physical contact and well-developed arms. Requesting another doctor take over this case." /datum/quirk/jolly name = "Jolly" @@ -66,6 +71,11 @@ value = 1 mob_trait = TRAIT_JOLLY mood_quirk = TRUE + medical_record_text = "Patient demonstrates constant euthymia irregular for environment. It's a bit much, to be honest." + +/datum/quirk/jolly/on_process() + if(prob(0.05)) + SEND_SIGNAL(quirk_holder, COMSIG_ADD_MOOD_EVENT, "jolly", /datum/mood_event/jolly) /datum/quirk/light_step name = "Light Step" @@ -74,6 +84,7 @@ mob_trait = TRAIT_LIGHT_STEP gain_text = "You walk with a little more litheness." lose_text = "You start tromping around like a barbarian." + medical_record_text = "Patient's dexterity belies a strong capacity for stealth." /datum/quirk/quick_step name = "Quick Step" @@ -82,6 +93,7 @@ mob_trait = TRAIT_SPEEDY_STEP gain_text = "You feel determined. No time to lose." lose_text = "You feel less determined. What's the rush, man?" + medical_record_text = "Patient scored highly on racewalking tests." /datum/quirk/musician name = "Musician" @@ -90,6 +102,7 @@ mob_trait = TRAIT_MUSICIAN gain_text = "You know everything about musical instruments." lose_text = "You forget how musical instruments work." + medical_record_text = "Patient brain scans show a highly-developed auditory pathway." /datum/quirk/musician/on_spawn() var/mob/living/carbon/human/H = quirk_holder @@ -108,6 +121,7 @@ mob_trait = TRAIT_PHOTOGRAPHER gain_text = "You know everything about photography." lose_text = "You forget how photo cameras work." + medical_record_text = "Patient mentions photography as a stress-relieving hobby." /datum/quirk/photographer/on_spawn() var/mob/living/carbon/human/H = quirk_holder @@ -121,12 +135,14 @@ desc = "You know your body well, and can accurately assess the extent of your wounds." value = 2 mob_trait = TRAIT_SELF_AWARE + medical_record_text = "Patient demonstrates an uncanny knack for self-diagnosis." /datum/quirk/skittish name = "Skittish" desc = "You can conceal yourself in danger. Ctrl-shift-click a closed locker to jump into it, as long as you have access." value = 2 mob_trait = TRAIT_SKITTISH + medical_record_text = "Patient demonstrates a high aversion to danger and has described hiding in containers out of fear." /datum/quirk/spiritual name = "Spiritual" @@ -135,6 +151,7 @@ mob_trait = TRAIT_SPIRITUAL gain_text = "You feel a little more faithful to the gods today." lose_text = "You feel less faithful in the gods." + medical_record_text = "Patient reports a belief in a higher power." /datum/quirk/tagger name = "Tagger" @@ -143,6 +160,7 @@ mob_trait = TRAIT_TAGGER gain_text = "You know how to tag walls efficiently." lose_text = "You forget how to tag walls properly." + medical_record_text = "Patient was recently seen for possible paint huffing incident." /datum/quirk/tagger/on_spawn() var/mob/living/carbon/human/H = quirk_holder @@ -158,6 +176,7 @@ mob_trait = TRAIT_VORACIOUS gain_text = "You feel HONGRY." lose_text = "You no longer feel HONGRY." + medical_record_text = "Patient demonstrates a disturbing capacity for eating." /datum/quirk/trandening name = "High Luminosity Eyes" @@ -179,6 +198,7 @@ mob_trait = TRAIT_HIGH_BLOOD gain_text = "You feel full of blood!" lose_text = "You feel like your blood pressure went down." + medical_record_text = "Patient's blood tests report an abnormal concentration of red blood cells in their bloodstream." /datum/quirk/bloodpressure/add() var/mob/living/M = quirk_holder diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index 178e1aaeb0..63bb9f45ed 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -22,14 +22,19 @@ value = -1 gain_text = "You start feeling depressed." lose_text = "You no longer feel depressed." //if only it were that easy! - medical_record_text = "Patient has a severe mood disorder causing them to experience sudden moments of sadness." + medical_record_text = "Patient has a severe mood disorder, causing them to experience acute episodes of depression." mood_quirk = TRUE +/datum/quirk/depression/on_process() + if(prob(0.05)) + SEND_SIGNAL(quirk_holder, COMSIG_ADD_MOOD_EVENT, "depression", /datum/mood_event/depression) + /datum/quirk/family_heirloom name = "Family Heirloom" desc = "You are the current owner of an heirloom, passed down for generations. You have to keep it safe!" value = -1 mood_quirk = TRUE + medical_record_text = "Patient demonstrates an unnatural attachment to a family heirloom." var/obj/item/heirloom var/where @@ -143,6 +148,7 @@ name = "Nyctophobia" desc = "As far as you can remember, you've always been afraid of the dark. While in the dark without a light source, you instinctually act careful, and constantly feel a sense of dread." value = -1 + medical_record_text = "Patient demonstrates a fear of the dark. (Seriously?)" /datum/quirk/nyctophobia/on_process() var/mob/living/carbon/human/H = quirk_holder @@ -163,7 +169,8 @@ desc = "Bright lights irritate you. Your eyes start to water, your skin feels itchy against the photon radiation, and your hair gets dry and frizzy. Maybe it's a medical condition. If only Nanotrasen was more considerate of your needs..." value = -1 gain_text = "The safty of light feels off..." - lose_text = "Enlighing." + lose_text = "Enlightening." + medical_record_text = "Despite my warnings, the patient refuses turn on the lights, only to end up rolling down a full flight of stairs and into the cellar." /datum/quirk/lightless/on_process() var/turf/T = get_turf(quirk_holder) @@ -373,7 +380,7 @@ value = -4 gain_text = "You can't see anything." lose_text = "You miraculously gain back your vision." - medical_record_text = "Subject has permanent blindness." + medical_record_text = "Patient has permanent blindness." /datum/quirk/blindness/add() quirk_holder.become_blind(ROUNDSTART_TRAIT) diff --git a/code/datums/traits/neutral.dm b/code/datums/traits/neutral.dm index 9e05af03b6..eae2db6a5f 100644 --- a/code/datums/traits/neutral.dm +++ b/code/datums/traits/neutral.dm @@ -16,6 +16,7 @@ value = 0 gain_text = "You feel an intense craving for pineapple." lose_text = "Your feelings towards pineapples seem to return to a lukewarm state." + medical_record_text = "Patient demonstrates a pathological love of pineapple." /datum/quirk/pineapple_liker/add() var/mob/living/carbon/human/H = quirk_holder @@ -34,6 +35,7 @@ value = 0 gain_text = "You find yourself pondering what kind of idiot actually enjoys pineapples..." lose_text = "Your feelings towards pineapples seem to return to a lukewarm state." + medical_record_text = "Patient is correct to think that pineapple is disgusting." /datum/quirk/pineapple_hater/add() var/mob/living/carbon/human/H = quirk_holder @@ -52,6 +54,7 @@ value = 0 gain_text = "You start craving something that tastes strange." lose_text = "You feel like eating normal food again." + medical_record_text = "Patient demonstrates irregular nutrition preferences." /datum/quirk/deviant_tastes/add() var/mob/living/carbon/human/H = quirk_holder @@ -92,7 +95,7 @@ value = 0 gain_text = "You feel more prudish." lose_text = "You don't feel as prudish as before." - medical_record_text = "Patient exhibits a special gene that makes them immune to Crocin and Hexacrocin." + medical_record_text = "Patient exhibits a special gene that makes them immune to aphrodisiacs." /datum/quirk/libido name = "Nymphomania" @@ -134,6 +137,7 @@ value = 0 mob_trait = TRAIT_PHARMA lose_text = "Your liver feels different." + medical_record_text = "Non-invasive tests report that the patient's metabolism is indeed incompatible with a certain \"stimulants\"." var/active = FALSE var/power = 0 var/cachedmoveCalc = 1 diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index c476e5a310..b35e996bc6 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -170,12 +170,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/prefered_security_department = SEC_DEPT_RANDOM var/custom_species = null - //Quirk list - var/list/positive_quirks = list() - var/list/negative_quirks = list() - var/list/neutral_quirks = list() + //Quirk list var/list/all_quirks = list() - var/list/character_quirks = list() //Job preferences 2.0 - indexed by job title , no key or value implies never var/list/job_preferences = list() @@ -1200,7 +1196,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "
Done
" dat += "
" dat += "
Current quirks: [all_quirks.len ? all_quirks.Join(", ") : "None"]
" - dat += "
[positive_quirks.len] / [MAX_QUIRKS] max positive quirks
\ + dat += "
[GetPositiveQuirkCount()] / [MAX_QUIRKS] max positive quirks
\ Quirk balance remaining: [GetQuirkBalance()]

" for(var/V in SSquirks.quirks) var/datum/quirk/T = SSquirks.quirks[V] @@ -1231,12 +1227,12 @@ GLOBAL_LIST_EMPTY(preferences_datums) LOCKED: [lock_reason]
" else if(has_quirk) - dat += "[quirk_name] - [initial(T.desc)] \ - [has_quirk ? "Lose" : "Take"] ([quirk_cost] pts.)
" + dat += "[has_quirk ? "Remove" : "Take"] ([quirk_cost] pts.) \ + [quirk_name] - [initial(T.desc)]
" else - dat += "[quirk_name] - [initial(T.desc)] \ - [has_quirk ? "Lose" : "Take"] ([quirk_cost] pts.)
" - dat += "
Reset Traits
" + dat += "[has_quirk ? "Remove" : "Take"] ([quirk_cost] pts.) \ + [quirk_name] - [initial(T.desc)]
" + dat += "
Reset Quirks
" var/datum/browser/popup = new(user, "mob_occupation", "
Quirk Preferences
", 900, 600) //no reason not to reuse the occupation window, as it's cleaner that way popup.set_window_options("can_close=0") @@ -1250,6 +1246,12 @@ GLOBAL_LIST_EMPTY(preferences_datums) bal -= initial(T.value) return bal +/datum/preferences/proc/GetPositiveQuirkCount() + . = 0 + for(var/q in all_quirks) + if(SSquirks.quirk_points[q] > 0) + .++ + /datum/preferences/Topic(href, href_list, hsrc) //yeah, gotta do this I guess.. . = ..() if(href_list["close"]) @@ -1315,43 +1317,30 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/quirk = href_list["trait"] if(!SSquirks.quirks[quirk]) return + for(var/V in SSquirks.quirk_blacklist) //V is a list + var/list/L = V + for(var/Q in all_quirks) + if((quirk in L) && (Q in L) && !(Q == quirk)) //two quirks have lined up in the list of the list of quirks that conflict with each other, so return (see quirks.dm for more details) + to_chat(user, "[quirk] is incompatible with [Q].") + return var/value = SSquirks.quirk_points[quirk] - if(value == 0) - if(quirk in neutral_quirks) - neutral_quirks -= quirk - all_quirks -= quirk - else - neutral_quirks += quirk - all_quirks += quirk + var/balance = GetQuirkBalance() + if(quirk in all_quirks) + if(balance + value < 0) + to_chat(user, "Refunding this would cause you to go below your balance!") + return + all_quirks -= quirk else - var/balance = GetQuirkBalance() - if(quirk in positive_quirks) - positive_quirks -= quirk - all_quirks -= quirk - else if(quirk in negative_quirks) - if(balance + value < 0) - to_chat(user, "Refunding this would cause you to go below your balance!") - return - negative_quirks -= quirk - all_quirks -= quirk - else if(value > 0) - if(positive_quirks.len >= MAX_QUIRKS) - to_chat(user, "You can't have more than [MAX_QUIRKS] positive quirks!") - return - if(balance - value < 0) - to_chat(user, "You don't have enough balance to gain this quirk!") - return - positive_quirks += quirk - all_quirks += quirk - else - negative_quirks += quirk - all_quirks += quirk + if(GetPositiveQuirkCount() >= MAX_QUIRKS) + to_chat(user, "You can't have more than [MAX_QUIRKS] positive quirks!") + return + if(balance - value < 0) + to_chat(user, "You don't have enough balance to gain this quirk!") + return + all_quirks += quirk SetQuirks(user) if("reset") all_quirks = list() - positive_quirks = list() - negative_quirks = list() - neutral_quirks = list() SetQuirks(user) else SetQuirks(user) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 29ea8f5821..f7f49a66af 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -112,7 +112,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car if(current_version < 24 && S["feature_exhibitionist"]) var/datum/quirk/exhibitionism/E var/quirk_name = initial(E.name) - neutral_quirks += quirk_name all_quirks += quirk_name /datum/preferences/proc/load_path(ckey,filename="preferences.sav") @@ -386,9 +385,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car //Quirks S["all_quirks"] >> all_quirks - S["positive_quirks"] >> positive_quirks - S["negative_quirks"] >> negative_quirks - S["neutral_quirks"] >> neutral_quirks //Citadel code S["feature_genitals_use_skintone"] >> features["genitals_use_skintone"] @@ -519,10 +515,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car all_quirks = SANITIZE_LIST(all_quirks) - positive_quirks = SANITIZE_LIST(positive_quirks) - negative_quirks = SANITIZE_LIST(negative_quirks) - neutral_quirks = SANITIZE_LIST(neutral_quirks) - cit_character_pref_load(S) return 1 @@ -598,9 +590,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car //Quirks WRITE_FILE(S["all_quirks"] , all_quirks) - WRITE_FILE(S["positive_quirks"] , positive_quirks) - WRITE_FILE(S["negative_quirks"] , negative_quirks) - WRITE_FILE(S["neutral_quirks"] , neutral_quirks) cit_character_pref_save(S) diff --git a/code/modules/hydroponics/grown/replicapod.dm b/code/modules/hydroponics/grown/replicapod.dm index ce0ca0220b..bac480bee6 100644 --- a/code/modules/hydroponics/grown/replicapod.dm +++ b/code/modules/hydroponics/grown/replicapod.dm @@ -41,7 +41,7 @@ blood_type = B.data["blood_type"] features = B.data["features"] factions = B.data["factions"] - factions = B.data["quirks"] + quirks = B.data["quirks"] contains_sample = TRUE visible_message("The [src] is injected with a fresh blood sample.") else diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 3ae2e3bdbd..3483b65753 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -858,6 +858,7 @@ .["Make slime"] = "?_src_=vars;[HrefToken()];makeslime=[REF(src)]" .["Toggle Purrbation"] = "?_src_=vars;[HrefToken()];purrbation=[REF(src)]" .["Copy outfit"] = "?_src_=vars;[HrefToken()];copyoutfit=[REF(src)]" + .["Add/Remove Quirks"] = "?_src_=vars;[HrefToken()];modquirks=[REF(src)]" /mob/living/carbon/human/MouseDrop_T(mob/living/target, mob/living/user) if(pulling == target && grab_state >= GRAB_AGGRESSIVE && stat == CONSCIOUS) diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 0880f7f432..facc86da46 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -140,24 +140,28 @@ /////////////////////////////////// DISABILITIES //////////////////////////////////// -/mob/living/proc/add_quirk(quirk, spawn_effects) //separate proc due to the way these ones are handled - if(HAS_TRAIT(src, quirk)) +/mob/living/proc/add_quirk(quirktype, spawn_effects) //separate proc due to the way these ones are handled + if(has_quirk(quirktype)) return - if(!SSquirks || !SSquirks.quirks[quirk]) + var/datum/quirk/T = quirktype + var/qname = initial(T.name) + if(!SSquirks || !SSquirks.quirks[qname]) return - var/datum/quirk/T = SSquirks.quirks[quirk] - new T (src, spawn_effects) + new quirktype (src, spawn_effects) return TRUE -/mob/living/proc/remove_quirk(quirk) - var/datum/quirk/T = roundstart_quirks[quirk] - if(T) - qdel(T) - return TRUE - -/mob/living/proc/has_quirk(quirk) - return roundstart_quirks[quirk] +/mob/living/proc/remove_quirk(quirktype) + for(var/datum/quirk/Q in roundstart_quirks) + if(Q.type == quirktype) + qdel(Q) + return TRUE + return FALSE +/mob/living/proc/has_quirk(quirktype) + for(var/datum/quirk/Q in roundstart_quirks) + if(Q.type == quirktype) + return TRUE + return FALSE /////////////////////////////////// TRAIT PROCS //////////////////////////////////// /mob/living/proc/cure_blind(list/sources) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index bb65392057..312254163b 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -1,5 +1,5 @@ /datum/reagent/blood - data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_HUMAN, "blood_type"= null,"resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null) + data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_HUMAN, "blood_type"= null,"resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null,"quirks"=null) name = "Blood" id = "blood" value = 1