mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 09:42:29 +00:00
Quirks send on_gain messages in fewer contexts (#91867)
## About The Pull Request Quirks only send their on_gain text when given midround, such as by an admin ## Why It's Good For The Game Spams the hell out of you for no reason - in very few contexts are these messages important (randomized allergies come to mind), but there are other avenues to figure out (such as dogtags)  ## Changelog 🆑 Melbert qol: Quirks spam you less on roundstart or latejoin /🆑
This commit is contained in:
@@ -90,6 +90,6 @@ GLOBAL_PROTECT(duplicate_forbidden_vars)
|
||||
copied_implant.implant(made_copy, silent = TRUE, force = TRUE)
|
||||
//transfer quirks, we do this because transfering the original's quirks keeps the 'owner' as the original.
|
||||
for(var/datum/quirk/original_quirks as anything in original_living.quirks)
|
||||
copied_living.add_quirk(original_quirks.type)
|
||||
copied_living.add_quirk(original_quirks.type, announce = FALSE)
|
||||
|
||||
return made_copy
|
||||
|
||||
@@ -94,7 +94,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
for(var/quirk_name in applied_client.prefs.all_quirks)
|
||||
var/datum/quirk/quirk_type = quirks[quirk_name]
|
||||
if(ispath(quirk_type))
|
||||
if(user.add_quirk(quirk_type, override_client = applied_client))
|
||||
if(user.add_quirk(quirk_type, override_client = applied_client, announce = FALSE))
|
||||
SSblackbox.record_feedback("tally", "quirks_taken", 1, "[quirk_name]")
|
||||
else
|
||||
stack_trace("Invalid quirk \"[quirk_name]\" in client [applied_client.ckey] preferences")
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
* * new_holder - The mob to add this quirk to.
|
||||
* * quirk_transfer - If this is being added to the holder as part of a quirk transfer. Quirks can use this to decide not to spawn new items or apply any other one-time effects.
|
||||
*/
|
||||
/datum/quirk/proc/add_to_holder(mob/living/new_holder, quirk_transfer = FALSE, client/client_source, unique = TRUE)
|
||||
/datum/quirk/proc/add_to_holder(mob/living/new_holder, quirk_transfer = FALSE, client/client_source, unique = TRUE, announce = TRUE)
|
||||
if(!new_holder)
|
||||
CRASH("Quirk attempted to be added to null mob.")
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
START_PROCESSING(SSquirks, src)
|
||||
|
||||
if(!quirk_transfer)
|
||||
if(gain_text)
|
||||
if(gain_text && announce)
|
||||
to_chat(quirk_holder, gain_text)
|
||||
if (unique)
|
||||
add_unique(client_source)
|
||||
@@ -222,7 +222,7 @@
|
||||
* * default_location - If the item isn't possible to equip in a valid slot, this is a description of where the item was spawned.
|
||||
* * notify_player - If TRUE, adds strings to where_items_spawned list to be output to the player in [/datum/quirk/item_quirk/post_add()]
|
||||
*/
|
||||
/datum/quirk/item_quirk/proc/give_item_to_holder(obj/item/quirk_item, list/valid_slots, flavour_text = null, default_location = "at your feet", notify_player = TRUE)
|
||||
/datum/quirk/item_quirk/proc/give_item_to_holder(obj/item/quirk_item, list/valid_slots, flavour_text = null, default_location = "at your feet", notify_player = FALSE)
|
||||
if(ispath(quirk_item))
|
||||
quirk_item = new quirk_item(get_turf(quirk_holder))
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
var/mob/living/carbon/human/human_holder = quirk_holder
|
||||
var/obj/item/clothing/accessory/dogtag/allergy/dogtag = new(get_turf(human_holder), allergy_string)
|
||||
|
||||
give_item_to_holder(dogtag, list(LOCATION_BACKPACK, LOCATION_HANDS), flavour_text = "Make sure medical staff can see this...")
|
||||
give_item_to_holder(dogtag, list(LOCATION_BACKPACK, LOCATION_HANDS), flavour_text = "Make sure medical staff can see this...", notify_player = TRUE)
|
||||
|
||||
/datum/quirk/item_quirk/allergic/post_add()
|
||||
quirk_holder.add_mob_memory(/datum/memory/key/quirk_allergy, allergy_string = allergy_string)
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
LOCATION_HANDS,
|
||||
),
|
||||
flavour_text = "These will keep you alive until you can secure a supply of medication. Don't rely on them too much!",
|
||||
notify_player = TRUE,
|
||||
)
|
||||
|
||||
/datum/quirk/item_quirk/brainproblems/process(seconds_per_tick)
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
quirk_holder.ForceContractDisease(hms)
|
||||
|
||||
/datum/quirk/item_quirk/chronic_illness/add_unique(client/client_source)
|
||||
give_item_to_holder(/obj/item/storage/pill_bottle/sansufentanyl, list(LOCATION_BACKPACK), flavour_text = "You've been provided with medication to help manage your condition. Take it regularly to avoid complications.")
|
||||
give_item_to_holder(/obj/item/storage/pill_bottle/sansufentanyl, list(LOCATION_BACKPACK), flavour_text = "You've been provided with medication to help manage your condition. Take it regularly to avoid complications.", notify_player = TRUE)
|
||||
give_item_to_holder(/obj/item/healthanalyzer/simple/disease, list(LOCATION_BACKPACK))
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
LOCATION_HANDS,
|
||||
),
|
||||
flavour_text = "This is a precious family heirloom, passed down from generation to generation. Keep it safe!",
|
||||
notify_player = TRUE,
|
||||
)
|
||||
|
||||
/datum/quirk/item_quirk/family_heirloom/post_add()
|
||||
|
||||
@@ -46,4 +46,4 @@ GLOBAL_LIST_INIT(possible_food_allergies, list(
|
||||
to_chat(client_source.mob, span_info("You are allergic to [what_are_we_actually_killed_by]. Watch what you eat!"))
|
||||
|
||||
var/obj/item/clothing/accessory/dogtag/allergy/dogtag = new(quirk_holder, what_are_we_actually_killed_by)
|
||||
give_item_to_holder(dogtag, list(LOCATION_BACKPACK, LOCATION_HANDS), flavour_text = "Keep it close around the kitchen.")
|
||||
give_item_to_holder(dogtag, list(LOCATION_BACKPACK, LOCATION_HANDS), flavour_text = "Keep it close around the kitchen.", notify_player = TRUE)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
LOCATION_HANDS,
|
||||
),
|
||||
flavour_text = "Given to you to aid in staying awake this shift...",
|
||||
notify_player = TRUE,
|
||||
)
|
||||
|
||||
/datum/quirk/item_quirk/narcolepsy/remove()
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
associated_typepath = /datum/quirk/chipped
|
||||
customization_options = list(/datum/preference/choiced/chipped)
|
||||
|
||||
/datum/quirk/chipped/add_to_holder(mob/living/new_holder, quirk_transfer, client/client_source, unique = TRUE)
|
||||
/datum/quirk/chipped/add_to_holder(mob/living/new_holder, quirk_transfer, client/client_source, unique = TRUE, announce = FALSE)
|
||||
var/chip_pref = client_source?.prefs?.read_preference(/datum/preference/choiced/chipped)
|
||||
|
||||
if(isnull(chip_pref))
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
dna.copy_dna(subject.dna, COPY_DNA_SE|COPY_DNA_SPECIES)
|
||||
|
||||
for (var/quirk_type as anything in quirks)
|
||||
subject.add_quirk(quirk_type, add_unique = FALSE)
|
||||
subject.add_quirk(quirk_type, add_unique = FALSE, announce = FALSE)
|
||||
|
||||
for (var/trauma_type as anything in brain_traumas)
|
||||
subject.gain_trauma(trauma_type)
|
||||
|
||||
@@ -112,8 +112,8 @@
|
||||
addObjectives()
|
||||
addMemories()
|
||||
equip_space_ninja(owner.current)
|
||||
owner.current.add_quirk(/datum/quirk/freerunning)
|
||||
owner.current.add_quirk(/datum/quirk/light_step)
|
||||
owner.current.add_quirk(/datum/quirk/freerunning, announce = FALSE)
|
||||
owner.current.add_quirk(/datum/quirk/light_step, announce = FALSE)
|
||||
owner.current.mind.set_assigned_role(SSjob.get_job_type(/datum/job/space_ninja))
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ GLOBAL_LIST_EMPTY(wizard_spellbook_purchases_by_key)
|
||||
CRASH("Wizard datum with no owner.")
|
||||
assign_ritual()
|
||||
equip_wizard()
|
||||
owner.current.add_quirk(/datum/quirk/introvert)
|
||||
owner.current.add_quirk(/datum/quirk/introvert, announce = FALSE)
|
||||
if(give_objectives)
|
||||
create_objectives()
|
||||
if(move_to_lair)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
var/datum/quirk/quirk
|
||||
|
||||
/datum/corpse_flavor/quirk/apply_flavor(mob/living/carbon/human/working_dead, list/job_gear, list/datum/callback/on_revive_and_player_occupancy)
|
||||
working_dead.add_quirk(quirk)
|
||||
working_dead.add_quirk(quirk, announce = FALSE)
|
||||
|
||||
/datum/corpse_flavor/quirk/prosthetic_limb
|
||||
quirk = /datum/quirk/prosthetic_limb
|
||||
|
||||
@@ -124,6 +124,6 @@
|
||||
var/datum/quirk/quirk_type = SSquirks.quirks[quirk_name]
|
||||
if(!(initial(quirk_type.quirk_flags) & QUIRK_CHANGES_APPEARANCE))
|
||||
continue
|
||||
mannequin.add_quirk(quirk_type, parent)
|
||||
mannequin.add_quirk(quirk_type, parent, announce = FALSE)
|
||||
|
||||
return mannequin.appearance
|
||||
|
||||
@@ -299,7 +299,7 @@
|
||||
clone.dress_up_as_job(SSjob.get_job(job))
|
||||
|
||||
for(var/datum/quirk/original_quircks as anything in quirks)
|
||||
clone.add_quirk(original_quircks.type, override_client = client)
|
||||
clone.add_quirk(original_quircks.type, override_client = client, announce = FALSE)
|
||||
|
||||
clone.updateappearance(mutcolor_update = TRUE, mutations_overlay_update = TRUE)
|
||||
|
||||
|
||||
@@ -450,14 +450,14 @@
|
||||
*
|
||||
* Returns TRUE on success, FALSE on failure (already has the quirk, etc)
|
||||
*/
|
||||
/mob/living/proc/add_quirk(datum/quirk/quirktype, client/override_client, add_unique = TRUE)
|
||||
/mob/living/proc/add_quirk(datum/quirk/quirktype, client/override_client, add_unique = TRUE, announce = TRUE)
|
||||
if(has_quirk(quirktype))
|
||||
return FALSE
|
||||
var/qname = initial(quirktype.name)
|
||||
if(!SSquirks || !SSquirks.quirks[qname])
|
||||
return FALSE
|
||||
var/datum/quirk/quirk = new quirktype()
|
||||
if(quirk.add_to_holder(new_holder = src, client_source = override_client, unique = add_unique))
|
||||
if(quirk.add_to_holder(new_holder = src, client_source = override_client, unique = add_unique, announce = announce))
|
||||
return TRUE
|
||||
qdel(quirk)
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user