mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-13 03:02:38 +00:00
[SEMI-MODULAR] Synthetic Quirks Rebalancer & Quirk Hider (#16697)
* Makes liquid_solder a liquid, adjusts solder and system cleaner math to use delta_time * Adds boolean to quirks to hide them from TGUI and the character prefs window * Renames brainproblems from Brain Tumor to Brain Degeneration. Refactors brainproblems and blooddeficiency for synths, adds species-specific detours to quirks, adds prefab pills and pillbottles for synth meds * Add synth pills to tgstation.dme * Adding forgotten brainproblems med record text * Fixes quirk icons failing unittests * Further fixes icons failing unittests * Remove semicolon from quirks.dm Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com> * Relocated qdel calls, renamed bp_synth and bd_synth private vars, changed is_species to isrobotic Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
This commit is contained in:
@@ -62,6 +62,9 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
// SKYRAT EDIT ADDITION START
|
||||
if(initial(quirk_type.erp_quirk) && CONFIG_GET(flag/disable_erp_preferences))
|
||||
continue
|
||||
// Hidden quirks aren't visible to TGUI or the player
|
||||
if (initial(quirk_type.hidden_quirk))
|
||||
continue
|
||||
// SKYRAT EDIT ADDITION END
|
||||
|
||||
quirks[initial(quirk_type.name)] = quirk_type
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/datum/quirk
|
||||
/// Is this quirk restricted to veteran players only?
|
||||
var/veteran_only = FALSE
|
||||
// Is this quirk hidden from TGUI / the character preferences window?
|
||||
var/hidden_quirk = FALSE
|
||||
|
||||
@@ -21,3 +21,75 @@
|
||||
return
|
||||
to_chat(quirk_holder, span_warning("The nerve staple suddenly falls off your face and melts[istype(quirk_holder.loc, /turf/open/floor) ? " on the floor" : ""]!"))
|
||||
qdel(staple)
|
||||
|
||||
// Re-labels TG brainproblems to be more generic. There never was a tumor anyways!
|
||||
/datum/quirk/item_quirk/brainproblems
|
||||
name = "Brain Degeneration"
|
||||
desc = "You have a lethal condition in your brain that is slowly destroying it. Better bring some mannitol!"
|
||||
medical_record_text = "Patient has a lethal condition in their brain that is slowly causing brain death."
|
||||
|
||||
// Override of Brain Tumor quirk for robotic/synthetic species with posibrains.
|
||||
// Does not appear in TGUI or the character preferences window.
|
||||
/datum/quirk/item_quirk/brainproblems/synth
|
||||
name = "Positronic Cascade Anomaly"
|
||||
desc = "Your positronic brain is slowly corrupting itself due to a cascading anomaly. Better bring some liquid solder!"
|
||||
gain_text = "<span class='danger'>You feel glitchy.</span>"
|
||||
lose_text = "<span class='notice'>You no longer feel glitchy.</span>"
|
||||
medical_record_text = "Patient has a cascading anomaly in their brain that is slowly causing brain death."
|
||||
icon = "bp_synth_brain"
|
||||
mail_goodies = list(/obj/item/storage/pill_bottle/liquid_solder/braintumor)
|
||||
hidden_quirk = TRUE
|
||||
|
||||
// If brainproblems is added to a synth, this detours to the brainproblems/synth quirk.
|
||||
// TODO: Add more brain-specific detours when PR #16105 is merged
|
||||
/datum/quirk/item_quirk/brainproblems/add_to_holder(mob/living/new_holder, quirk_transfer)
|
||||
if(!(isrobotic(new_holder) && (src.type == /datum/quirk/item_quirk/brainproblems)))
|
||||
// Defer to TG brainproblems if the character isn't robotic.
|
||||
return ..()
|
||||
// TODO: Check brain type and detour to appropriate brainproblems quirk
|
||||
var/datum/quirk/item_quirk/brainproblems/synth/bp_synth = new
|
||||
qdel(src)
|
||||
return bp_synth.add_to_holder(new_holder, quirk_transfer)
|
||||
|
||||
// Synthetics get liquid_solder with Brain Tumor instead of mannitol.
|
||||
/datum/quirk/item_quirk/brainproblems/synth/add_unique()
|
||||
give_item_to_holder(
|
||||
/obj/item/storage/pill_bottle/liquid_solder/braintumor,
|
||||
list(
|
||||
LOCATION_LPOCKET = ITEM_SLOT_LPOCKET,
|
||||
LOCATION_RPOCKET = ITEM_SLOT_RPOCKET,
|
||||
LOCATION_BACKPACK = ITEM_SLOT_BACKPACK,
|
||||
LOCATION_HANDS = ITEM_SLOT_HANDS,
|
||||
),
|
||||
flavour_text = "These will keep you alive until you can secure a supply of medication. Don't rely on them too much!",
|
||||
)
|
||||
|
||||
// Override of Blood Deficiency quirk for robotic/synthetic species.
|
||||
// Does not appear in TGUI or the character preferences window.
|
||||
/datum/quirk/blooddeficiency/synth
|
||||
name = "Hydraulic Leak"
|
||||
desc = "Your body's hydraulic fluids are leaking through their seals."
|
||||
medical_record_text = "Patient requires regular treatment for hydraulic fluid loss."
|
||||
icon = "bd_synth_tint"
|
||||
hidden_quirk = TRUE
|
||||
|
||||
// If blooddeficiency is added to a synth, this detours to the blooddeficiency/synth quirk.
|
||||
/datum/quirk/blooddeficiency/add_to_holder(mob/living/new_holder, quirk_transfer)
|
||||
if(!(isrobotic(new_holder) && (src.type == /datum/quirk/blooddeficiency)))
|
||||
// Defer to TG blooddeficiency if the character isn't robotic.
|
||||
return ..()
|
||||
var/datum/quirk/blooddeficiency/synth/bd_synth = new
|
||||
qdel(src)
|
||||
return bd_synth.add_to_holder(new_holder, quirk_transfer)
|
||||
|
||||
// Synthetics lose more fluids than organics. Rebalances the quirk for synths!
|
||||
/datum/quirk/blooddeficiency/synth/process(delta_time)
|
||||
if(quirk_holder.stat == DEAD)
|
||||
return
|
||||
var/mob/living/carbon/carbon_target = quirk_holder
|
||||
// Can't lose blood if your species doesn't have any.
|
||||
if(NOBLOOD in carbon_target.dna.species.species_traits)
|
||||
return
|
||||
// Survivable without treatment, but causes lots of fainting.
|
||||
if (carbon_target.blood_volume > BLOOD_VOLUME_BAD)
|
||||
carbon_target.blood_volume -= 0.275 * delta_time
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
// Pill bottles for synthetic healing medications
|
||||
/obj/item/storage/pill_bottle/liquid_solder
|
||||
name = "bottle of liquid solder pills"
|
||||
desc = "Contains pills used to treat synthetic brain damage."
|
||||
|
||||
/obj/item/storage/pill_bottle/liquid_solder/PopulateContents()
|
||||
for(var/i in 1 to 7)
|
||||
new /obj/item/reagent_containers/pill/liquid_solder(src)
|
||||
|
||||
// Contains 4 liquid_solder pills instead of 7, and 10u pills instead of 50u.
|
||||
// 50u pills heal 375 brain damage, 10u pills heal 75.
|
||||
/obj/item/storage/pill_bottle/liquid_solder/braintumor
|
||||
desc = "Contains diluted pills used to treat synthetic brain damage symptoms. Take one when feeling lightheaded."
|
||||
|
||||
/obj/item/storage/pill_bottle/liquid_solder/braintumor/PopulateContents()
|
||||
for(var/i in 1 to 4)
|
||||
new /obj/item/reagent_containers/pill/liquid_solder/braintumor(src)
|
||||
|
||||
/obj/item/storage/pill_bottle/nanite_slurry
|
||||
name = "bottle of nanite slurry pills"
|
||||
desc = "Contains pills used to treat robotic bodyparts."
|
||||
|
||||
/obj/item/storage/pill_bottle/nanite_slurry/PopulateContents()
|
||||
for(var/i in 1 to 7)
|
||||
new /obj/item/reagent_containers/pill/nanite_slurry(src)
|
||||
|
||||
/obj/item/storage/pill_bottle/system_cleaner
|
||||
name = "bottle of system cleaner pills"
|
||||
desc = "Contains pills used to detoxify synthetic bodies."
|
||||
|
||||
/obj/item/storage/pill_bottle/system_cleaner/PopulateContents()
|
||||
for(var/i in 1 to 7)
|
||||
new /obj/item/reagent_containers/pill/system_cleaner(src)
|
||||
26
modular_skyrat/master_files/code/modules/reagents/pill.dm
Normal file
26
modular_skyrat/master_files/code/modules/reagents/pill.dm
Normal file
@@ -0,0 +1,26 @@
|
||||
/obj/item/reagent_containers/pill/liquid_solder
|
||||
name = "liquid solder pill"
|
||||
desc = "Used to treat synthetic brain damage."
|
||||
icon_state = "pill21"
|
||||
list_reagents = list(/datum/reagent/medicine/liquid_solder = 50)
|
||||
rename_with_volume = TRUE
|
||||
|
||||
// Lower quantity solder pill.
|
||||
// 50u pills heal 375 brain damage, 10u pills heal 75.
|
||||
/obj/item/reagent_containers/pill/liquid_solder/braintumor
|
||||
desc = "Used to treat symptoms of synthetic brain damage."
|
||||
list_reagents = list(/datum/reagent/medicine/liquid_solder = 10)
|
||||
|
||||
/obj/item/reagent_containers/pill/nanite_slurry
|
||||
name = "nanite slurry pill"
|
||||
desc = "Used to repair robotic bodyparts."
|
||||
icon_state = "pill18"
|
||||
list_reagents = list(/datum/reagent/medicine/nanite_slurry = 19)
|
||||
rename_with_volume = TRUE
|
||||
|
||||
/obj/item/reagent_containers/pill/system_cleaner
|
||||
name = "system cleaner pill"
|
||||
desc = "Used to detoxify synthetic bodies."
|
||||
icon_state = "pill7"
|
||||
list_reagents = list(/datum/reagent/medicine/system_cleaner = 50)
|
||||
rename_with_volume = TRUE
|
||||
@@ -24,25 +24,27 @@
|
||||
process_flags = REAGENT_SYNTHETIC
|
||||
|
||||
/datum/reagent/medicine/system_cleaner/on_mob_life(mob/living/carbon/affected_mob, delta_time, times_fired)
|
||||
affected_mob.adjustToxLoss(-2 * REM, 0)
|
||||
affected_mob.adjustToxLoss(-2 * REM * delta_time, 0)
|
||||
. = 1
|
||||
var/remove_amount = 1 * REM * delta_time;
|
||||
for(var/thing in affected_mob.reagents.reagent_list)
|
||||
var/datum/reagent/reagent = thing
|
||||
if(reagent != src)
|
||||
affected_mob.reagents.remove_reagent(reagent.type, 1 * REM * delta_time)
|
||||
affected_mob.reagents.remove_reagent(reagent.type, remove_amount)
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/liquid_solder
|
||||
name = "Liquid Solder"
|
||||
description = "Repairs brain damage in synthetics."
|
||||
reagent_state = LIQUID
|
||||
color = "#727272"
|
||||
taste_description = "metal"
|
||||
process_flags = REAGENT_SYNTHETIC
|
||||
|
||||
/datum/reagent/medicine/liquid_solder/on_mob_life(mob/living/carbon/C)
|
||||
C.adjustOrganLoss(ORGAN_SLOT_BRAIN, -3*REM)
|
||||
/datum/reagent/medicine/liquid_solder/on_mob_life(mob/living/carbon/affected_mob, delta_time)
|
||||
affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -3 * REM * delta_time)
|
||||
if(prob(10))
|
||||
C.cure_trauma_type(resilience = TRAUMA_RESILIENCE_BASIC)
|
||||
affected_mob.cure_trauma_type(resilience = TRAUMA_RESILIENCE_BASIC)
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/nanite_slurry
|
||||
@@ -60,8 +62,9 @@
|
||||
var/temperature_change = 50
|
||||
|
||||
|
||||
/datum/reagent/medicine/nanite_slurry/on_mob_life(mob/living/carbon/affected_mob)
|
||||
affected_mob.heal_bodypart_damage(healing * REM, healing * REM, required_status = BODYTYPE_ROBOTIC)
|
||||
/datum/reagent/medicine/nanite_slurry/on_mob_life(mob/living/carbon/affected_mob, delta_time)
|
||||
var/heal_amount = healing * REM * delta_time
|
||||
affected_mob.heal_bodypart_damage(heal_amount, heal_amount, required_status = BODYTYPE_ROBOTIC)
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/nanite_slurry/overdose_process(mob/living/carbon/affected_mob, delta_time, times_fired)
|
||||
|
||||
@@ -4890,6 +4890,7 @@
|
||||
#include "modular_skyrat\master_files\code\game\objects\items\devices\anomaly_neutralizer.dm"
|
||||
#include "modular_skyrat\master_files\code\game\objects\items\stacks\sheets\sheet_types.dm"
|
||||
#include "modular_skyrat\master_files\code\game\objects\items\storage\boxes.dm"
|
||||
#include "modular_skyrat\master_files\code\game\objects\items\storage\pill_bottles.dm"
|
||||
#include "modular_skyrat\master_files\code\game\objects\items\tools\weldingtool.dm"
|
||||
#include "modular_skyrat\master_files\code\game\objects\structures\railings.dm"
|
||||
#include "modular_skyrat\master_files\code\game\objects\structures\sauna_oven.dm"
|
||||
@@ -5006,6 +5007,7 @@
|
||||
#include "modular_skyrat\master_files\code\modules\projectiles\guns\ballistic\automatic.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\projectiles\guns\ballistic\revolver.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\reagents\bottle.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\reagents\pill.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\reagents\chemistry\colors.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\reagents\withdrawal\generic_addictions.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\research\designs\biogenerator_designs.dm"
|
||||
|
||||
Reference in New Issue
Block a user