Files
Paradise/code/game/objects/objs.dm
Migratingcocofruit a5260456ae Advanced Disease Rework (#28451)
* Reworks cures, adds strains, adds treatment chems to symptoms

* Enables coexistence of different samples of the same strain at different stages within the same container

* Adds symptom guessing. Correct guesses reduce analysis time and wrong ones increase it.

* Adds a chance for a virus to evolve into a new strain. changing the cure and adding/subtracting symptoms

* Revert "Adds a chance for a virus to evolve into a new strain. changing the cure and adding/subtracting symptoms"

This reverts commit 124dd485c7.

* Adds spontaneous virus mutations, strain tracking. Removes antibody metabolism

* change the amount of time added/reduced by each factor

* Creates a disease outbreak event that allows admins to cause an outbreak of a virus of their choosing. Allows virus creation when choosing virus to give someone or for an outbreak.

* The normal base property values are now the defaults for disease creation

* Rebuild TGUI

* Rebuild TGUI

* Rebuild TGUI

* Update tgui.bundle.js

* remove redundant lines

* improves ui some and moves to using world time for analysis time

* fixes a bug with the analysis time and updates the initial known advanced disease list

* Buffs the disease outbreak event and adds a base stat row to the PANDEMIC

* Update tgui.bundle.js

* Implements calibration

* Adds a remove from database button

* Moves the known disease global list to work per z level

* Removes treatments from most chems and makes each instance of a symptom not acting purge some of the reagent that treated it

* Update symptoms.dm

* Adds stage to unknown diseases

* Moves accumulated error to work per z level and change the location of the delete strain data button

* Adds confirmation to the delete data button and moves the disease text out of the loop in the copy constructor

* fix indentation

* Replaces pent with hydrocodone in the advanced cure list

* gives more buffs to event disease based on severity. removes longevity from possible symptoms an event disease can get.  Fixes a bug with determining analysis time

* Update tgui.bundle.js

* Update pandemic.dm

* Update pandemic.dm

* Update tgui.bundle.js

* review changes

* Update tgui.bundle.js

* Update tgui.bundle.js

* Update tgui.bundle.js

* Update tgui.bundle.js

* Update tgui.bundle.js

* Update tgui.bundle.js

* Update tgui.bundle.js

* Update tgui.bundle.js

* review changes

* Update tgui.bundle.js

* Makes vaccines only add resistances and no longer cure

* improves pandemic ui and fixes calibration button not being properly disabled

* Update tgui.bundle.js

* Add the new agars to the virologist's fridge

* lowered evolution chance of viruses a bit

* further lowers evolution chance

* Update advance.dm

* Changes the scaling of analysis time and fixes stage speed presentation in the pandemic

* Scanners can now see virus strains that have been inserted in the pandemic

* Allows a mob to be infected by both an event and non event disease

* Fixes the +1 syringe of translocation stabbing your feet

* Update tgui.bundle.js

* Changes spontanous mutation to be per spread and makes disease events less likely.

* Diseases less common, mutations happen only on spread now, symptom list ordered alphabetically in the dropdown, fixed some bugs

* Update tgui.bundle.js

* changes virus alerts

* Removes numbers from the virus alert text and fixes a bug that caused excessive virus mutations

* Update tgui.bundle.js

* refactor disease spread

* Changes disease spread logic to give players options to protect themselves and others

* Blackbox things

* Increases announcement timer and fixes the infection talley

* Update disease_outbreak.dm

* Adds an incubation period to advanced viruses. bumps sneeze back to 5 range

* Adds failsafe to disease outbreaks that will infect a random crew member if none have arrived in 10 minutes

* Only record advanced disease infections

* Properly handle recording of disease infection events

* Changed resistance effect on cure

* another adjustment to res effect on cure

* Small resist buff, spontanous combustion buff and some calculation fixes

* changes spontanous combustion stat bonuses and maluses

* Update flesh_eating.dm

* Update flesh_eating.dm

* Update flesh_eating.dm

* Big trait changes and rebalance

* adds treatments to fire and necro

* Introduces viral contamination of food and reagent containers, as well as disinfection

* Fix runtime in reagent transfers

* Revert the prefs and config changes

* Slowed down diseases and made symptoms more gradual, improved disease alerts to both crew and dchat

* Sterilizine now sterilizes things contaminated with viruses. Heat reactions now take place alongside chemical reactions when adding reagents to a beaker

* Adds option to order sterile masks, goggles and biosuits in packs of 4. Makes sterile masks as good as internals for viruses

* adds logging to pandemic

* Changes symptom stats and increased disease varaiety

* Fixes some disease bugs

* Fixes some bugs and makes it behave better

* Adds shiver emote to shiver symptom

* Adds admin message/log to contracting an event disease and fixes copy behaviour when infecting

* Prefix spread defines

* Change the rest of the macros

* correct the disinfection temp macro

* Moves disease signals to their own file

* move disnifection temp back

* fix a type

* viral contaminations component review changes

* var name changes

* more style fixes

* Update tgui.bundle.js

* fixes pandemic

* Fixes disease outbreak having two carriers sometimes and changes the virus alert to the new one

* Update disease_defines.dm

* fixes samples not passing stages on properly

* actually fixes the bug

* Fixes stabilization being lost on cloning

* Finally completely and absolutely fixes the sample stages bug(please)

* Makes the pandemic a machine

* Update pandemic.dm

* removed drinks from cure requirements

* lowers chance of major viral outbreak

* fixes pandemic not processing properly

* Changes the cure system to have more options

* Makes mixing event viruses more random

* Fixes hardsuits having a 1% chance to be infected

* Increases virus protection of most clothing. medical scrubs and surgical hat buffed sunstantially

* Slow down progress of diseases

* makes spread less likely

* envirosuit is now slightly more protective from viruses, while the medical one is as good as scrubs

* Adds further protection to helmets

* Increases the number of possible cures and the scaling of required cures

* Pandemic ui improvements

* Update _disease.dm

* fix a bug with spread target in the disease outbreak event

* changes some clothing permeability

* Adds the ability to make viral DNA extracts by injecting a sample into a black slime core. It's equivalent to 2 stages

* Adds age to health analyzer, makes viral evolution toggle minor disabilities, confusion symptom now confuses more often

* Update pandemic.dm

* replace lazarus with acetic acid in the cures

* Changes the relation of the amount of cure options to required cures and the scaling of required cures with resistance

* Fixes virus renaming

* changes description and permeability of some medical jumpsuits

* Adds a list of all diseases infecting client mobs to the disease outbreak event

* uses event UID instead of ref in the disease

* Adds advanced disease carriers to admin antag menu

* Adds viral eraser which removes tracking and stabilizing. Admin spawn only for now

* Update tgui.bundle.js

* Adds the ability to create viral genetic material using radiation. it can be used in addition to that produced in xenobio

* changes alert logic, disease generation logic, adds treatments to weakness, cough and sneeze now more gradual and cough spreads at range 3

* makes disease advance a bit faster

* reduce time to announcement to 6 minutes after 3 people are infected

* Changes medibot disease detection to be the same as analyzers. Treatment chems now put the symptom on a cooldown that persists after they leave the body.

* Make sure the disease outbreak event only selects crew

* Fix abductor virus gland virus generation

* Adds sterilizine to viro locker

* Fixes null viruses appearing when merging virusless blood

* Adds oculine to hyphema treatments

* Rebalances weight loss and flesh eating

* Improvements to advanced disease carrier tab on the TGUI antag menu

* change the flag on away missions

* Update mob_spawn.dm

* Update tgui.bundle.js

* adds sterilizine recipe back

* Adds viral contamination to surgery tools and surgery steps

* small changes

* fixes pandemic ui. should work properly now(I hope)

* CI compliance

* Update flesh_eating.dm

* Update vomit.dm

* Update tgui.bundle.js

* Initial revision of analysis and fixes the UI issue with multiple stage samples

* refactors treatment and makes treatment chems more adjustable

* var correction

* symptoms and their contribution now show up on the pandemic

* Update tgui.bundle.js

* Update code/datums/diseases/advance/symptoms/cough.dm

Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com>

* change wizard disease and zombie disease macros to new ones

* Update tgui.bundle.js

* changes the part requirements on the pandemic boards to fit the actual parts

* fix misbehaviour when inserting samples without symptoms

* Some changes to difficulty scaling, reverts the level of projectile vomiting back to 4, and disallows germaphobes to avoid infection by injection

* Adds viral contamination to IV bags

---------

Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
2025-08-08 01:54:36 +00:00

299 lines
10 KiB
Plaintext

/obj
//var/datum/module/mod //not used
var/origin_tech = null //Used by R&D to determine what research bonuses it grants.
animate_movement = SLIDE_STEPS
var/list/species_exception = null // list() of species types, if a species cannot put items in a certain slot, but species type is in list, it will be able to wear that item
var/sharp = FALSE // whether this object cuts
var/in_use = FALSE // If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING!
var/damtype = "brute"
var/force = 0
// You can define armor as a list in datum definition (e.g. `armor = list("fire" = 80, "brute" = 10)`),
// which would be converted to armor datum during initialization.
// Setting `armor` to a list on an *existing* object would inevitably runtime. Use `getArmor()` instead.
var/datum/armor/armor
var/obj_integrity //defaults to max_integrity
var/max_integrity = 500
var/integrity_failure = 0 //0 if we have no special broken behavior
///Damage under this value will be completely ignored
var/damage_deflection = 0
var/resistance_flags = NONE // INDESTRUCTIBLE
var/custom_fire_overlay // Update_fire_overlay will check if a different icon state should be used
var/acid_level = 0 //how much acid is on that obj
var/can_be_hit = TRUE //can this be bludgeoned by items?
var/being_shocked = FALSE
var/speed_process = FALSE
var/on_blueprints = FALSE //Are we visible on the station blueprints at roundstart?
var/force_blueprints = FALSE //forces the obj to be on the blueprints, regardless of when it was created.
var/suicidal_hands = FALSE // Does it requires you to hold it to commit suicide with it?
/// Is it emagged or not?
var/emagged = FALSE
// Access-related fields
/// A list of accesses as defined by `code/__DEFINES/access_defines.dm`. All accesses are required when checking.
var/list/req_access = null
/// A list of accesses as defined by `code/__DEFINES/access_defines.dm`. At least one access is required when checking.
var/list/req_one_access = null
/obj/Initialize(mapload)
. = ..()
if(islist(armor))
armor = getArmor(arglist(armor))
else if(!armor)
armor = getArmor()
else if(!istype(armor, /datum/armor))
stack_trace("Invalid type [armor.type] found in .armor during /obj Initialize()")
if(sharp)
AddComponent(/datum/component/surgery_initiator)
if(obj_integrity == null)
obj_integrity = max_integrity
if(on_blueprints && isturf(loc))
var/turf/T = loc
if(force_blueprints)
T.add_blueprints(src)
else
T.add_blueprints_preround(src)
/obj/Topic(href, href_list, nowindow = FALSE, datum/ui_state/state = GLOB.default_state)
// Calling Topic without a corresponding window open causes runtime errors
if(!nowindow && ..())
return TRUE
// In the far future no checks are made in an overriding Topic() beyond if(..()) return
// Instead any such checks are made in CanUseTopic()
if(ui_status(usr, state, href_list) == UI_INTERACTIVE)
var/atom/host = ui_host()
host.add_fingerprint(usr)
return FALSE
return TRUE
/obj/Destroy()
if(!ismachinery(src))
if(!speed_process)
STOP_PROCESSING(SSobj, src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists
// AA 2024-05-20 - processing var?????
else
STOP_PROCESSING(SSfastprocess, src)
return ..()
//Output a creative message and then return the damagetype done
/obj/proc/suicide_act(mob/user)
return FALSE
/obj/proc/handle_internal_lifeform(mob/lifeform_inside_me, breath_request, datum/gas_mixture/environment)
//Return: (NONSTANDARD)
// null if object handles breathing logic for lifeform
// datum/air_group to tell lifeform to process using that breath return
//DEFAULT: Take air from turf to give to have mob process
if(breath_request > 0)
var/datum/gas_mixture/air = return_obj_air()
if(isnull(air))
air = environment
if(isnull(air))
return
var/breath_percentage = BREATH_VOLUME / air.return_volume()
return air.remove(air.total_moles() * breath_percentage)
else
return null
/obj/proc/updateUsrDialog()
if(in_use)
var/is_in_use = FALSE
var/list/nearby = viewers(1, src)
for(var/mob/M in nearby)
if(M.client && M.machine == src)
is_in_use = TRUE
src.attack_hand(M)
if(is_ai(usr) || isrobot(usr))
if(!(usr in nearby))
if(usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
is_in_use = TRUE
src.attack_ai(usr)
// check for TK users
if(ishuman(usr))
if(istype(usr.l_hand, /obj/item/tk_grab) || istype(usr.r_hand, /obj/item/tk_grab/))
if(!(usr in nearby))
if(usr.client && usr.machine == src)
is_in_use = TRUE
src.attack_hand(usr)
in_use = is_in_use
/obj/proc/updateDialog()
// Check that people are actually using the machine. If not, don't update anymore.
if(in_use)
var/list/nearby = viewers(1, src)
var/is_in_use = FALSE
for(var/mob/M in nearby)
if(M.client && M.machine == src)
is_in_use = TRUE
src.interact(M)
var/ai_in_use = AutoUpdateAI(src)
if(!ai_in_use && !is_in_use)
in_use = FALSE
/obj/proc/interact(mob/user)
return
/mob/proc/unset_machine()
if(machine)
UnregisterSignal(machine, COMSIG_PARENT_QDELETING)
machine = null
/mob/proc/set_machine(obj/O)
if(src.machine)
unset_machine()
src.machine = O
if(istype(O))
O.in_use = TRUE
RegisterSignal(O, COMSIG_PARENT_QDELETING, PROC_REF(unset_machine))
/obj/item/proc/updateSelfDialog()
var/mob/M = src.loc
if(istype(M) && M.client && M.machine == src)
src.attack_self__legacy__attackchain(M)
/obj/proc/hide(h)
return
/obj/proc/hear_talk(mob/M, list/message_pieces)
return
/obj/proc/hear_message(mob/M, text)
return
/obj/proc/default_welder_repair(mob/user, obj/item/I) //Returns TRUE if the object was successfully repaired. Fully repairs an object (setting BROKEN to FALSE), default repair time = 40
if(obj_integrity >= max_integrity)
to_chat(user, "<span class='notice'>[src] does not need repairs.</span>")
return
if(I.tool_behaviour != TOOL_WELDER)
return
if(!I.tool_use_check(user, 0))
return
var/time = max(50 * (1 - obj_integrity / max_integrity), 5)
WELDER_ATTEMPT_REPAIR_MESSAGE
if(I.use_tool(src, user, time, volume = I.tool_volume))
WELDER_REPAIR_SUCCESS_MESSAGE
obj_integrity = max_integrity
update_icon()
return TRUE
/obj/proc/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
if(!anchored && !isfloorturf(loc))
user.visible_message("<span class='warning'>A floor must be present to secure [src]!</span>")
return FALSE
if(I.tool_behaviour != TOOL_WRENCH)
return FALSE
if(!I.tool_use_check(user, 0))
return FALSE
if(!(flags & NODECONSTRUCT))
to_chat(user, "<span class='notice'>Now [anchored ? "un" : ""]securing [name].</span>")
if(I.use_tool(src, user, time, volume = I.tool_volume))
to_chat(user, "<span class='notice'>You've [anchored ? "un" : ""]secured [name].</span>")
anchored = !anchored
return TRUE
return FALSE
/obj/water_act(volume, temperature, source, method = REAGENT_TOUCH)
. = ..()
extinguish()
acid_level = 0
if(temperature > VIRUS_DISINFECTION_TEMP)
SEND_SIGNAL(src, COMSIG_ATOM_DISINFECTED)
/obj/singularity_pull(S, current_size)
..()
if(!anchored || current_size >= STAGE_FIVE)
step_towards(src, S)
/obj/proc/container_resist(mob/living)
return
/obj/proc/on_mob_move(dir, mob/user)
return
/obj/proc/makeSpeedProcess()
if(speed_process)
return
speed_process = TRUE
STOP_PROCESSING(SSobj, src)
START_PROCESSING(SSfastprocess, src)
/obj/proc/makeNormalProcess()
if(!speed_process)
return
speed_process = FALSE
START_PROCESSING(SSobj, src)
STOP_PROCESSING(SSfastprocess, src)
/obj/proc/check_uplink_validity()
return TRUE
/obj/proc/cult_conceal() //Called by cult conceal spell
return
/obj/proc/cult_reveal() //Called by cult reveal spell and chaplain's bible
return
/// Set whether the item should be sharp or not
/obj/proc/set_sharpness(new_sharp_val)
if(sharp == new_sharp_val)
return
sharp = new_sharp_val
SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_SHARPNESS)
if(!sharp && new_sharp_val)
AddComponent(/datum/component/surgery_initiator)
/obj/proc/force_eject_occupant(mob/target)
// This proc handles safely removing occupant mobs from the object if they must be teleported out (due to being SSD/AFK, by admin teleport, etc) or transformed.
// In the event that the object doesn't have an overriden version of this proc to do it, log a runtime so one can be added.
CRASH("Proc force_eject_occupant() is not overridden on a machine containing a mob.")
/obj/hit_by_thrown_mob(mob/living/C, datum/thrownthing/throwingdatum, damage, mob_hurt, self_hurt)
damage *= 0.75 //Define this probably somewhere, we want objects to hurt less than walls, unless special impact effects.
playsound(src, 'sound/weapons/punch1.ogg', 35, 1)
if(mob_hurt) //Density check probably not needed, one should only bump into something if it is dense, and blob tiles are not dense, because of course they are not.
return
C.visible_message("<span class='danger'>[C] slams into [src]!</span>", "<span class='userdanger'>You slam into [src]!</span>")
if(!self_hurt)
take_damage(damage, BRUTE)
if(issilicon(C))
C.Weaken(3 SECONDS)
C.adjustBruteLoss(damage)
else
var/obj/item/organ/external/affecting = C.get_organ(ran_zone(throwingdatum.target_zone))
if(affecting)
var/armor_block = C.run_armor_check(affecting, MELEE)
C.apply_damage(damage, BRUTE, affecting, armor_block)
else
C.take_organ_damage(damage)
C.KnockDown(3 SECONDS)
/obj/handle_ricochet(obj/item/projectile/P)
. = ..()
if(. && receive_ricochet_damage_coeff)
// pass along receive_ricochet_damage_coeff damage to the structure for the ricochet
take_damage(P.damage * receive_ricochet_damage_coeff, P.damage_type, P.flag, 0, REVERSE_DIR(P.dir), P.armour_penetration_flat, P.armour_penetration_percentage)
/obj/proc/return_obj_air()
RETURN_TYPE(/datum/gas_mixture)
if(isobj(loc))
var/obj/O = loc
return O.return_obj_air()
else
return null