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
1 change: 1 addition & 0 deletions code/__DEFINES/movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ GLOBAL_VAR_INIT(glide_size_multiplier, 1.0)
* currently_z_moving defines. Higher numbers mean higher priority.
* This one is for falling down open space from stuff such as deleted tile, pit grate...
*/
#define CURERENTLY_Z_CLIMBING_DOWN 0.5
#define CURRENTLY_Z_FALLING 1
/// currently_z_moving is set to this in zMove() if 0.
#define CURRENTLY_Z_MOVING_GENERIC 2
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/definitions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_NO_FLOATING_ANIM "no-floating-animation"

///generic atom traits
///Chasms will be safe to cross while they've this trait.
#define TRAIT_CHASM_STOPPED "chasm_stopped"
/// If this movable is currently considered to be treading in a turf with the immerse element.
#define TRAIT_IMMERSED "immersed"
///The effects of the immerse element will be halted while this trait is present.
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@
if (!istype(turf_area, specific_area))
continue

if (!is_blocked_turf(found_turf))
if (!found_turf.is_blocked_turf())
possible_loc.Add(found_turf)

// Need at least one free location.
Expand Down
14 changes: 3 additions & 11 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,6 @@ Turf and target are separate in case you want to teleport some distance from a t
assembled += A
return assembled

/proc/is_blocked_turf(turf/T, exclude_mobs)
if(T.density)
return 1
for(var/atom/A as anything in T)
if(A.density && (!exclude_mobs || !ismob(A)))
return 1
return 0

/proc/is_anchored_dense_turf(turf/T) //like the older version of the above, fails only if also anchored
if(T.density)
return 1
Expand All @@ -330,7 +322,7 @@ Turf and target are separate in case you want to teleport some distance from a t
var/base_dir = get_dir(ref, get_step_towards(ref,trg))
var/turf/temp = get_step_towards(ref,trg)

if(is_blocked_turf(temp))
if(temp.is_blocked_turf())
var/dir_alt1 = turn(base_dir, 90)
var/dir_alt2 = turn(base_dir, -90)
var/turf/turf_last1 = temp
Expand All @@ -339,10 +331,10 @@ Turf and target are separate in case you want to teleport some distance from a t
var/breakpoint = 0

while(!free_tile && breakpoint < 10)
if(!is_blocked_turf(turf_last1))
if(!turf_last1.is_blocked_turf())
free_tile = turf_last1
break
if(!is_blocked_turf(turf_last2))
if(!turf_last2.is_blocked_turf())
free_tile = turf_last2
break
turf_last1 = get_step(turf_last1,dir_alt1)
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ GLOBAL_LIST_INIT(traits_by_type, list(
),
/turf = list(
"TRAIT_AI_AVOID_TURF" = TRAIT_AI_AVOID_TURF,
"TRAIT_CHASM_STOPPED" = TRAIT_CHASM_STOPPED,
"TRAIT_IMMERSE_STOPPED" = TRAIT_IMMERSE_STOPPED,
"TRAIT_TURF_IGNORE_SLOWDOWN" = TRAIT_TURF_IGNORE_SLOWDOWN,
)
))
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/migration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ SUBSYSTEM_DEF(migrants)
continue
if(islava(turf))
continue
if(is_blocked_turf(turf))
if(turf.is_blocked_turf())
continue
turfs += turf
turfs = shuffle(turfs)
Expand Down
6 changes: 3 additions & 3 deletions code/datums/ai/behaviours/run_from_target.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@
var/turf/return_turf
for(var/i in 1 to run_distance)
var/turf/test_destination = get_ranged_target_turf_direct(source, target, range = i, offset = angle)
if(isopenspace(test_destination) || is_blocked_turf(test_destination, exclude_mobs = !source.density))
if(isopenspace(test_destination) || test_destination.is_blocked_turf(exclude_mobs = !source.density))
var/origin = return_turf || get_turf(source)
var/obj/structure/stairs/found_stairs = locate() in origin
if(!found_stairs)
break
var/stairs_destination = found_stairs.get_transit_destination(get_dir(origin, test_destination))
if(isopenspace(stairs_destination) || is_blocked_turf(stairs_destination, exclude_mobs = !source.density))
var/turf/stairs_destination = found_stairs.get_transit_destination(get_dir(origin, test_destination))
if(isopenspace(stairs_destination) || stairs_destination.is_blocked_turf(exclude_mobs = !source.density))
break
return stairs_destination
return_turf = test_destination
Expand Down
4 changes: 2 additions & 2 deletions code/datums/brain_damage/mild.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
owner.derpspeech = min(owner.derpspeech + 5, 25)
if(prob(3))
owner.emote("drool")
else if(owner.stat == CONSCIOUS && prob(3))
owner.say(pick_list_replacements(BRAIN_DAMAGE_FILE, "brain_damage"), forced = "brain damage")
// else if(owner.stat == CONSCIOUS && prob(3))
// owner.say(pick_list_replacements(BRAIN_DAMAGE_FILE, "brain_damage"), forced = "brain damage")
..()

/datum/brain_trauma/mild/dumbness/on_lose()
Expand Down
1 change: 1 addition & 0 deletions code/datums/elements/immerse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ GLOBAL_LIST_INIT(immerse_ignored_movable, typecacheof(list(
try_unimmerse(movable, buckled)
LAZYREMOVE(attached_turf_contents[source], movable)
UnregisterSignal(movable, list(COMSIG_LIVING_SET_BUCKLED, COMSIG_QDELETING, COMSIG_LIVING_UPDATE_OFFSETS, COMSIG_ATOM_SPIN_ANIMATION, COMSIG_LIVING_POST_UPDATE_TRANSFORM))
REMOVE_TRAIT(movable, TRAIT_IMMERSED, ELEMENT_TRAIT(src)) // redundant but just in case
REMOVE_TRAIT(movable, TRAIT_ENTERED_IMMERSE, ELEMENT_TRAIT(src))

/// Generate a mask filter mutable to use as render_source for the alpha filter based on provided width, height and immersion state
Expand Down
1 change: 1 addition & 0 deletions code/datums/wounds/arteries.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
min_damage_dividend = 0
strong_intent_bonus = TRUE
aimed_intent_bonus = TRUE
crit_message = "Blood sprays from %VICTIM's %BODYPART!"
var/artery_type_override

/datum/wound/artery/get_crit_prob(bclass, dam, damage_dividend, mob/living/user, obj/item/bodypart/affected, zone_precise, list/modifiers)
Expand Down
2 changes: 2 additions & 0 deletions code/game/atom/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@
if(z_move_flags & ZMOVE_FEEDBACK)
to_chat(rider || src, span_warning("There's nowhere to go in that direction!"))
return FALSE
if(HAS_TRAIT(src, TRAIT_I_AM_INVISIBLE_ON_A_BOAT)) // VANDERLIN CHANGE
return FALSE
if(SEND_SIGNAL(src, COMSIG_CAN_Z_MOVE, start, destination) & COMPONENT_CANT_Z_MOVE)
return FALSE
if(z_move_flags & ZMOVE_FALL_CHECKS && (throwing || (movement_type & MOVETYPES_NOT_TOUCHING_GROUND)))
Expand Down
15 changes: 13 additions & 2 deletions code/game/machinery/trams_and_elevators/industrial_lift.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ GLOBAL_LIST_INIT(all_radial_directions, list(
var/list/moving_lifts = list()
///are we fake? if so we remove the z_fall block and such
var/fake = FALSE
var/static/list/turf_traits = list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)

/obj/structure/industrial_lift/Initialize(mapload)
. = ..()
Expand All @@ -83,9 +84,9 @@ GLOBAL_LIST_INIT(all_radial_directions, list(
set_movement_registrations()
if(fake)
alpha = 0
obj_flags = CAN_BE_HIT
obj_flags &= ~BLOCK_Z_OUT_DOWN
else
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
AddElement(/datum/element/give_turf_traits, string_list(turf_traits))

//since lift_master datums find all connected platforms when an industrial lift first creates it and then
//sets those platforms' lift_master_datum to itself, this check will only evaluate to true once per tram platform
Expand Down Expand Up @@ -664,6 +665,16 @@ GLOBAL_LIST_INIT(all_radial_directions, list(
return FALSE
return TRUE

/obj/structure/industrial_lift/proc/show_lift()
obj_flags |= BLOCK_Z_OUT_DOWN
AddElement(/datum/element/give_turf_traits, string_list(turf_traits))
alpha = 255

/obj/structure/industrial_lift/proc/hide_lift()
obj_flags &= ~BLOCK_Z_OUT_DOWN
RemoveElement(/datum/element/give_turf_traits, string_list(turf_traits))
alpha = 0

/obj/structure/industrial_lift/attack_hand(mob/user, list/modifiers)
. = ..()
if(.)
Expand Down
31 changes: 13 additions & 18 deletions code/game/machinery/trams_and_elevators/lift_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,7 @@ GLOBAL_LIST_EMPTY(active_lifts_by_type)
platform.horizontal_speed = 0.1
base_horizontal_speed = 0.1
horizontal_speed = 0.1
if(!platform.fake)
platform.obj_flags &= ~BLOCK_Z_OUT_DOWN
platform.RemoveElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
platform.alpha = 0

for(var/atom/movable/movable in platform.lift_load)
if(ismob(movable))
platform.RemoveItemFromLift(movable)
Expand All @@ -589,13 +586,14 @@ GLOBAL_LIST_EMPTY(active_lifts_by_type)
movable.density = FALSE
movable.alpha = 0

if(!platform.fake)
platform.hide_lift()

for(var/obj/structure/industrial_lift/tram/moving_platform in platform.moving_lifts)
if(moving_platform.fake)
continue
moving_platform.horizontal_speed = 0.1
moving_platform.obj_flags &= ~BLOCK_Z_OUT_DOWN
moving_platform.RemoveElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
moving_platform.alpha = 0
moving_platform.hide_lift()

/datum/lift_master/tram/proc/show_tram()
ignore_pathing_obstacles = FALSE
Expand All @@ -604,22 +602,19 @@ GLOBAL_LIST_EMPTY(active_lifts_by_type)
base_horizontal_speed = 4
horizontal_speed = 4
if(!platform.fake)
platform.obj_flags |= BLOCK_Z_OUT_DOWN
platform.AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
platform.alpha = 255
for(var/atom/movable/movable in objects_pre_alpha)
movable.alpha = objects_pre_alpha[movable]
REMOVE_TRAIT(movable, TRAIT_I_AM_INVISIBLE_ON_A_BOAT, REF(src))
objects_pre_alpha -= movable
movable.density = initial(movable.density)
platform.show_lift()

for(var/obj/structure/industrial_lift/tram/moving_platform in platform.moving_lifts)
if(moving_platform.fake)
continue
moving_platform.horizontal_speed = 4
moving_platform.obj_flags |= BLOCK_Z_OUT_DOWN
moving_platform.AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
moving_platform.alpha = 255
moving_platform.show_lift()

for(var/atom/movable/movable in objects_pre_alpha)
movable.alpha = objects_pre_alpha[movable]
REMOVE_TRAIT(movable, TRAIT_I_AM_INVISIBLE_ON_A_BOAT, REF(src))
objects_pre_alpha -= movable
movable.density = initial(movable.density)

/datum/lift_master/tram/proc/try_process_order(fence = FALSE)
var/total_coin_value = 0
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/harpoon_gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

var/list/turf_list = (getline(user, attacked_atom) - get_turf(src))
for(var/turf/singular_turf as anything in turf_list)
if(!is_blocked_turf(singular_turf))
if(!singular_turf.is_blocked_turf())
continue
attacked_atom = singular_turf
break
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/scrolls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
smoke.start()
var/list/L = list()
for(var/turf/T in get_area_turfs(thearea.type))
if(!is_blocked_turf(T))
if(!T.is_blocked_turf())
L += T

if(!L.len)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/lighting/rogue_fires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@

/obj/machinery/light/fueled/chand/Initialize()
. = ..()
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)))

/obj/machinery/light/fueled/chand/attack_hand(mob/user)
if(isliving(user) && on)
Expand Down
10 changes: 5 additions & 5 deletions code/game/objects/minecart_system/minecart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@
return

obj_flags |= BLOCK_Z_OUT_DOWN
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
var/movedir = bumped_atom.dir
var/turf/next_turf = get_step(src, movedir)
if(!can_travel_on_turf(next_turf, movedir))
Expand Down Expand Up @@ -278,6 +277,7 @@
if(momentum <= 0)
return

AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)))
setDir(movedir)
var/datum/move_loop/loop = SSmove_manager.move(src, dir, delay = calculate_delay(), subsystem = SSminecarts, flags = MOVEMENT_LOOP_START_FAST|MOVEMENT_LOOP_IGNORE_PRIORITY, move_loop_type = /datum/move_loop/minecart)
RegisterSignal(loop, COMSIG_MOVELOOP_PREPROCESS_CHECK, PROC_REF(check_rail))
Expand All @@ -290,7 +290,7 @@
stack_trace("Mine cart moving on 0 momentum!")
SSmove_manager.stop_looping(src, SSminecarts)
obj_flags &= ~BLOCK_Z_OUT_DOWN
RemoveElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
RemoveElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)))
momentum = 0
return MOVELOOP_SKIP_STEP
// Forced to not move
Expand Down Expand Up @@ -345,7 +345,7 @@
// Can't go straight and cant turn = STOP
SSmove_manager.stop_looping(src, SSminecarts)
obj_flags &= ~BLOCK_Z_OUT_DOWN
RemoveElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
RemoveElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)))
if(momentum >= 12)
visible_message(span_warning("[src] comes to a violent halt!"))
throw_contents()
Expand All @@ -367,7 +367,7 @@
visible_message(span_notice("[src] comes to a stop."))
SSmove_manager.stop_looping(src, SSminecarts)
obj_flags &= ~BLOCK_Z_OUT_DOWN
RemoveElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
RemoveElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)))
momentum = 0
return
check_powered()
Expand All @@ -377,7 +377,7 @@
if(momentum <= 0)
SSmove_manager.stop_looping(src, SSminecarts)
obj_flags &= ~BLOCK_Z_OUT_DOWN
RemoveElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
RemoveElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)))
momentum = 0
visible_message(span_notice("[src] comes to a slow stop."))
return
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/bridge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
AddElement(/datum/element/footstep_override, footstep = FOOTSTEP_OLDWOOD, barefootstep = FOOTSTEP_OLDWOOD)
var/static/list/loc_connections = list(COMSIG_ATOM_EXIT = PROC_REF(on_exit))
AddElement(/datum/element/connect_loc, loc_connections)
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)))
// Shift sprite down when going east/west so that people properly walk on the bridge
if(dir == EAST || dir == WEST)
pixel_y = base_pixel_y - 7
Expand Down Expand Up @@ -86,7 +86,7 @@
if(obj_broken)
obj_broken = FALSE // Not obj_broken anymore
obj_flags = initial(obj_flags) // so we set back initial flags
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)))
update_appearance(UPDATE_ICON_STATE)

/// Stakes at the end of a makeshift bridge
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/structures/fluff.dm
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
attacked_sound = list('sound/combat/hits/onmetal/grille (1).ogg', 'sound/combat/hits/onmetal/grille (2).ogg', 'sound/combat/hits/onmetal/grille (3).ogg')
redstone_structure = TRUE
var/togg = FALSE
var/static/list/turf_traits = list(TRAIT_IMMERSE_STOPPED)
var/static/list/turf_traits = list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)

/obj/structure/bars/grille/Initialize()
AddElement(/datum/element/footstep_override, footstep = FOOTSTEP_CATWALK)
Expand Down Expand Up @@ -332,7 +332,7 @@

/obj/structure/plank/Initialize()
. = ..()
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)))

/obj/structure/bars/pipe
name = "bronze pipe"
Expand All @@ -351,7 +351,7 @@
/obj/structure/bars/pipe/Initialize()
. = ..()
AddElement(/datum/element/footstep_override, footstep = FOOTSTEP_CATWALK)
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)))

/obj/structure/bars/pipe/left
name = "bronze pipe"
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/newtree.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/obj/structure/flora/newtree/Initialize()
. = ..()
GenerateTree()
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)))

/obj/structure/flora/newtree/Destroy()
SStreesetup.initialize_me -= src
Expand Down Expand Up @@ -393,7 +393,7 @@
100,\
extrarange = SHORT_RANGE_SOUND_EXTRARANGE,\
)
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED)))
AddElement(/datum/element/give_turf_traits, string_list(list(TRAIT_IMMERSE_STOPPED, TRAIT_CHASM_STOPPED)))
update_appearance(UPDATE_OVERLAYS)

/obj/structure/flora/newbranch/update_overlays()
Expand Down
Loading
Loading