Skip to content

Commit

Permalink
Merge pull request #4781 from MistakeNot4892/devupdate
Browse files Browse the repository at this point in the history
Updating dev from staging.
  • Loading branch information
MistakeNot4892 authored Jan 20, 2025
2 parents 5cd6a30 + ae7d77f commit 42ac5a3
Show file tree
Hide file tree
Showing 73 changed files with 354 additions and 199 deletions.
22 changes: 15 additions & 7 deletions code/controllers/subsystems/fluids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,21 @@ SUBSYSTEM_DEF(fluids)
if(!istype(current_fluid_holder) || QDELETED(current_fluid_holder))
continue
var/pushed_something = FALSE
if(current_fluid_holder.reagents?.total_volume > FLUID_SHALLOW && current_fluid_holder.last_flow_strength >= 10)
for(var/atom/movable/AM as anything in current_fluid_holder.get_contained_external_atoms())
if(AM.is_fluid_pushable(current_fluid_holder.last_flow_strength))
AM.pushed(current_fluid_holder.last_flow_dir)
pushed_something = TRUE
if(pushed_something && prob(1))
playsound(current_fluid_holder, 'sound/effects/slosh.ogg', 25, 1)

if(current_fluid_holder.last_flow_strength >= 10)
// Catwalks mean items will be above the turf; subtract the turf height from our volume.
// TODO: somehow handle stuff that is on a catwalk or on the turf within the same turf.
var/effective_volume = current_fluid_holder.reagents?.total_volume
if(current_fluid_holder.get_supporting_platform())
// Depth is negative height, hence +=. TODO: positive heights? No idea how to handle that.
effective_volume += current_fluid_holder.get_physical_height()
if(effective_volume > FLUID_SHALLOW)
for(var/atom/movable/AM as anything in current_fluid_holder.get_contained_external_atoms())
if(AM.try_fluid_push(effective_volume, current_fluid_holder.last_flow_strength))
AM.pushed(current_fluid_holder.last_flow_dir)
pushed_something = TRUE
if(pushed_something && prob(1))
playsound(current_fluid_holder, 'sound/effects/slosh.ogg', 25, 1)
if(MC_TICK_CHECK)
processing_flows.Cut(1, i+1)
return
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystems/holomap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ SUBSYSTEM_DEF(minimap)
continue
if((tile.turf_flags & TURF_IS_HOLOMAP_OBSTACLE) || (locate(/obj/structure/grille) in tile))
canvas.DrawBox(COLOR_HOLOMAP_OBSTACLE, tile.x + offset_x, tile.y + offset_y)
else if((tile.turf_flags & TURF_IS_HOLOMAP_PATH) || (locate(/obj/structure/catwalk) in tile))
else if((tile.turf_flags & TURF_IS_HOLOMAP_PATH) || tile.get_supporting_platform())
canvas.DrawBox(COLOR_HOLOMAP_PATH, tile.x + offset_x, tile.y + offset_y)
CHECK_TICK
return canvas
Expand Down
7 changes: 5 additions & 2 deletions code/datums/extensions/storage/subtypes_mre.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
open_sound = 'sound/effects/rip1.ogg'

/datum/storage/mre/open(mob/user)
if(!opened)
to_chat(user, "<span class='notice'>You tear open the bag, breaking the vacuum seal.</span>")
var/obj/item/mre/mre = holder
if(istype(mre) && !mre.has_been_opened)
to_chat(user, SPAN_NOTICE("You tear open the bag, breaking the vacuum seal."))
mre.has_been_opened = TRUE
mre.update_icon()
. = ..()

/datum/storage/mrebag
Expand Down
6 changes: 3 additions & 3 deletions code/game/atoms_fluids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/atom/proc/CanFluidPass(var/coming_from)
return TRUE

/atom/movable/proc/is_fluid_pushable(var/amt)
/atom/movable/proc/try_fluid_push(volume, strength)
return simulated && !anchored

/atom/movable/is_flooded(var/lying_mob, var/absolute)
Expand Down Expand Up @@ -47,7 +47,7 @@
// This override exists purely because throwing is movable-level and not atom-level,
// for obvious reasons (that being that non-movable atoms cannot move).
/atom/movable/submerged(depth, above_turf)
above_turf ||= !!throwing
above_turf ||= immune_to_floor_hazards()
return ..()

/obj/item/submerged(depth, above_turf)
Expand All @@ -66,7 +66,7 @@
return ..()

/mob/submerged(depth, above_turf)
above_turf ||= is_floating || !!throwing // check throwing here because of the table check coming before parent call
above_turf ||= immune_to_floor_hazards() // check throwing here because of the table check coming before parent call
var/obj/structure/table/standing_on = locate(/obj/structure/table) in loc
// can't stand on a table if we're floating
if(!above_turf && standing_on && standing_on.mob_offset > 0) // standing atop a table that is a meaningful amount above the ground (not a bench)
Expand Down
9 changes: 8 additions & 1 deletion code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@
return null

/atom/movable/immune_to_floor_hazards()
return ..() || throwing
return ..() || !!throwing

// TODO: make everything use this.
/atom/movable/proc/set_anchored(new_anchored)
Expand All @@ -603,3 +603,10 @@
return TRUE
return FALSE

// updates pixel offsets, triggers fluids, etc.
/atom/movable/proc/on_turf_height_change(new_height)
if(simulated)
reset_offsets()
return TRUE
return FALSE

4 changes: 2 additions & 2 deletions code/game/machinery/turrets/_turrets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
playsound(src.loc, 'sound/weapons/flipblade.ogg', 50, 1)
reloading_progress = 0

else if(stored_magazine && length(stored_magazine.stored_ammo) < stored_magazine.max_ammo)
else if(stored_magazine && stored_magazine.get_stored_ammo_count() < stored_magazine.max_ammo)
var/obj/item/stock_parts/ammo_box/ammo_box = get_component_of_type(/obj/item/stock_parts/ammo_box)
if(ammo_box?.is_functional() && ammo_box.stored_caliber == proj_gun.caliber)
var/obj/item/ammo_casing/casing = ammo_box.remove_ammo(stored_magazine)
Expand Down Expand Up @@ -366,7 +366,7 @@
// Only reload the magazine if we're completely out of ammo or we don't have a target.
if(ammo_remaining == 0)
return TRUE
if(!is_valid_target(target?.resolve()) && length(proj_gun.ammo_magazine.stored_ammo) != proj_gun.ammo_magazine.max_ammo)
if(!is_valid_target(target?.resolve()) && proj_gun.ammo_magazine.get_stored_ammo_count() != proj_gun.ammo_magazine.max_ammo)
return TRUE
else
return FALSE
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/turrets/turret_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@
if(stored_caliber && magazine.caliber != stored_caliber)
to_chat(user, SPAN_WARNING("The caliber of \the [magazine] does not match the caliber stored in \the [src]!"))
return TRUE
if(!length(magazine.stored_ammo))
if(!magazine.get_stored_ammo_count())
to_chat(user, SPAN_WARNING("\The [magazine] is empty!"))
return TRUE
if(length(stored_ammo) >= max_ammo)
to_chat(user, SPAN_WARNING("\The [src] is full!"))
return TRUE

stored_caliber = magazine.caliber
for(var/obj/item/ammo_casing/casing in magazine.stored_ammo)
for(var/obj/item/ammo_casing/casing in magazine.get_stored_ammo_count())
// Just in case.
if(casing.caliber != stored_caliber)
continue
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/__objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@
add_fingerprint(user)
return ..()

/obj/is_fluid_pushable(var/amt)
return ..() && w_class <= round(amt/20)
/obj/try_fluid_push(volume, strength)
return ..() && w_class <= round(strength/20)

/obj/proc/can_embed()
return FALSE
Expand Down
6 changes: 6 additions & 0 deletions code/game/objects/effects/footprints.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
footprints.Cut() // don't qdel images
. = ..()

/obj/effect/footprints/on_turf_height_change(new_height)
if(simulated)
qdel(src)
return TRUE
return FALSE

/obj/effect/footprints/on_update_icon()
set_overlays(footprints?.Copy())
compile_overlays()
Expand Down
5 changes: 4 additions & 1 deletion code/game/objects/items/devices/chameleonproj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@
// As it is, the effect can freely levitate over any open space.
/obj/effect/dummy/chameleon/Move()
. = ..()
if(. && isturf(loc) && loc.has_gravity() && !(locate(/obj/structure/catwalk) in loc) && !(locate(/obj/structure/lattice) in loc))
if(!. || !isturf(loc) || !loc.has_gravity())
return
var/turf/my_turf = loc
if(!my_turf.get_supporting_platform() && !(locate(/obj/structure/lattice) in loc))
disrupted()

/datum/movement_handler/delay/chameleon_projector
Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/items/weapons/storage/fancy/_fancy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

/obj/item/box/fancy/proc/update_icon_state()
icon_state = initial(icon_state)
if(key_type && storage?.opened)
if(!length(contents))
var/empty_state = "[icon_state]0"
if(check_state_in_icon(empty_state, icon))
icon_state = empty_state
else if(key_type && storage?.opened)
icon_state = "[icon_state][count_by_type(contents, key_type)]"

/obj/item/box/fancy/proc/add_contents_overlays()
Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/items/weapons/storage/mre.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ MRE Stuff
obj_flags = OBJ_FLAG_HOLLOW
var/main_meal = /obj/item/mrebag
var/meal_desc = "This one is menu 1, meat pizza."
var/has_been_opened = FALSE

/obj/item/mre/WillContain()
. = list(
Expand All @@ -33,10 +34,13 @@ MRE Stuff
. = ..()
to_chat(user, meal_desc)

/obj/item/mre/attack_self(mob/user)
. = ..()

/obj/item/mre/on_update_icon()
. = ..()
icon_state = get_world_inventory_state()
if(storage?.opened)
if(has_been_opened)
icon_state = "[icon_state]-open"

/obj/item/mre/attack_self(mob/user)
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/random/subtypes/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
/obj/random/mre/spread/spawn_choices()
var/static/list/spawnable_choices = list(
/obj/item/chems/packet/jelly,
/obj/item/chems/packet/honey
/obj/item/chems/packet/honey,
/obj/item/chems/packet/honey_fake
)
return spawnable_choices

Expand Down
12 changes: 12 additions & 0 deletions code/game/objects/structures/__structure.dm
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,21 @@ Note: This proc can be overwritten to allow for different types of auto-alignmen
W.pixel_y = (CELLSIZE * (cell_y + 0.5)) - center["y"]
W.pixel_z = 0

// Does this structure override turf depth for the purposes of mob offsets?
/obj/structure/proc/is_platform()
return FALSE

/obj/structure/proc/is_z_passable()
return TRUE

/obj/structure/on_turf_height_change(new_height)
// We may be a fixed point.
return !is_platform() && ..()

/obj/structure/hitby(var/atom/movable/AM, var/datum/thrownthing/TT)
. = ..()
if(. && (structure_flags & STRUCTURE_FLAG_THROWN_DAMAGE))
visible_message(SPAN_DANGER("\The [src] was hit by \the [AM]."))
playsound(src.loc, hitsound, 100, 1)
take_damage(AM.get_thrown_attack_force() * (TT.speed/THROWFORCE_SPEED_DIVISOR), AM.atom_damage_type)

34 changes: 23 additions & 11 deletions code/game/objects/structures/catwalk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@
var/list/connections
var/list/other_connections

/obj/structure/catwalk/clear_connections()
connections = null
other_connections = null

/obj/structure/catwalk/set_connections(dirs, other_dirs)
connections = dirs_to_corner_states(dirs)
other_connections = dirs_to_corner_states(other_dirs)

/obj/structure/catwalk/Initialize()
. = ..()
DELETE_IF_DUPLICATE_OF(/obj/structure/catwalk)
Expand All @@ -41,16 +33,33 @@
update_connections(1)
update_icon()

/obj/structure/catwalk/can_climb_from_below(var/mob/climber)
return TRUE

/obj/structure/catwalk/Destroy()
var/turf/oldloc = loc
redraw_nearby_catwalks()
. = ..()
if(istype(oldloc))
for(var/atom/movable/AM in oldloc)
AM.fall(oldloc)
oldloc.supporting_platform = null

// Catwalks need to layer over grass and water.
/obj/structure/catwalk/update_turf_alpha_mask()
return FALSE

/obj/structure/catwalk/clear_connections()
connections = null
other_connections = null

/obj/structure/catwalk/is_platform()
return TRUE

/obj/structure/catwalk/set_connections(dirs, other_dirs)
connections = dirs_to_corner_states(dirs)
other_connections = dirs_to_corner_states(other_dirs)

/obj/structure/catwalk/can_climb_from_below(var/mob/climber)
return TRUE


/obj/structure/catwalk/proc/redraw_nearby_catwalks()
for(var/direction in global.alldirs)
Expand Down Expand Up @@ -170,6 +179,9 @@
/obj/structure/catwalk/refresh_neighbors()
return

/obj/structure/catwalk/is_z_passable()
return !plated_tile

/obj/effect/catwalk_plated
name = "plated catwalk spawner"
icon = 'icons/obj/structures/catwalks.dmi'
Expand Down
7 changes: 4 additions & 3 deletions code/game/objects/structures/lattice.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,13 @@
return TRUE

var/obj/item/stack/material/rods/R = C
if(locate(/obj/structure/catwalk) in get_turf(src))
to_chat(user, SPAN_WARNING("There is already a catwalk here."))
var/turf/my_turf = get_turf(src)
if(my_turf?.get_supporting_platform())
to_chat(user, SPAN_WARNING("There is already a platform here."))
return TRUE
else if(R.use(2))
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
new /obj/structure/catwalk(src.loc, R.material.type)
new /obj/structure/catwalk(my_turf, R.material.type)
return TRUE
else
to_chat(user, SPAN_WARNING("You require at least two rods to complete the catwalk."))
Expand Down
7 changes: 6 additions & 1 deletion code/game/objects/structures/transit_tubes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@
var/moving = 0
var/datum/gas_mixture/air_contents = new()


/obj/structure/transit_tube_pod/attack_hand(mob/user)
if(!moving && length(contents) && isturf(user.loc))
user.visible_message(SPAN_NOTICE("\The [user] empties out \the [src]!"))
dump_contents()
return TRUE
return ..()

/obj/structure/transit_tube_pod/Destroy()
dump_contents()
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/flooring/flooring_lava.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/decl/flooring/lava/handle_environment_proc(turf/floor/target)
. = PROCESS_KILL
if(locate(/obj/structure/catwalk) in target)
if(target.get_supporting_platform())
return
var/datum/gas_mixture/environment = target.return_air()
var/pressure = environment?.return_pressure()
Expand Down
1 change: 1 addition & 0 deletions code/game/turfs/flooring/flooring_snow.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
icon = 'icons/turf/flooring/snow.dmi'
icon_base = "snow"
icon_edge_layer = FLOOR_EDGE_SNOW
flooring_flags = TURF_REMOVE_SHOVEL
footstep_type = /decl/footsteps/snow
has_base_range = 13
force_material = /decl/material/solid/ice/snow
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/floors/floor_attackby.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
return ..()

/turf/floor/proc/try_build_catwalk(var/obj/item/used_item, var/mob/user)
if(!(locate(/obj/structure/catwalk) in src) && istype(used_item, /obj/item/stack/material/rods))
if(istype(used_item, /obj/item/stack/material/rods) && !get_supporting_platform())
var/obj/item/stack/material/rods/R = used_item
if (R.use(2))
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
Expand Down
13 changes: 8 additions & 5 deletions code/game/turfs/floors/floor_digging.dm
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/turf/floor
var/gemstone_dropped = FALSE

/turf/floor/proc/is_fundament()
/turf/floor/proc/flooring_is_diggable()
var/decl/flooring/flooring = get_topmost_flooring()
return flooring ? !flooring.constructed : TRUE
if(!flooring || flooring.constructed)
return FALSE
return TRUE

/turf/floor/can_be_dug(tool_hardness = MAT_VALUE_MALLEABLE, using_tool = TOOL_SHOVEL)
// This should be removed before digging trenches.
if(!is_fundament())
if(!flooring_is_diggable())
return FALSE
var/decl/flooring/flooring = get_base_flooring()
if(istype(flooring) && flooring.constructed)
Expand All @@ -27,7 +29,7 @@
return can_be_dug(tool_hardness, using_tool) && get_physical_height() > -(FLUID_DEEP)

/turf/floor/dig_trench(mob/user, tool_hardness = MAT_VALUE_MALLEABLE, using_tool = TOOL_SHOVEL)
if(is_fundament())
if(flooring_is_diggable())
handle_trench_digging(user)

/turf/floor/proc/handle_trench_digging(mob/user)
Expand All @@ -47,7 +49,7 @@

/turf/floor/get_diggable_resources()
var/decl/material/my_material = get_material()
if(!is_fundament() || !istype(my_material) || !my_material.dug_drop_type || (get_physical_height() <= -(FLUID_DEEP)))
if(!flooring_is_diggable() || !istype(my_material) || !my_material.dug_drop_type || (get_physical_height() <= -(FLUID_DEEP)))
return

. = list()
Expand All @@ -64,3 +66,4 @@
gemstone_dropped = TRUE
var/gem_mat = pick(my_material.gemstone_types)
.[/obj/item/gemstone] = list("amount" = 1, "material" = gem_mat)

Loading

0 comments on commit 42ac5a3

Please sign in to comment.