Skip to content

Commit

Permalink
Merge pull request #3268 from MistakeNot4892/devupdate
Browse files Browse the repository at this point in the history
Dev update from staging.
  • Loading branch information
MistakeNot4892 authored Aug 9, 2023
2 parents c533562 + 9a72d63 commit 047a87a
Show file tree
Hide file tree
Showing 55 changed files with 383 additions and 240 deletions.
2 changes: 1 addition & 1 deletion code/__defines/fluids.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define FLUID_QDEL_POINT 1 // Depth a fluid begins self-deleting
#define FLUID_MINIMUM_TRANSFER 10 // Minimum amount that a flowing fluid will transfer from one turf to another.
#define FLUID_MINIMUM_TRANSFER 5 // Minimum amount that a flowing fluid will transfer from one turf to another.
#define FLUID_PUDDLE 25 // Minimum total depth that a fluid needs before it will start spreading.
#define FLUID_SHALLOW 200 // Depth shallow icon is used
#define FLUID_OVER_MOB_HEAD 300 // Depth icon layers over mobs.
Expand Down
38 changes: 36 additions & 2 deletions code/__defines/items_clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@
#define BP_R_LEG "r_leg"
#define BP_L_HAND "l_hand"
#define BP_R_HAND "r_hand"
#define BP_L_HAND_UPPER "l_u_hand"
#define BP_R_HAND_UPPER "r_u_hand"
#define BP_L_ARM "l_arm"
#define BP_R_ARM "r_arm"
#define BP_HEAD "head"
Expand All @@ -193,8 +195,38 @@
// Other inventory-related slots (also organs).
#define BP_MOUTH "mouth"

var/global/list/all_limb_tags = list(BP_CHEST, BP_GROIN, BP_TAIL, BP_HEAD, BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND, BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT)
var/global/list/all_limb_tags_by_depth = list(BP_HEAD, BP_L_HAND, BP_R_HAND, BP_L_ARM, BP_R_ARM, BP_L_FOOT, BP_R_FOOT, BP_L_LEG, BP_R_LEG, BP_GROIN, BP_TAIL, BP_CHEST)
var/global/list/all_limb_tags = list(
BP_CHEST,
BP_GROIN,
BP_TAIL,
BP_HEAD,
BP_L_ARM,
BP_R_ARM,
BP_L_HAND,
BP_R_HAND,
BP_L_HAND_UPPER,
BP_R_HAND_UPPER,
BP_L_LEG,
BP_R_LEG,
BP_L_FOOT,
BP_R_FOOT
)
var/global/list/all_limb_tags_by_depth = list(
BP_HEAD,
BP_L_HAND,
BP_L_HAND_UPPER,
BP_R_HAND,
BP_R_HAND_UPPER,
BP_L_ARM,
BP_R_ARM,
BP_L_FOOT,
BP_R_FOOT,
BP_L_LEG,
BP_R_LEG,
BP_GROIN,
BP_TAIL,
BP_CHEST
)

var/global/list/default_onmob_icons = list(
BP_L_HAND = 'icons/mob/onmob/items/lefthand.dmi',
Expand All @@ -205,6 +237,8 @@ var/global/list/default_onmob_icons = list(
var/global/list/all_inventory_slots = list(
BP_L_HAND,
BP_R_HAND,
BP_L_HAND_UPPER,
BP_R_HAND_UPPER,
BP_MOUTH,
slot_w_uniform_str,
slot_head_str,
Expand Down
5 changes: 4 additions & 1 deletion code/_helpers/cmp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,7 @@
return A.sort_priority - B.sort_priority

/proc/cmp_submap_asc(var/datum/submap/A, var/datum/submap/B)
return A.archetype.sort_priority - B.archetype.sort_priority
return A.archetype.sort_priority - B.archetype.sort_priority

/proc/cmp_gripper_asc(datum/inventory_slot/gripper/a, datum/inventory_slot/gripper/b)
return a.hand_sort_priority - b.hand_sort_priority
14 changes: 13 additions & 1 deletion code/_onclick/hud/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,27 @@

// Build held item boxes for missing slots.
var/list/held_slots = mymob.get_held_item_slots()

// Sort our slots for display.
var/list/gripper_datums = list()
for(var/hand_tag in held_slots)
gripper_datums += mymob.get_inventory_slot_datum(hand_tag)
gripper_datums = sortTim(gripper_datums, /proc/cmp_gripper_asc)

for(var/datum/inventory_slot/inv_slot in gripper_datums)

// Re-order the held slot list so it aligns with the display order.
var/hand_tag = inv_slot.slot_id
held_slots -= hand_tag
held_slots += hand_tag

var/obj/screen/inventory/inv_box
for(var/obj/screen/inventory/existing_box in hand_hud_objects)
if(existing_box.slot_id == hand_tag)
inv_box = existing_box
break
if(!inv_box)
inv_box = new /obj/screen/inventory()
var/datum/inventory_slot/inv_slot = mymob.get_inventory_slot_datum(hand_tag)
inv_box.SetName(hand_tag)
inv_box.icon = ui_style
inv_box.icon_state = "hand_base"
Expand Down
7 changes: 5 additions & 2 deletions code/controllers/subsystems/fluids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,21 @@ SUBSYSTEM_DEF(fluids)
current_depth = reagent_holder?.total_volume || 0

// How is this happening
if(current_depth == -1.#IND || current_depth == 1.#IND)
if(QDELETED(reagent_holder) || current_depth == -1.#IND || current_depth == 1.#IND)
qdel(current_fluid)
continue

// Evaporation: todo, move liquid into current_turf.zone air contents if applicable.
if(current_depth <= FLUID_MINIMUM_TRANSFER && prob(15))
if(current_depth <= FLUID_PUDDLE && prob(60))
current_turf.remove_fluids(min(current_depth, 1), defer_update = TRUE)
current_depth = current_turf.get_fluid_depth()
if(current_depth <= FLUID_QDEL_POINT)
qdel(current_fluid)
continue

// Wash our turf.
current_turf.fluid_act(reagent_holder)

if(isspaceturf(current_turf) || istype(current_turf, /turf/exterior))
removing = round(current_depth * 0.5)
if(removing > 0)
Expand Down
20 changes: 17 additions & 3 deletions code/datums/inventory_slots/inventory_gripper.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
/datum/inventory_slot/gripper
var/hand_sort_priority = 1
var/can_use_held_item = TRUE
var/dexterity = DEXTERITY_FULL
// For reference, grippers do not use ui_loc, they have it set dynamically during /datum/hud/proc/rebuild_hands()

/datum/inventory_slot/gripper/proc/get_dexterity()
return dexterity

/datum/inventory_slot/gripper/GetCloneArgs()
return list(slot_id, ui_loc, overlay_slot, ui_label)

Expand All @@ -21,18 +26,27 @@
return "You are holding [_holding.get_examine_line()] in your [E?.name || lowertext(slot_name)]."
return "[pronouns.He] [pronouns.is] holding [_holding.get_examine_line()] in [pronouns.his] [E?.name || lowertext(slot_name)]."

/datum/inventory_slot/gripper/can_equip_to_slot(var/mob/user, var/obj/item/prop, var/disable_warning)
return ..() && user.check_dexterity(DEXTERITY_HOLD_ITEM)

// Hand subtypes below
// Mouths are used by diona nymphs and Ascent babies to eat stuff, not just hold stuff in the mouth.
/datum/inventory_slot/gripper/mouth
slot_name = "Mouth"
slot_id = BP_MOUTH
requires_organ_tag = null
requires_organ_tag = BP_HEAD
can_use_held_item = FALSE
overlay_slot = BP_MOUTH
ui_label = "M"
hand_sort_priority = 3

/datum/inventory_slot/gripper/mouth/can_equip_to_slot(mob/user, obj/item/prop, disable_warning, ignore_equipped)
. = ..() && prop.w_class <= user.can_pull_size

/datum/inventory_slot/gripper/mouth/equipped(var/mob/living/user, var/obj/item/prop, var/redraw_mob = TRUE, var/delete_old_item = TRUE)
// Mouths are used by diona nymphs and Ascent babies to eat stuff, not just hold stuff in the mouth.
/datum/inventory_slot/gripper/mouth/nymph
requires_organ_tag = null

/datum/inventory_slot/gripper/mouth/nymph/equipped(var/mob/living/user, var/obj/item/prop, var/redraw_mob = TRUE, var/delete_old_item = TRUE)
. = ..()
if(.)

Expand Down
4 changes: 2 additions & 2 deletions code/game/atoms_fluids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
return

/atom/proc/fluid_act(var/datum/reagents/fluids)
fluids.touch(src)
if(reagents && fluids.total_volume >= FLUID_SHALLOW && ATOM_IS_OPEN_CONTAINER(src))
SHOULD_CALL_PARENT(TRUE)
if(reagents && fluids?.total_volume >= FLUID_SHALLOW && ATOM_IS_OPEN_CONTAINER(src))
reagents.trans_to_holder(fluids, reagents.total_volume)
fluids.trans_to_holder(reagents, min(fluids.total_volume, reagents.maximum_volume))

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/_machines_base/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ Class Procs:
// This is really pretty crap and should be overridden for specific machines.
/obj/machinery/fluid_act(var/datum/reagents/fluids)
..()
if(!(stat & (NOPOWER|BROKEN)) && !waterproof && (fluids.total_volume > FLUID_DEEP))
if(!QDELETED(src) && !(stat & (NOPOWER|BROKEN)) && !waterproof && (fluids?.total_volume > FLUID_DEEP))
explosion_act(3)

/obj/machinery/Move()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/chem/water.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

/obj/effect/effect/water/Bump(atom/A)
if(reagents)
reagents.touch(A)
A.fluid_act(reagents)
return ..()

//Used by spraybottles.
Expand Down
7 changes: 5 additions & 2 deletions code/game/objects/effects/decals/cleanable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@
set_extension(src, scent_type, cleanable_scent, scent_intensity, scent_descriptor, scent_range)

/obj/effect/decal/cleanable/fluid_act(var/datum/reagents/fluid)
reagents?.trans_to(fluid, reagents.total_volume)
qdel(src)
SHOULD_CALL_PARENT(FALSE)
if(fluid?.total_volume && !QDELETED(src))
if(reagents?.total_volume)
reagents.trans_to(fluid, reagents.total_volume)
qdel(src)
17 changes: 12 additions & 5 deletions code/game/objects/effects/fluids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
alpha = 0
color = COLOR_LIQUID_WATER

var/last_slipperiness = 0
var/last_flow_strength = 0
var/last_flow_dir = 0
var/update_lighting = FALSE
Expand All @@ -34,6 +35,12 @@

/obj/effect/fluid/on_reagent_change()
. = ..()

if(reagents?.total_volume)
var/decl/material/primary_reagent = reagents.get_primary_reagent_decl()
if(primary_reagent)
last_slipperiness = primary_reagent.slipperiness

ADD_ACTIVE_FLUID(src)
for(var/checkdir in global.cardinal)
var/obj/effect/fluid/F = locate() in get_step(loc, checkdir)
Expand All @@ -51,8 +58,8 @@
REMOVE_ACTIVE_FLUID(src)
SSfluids.pending_flows -= src
. = ..()
if(istype(T) && reagents?.total_volume > 0)
T.wet_floor()
if(istype(T) && last_slipperiness > 0)
T.wet_floor(last_slipperiness)

/obj/effect/fluid/on_update_icon()

Expand Down Expand Up @@ -97,7 +104,7 @@
set_light(0)

// Map helper.
/obj/effect/fluid_mapped
/obj/abstract/fluid_mapped
name = "mapped flooded area"
alpha = 125
icon_state = "shallow_still"
Expand All @@ -106,14 +113,14 @@
var/fluid_type = /decl/material/liquid/water
var/fluid_initial = FLUID_MAX_DEPTH

/obj/effect/fluid_mapped/Initialize()
/obj/abstract/fluid_mapped/Initialize()
..()
var/turf/T = get_turf(src)
if(istype(T))
T.add_fluid(fluid_type, fluid_initial)
return INITIALIZE_HINT_QDEL

/obj/effect/fluid_mapped/fuel
/obj/abstract/fluid_mapped/fuel
name = "spilled fuel"
fluid_type = /decl/material/liquid/fuel
fluid_initial = 10
Expand Down
5 changes: 4 additions & 1 deletion code/game/objects/items/weapons/flame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@

/obj/item/flame/fluid_act(var/datum/reagents/fluids)
..()
if(!waterproof && lit)
if(!QDELETED(src) && fluids?.total_volume && !waterproof && lit)
var/turf/location = get_turf(src)
if(location)
location.hotspot_expose(700, 5) // Potentially set fire to fuel etc.
extinguish(no_message = TRUE)

/obj/item/flame/get_heat()
Expand Down
5 changes: 4 additions & 1 deletion code/game/objects/items/weapons/tools/weldingtool.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@

/obj/item/weldingtool/fluid_act(var/datum/reagents/fluids)
..()
if(welding && !waterproof)
if(!QDELETED(src) && fluids?.total_volume && welding && !waterproof)
var/turf/location = get_turf(src)
if(location)
location.hotspot_expose(WELDING_TOOL_HOTSPOT_TEMP_ACTIVE, 50, 1)
turn_off()

/obj/item/weldingtool/Process()
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,8 @@
/decl/interaction_handler/rotate/invoked(atom/target, mob/user, obj/item/prop)
var/obj/O = target
O.rotate(user)

/obj/fluid_act(var/datum/reagents/fluids)
..()
if(!QDELETED(src) && fluids?.total_volume)
fluids.touch_obj(src)
2 changes: 1 addition & 1 deletion code/game/objects/structures/fires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

/obj/structure/fire_source/fluid_act(datum/reagents/fluids)
. = ..()
if(fluids.total_volume > 0)
if(!QDELETED(src) && fluids?.total_volume)
take_reagents(fluids)

/obj/structure/fire_source/explosion_act()
Expand Down
8 changes: 5 additions & 3 deletions code/game/turfs/turf_fluids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@
return flooring?.height || 0

/turf/fluid_act(var/datum/reagents/fluids)
fluids.touch(src)
for(var/atom/movable/AM as anything in get_contained_external_atoms())
AM.fluid_act(fluids)
..()
if(!QDELETED(src) && fluids?.total_volume)
fluids.touch_turf(src)
for(var/atom/movable/AM as anything in get_contained_external_atoms())
AM.fluid_act(fluids)

/turf/proc/remove_fluids(var/amount, var/defer_update)
var/obj/effect/fluid/F = locate() in src
Expand Down
7 changes: 4 additions & 3 deletions code/modules/admin/verbs/randomverbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,10 @@ Traitors and the like can also be revived with the previous role mostly intact.
new_character.mind.assigned_role = global.using_map.default_job_title//If they somehow got a null assigned role.

//DNA
new_character.dna.ready_dna(new_character)
if(record_found)//Pull up their name from database records if they did have a mind.
new_character.dna.unique_enzymes = record_found.get_dna()
if(new_character.dna)
new_character.dna.ready_dna(new_character)
if(record_found)//Pull up their name from database records if they did have a mind.
new_character.dna.unique_enzymes = record_found.get_dna()
new_character.key = G_found.key

/*
Expand Down
7 changes: 5 additions & 2 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,11 @@ var/global/list/time_prefs_fixed = list()
if(LAZYLEN(appearance_descriptors))
character.appearance_descriptors = appearance_descriptors.Copy()

character.dna.ready_dna(character)
character.dna.b_type = client.prefs.blood_type
if(character.dna)
character.dna.ready_dna(character)
if(client.prefs?.blood_type)
character.dna.b_type = client.prefs.blood_type

character.force_update_limbs()
character.update_mutations(0)
character.update_body(0)
Expand Down
5 changes: 4 additions & 1 deletion code/modules/clothing/masks/smokable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@

/obj/item/clothing/mask/smokable/fluid_act(var/datum/reagents/fluids)
..()
if(!waterproof && lit)
if(!QDELETED(src) && fluids?.total_volume && !waterproof && lit)
var/turf/location = get_turf(src)
if(location)
location.hotspot_expose(700, 5)
extinguish(no_message = TRUE)

/obj/item/clothing/mask/smokable/proc/light(var/flavor_text = "[usr] lights the [name].")
Expand Down
2 changes: 1 addition & 1 deletion code/modules/emotes/emote_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
if(m_type != use_emote.message_type && use_emote.conscious && stat != CONSCIOUS)
return

if(use_emote.message_type == AUDIBLE_MESSAGE && is_muzzled())
if(use_emote.message_type == AUDIBLE_MESSAGE && get_item_blocking_speech())
audible_message("<b>\The [src]</b> makes a muffled sound.")
return
else
Expand Down
2 changes: 1 addition & 1 deletion code/modules/materials/_materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/gas_overlay)
for(var/obj/effect/overlay/wallrot/E in W)
W.visible_message(SPAN_NOTICE("\The [E] is completely dissolved by the solution!"))
qdel(E)
if(slipperiness != 0)
if(slipperiness != 0 && !T.check_fluid_depth()) // Don't make floors slippery if they have an active fluid on top of them please.
if(slipperiness < 0)
W.unwet_floor(TRUE)
else
Expand Down
Loading

0 comments on commit 047a87a

Please sign in to comment.