Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhials committed Jun 23, 2024
2 parents bc61bba + 1caab50 commit 443938e
Show file tree
Hide file tree
Showing 49 changed files with 344 additions and 130 deletions.
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,7 @@
#define COMSIG_ATOM_PRE_CLEAN "atom_pre_clean"
///cancel clean
#define COMSIG_ATOM_CANCEL_CLEAN (1<<0)

/// From /obj/effect/particle_effect/sparks/proc/sparks_touched(datum/source, atom/movable/singed)
#define COMSIG_ATOM_TOUCHED_SPARKS "atom_touched_sparks"
#define COMSIG_ATOM_TOUCHED_HAZARDOUS_SPARKS "atom_touched_hazardous_sparks"
9 changes: 5 additions & 4 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ GLOBAL_LIST_INIT(skin_tone_names, list(
/proc/deadchat_broadcast(message, source=null, mob/follow_target=null, turf/turf_target=null, speaker_key=null, message_type=DEADCHAT_REGULAR, admin_only=FALSE)
message = span_deadsay("[source][span_linkify(message)]")

if(admin_only)
message += span_deadsay(" (This is viewable to admins only).")

for(var/mob/M in GLOB.player_list)
var/chat_toggles = TOGGLES_DEFAULT_CHAT
var/toggles = TOGGLES_DEFAULT
Expand All @@ -341,10 +344,8 @@ GLOBAL_LIST_INIT(skin_tone_names, list(
toggles = prefs.toggles
ignoring = prefs.ignoring
if(admin_only)
if (!M.client?.holder)
return
else
message += span_deadsay(" (This is viewable to admins only).")
if(!M.client?.holder)
continue
var/override = FALSE
if(M.client?.holder && (chat_toggles & CHAT_DEAD))
override = TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/bloodysoles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
///lowers bloody_shoes[index] by adjust_by
/datum/component/bloodysoles/proc/adjust_bloody_shoes(index, adjust_by)
bloody_shoes[index] = max(bloody_shoes[index] - adjust_by, 0)
on_changed_bloody_shoes()
on_changed_bloody_shoes(index)

/datum/component/bloodysoles/proc/set_bloody_shoes(index, new_value)
bloody_shoes[index] = new_value
Expand Down
8 changes: 8 additions & 0 deletions code/datums/components/combustible_flooder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, PROC_REF(attackby_react))
RegisterSignal(parent, COMSIG_ATOM_FIRE_ACT, PROC_REF(flame_react))
RegisterSignal(parent, COMSIG_ATOM_TOUCHED_SPARKS, PROC_REF(sparks_react))
RegisterSignal(parent, COMSIG_ATOM_BULLET_ACT, PROC_REF(projectile_react))
RegisterSignal(parent, COMSIG_ATOM_TOOL_ACT(TOOL_WELDER), PROC_REF(welder_react))
if(isturf(parent))
Expand Down Expand Up @@ -62,6 +63,13 @@
if(exposed_temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
flood(null, exposed_temperature)

/// sparks_touched reaction.
/datum/component/combustible_flooder/proc/sparks_react(datum/source, obj/effect/particle_effect/sparks/sparks)
SIGNAL_HANDLER

if(sparks) // this shouldn't ever be false but existence is mysterious
flood(null, FIRE_MINIMUM_TEMPERATURE_TO_SPREAD)

/// Hotspot reaction.
/datum/component/combustible_flooder/proc/hotspots_react(datum/source, air, exposed_temperature)
SIGNAL_HANDLER
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/food/processable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
var/found_location = found_item.loc
var/found_turf = isturf(found_location)
var/found_table = locate(/obj/structure/table) in found_location
var/found_tray = locate(/obj/item/storage/bag/tray) in found_location
var/found_tray = locate(/obj/item/storage/bag/tray) in found_location || locate(/obj/item/plate/oven_tray) in found_location
if(!found_turf && !istype(found_location, /obj/item/storage/bag/tray) || found_turf && !(found_table || found_tray))
to_chat(user, span_notice("You cannot make [initial(result_atom_type.name)] here! You need a table or at least a tray."))
return
Expand Down
5 changes: 5 additions & 0 deletions code/datums/elements/strippable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
if (!isnull(should_strip_proc_path) && !call(source, should_strip_proc_path)(user))
return

if (isliving(source))
var/mob/living/mob = source
if (mob.can_be_held && (user.grab_state == GRAB_AGGRESSIVE) && (user.pulling == source))
return

var/datum/strip_menu/strip_menu = LAZYACCESS(strip_menus, source)

if (isnull(strip_menu))
Expand Down
12 changes: 12 additions & 0 deletions code/datums/status_effects/debuffs/fire_stacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,18 @@
/// Type of mob light emitter we use when on fire
var/moblight_type = /obj/effect/dummy/lighting_obj/moblight/fire

/datum/status_effect/fire_handler/fire_stacks/proc/owner_touched_sparks()
SIGNAL_HANDLER

ignite()

/datum/status_effect/fire_handler/fire_stacks/on_creation(mob/living/new_owner, new_stacks, forced = FALSE)
. = ..()
RegisterSignal(owner, COMSIG_ATOM_TOUCHED_SPARKS, PROC_REF(owner_touched_sparks))

/datum/status_effect/fire_handler/fire_stacks/on_remove()
UnregisterSignal(owner, COMSIG_ATOM_TOUCHED_SPARKS)

/datum/status_effect/fire_handler/fire_stacks/tick(seconds_between_ticks)
if(stacks <= 0)
qdel(src)
Expand Down
50 changes: 25 additions & 25 deletions code/game/machinery/washing_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -333,33 +333,33 @@ GLOBAL_LIST_INIT(dye_registry, list(
default_unfasten_wrench(user, tool)
return ITEM_INTERACT_SUCCESS

/obj/machinery/washing_machine/attackby(obj/item/W, mob/living/user, params)
if(default_deconstruction_screwdriver(user, null, null, W))
update_appearance()
return

else if(!user.combat_mode)
if (!state_open)
to_chat(user, span_warning("Open the door first!"))
return TRUE

if(bloody_mess)
to_chat(user, span_warning("[src] must be cleaned up first!"))
return TRUE

if(contents.len >= max_wash_capacity)
to_chat(user, span_warning("The washing machine is full!"))
return TRUE

if(!user.transferItemToLoc(W, src))
to_chat(user, span_warning("\The [W] is stuck to your hand, you cannot put it in the washing machine!"))
return TRUE
if(W.dye_color)
color_source = W
/obj/machinery/washing_machine/screwdriver_act(mob/living/user, obj/item/tool)
if (!state_open)
default_deconstruction_screwdriver(user, null, null, tool)
update_appearance()
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_BLOCKING

/obj/machinery/washing_machine/item_interaction(mob/living/user, obj/item/item, list/modifiers)
if(user.combat_mode)
return NONE
if (!state_open)
to_chat(user, span_warning("Open the door first!"))
return ITEM_INTERACT_BLOCKING
if(bloody_mess)
to_chat(user, span_warning("[src] must be cleaned up first!"))
return ITEM_INTERACT_BLOCKING
if(contents.len >= max_wash_capacity)
to_chat(user, span_warning("The washing machine is full!"))
return ITEM_INTERACT_BLOCKING
if(!user.transferItemToLoc(item, src))
to_chat(user, span_warning("\The [item] is stuck to your hand, you cannot put it in the washing machine!"))
return ITEM_INTERACT_BLOCKING
if(item.dye_color)
color_source = item
update_appearance()
return ITEM_INTERACT_SUCCESS

else
return ..()

/obj/machinery/washing_machine/attack_hand(mob/living/user, list/modifiers)
. = ..()
Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/effects/decals/cleanable/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@
COMSIG_TURF_MOVABLE_THROW_LANDED = PROC_REF(ignition_trigger),
)
AddElement(/datum/element/connect_loc, ignition_trigger_connections)
RegisterSignal(src, COMSIG_ATOM_TOUCHED_SPARKS, PROC_REF(ignition_trigger))
for(var/obj/effect/decal/cleanable/fuel_pool/pool in get_turf(src)) //Can't use locate because we also belong to that turf
if(pool == src)
continue
Expand Down Expand Up @@ -532,6 +533,8 @@
var/mob/living/enflamed_liver = enflammable_atom
if(enflamed_liver.on_fire)
ignite()
else if(istype(enflammable_atom, /obj/effect/particle_effect/sparks))
ignite()


/obj/effect/decal/cleanable/fuel_pool/hivis
Expand Down
39 changes: 12 additions & 27 deletions code/game/objects/effects/effect_system/effects_sparks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
*/
/obj/effect/particle_effect/sparks/proc/affect_location(turf/location, just_initialized = FALSE)
location.hotspot_expose(1000,100)
SEND_SIGNAL(location, COMSIG_ATOM_TOUCHED_SPARKS, src) // for plasma floors; other floor types only have to worry about the mysterious HAZARDOUS sparks
if(just_initialized)
for(var/atom/movable/singed in location)
sparks_touched(src, singed)
Expand All @@ -67,43 +68,27 @@
* This is invoked by the signals sent by every atom when they're crossed or crossing something. It
* signifies that something has been touched by sparks, and should be affected by possible pyrotechnic affects..
* datum/source - Can either be the spark itself or an object that just walked into it
* mob/living/singed_mob - The mob that was touched by the spark
* mob/living/singed - What was touched by the spark
*/
/obj/effect/particle_effect/sparks/proc/sparks_touched(datum/source, atom/movable/singed)
/obj/effect/particle_effect/sparks/proc/sparks_touched(datum/source, atom/singed)
SIGNAL_HANDLER

SEND_SIGNAL(singed, COMSIG_ATOM_TOUCHED_SPARKS, src)
if(isobj(singed))
var/obj/singed_obj = singed
if(singed_obj.reagents)
var/datum/reagents/reagents = singed_obj.reagents // heat up things that contain reagents before we check to see if they burn
if(singed.reagents)
var/datum/reagents/reagents = singed.reagents // heat up things that contain reagents before we check to see if they burn
reagents?.expose_temperature(1000) // we set this at 1000 because that's the max reagent temp for a chem heater, higher temps require more than sparks
if(singed_obj.custom_materials && (GET_MATERIAL_REF(/datum/material/plasma) in singed_obj.custom_materials))
singed_obj.fire_act(FIRE_MINIMUM_TEMPERATURE_TO_SPREAD,100)
return // if it's made of plasma we just start burning no matter what, even furniture (see right below)
if(isstructure(singed_obj) || ismachinery(singed_obj)) // don't ignite furniture even if it's flammable, leave that to actual fires
return
if(singed_obj.resistance_flags & FLAMMABLE && !(singed_obj.resistance_flags & ON_FIRE)) //only fire_act flammable objects instead of burning EVERYTHING
if(isitem(singed_obj))
var/obj/item/singed_item = singed_obj
var/ignite_chance = 120 // base chance applies to anything under WEIGHT_CLASS_NORMAL, so burn everything flammable that's small/tiny
if(singed_item.w_class > WEIGHT_CLASS_SMALL)
var/ignite_chance_penalty = (singed_item.w_class * 2 + round(singed_item.w_class * 0.5)) * 10 // size penalties to ignite chance: normal = 70, bulky = 100,
ignite_chance -= ignite_chance_penalty // the bigger the item, the less likely it is to ignite
if(prob(ignite_chance))
singed_item.fire_act(FIRE_MINIMUM_TEMPERATURE_TO_SPREAD,100)
return
else
singed_obj.fire_act(FIRE_MINIMUM_TEMPERATURE_TO_SPREAD,100)
return
if(isliving(singed))
var/mob/living/singed_living = singed
if(singed_living.fire_stacks)
singed_living.ignite_mob(FALSE) //ignite the mob, silent = FALSE (You're set on fire!)
return
if(ishuman(singed))
var/mob/living/carbon/human/singed_human = singed
for(var/obj/item/anything in singed_human.get_visible_items())
sparks_touched(src, anything)

/datum/effect_system/spark_spread
effect_type = /obj/effect/particle_effect/sparks



/datum/effect_system/spark_spread/quantum
effect_type = /obj/effect/particle_effect/sparks/quantum

Expand Down
9 changes: 9 additions & 0 deletions code/game/objects/items/cigs_lighters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
light()
AddComponent(/datum/component/knockoff, 90, list(BODY_ZONE_PRECISE_MOUTH), slot_flags) //90% to knock off when wearing a mask
AddElement(/datum/element/update_icon_updates_onmob)
RegisterSignal(src, COMSIG_ATOM_TOUCHED_SPARKS, PROC_REF(sparks_touched))
icon_state = icon_off
inhand_icon_state = inhand_icon_off

Expand Down Expand Up @@ -306,6 +307,14 @@ CIGARETTE PACKETS ARE IN FANCY.DM
icon_state = icon_off
inhand_icon_state = inhand_icon_off


/obj/item/clothing/mask/cigarette/proc/sparks_touched(datum/source, obj/effect/particle_effect)
SIGNAL_HANDLER

if(lit)
return
light()

/// Lights the cigarette with given flavor text.
/obj/item/clothing/mask/cigarette/proc/light(flavor_text = null)
if(lit)
Expand Down
39 changes: 33 additions & 6 deletions code/game/objects/items/dna_probe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,46 @@
var/datum/weakref/dna_vault_ref

/obj/item/dna_probe/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
if(istype(interacting_with, /obj/machinery/dna_vault) && !dna_vault_ref?.resolve())
try_linking_vault(interacting_with, user)
else
scan_dna(interacting_with, user)
if(istype(interacting_with, /obj/machinery/dna_vault))
if(dna_vault_ref?.resolve())
// Weirdly we can upload to any existing DNA vault so long as we're linked to any other existing DNA vault.
return try_upload_dna(interacting_with, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING
else
return try_linking_vault(interacting_with, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING

scan_dna(interacting_with, user)
return ITEM_INTERACT_BLOCKING

/obj/item/dna_probe/proc/try_linking_vault(atom/target, mob/user)
/obj/item/dna_probe/proc/try_linking_vault(obj/machinery/dna_vault/target, mob/user)
var/obj/machinery/dna_vault/our_vault = dna_vault_ref?.resolve()
if(!our_vault)
dna_vault_ref = WEAKREF(target)//linking the dna vault with the probe
balloon_alert(user, "vault linked")
playsound(src, 'sound/machines/terminal_success.ogg', 50)
return
return TRUE
return FALSE

/obj/item/dna_probe/proc/try_upload_dna(obj/machinery/dna_vault/target, mob/user)
var/uploaded = 0
var/plant_dna_length = length(stored_dna_plants)
var/human_dna_length = length(stored_dna_human)
var/animal_dna_length = length(stored_dna_animal)
if(plant_dna_length)
uploaded += plant_dna_length
target.plant_dna += stored_dna_plants
stored_dna_plants.Cut()
if(human_dna_length)
uploaded += human_dna_length
target.human_dna += stored_dna_human
stored_dna_human.Cut()
if(animal_dna_length)
uploaded += animal_dna_length
target.animal_dna += stored_dna_animal
stored_dna_animal.Cut()
target.check_goal()
playsound(target, 'sound/misc/compiler-stage1.ogg', 50)
to_chat(user, span_notice("[uploaded] new datapoints uploaded."))
return uploaded

/obj/item/dna_probe/proc/scan_dna(atom/target, mob/user)
var/obj/machinery/dna_vault/our_vault = dna_vault_ref?.resolve()
Expand Down
Loading

0 comments on commit 443938e

Please sign in to comment.