Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions code/__DEFINES/DNA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@
#define DNA_AVIAN_EARS_BLOCK 18 // NON-MODULE CHANGE
#define DNA_AVIAN_TAIL_BLOCK 19 // NON-MODULE CHANGE
#define DNA_FEATHER_COLOR_BLOCK 20 // NON-MODULE CHANGE
#define DNA_SYNTH_HEAD_COVER_BLOCK 21 // NON-MODULE CHANGE

#define DNA_FEATURE_BLOCKS 21 // NON-MODULE CHANGE
#define DNA_FEATURE_BLOCKS 20 // NON-MODULE CHANGE

#define DNA_SEQUENCE_LENGTH 4
#define DNA_MUTATION_BLOCKS 8
Expand All @@ -73,8 +72,12 @@
#define ORGAN_SLOT_ADAMANTINE_RESONATOR "adamantine_resonator"
#define ORGAN_SLOT_APPENDIX "appendix"
#define ORGAN_SLOT_BRAIN "brain"
#define ORGAN_SLOT_BRAIN_ANTIDROP "brain_antidrop"
#define ORGAN_SLOT_BRAIN_ANTISTUN "brain_antistun"
/// Brain implants that affect the mob's motor control (grabbing, moving, attacking)
#define ORGAN_SLOT_BRAIN_CEREBELLUM "brain_motorcontrol"
/// Brain implants that affect the mob's sensory systems (pain, vision, hearing, etc)
#define ORGAN_SLOT_BRAIN_CNS "brain_cns"
/// Brain implants that affect the mob's memory and cognition (skills, knowledge, etc)
#define ORGAN_SLOT_BRAIN_HIPPOCAMPUS "brain_memory"
#define ORGAN_SLOT_BREATHING_TUBE "breathing_tube"
#define ORGAN_SLOT_EARS "ears"
#define ORGAN_SLOT_EYES "eye_sight"
Expand Down Expand Up @@ -157,8 +160,9 @@ GLOBAL_LIST_INIT(organ_process_order, list(
ORGAN_SLOT_VOICE,
ORGAN_SLOT_ADAMANTINE_RESONATOR,
ORGAN_SLOT_HEART_AID,
ORGAN_SLOT_BRAIN_ANTIDROP,
ORGAN_SLOT_BRAIN_ANTISTUN,
ORGAN_SLOT_BRAIN_CEREBELLUM,
ORGAN_SLOT_BRAIN_CNS,
ORGAN_SLOT_BRAIN_HIPPOCAMPUS,
ORGAN_SLOT_PARASITE_EGG,
ORGAN_SLOT_MONSTER_CORE,
ORGAN_SLOT_XENO_PLASMAVESSEL,
Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/cooldowns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,8 @@
#define COOLDOWN_STARTED(cd_source, cd_index) (cd_source.cd_index != 0)

#define COOLDOWN_TIMELEFT(cd_source, cd_index) (max(0, cd_source.cd_index - world.time))

/// Add time to an ongoing cooldown or start a cooldown of given time if not started yet
#define COOLDOWN_ADD(cd_source, cd_index, cd_time) (cd_source.cd_index = (cd_source.cd_index == 0 ? world.time : cd_source.cd_index) + (cd_time))
/// Sets the cooldown to whichever is larger, any ongoing cooldown or the given time
#define COOLDOWN_MINIMUM(cd_source, cd_index, cd_time) (cd_source.cd_index = max(cd_source.cd_index, world.time + (cd_time)))
4 changes: 4 additions & 0 deletions code/__DEFINES/crafting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#define CRAFT_CHECK_DENSITY (1<<5)
/// If the created atom will gain custom mat datums
#define CRAFT_APPLIES_MATS (1<<6)
/// Crafting passes reagents of components to the finished product
#define CRAFT_TRANSFERS_REAGENTS (1<<7)
/// Crafting clears all reagents present in the finished product
#define CRAFT_CLEARS_REAGENTS (1<<8)

//food/drink crafting defines
//When adding new defines, please make sure to also add them to the encompassing list
Expand Down
4 changes: 3 additions & 1 deletion code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
#define COMSIG_MOB_REAGENT_CHECK "mob_reagent_check"
///stops the reagent check call
#define COMSIG_MOB_STOP_REAGENT_CHECK (1<<0)
///from base of mob/clickon(): (atom/A, params)
///Allows for most on_life calls BUT metabolize()
#define COMSIG_MOB_STOP_REAGENT_METABOLISM (1<<1)
///from base of mob/clickon(): (atom/A, list/modifiers)
#define COMSIG_MOB_CLICKON "mob_clickon"
///from base of mob/MiddleClickOn(): (atom/A)
#define COMSIG_MOB_MIDDLECLICKON "mob_middleclickon"
Expand Down
22 changes: 10 additions & 12 deletions code/__DEFINES/reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,29 @@
//reagent bitflags, used for altering how they works
///allows on_mob_dead() if present in a dead body
#define REAGENT_DEAD_PROCESS (1<<0)
///Do not split the chem at all during processing - ignores all purity effects
#define REAGENT_DONOTSPLIT (1<<1)
///Doesn't appear on handheld health analyzers.
#define REAGENT_INVISIBLE (1<<2)
#define REAGENT_INVISIBLE (1<<1)
///When inverted, the inverted chem uses the name of the original chem
#define REAGENT_SNEAKYNAME (1<<3)
#define REAGENT_SNEAKYNAME (1<<2)
///Retains initial volume of chem when splitting for purity effects
#define REAGENT_SPLITRETAINVOL (1<<4)
#define REAGENT_SPLITRETAINVOL (1<<3)
///Lets a given reagent be synthesized important for random reagents and things like the odysseus syringe gun(Replaces the old can_synth variable)
#define REAGENT_CAN_BE_SYNTHESIZED (1<<5)
#define REAGENT_CAN_BE_SYNTHESIZED (1<<4)
///Allows a reagent to work on a mob regardless of stasis
#define REAGENT_IGNORE_STASIS (1<<6)
#define REAGENT_IGNORE_STASIS (1<<5)
///This reagent won't be used in most randomized recipes. Meant for reagents that could be synthetized but are normally inaccessible or TOO hard to get.
#define REAGENT_NO_RANDOM_RECIPE (1<<7)
#define REAGENT_NO_RANDOM_RECIPE (1<<6)
///Does this reagent clean things?
#define REAGENT_CLEANS (1<<8)
#define REAGENT_CLEANS (1<<7)
///Does this reagent affect wounds? Used to check if some procs should be ran.
#define REAGENT_AFFECTS_WOUNDS (1<<9)
#define REAGENT_AFFECTS_WOUNDS (1<<8)
/// If present, when metabolizing out of a mob, we divide by the mob's metabolism rather than multiply.
/// Without this flag: Higher metabolism means the reagent exits the system faster.
/// With this flag: Higher metabolism means the reagent exits the system slower.
#define REAGENT_REVERSE_METABOLISM (1<<10)
#define REAGENT_REVERSE_METABOLISM (1<<9)
/// If present, this reagent will not be affected by the mob's metabolism at all, meaning it exits at a fixed rate for all mobs.
/// Supercedes [REAGENT_REVERSE_METABOLISM].
#define REAGENT_UNAFFECTED_BY_METABOLISM (1<<11)
#define REAGENT_UNAFFECTED_BY_METABOLISM (1<<10)

//Chemical reaction flags, for determining reaction specialties
///Convert into impure/pure on reaction completion
Expand Down
1 change: 0 additions & 1 deletion code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ DEFINE_BITFIELD(zap_flags, list(

DEFINE_BITFIELD(chemical_flags, list(
"REAGENT_DEAD_PROCESS" = REAGENT_DEAD_PROCESS,
"REAGENT_DONOTSPLIT" = REAGENT_DONOTSPLIT,
"REAGENT_INVISIBLE" = REAGENT_INVISIBLE,
"REAGENT_SNEAKYNAME" = REAGENT_SNEAKYNAME,
"REAGENT_SPLITRETAINVOL" = REAGENT_SPLITRETAINVOL,
Expand Down
19 changes: 0 additions & 19 deletions code/controllers/subsystem/addiction.dm

This file was deleted.

9 changes: 9 additions & 0 deletions code/datums/bodypart_overlays/emote_bodypart_overlay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@
offset_key = OFFSET_FACE
attached_body_zone = BODY_ZONE_HEAD

/datum/bodypart_overlay/simple/emote/blush/color_image(image/overlay, layer, obj/item/bodypart/limb)
var/list/blood_hsl = rgb2num(limb.damage_color, COLORSPACE_HSL)
// take blood color then just make it a lot brighter and desaturate it a bit
blood_hsl[2] = max(0, blood_hsl[2] - 20)
blood_hsl[3] = min(100, blood_hsl[3] + 30)

overlay.color = rgb(blood_hsl[1], blood_hsl[2], blood_hsl[3], space = COLORSPACE_HSL)
overlay.alpha = 200

/datum/bodypart_overlay/simple/emote/cry
icon_state = "tears"
draw_color = COLOR_DARK_CYAN
Expand Down
6 changes: 4 additions & 2 deletions code/datums/components/crafting/crafting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,10 @@
var/datum/reagents/holder = locate() in parts
if(holder) //transfer reagents from ingredients to result
if(!ispath(recipe.result, /obj/item/reagent_containers) && result.reagents)
result.reagents.clear_reagents()
holder.trans_to(result.reagents, holder.total_volume, no_react = TRUE)
if(recipe.crafting_flags & CRAFT_CLEARS_REAGENTS)
result.reagents.clear_reagents()
if(recipe.crafting_flags & CRAFT_TRANSFERS_REAGENTS)
holder.trans_to(result.reagents, holder.total_volume, no_react = TRUE)
parts -= holder
qdel(holder)
result.CheckParts(parts, recipe)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/diseases/asthma_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@

/datum/disease/asthma_attack/severe/stage_act(seconds_per_tick, times_fired)
. = ..()
if (!.)
if (!. || QDELETED(src))
return FALSE

if (stage > 1)
Expand Down
8 changes: 0 additions & 8 deletions code/datums/dna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
L[DNA_AVIAN_EARS_BLOCK] = construct_block(SSaccessories.avian_ears_list.Find(features["ears_avian"]), length(SSaccessories.avian_ears_list))
if(features["feathers"]) // NON-MODULE CHANGE
L[DNA_FEATHER_COLOR_BLOCK] = sanitize_hexcolor(features["feathers"], include_crunch = FALSE)
if(features["synth_head_cover"]) // NON-MODULE CHANGE
L[DNA_SYNTH_HEAD_COVER_BLOCK] = construct_block(SSaccessories.synth_head_cover_list.Find(features["synth_head_cover"]), length(SSaccessories.synth_head_cover_list))


for(var/blocknum in 1 to DNA_FEATURE_BLOCKS)
. += L[blocknum] || random_string(GET_UI_BLOCK_LEN(blocknum), GLOB.hex_characters)
Expand Down Expand Up @@ -397,9 +394,6 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
set_uni_feature_block(blocknumber, construct_block(SSaccessories.avian_ears_list.Find(features["ears_avian"]), length(SSaccessories.avian_ears_list)))
if(DNA_FEATHER_COLOR_BLOCK) // NON-MODULE CHANGE
set_uni_feature_block(blocknumber, sanitize_hexcolor(features["feathers"], include_crunch = FALSE))
if(DNA_SYNTH_HEAD_COVER_BLOCK) // NON-MODULE CHANGE
set_uni_feature_block(blocknumber, construct_block(SSaccessories.synth_head_cover_list.Find(features["head_tentacles"]), length(SSaccessories.synth_head_cover_list)))


//Please use add_mutation or activate_mutation instead
/datum/dna/proc/force_give(datum/mutation/human/human_mutation)
Expand Down Expand Up @@ -705,8 +699,6 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
dna.features["ears_avian"] = SSaccessories.avian_ears_list[deconstruct_block(get_uni_feature_block(features, DNA_AVIAN_EARS_BLOCK), length(SSaccessories.avian_ears_list))]
if(dna.features["feathers"]) // NON-MODULE CHANGE
dna.features["feathers"] = sanitize_hexcolor(get_uni_feature_block(features, DNA_FEATHER_COLOR_BLOCK))
if(dna.features["synth_head_cover"]) // NON-MODULE CHANGE
dna.features["synth_head_cover"] = SSaccessories.synth_head_cover_list[deconstruct_block(get_uni_feature_block(features, DNA_SYNTH_HEAD_COVER_BLOCK), length(SSaccessories.synth_head_cover_list))]
for(var/obj/item/organ/organ in organs)
organ.mutate_feature(features, src)

Expand Down
13 changes: 8 additions & 5 deletions code/datums/mind/_mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -523,16 +523,19 @@

///Adds addiction points to the specified addiction
/datum/mind/proc/add_addiction_points(type, amount)
var/last_amount = LAZYACCESS(addiction_points, type) || 0
LAZYSET(addiction_points, type, min(LAZYACCESS(addiction_points, type) + amount, MAX_ADDICTION_POINTS))
var/datum/addiction/affected_addiction = SSaddiction.all_addictions[type]
return affected_addiction.on_gain_addiction_points(src)
var/new_amount = LAZYACCESS(addiction_points, type)
return GLOB.addictions[type].on_gain_addiction_points(src, new_amount, last_amount)

///Adds addiction points to the specified addiction
/datum/mind/proc/remove_addiction_points(type, amount)
var/last_amount = LAZYACCESS(addiction_points, type) || 0
LAZYSET(addiction_points, type, max(LAZYACCESS(addiction_points, type) - amount, 0))
var/datum/addiction/affected_addiction = SSaddiction.all_addictions[type]
return affected_addiction.on_lose_addiction_points(src)

var/new_amount = LAZYACCESS(addiction_points, type)
if(new_amount <= 0)
LAZYREMOVE(addiction_points, type)
return GLOB.addictions[type].on_lose_addiction_points(src, new_amount, last_amount)

/// Setter for the assigned_role job datum.
/datum/mind/proc/set_assigned_role(datum/job/new_role)
Expand Down
4 changes: 4 additions & 0 deletions code/datums/mood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@

update_mood_icon()

/// Sets sanity to a specific amount, useful for callbacks
/datum/mood/proc/reset_sanity(amount)
set_sanity(amount, override = TRUE)

/// Adjusts sanity by a value
/datum/mood/proc/adjust_sanity(amount, minimum = SANITY_INSANE, maximum = SANITY_GREAT, override = FALSE)
set_sanity(sanity + amount, minimum, maximum, override)
Expand Down
10 changes: 6 additions & 4 deletions code/datums/mood_events/drug_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,27 @@
mood_change = -2

/datum/mood_event/withdrawal_light/add_effects(drug_name)
description = "I could use some [drug_name]..."
description = "I could use some [drug_name][plural_s(drug_name)]..."

/datum/mood_event/withdrawal_medium
mood_change = -5

/datum/mood_event/withdrawal_medium/add_effects(drug_name)
description = "I really need [drug_name]."
description = "I really need [drug_name][plural_s(drug_name)]."

/datum/mood_event/withdrawal_severe
mood_change = -8

/datum/mood_event/withdrawal_severe/add_effects(drug_name)
description = "Oh god, I need some of that [drug_name]!"
description = "I need some of that [drug_name][plural_s(drug_name)] right now!"

/datum/mood_event/withdrawal_critical
mood_change = -10

/datum/mood_event/withdrawal_critical/add_effects(drug_name)
description = "[drug_name]! [drug_name]! [drug_name]!"
var/base = "[drug_name][plural_s(drug_name)]!"
for(var/i in 1 to 3)
description = "[base] "

/datum/mood_event/happiness_drug
description = "Can't feel a thing..."
Expand Down
11 changes: 5 additions & 6 deletions code/datums/mutations/sight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@
if(!istype(to_modify)) // null or invalid
return

to_modify.eye_damage = 10 * GET_MUTATION_SYNCHRONIZER(src)
to_modify.thermal_duration = 10 SECONDS * GET_MUTATION_POWER(src)
to_modify.eye_damage = /datum/action/cooldown/spell/thermal_vision::eye_damage * GET_MUTATION_SYNCHRONIZER(src) * GET_MUTATION_POWER(src)
to_modify.thermal_duration = /datum/action/cooldown/spell/thermal_vision::thermal_duration * GET_MUTATION_POWER(src)

/datum/action/cooldown/spell/thermal_vision
name = "Activate Thermal Vision"
desc = "You can see thermal signatures, at the cost of your eyesight."
button_icon = 'icons/mob/actions/actions_changeling.dmi'
button_icon_state = "augmented_eyesight"

cooldown_time = 25 SECONDS
cooldown_time = 60 SECONDS
spell_requirements = NONE

/// How much eye damage is given on cast
var/eye_damage = 10
var/eye_damage = 7.5
/// The duration of the thermal vision
var/thermal_duration = 10 SECONDS
var/thermal_duration = 30 SECONDS

/datum/action/cooldown/spell/thermal_vision/Remove(mob/living/remove_from)
REMOVE_TRAIT(remove_from, TRAIT_THERMAL_VISION, GENETIC_MUTATION)
Expand Down Expand Up @@ -198,4 +198,3 @@
if(..())
return
REMOVE_TRAIT(owner, TRAIT_ILLITERATE, GENETIC_MUTATION)

4 changes: 2 additions & 2 deletions code/datums/quirks/negative_quirks/addict.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
return ..()

/datum/quirk/item_quirk/addict/remove()
if(quirk_holder && reagent_instance)
for(var/addiction_type in subtypesof(/datum/addiction))
if(!QDELETED(quirk_holder) && reagent_instance)
for(var/addiction_type in GLOB.addictions)
quirk_holder.mind.remove_addiction_points(addiction_type, MAX_ADDICTION_POINTS)

/datum/quirk/item_quirk/addict/smoker
Expand Down
44 changes: 20 additions & 24 deletions code/datums/quirks/negative_quirks/allergic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,28 @@

give_item_to_holder(dogtag, list(OCATION_BACKPACK = ITEM_SLOT_BACKPACK, LOCATION_HANDS = ITEM_SLOT_HANDS), flavour_text = "Make sure medical staff can see this...", notify_player = TRUE)

/datum/quirk/item_quirk/allergic/add()
RegisterSignal(quirk_holder, COMSIG_MOB_REAGENT_CHECK, PROC_REF(block_metab))

/datum/quirk/item_quirk/allergic/remove()
UnregisterSignal(quirk_holder, COMSIG_MOB_REAGENT_CHECK)

/datum/quirk/item_quirk/allergic/post_add()
quirk_holder.add_mob_memory(/datum/memory/key/quirk_allergy, allergy_string = allergy_string)
to_chat(quirk_holder, span_boldnotice("You are allergic to [allergy_string], make sure not to consume any of these!"))

/datum/quirk/item_quirk/allergic/process(seconds_per_tick)
if(!iscarbon(quirk_holder))
return

if(HAS_TRAIT(quirk_holder, TRAIT_STASIS))
return

if(quirk_holder.stat == DEAD)
return
/datum/quirk/item_quirk/allergic/proc/block_metab(mob/living/carbon/source, datum/reagent/chem, seconds_per_tick, times_fired)
SIGNAL_HANDLER

var/mob/living/carbon/carbon_quirk_holder = quirk_holder
for(var/allergy in allergies)
var/datum/reagent/instantiated_med = carbon_quirk_holder.reagents.has_reagent(allergy)
if(!instantiated_med)
continue
//Just halts the progression, I'd suggest you run to medbay asap to get it fixed
if(carbon_quirk_holder.reagents.has_reagent(/datum/reagent/medicine/epinephrine))
instantiated_med.reagent_removal_skip_list |= ALLERGIC_REMOVAL_SKIP
return //intentionally stops the entire proc so we avoid the organ damage after the loop
instantiated_med.reagent_removal_skip_list -= ALLERGIC_REMOVAL_SKIP
carbon_quirk_holder.adjustToxLoss(3 * seconds_per_tick)
carbon_quirk_holder.reagents.add_reagent(/datum/reagent/toxin/histamine, 3 * seconds_per_tick)
if(SPT_PROB(10, seconds_per_tick))
carbon_quirk_holder.vomit(VOMIT_CATEGORY_DEFAULT)
carbon_quirk_holder.adjustOrganLoss(pick(ORGAN_SLOT_BRAIN,ORGAN_SLOT_APPENDIX,ORGAN_SLOT_LUNGS,ORGAN_SLOT_HEART,ORGAN_SLOT_LIVER,ORGAN_SLOT_STOMACH),10)
if(!is_type_in_list(chem, allergies))
return NONE
// Having epinephrine stops metabolization of an allergen, but doesn't remove it from the system
if(source.reagents.has_reagent(/datum/reagent/medicine/epinephrine))
return COMSIG_MOB_STOP_REAGENT_METABOLISM
// Otherwise the allergen causes a ton of damage though otherwise processes normally
source.apply_damage(3 * seconds_per_tick, TOX)
source.reagents.add_reagent(/datum/reagent/toxin/histamine, 3 * seconds_per_tick)
if(SPT_PROB(10, seconds_per_tick))
source.vomit(VOMIT_CATEGORY_DEFAULT)
source.adjustOrganLoss(pick(ORGAN_SLOT_BRAIN, ORGAN_SLOT_APPENDIX, ORGAN_SLOT_LUNGS, ORGAN_SLOT_HEART, ORGAN_SLOT_LIVER, ORGAN_SLOT_STOMACH), 10)
return NONE
14 changes: 11 additions & 3 deletions code/game/machinery/computer/crew.dm
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,17 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new)
ui = new(user, src, "CrewConsole")
ui.open()

/datum/crewmonitor/proc/show(mob/M, source)
ui_sources[WEAKREF(M)] = WEAKREF(source)
ui_interact(M)
// NON-MODULE CHANGE
/datum/crewmonitor/proc/show(mob/user, atom/source)
if(isobj(source) && !ui_sources[WEAKREF(user)])
user.examine_feedback(source)

ui_sources[WEAKREF(user)] = WEAKREF(source)
ui_interact(user)

// NON-MODULE CHANGE
/datum/crewmonitor/ui_close(mob/user)
ui_sources -= WEAKREF(user)

/datum/crewmonitor/ui_host(mob/user)
var/datum/weakref/host_ref = ui_sources[WEAKREF(user)]
Expand Down
Loading