diff --git a/aurorastation.dme b/aurorastation.dme index 3040bc90a04..0313082c6c3 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -100,6 +100,7 @@ #include "code\__DEFINES\modular_guns.dm" #include "code\__DEFINES\move_force.dm" #include "code\__DEFINES\movement.dm" +#include "code\__DEFINES\movement_info.dm" #include "code\__DEFINES\movespeed_modification.dm" #include "code\__DEFINES\multiz.dm" #include "code\__DEFINES\obj.dm" diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index c9f23bf2dc3..63192fcf332 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -26,11 +26,16 @@ GLOBAL_LIST_INIT(mimic_defines, list("ZM_MIMIC_BELOW", "ZM_NO_OCCLUDE", "ZM_MIMIC_BASETURF")) -//EMP protection +///EMP will protect itself. #define EMP_PROTECT_SELF (1<<0) +///EMP will protect the contents from also being EMPed. #define EMP_PROTECT_CONTENTS (1<<1) +///EMP will protect the wires. #define EMP_PROTECT_WIRES (1<<2) +///Protects against all EMP types. +#define EMP_PROTECT_ALL (EMP_PROTECT_SELF | EMP_PROTECT_CONTENTS | EMP_PROTECT_WIRES) + // Flags bitmask /// If a dense atom (potentially) only blocks movements from a given direction, i.e. window panes diff --git a/code/__DEFINES/movement.dm b/code/__DEFINES/movement.dm index a42134f36f5..a1d80321ece 100644 --- a/code/__DEFINES/movement.dm +++ b/code/__DEFINES/movement.dm @@ -31,6 +31,12 @@ #define MOVEMENT_BUCKET_TIME 1 #define MOVEMENT_BUCKET_LIST 2 +//Diagonal movement is split into two cardinal moves +/// The first step of the diagnonal movement +#define FIRST_DIAG_STEP 1 +/// The second step of the diagnonal movement +#define SECOND_DIAG_STEP 2 + ///Return values for moveloop Move() #define MOVELOOP_FAILURE 0 #define MOVELOOP_SUCCESS 1 diff --git a/code/__DEFINES/movement_info.dm b/code/__DEFINES/movement_info.dm new file mode 100644 index 00000000000..91d370f6c75 --- /dev/null +++ b/code/__DEFINES/movement_info.dm @@ -0,0 +1,21 @@ +#define ACTIVE_MOVEMENT_OLDLOC 1 +#define ACTIVE_MOVEMENT_DIRECTION 2 +#define ACTIVE_MOVEMENT_FORCED 3 +#define ACTIVE_MOVEMENT_OLDLOCS 4 + +/// The arguments of this macro correspond directly to the argument order of /atom/movable/proc/Moved +#define SET_ACTIVE_MOVEMENT(_old_loc, _direction, _forced, _oldlocs) \ + active_movement = list( \ + _old_loc, \ + _direction, \ + _forced, \ + _oldlocs, \ + ) + +/// Finish any active movements +#define RESOLVE_ACTIVE_MOVEMENT \ + if(active_movement) { \ + var/__move_args = active_movement; \ + active_movement = null; \ + Moved(arglist(__move_args)); \ + } diff --git a/code/_onclick/hud/skybox.dm b/code/_onclick/hud/skybox.dm index fb556c18ee3..4c3fa512191 100644 --- a/code/_onclick/hud/skybox.dm +++ b/code/_onclick/hud/skybox.dm @@ -24,7 +24,7 @@ if(skybox) skybox.screen_loc = "CENTER:[-224 - T.x],CENTER:[-224 - T.y]" -/mob/Move() +/mob/Move(atom/newloc, direct, glide_size_override, update_dir) var/old_z = GET_Z(src) . = ..() if(. && client) diff --git a/code/datums/signals.dm b/code/datums/signals.dm index 01ca02e41c2..4a3b9448e22 100644 --- a/code/datums/signals.dm +++ b/code/datums/signals.dm @@ -4,7 +4,7 @@ * This sets up a listening relationship such that when the target object emits a signal * the source datum this proc is called upon, will receive a callback to the given proctype * Use PROC_REF(procname), TYPE_PROC_REF(type,procname) or GLOBAL_PROC_REF(procname) macros to validate the passed in proc at compile time. - * PROC_REF for procs defined on current type or it's ancestors, TYPE_PROC_REF for procs defined on unrelated type and GLOBAL_PROC_REF for global procs. + * PROC_REF for procs defined on current type or its ancestors, TYPE_PROC_REF for procs defined on unrelated type and GLOBAL_PROC_REF for global procs. * Return values from procs registered must be a bitfield * * Arguments: diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 52c7375a185..de1193ec7fb 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -107,11 +107,10 @@ */ /atom/proc/emp_act(var/severity) SHOULD_CALL_PARENT(TRUE) + SHOULD_NOT_SLEEP(TRUE) var/protection = SEND_SIGNAL(src, COMSIG_ATOM_PRE_EMP_ACT, severity) - RETURN_TYPE(protection) - SEND_SIGNAL(src, COMSIG_ATOM_EMP_ACT, severity, protection) return protection // Pass the protection value collected here upwards diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 6cc91d05a2d..5abce4fe001 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -5,7 +5,9 @@ appearance_flags = DEFAULT_APPEARANCE_FLAGS | TILE_BOUND var/last_move = null - var/anchored = 0 + /// A list containing arguments for Moved(). + VAR_PRIVATE/tmp/list/active_movement + var/anchored = FALSE var/movable_flags ///Used to scale icons up or down horizonally in update_transform(). @@ -42,6 +44,9 @@ ///Delay in deciseconds between inertia based movement var/inertia_move_delay = 5 + ///0: not doing a diagonal move. 1 and 2: doing the first/second step of the diagonal move + var/moving_diagonally = 0 + ///Holds information about any movement loops currently running/waiting to run on the movable. Lazy, will be null if nothing's going on var/datum/movement_packet/move_packet @@ -71,6 +76,9 @@ ///Internal holder for emissive blocker object, DO NOT USE DIRECTLY. Use blocks_emissive var/mutable_appearance/em_block + /// Whether this atom should have its dir automatically changed when it moves. Setting this to FALSE allows for things such as directional windows to retain dir on moving without snowflake code all of the place. + var/set_dir_on_move = TRUE + /atom/movable/Initialize(mapload, ...) . = ..() update_emissive_blocker() @@ -148,7 +156,7 @@ if(old_area) old_area.Exited(src, NONE) - Moved(oldloc, NONE, TRUE, null) + RESOLVE_ACTIVE_MOVEMENT // Make sure you know what you're doing if you call this // You probably want CanPass() @@ -162,7 +170,7 @@ ///default byond proc that is deprecated for us in lieu of signals. do not call /atom/movable/Crossed(atom/movable/crossed_atom, oldloc) SHOULD_NOT_OVERRIDE(TRUE) - // CRASH("atom/movable/Crossed() was called!") //pending rework of /atom/movable/Move() this is suppressed + CRASH("atom/movable/Crossed() was called!") /** * `Uncross()` is a default BYOND proc that is called when something is *going* @@ -187,7 +195,7 @@ /atom/movable/Uncross() . = TRUE SHOULD_NOT_OVERRIDE(TRUE) - // CRASH("Uncross() should not be being called, please read the doc-comment for it for why.") //pending rework of /atom/movable/Move() this is suppressed + CRASH("Uncross() should not be being called, please read the doc-comment for it for why.") /** * default byond proc that is normally called on everything inside the previous turf @@ -197,7 +205,7 @@ */ /atom/movable/Uncrossed(atom/movable/uncrossed_atom) SHOULD_NOT_OVERRIDE(TRUE) - // CRASH("/atom/movable/Uncrossed() was called") //pending rework of /atom/movable/Move() this is suppressed + CRASH("/atom/movable/Uncrossed() was called") /** * Pretend this is `Bump()` @@ -486,14 +494,20 @@ // Core movement hooks & procs. /atom/movable/proc/forceMove(atom/destination) + . = FALSE + RESOLVE_ACTIVE_MOVEMENT + if(!destination) return FALSE if(loc) loc.Exited(src, destination) - var/old_loc = loc + var/oldloc = loc + + SET_ACTIVE_MOVEMENT(oldloc, NONE, TRUE, null) + loc = destination - loc.Entered(src, old_loc) - Moved(old_loc, get_dir(old_loc, destination), TRUE) + loc.Entered(src, oldloc) + Moved(oldloc, get_dir(oldloc, destination), TRUE) //Zmimic if(bound_overlay) @@ -515,6 +529,8 @@ L = thing L.source_atom.update_light() + RESOLVE_ACTIVE_MOVEMENT + return TRUE /** @@ -857,7 +873,7 @@ * most of the time you want forceMove() */ /atom/movable/proc/abstract_move(atom/new_loc) - // RESOLVE_ACTIVE_MOVEMENT // This should NEVER happen, but, just in case... + RESOLVE_ACTIVE_MOVEMENT // This should NEVER happen, but, just in case... var/atom/old_loc = loc var/direction = get_dir(old_loc, new_loc) loc = new_loc @@ -865,6 +881,155 @@ //is Moved(old_loc, direction, TRUE, momentum_change = FALSE) in tg Moved(old_loc, direction, TRUE) +//////////////////////////////////////// +// Here's where we rewrite how byond handles movement except slightly different +// To be removed on step_ conversion +// All this work to prevent a second bump +/atom/movable/Move(atom/newloc, direction, glide_size_override = 0, update_dir = TRUE) //Last 2 parameters are not used but they're caught + CAN_BE_REDEFINED(TRUE) + . = FALSE + if(!newloc || newloc == loc) + return + + // A mid-movement... movement... occurred, resolve that first. + RESOLVE_ACTIVE_MOVEMENT + + if(!direction) + direction = get_dir(src, newloc) + + // TEMPORARY OFF because i remember this giving some issues on something i don't quite remember + if(set_dir_on_move && dir != direction && update_dir) + set_dir(direction) + + //There should be some multitile code above, it was cut as we don't do multitile movement (yet) + if(!loc.Exit(src, direction)) + return + + //There should be some multitile code above, it was cut as we don't do multitile movement (yet) + if(!newloc.Enter(src)) + return + if(SEND_SIGNAL(src, COMSIG_MOVABLE_PRE_MOVE, newloc) & COMPONENT_MOVABLE_BLOCK_PRE_MOVE) + return + + var/atom/oldloc = loc + var/area/oldarea = get_area(oldloc) + var/area/newarea = get_area(newloc) + + SET_ACTIVE_MOVEMENT(oldloc, direction, FALSE, list()) //This is different from TG because we don't have multitile movement (yet) + loc = newloc + + . = TRUE + + oldloc.Exited(src, direction) + if(oldarea != newarea) + oldarea.Exited(src, direction) + + newloc.Entered(src, oldloc) //This is different from TG because we don't have multitile movement (yet) + if(oldarea != newarea) + newarea.Entered(src, oldarea) + + // Lighting. + if(light_sources) + var/datum/light_source/L + var/thing + for(thing in light_sources) + L = thing + L.source_atom.update_light() + + // Openturf. + if(bound_overlay) + // The overlay will handle cleaning itself up on non-openspace turfs. + bound_overlay.forceMove(get_step(src, UP)) + if(bound_overlay.dir != dir) + bound_overlay.set_dir(dir) + + if(opacity) + updateVisibility(src) + + //Mimics + if(bound_overlay) + bound_overlay.forceMove(get_step(src, UP)) + if(bound_overlay.dir != dir) + bound_overlay.set_dir(dir) + + src.move_speed = world.time - src.l_move_time + src.l_move_time = world.time + if ((oldloc != src.loc && oldloc && oldloc.z == src.z)) + src.last_move = get_dir(oldloc, src.loc) + + RESOLVE_ACTIVE_MOVEMENT + +//////////////////////////////////////// + +/atom/movable/Move(atom/newloc, direct, glide_size_override = 0, update_dir = TRUE) + CAN_BE_REDEFINED(TRUE) + // var/atom/movable/pullee = pulling + // var/turf/current_turf = loc + + if(!loc || !newloc) + return FALSE + + if(loc != newloc) + if (!(direct & (direct - 1))) //Cardinal move + . = ..() + else //Diagonal move, split it into cardinal moves + moving_diagonally = FIRST_DIAG_STEP + var/first_step_dir + // The `&& moving_diagonally` checks are so that a forceMove taking + // place due to a Crossed, Bumped, etc. call will interrupt + // the second half of the diagonal movement, or the second attempt + // at a first half if step() fails because we hit something. + if (direct & NORTH) + if (direct & EAST) + if (step(src, NORTH) && moving_diagonally) + first_step_dir = NORTH + moving_diagonally = SECOND_DIAG_STEP + . = step(src, EAST) + else if (moving_diagonally && step(src, EAST)) + first_step_dir = EAST + moving_diagonally = SECOND_DIAG_STEP + . = step(src, NORTH) + else if (direct & WEST) + if (step(src, NORTH) && moving_diagonally) + first_step_dir = NORTH + moving_diagonally = SECOND_DIAG_STEP + . = step(src, WEST) + else if (moving_diagonally && step(src, WEST)) + first_step_dir = WEST + moving_diagonally = SECOND_DIAG_STEP + . = step(src, NORTH) + else if (direct & SOUTH) + if (direct & EAST) + if (step(src, SOUTH) && moving_diagonally) + first_step_dir = SOUTH + moving_diagonally = SECOND_DIAG_STEP + . = step(src, EAST) + else if (moving_diagonally && step(src, EAST)) + first_step_dir = EAST + moving_diagonally = SECOND_DIAG_STEP + . = step(src, SOUTH) + else if (direct & WEST) + if (step(src, SOUTH) && moving_diagonally) + first_step_dir = SOUTH + moving_diagonally = SECOND_DIAG_STEP + . = step(src, WEST) + else if (moving_diagonally && step(src, WEST)) + first_step_dir = WEST + moving_diagonally = SECOND_DIAG_STEP + . = step(src, SOUTH) + if(moving_diagonally == SECOND_DIAG_STEP) + if(!. && set_dir_on_move && update_dir) + set_dir(first_step_dir) + else if(!inertia_moving) + newtonian_move(dir2angle(direct)) + + moving_diagonally = 0 + return + + last_move = direct + if(set_dir_on_move && dir != direct && update_dir) + set_dir(direct) + /** * Adds the red drop-shadow filter when pointed to by a mob. * Override if the atom doesn't play nice with filters. diff --git a/code/game/gamemodes/cult/structures/pylon.dm b/code/game/gamemodes/cult/structures/pylon.dm index 1243ec79783..1ee803b9f10 100644 --- a/code/game/gamemodes/cult/structures/pylon.dm +++ b/code/game/gamemodes/cult/structures/pylon.dm @@ -94,7 +94,7 @@ /obj/structure/cult/pylon/Move() - ..() + . = ..() last_target_loc = null /obj/structure/cult/pylon/proc/start_process() diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm index aebefd2808d..13556363800 100644 --- a/code/game/machinery/CableLayer.dm +++ b/code/game/machinery/CableLayer.dm @@ -14,7 +14,7 @@ cable.amount = max_cable /obj/machinery/cablelayer/Move(new_turf,M_Dir) - ..() + . = ..() if(on) layCable(new_turf,M_Dir) diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm index 277251d822c..4215b5e822d 100644 --- a/code/game/machinery/floorlayer.dm +++ b/code/game/machinery/floorlayer.dm @@ -15,7 +15,7 @@ T = new /obj/item/stack/tile/floor/full_stack(src) /obj/machinery/floorlayer/Move(new_turf,M_Dir) - ..() + . = ..() if(on) if(mode["dismantle"]) diff --git a/code/game/machinery/howitzer.dm b/code/game/machinery/howitzer.dm index f22dc116a94..fd7bad1ecee 100644 --- a/code/game/machinery/howitzer.dm +++ b/code/game/machinery/howitzer.dm @@ -340,7 +340,7 @@ ABSTRACT_TYPE(/obj/machinery/howitzer) else break - new /obj/effect/effect/smoke(smoke_position, 2 SECONDS) + new /obj/effect/smoke(smoke_position, 2 SECONDS) for(var/mob/living/carbon/human/H in range(3, src)) if(H.client) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 68a06f45290..0a6a5d142f5 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -406,7 +406,7 @@ set_dir(2) /obj/item/pipe/Move() - ..() + . = ..() if ((pipe_type in list (PIPE_SIMPLE_BENT, PIPE_SUPPLY_BENT, PIPE_SCRUBBERS_BENT, PIPE_FUEL_BENT, PIPE_AUX_BENT, PIPE_HE_BENT)) \ && (src.dir in GLOB.cardinals)) src.set_dir(src.dir|turn(src.dir, 90)) diff --git a/code/game/objects/effects/chem/chemsmoke.dm b/code/game/objects/effects/chem/chemsmoke.dm index 21d1af16378..6962bb1a1d7 100644 --- a/code/game/objects/effects/chem/chemsmoke.dm +++ b/code/game/objects/effects/chem/chemsmoke.dm @@ -1,7 +1,7 @@ ///////////////////////////////////////////// // Chem smoke ///////////////////////////////////////////// -/obj/effect/effect/smoke/chem +/obj/effect/smoke/chem icon = 'icons/effects/chemsmoke.dmi' opacity = 0 time_to_live = 300 @@ -9,10 +9,10 @@ var/splash_amount = 10 //atoms moving through a smoke cloud get splashed with up to 10 units of reagent var/turf/destination -/obj/effect/effect/smoke/chem/New(var/newloc, smoke_duration, turf/dest_turf = null, icon/cached_icon = null) - time_to_live = smoke_duration +/obj/effect/smoke/chem/Initialize(mapload, duration, turf/dest_turf, icon/cached_icon) + time_to_live = duration - ..() + . = ..() create_reagents(500) @@ -28,35 +28,35 @@ if(destination) GLOB.move_manager.move_to(src, destination, priority = MOVEMENT_SPACE_PRIORITY) -/obj/effect/effect/smoke/chem/Destroy() +/obj/effect/smoke/chem/Destroy() GLOB.move_manager.stop_looping(src) return ..() -/obj/effect/effect/smoke/chem/Move() +/obj/effect/smoke/chem/Move() var/list/oldlocs = view(1, src) . = ..() if(.) for(var/turf/T in view(1, src) - oldlocs) for(var/atom/movable/AM in T) - if(!istype(AM, /obj/effect/effect/smoke/chem)) + if(!istype(AM, /obj/effect/smoke/chem)) reagents.splash(AM, splash_amount, copy = 1) if(loc == destination) bound_width = 96 bound_height = 96 -/obj/effect/effect/smoke/chem/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) +/obj/effect/smoke/chem/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) ..() - if(!istype(arrived, /obj/effect/effect/smoke/chem)) + if(!istype(arrived, /obj/effect/smoke/chem)) if(istype(arrived, /obj/item/reagent_containers) && !arrived.is_open_container()) return else reagents.splash(arrived, splash_amount, copy = 1) -/obj/effect/effect/smoke/chem/proc/initial_splash() +/obj/effect/smoke/chem/proc/initial_splash() for(var/turf/T in view(1, src)) for(var/atom/movable/AM in T) - if(!istype(AM, /obj/effect/effect/smoke/chem)) + if(!istype(AM, /obj/effect/smoke/chem)) if(istype(AM, /obj/item/reagent_containers) && !AM.is_open_container()) return else @@ -66,7 +66,7 @@ // Chem Smoke Effect System ///////////////////////////////////////////// /datum/effect/effect/system/smoke_spread/chem - smoke_type = /obj/effect/effect/smoke/chem + smoke_type = /obj/effect/smoke/chem var/obj/chemholder var/range var/list/targetTurfs @@ -183,7 +183,7 @@ for(var/turf/T in targetTurfs) chemholder.reagents.touch_turf(T) for(var/atom/A in T.contents) - if(istype(A, /obj/effect/effect/smoke/chem) || istype(A, /mob)) + if(istype(A, /obj/effect/smoke/chem) || istype(A, /mob)) continue else if(isobj(A) && !A.simulated) chemholder.reagents.touch_obj(A) @@ -253,13 +253,13 @@ // Randomizes and spawns the smoke effect. // Also handles deleting the smoke once the effect is finished. //------------------------------------------ -/datum/effect/effect/system/smoke_spread/chem/proc/spawnSmoke(var/turf/T, var/icon/I, var/smoke_duration, var/dist = 1, var/splash_initial=0, var/obj/effect/effect/smoke/chem/passed_smoke) +/datum/effect/effect/system/smoke_spread/chem/proc/spawnSmoke(var/turf/T, var/icon/I, var/smoke_duration, var/dist = 1, var/splash_initial=0, var/obj/effect/smoke/chem/passed_smoke) - var/obj/effect/effect/smoke/chem/smoke + var/obj/effect/smoke/chem/smoke if(passed_smoke) smoke = passed_smoke else - smoke = new /obj/effect/effect/smoke/chem(location, smoke_duration + rand(smoke_duration*-0.25, smoke_duration*0.25), T, I) + smoke = new /obj/effect/smoke/chem(location, smoke_duration + rand(smoke_duration*-0.25, smoke_duration*0.25), T, I) if(LAZYLEN(chemholder?.reagents?.reagent_volumes)) chemholder.reagents.trans_to_obj(smoke, chemholder.reagents.total_volume / dist, copy = 1) //copy reagents to the smoke so mob/breathe() can handle inhaling the reagents @@ -270,7 +270,7 @@ /datum/effect/effect/system/smoke_spread/chem/spores/spawnSmoke(var/turf/T, var/icon/I, var/smoke_duration, var/dist = 1) - var/obj/effect/effect/smoke/chem/spores = new /obj/effect/effect/smoke/chem(location) + var/obj/effect/smoke/chem/spores = new /obj/effect/smoke/chem(location) if(spores && seed) spores.name = "cloud of [seed.seed_name] [seed.seed_noun]" ..(T, I, smoke_duration, dist, spores) diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index 1145f808ee5..cc49c75a021 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -93,7 +93,7 @@ would spawn and follow the beaker, even if it is carried or thrown. ///////////////////////////////////////////// -/obj/effect/effect/smoke +/obj/effect/smoke name = "smoke" icon_state = "smoke" opacity = 1 @@ -108,8 +108,9 @@ would spawn and follow the beaker, even if it is carried or thrown. pixel_x = -32 pixel_y = -32 -/obj/effect/effect/smoke/New(var/loc, var/duration = 0) - ..() +/obj/effect/smoke/Initialize(mapload, duration = 0) + . = ..() + if (duration) time_to_live = duration addtimer(CALLBACK(src, PROC_REF(kill)), time_to_live) @@ -120,19 +121,19 @@ would spawn and follow the beaker, even if it is carried or thrown. AddElement(/datum/element/connect_loc, loc_connections) -/obj/effect/effect/smoke/proc/kill() +/obj/effect/smoke/proc/kill() animate(src, alpha = 0, time = 2 SECONDS, easing = QUAD_EASING) set_opacity(FALSE) QDEL_IN(src, 2.5 SECONDS) -/obj/effect/effect/smoke/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) +/obj/effect/smoke/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) SIGNAL_HANDLER if(istype(arrived, /mob/living/carbon)) affect(arrived) -/obj/effect/effect/smoke/proc/affect(var/mob/living/carbon/M) +/obj/effect/smoke/proc/affect(var/mob/living/carbon/M) if (istype(M)) return 0 if (M.internal != null) @@ -149,13 +150,13 @@ would spawn and follow the beaker, even if it is carried or thrown. // Illumination ///////////////////////////////////////////// -/obj/effect/effect/smoke/illumination +/obj/effect/smoke/illumination name = "illumination" opacity = 0 icon = 'icons/effects/effects.dmi' icon_state = "sparks" -/obj/effect/effect/smoke/illumination/New(var/newloc, var/brightness=15, var/lifetime=10) +/obj/effect/smoke/illumination/New(var/newloc, var/brightness=15, var/lifetime=10) time_to_live=lifetime ..() set_light(brightness) @@ -164,15 +165,15 @@ would spawn and follow the beaker, even if it is carried or thrown. // Bad smoke ///////////////////////////////////////////// -/obj/effect/effect/smoke/bad +/obj/effect/smoke/bad time_to_live = 200 -/obj/effect/effect/smoke/bad/Move() - ..() +/obj/effect/smoke/bad/Move() + . = ..() for(var/mob/living/carbon/M in get_turf(src)) affect(M) -/obj/effect/effect/smoke/bad/affect(var/mob/living/carbon/M) +/obj/effect/smoke/bad/affect(var/mob/living/carbon/M) if (!..()) return 0 M.drop_item() @@ -183,7 +184,7 @@ would spawn and follow the beaker, even if it is carried or thrown. spawn ( 20 ) M.coughedtime = 0 -/obj/effect/effect/smoke/bad/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) +/obj/effect/smoke/bad/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group || (height==0)) return TRUE @@ -199,14 +200,14 @@ would spawn and follow the beaker, even if it is carried or thrown. // Sleep smoke ///////////////////////////////////////////// -/obj/effect/effect/smoke/sleepy +/obj/effect/smoke/sleepy -/obj/effect/effect/smoke/sleepy/Move() - ..() +/obj/effect/smoke/sleepy/Move() + . = ..() for(var/mob/living/carbon/M in get_turf(src)) affect(M) -/obj/effect/effect/smoke/sleepy/affect(mob/living/carbon/M) +/obj/effect/smoke/sleepy/affect(mob/living/carbon/M) if (!..()) return 0 @@ -222,16 +223,16 @@ would spawn and follow the beaker, even if it is carried or thrown. ///////////////////////////////////////////// -/obj/effect/effect/smoke/mustard +/obj/effect/smoke/mustard name = "mustard gas" icon_state = "mustard" -/obj/effect/effect/smoke/mustard/Move() - ..() +/obj/effect/smoke/mustard/Move() + . = ..() for(var/mob/living/carbon/human/R in get_turf(src)) affect(R) -/obj/effect/effect/smoke/mustard/affect(var/mob/living/carbon/human/R) +/obj/effect/smoke/mustard/affect(var/mob/living/carbon/human/R) if (!..()) return 0 if (R.wear_suit != null) @@ -253,7 +254,7 @@ would spawn and follow the beaker, even if it is carried or thrown. /datum/effect/effect/system/smoke_spread var/total_smoke = 0 // To stop it being spammed and lagging! var/direction - var/smoke_type = /obj/effect/effect/smoke + var/smoke_type = /obj/effect/smoke var/smoke_duration /datum/effect/effect/system/smoke_spread/set_up(n = 5, c = 0, loca, direct, duration = 0) @@ -277,7 +278,7 @@ would spawn and follow the beaker, even if it is carried or thrown. spawn(0) if(holder) src.location = get_turf(holder) - var/obj/effect/effect/smoke/smoke = new smoke_type(src.location) + var/obj/effect/smoke/smoke = new smoke_type(src.location) src.total_smoke++ var/direction = src.direction if(!direction) @@ -294,14 +295,14 @@ would spawn and follow the beaker, even if it is carried or thrown. /datum/effect/effect/system/smoke_spread/bad - smoke_type = /obj/effect/effect/smoke/bad + smoke_type = /obj/effect/smoke/bad /datum/effect/effect/system/smoke_spread/sleepy - smoke_type = /obj/effect/effect/smoke/sleepy + smoke_type = /obj/effect/smoke/sleepy /datum/effect/effect/system/smoke_spread/mustard - smoke_type = /obj/effect/effect/smoke/mustard + smoke_type = /obj/effect/smoke/mustard ///////////////////////////////////////////// //////// Attach a steam trail to an object (eg. a reacting beaker) that will follow it diff --git a/code/game/objects/effects/explosion_particles.dm b/code/game/objects/effects/explosion_particles.dm index e90be5fbac0..cc18ad1150f 100644 --- a/code/game/objects/effects/explosion_particles.dm +++ b/code/game/objects/effects/explosion_particles.dm @@ -12,7 +12,7 @@ return /obj/effect/expl_particles/Move() - ..() + . = ..() return /obj/effect/expl_particles/Destroy() diff --git a/code/game/objects/empulse.dm b/code/game/objects/empulse.dm index 0982e8cabd6..c503bfd9b3a 100644 --- a/code/game/objects/empulse.dm +++ b/code/game/objects/empulse.dm @@ -47,8 +47,8 @@ var/virtual_epicenter = locate(epicenter.x, epicenter.y, z) //We assume each zlevel to be 9 meters tall, and apply the pythagorean theorem to obtain the radius of the sphere at that vertical distance from the epicenter - var/virtual_heavy_range = abs(epicenter.z - z) ? ( sqrt(((heavy_range*heavy_range)-((9*(epicenter.z - z))*(9*(epicenter.z - z))))) ) : heavy_range - var/virtual_light_range = abs(epicenter.z - z) ? ( sqrt(((light_range*light_range)-((9*(epicenter.z - z))*(9*(epicenter.z - z))))) ) : light_range + var/virtual_heavy_range = abs(epicenter.z - z) ? ( sqrt(abs((heavy_range*heavy_range)-((9*(epicenter.z - z))*(9*(epicenter.z - z))))) ) : heavy_range + var/virtual_light_range = abs(epicenter.z - z) ? ( sqrt(abs((light_range*light_range)-((9*(epicenter.z - z))*(9*(epicenter.z - z))))) ) : light_range #ifdef EMPDEBUG log_and_message_admins("EMPDEBUG: Heavy range for explosion at Z-level [z] is [virtual_heavy_range]") diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 06bba584c5c..bbf7a76dab5 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -415,9 +415,9 @@ pixel_x = 8; set_on(has_power) // has_power is given by our listener machinery update_icon() -/obj/item/device/radio/intercom/forceMove(atom/dest) - power_interface.forceMove(dest) - ..(dest) +/obj/item/device/radio/intercom/forceMove(atom/destination) + power_interface.forceMove(destination) + . = ..() /obj/item/device/radio/intercom/update_icon() ClearOverlays() diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm index da319174b26..c4396d62131 100644 --- a/code/game/objects/items/weapons/grenades/flashbang.dm +++ b/code/game/objects/items/weapons/grenades/flashbang.dm @@ -17,7 +17,7 @@ B.update_icon() single_spark(T) - new /obj/effect/effect/smoke/illumination(T, brightness=15) + new /obj/effect/smoke/illumination(T, brightness=15) qdel(src) /obj/item/grenade/flashbang/explode_in_hand(var/mob/living/carbon/human/victim, var/obj/item/organ/external/exploded_hand) diff --git a/code/game/objects/items/weapons/tanks/watertank.dm b/code/game/objects/items/weapons/tanks/watertank.dm index 63613d4ae68..067ddfe2741 100644 --- a/code/game/objects/items/weapons/tanks/watertank.dm +++ b/code/game/objects/items/weapons/tanks/watertank.dm @@ -114,7 +114,7 @@ return /obj/item/reagent_containers/spray/chemsprayer/mister/Move() - ..() + . = ..() if(loc != tank.loc) forceMove(tank.loc) diff --git a/code/game/objects/items/weapons/traps.dm b/code/game/objects/items/weapons/traps.dm index 7cc7351611c..edb64677ad9 100644 --- a/code/game/objects/items/weapons/traps.dm +++ b/code/game/objects/items/weapons/traps.dm @@ -670,7 +670,7 @@ ..() /obj/item/trap/animal/Move() - ..() + . = ..() if(captured) var/datum/M = captured.resolve() if(isliving(M)) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index dc02ae6f313..6e9092806f2 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -113,7 +113,8 @@ return ..() /obj/structure/closet/crate/Move(var/turf/destination, dir) - if(..()) + . = ..() + if(.) if (locate(/obj/structure/table) in destination) if(locate(/obj/structure/table/rack) in destination) set_tablestatus(ABOVE_TABLE) diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 3d3718d37d0..09f614652d9 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -122,10 +122,10 @@ painted_colour = new_colour return painted_colour != last_colour -/obj/structure/bed/forceMove(atom/dest) +/obj/structure/bed/forceMove(atom/destination) . = ..() if(buckled) - buckled.forceMove(dest) + buckled.forceMove(destination) /obj/structure/bed/ex_act(severity) switch(severity) @@ -519,7 +519,7 @@ collapse() /obj/structure/bed/roller/Move() - ..() + . = ..() if(buckled) if(buckled.buckled_to == src) buckled.forceMove(src.loc) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 5fa8c9c74b5..b9fce38d9ac 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -400,7 +400,7 @@ update_nearby_tiles(need_rebuild=1) - ..() + . = ..() set_dir(ini_dir) update_nearby_tiles(need_rebuild=1) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 10458ce0a15..430f9dc8a9d 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -808,8 +808,8 @@ var/global/enabled_spooking = 0 set desc="Start the round RIGHT NOW" set name="Start Now" if(!MC_RUNNING()) - alert("Unable to start the game as it is not set up.") - return + to_chat(usr, SPAN_NOTICE("The round will be started automatically as soon as ready.")) + UNTIL(SSticker?.current_state == GAME_STATE_PREGAME) if(SSticker.current_state == GAME_STATE_PREGAME) SSticker.current_state = GAME_STATE_SETTING_UP log_admin("[usr.key] has started the game.") diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 2892ac83fb7..0395d758174 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -106,10 +106,9 @@ /obj/item/device/assembly/infra/Move() var/t = dir - ..() + . = ..() set_dir(t) QDEL_NULL(first) - return /obj/item/device/assembly/infra/holder_movement() if(!holder) diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index a0f5bd9fe21..d4ca2012139 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -97,7 +97,7 @@ grenade.primed(scanning) /obj/item/device/assembly/prox_sensor/Move() - ..() + . = ..() sense() /obj/item/device/assembly/prox_sensor/interact(mob/user) diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index b2b3f8388d6..7b3f213e5ba 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -1195,7 +1195,7 @@ BLIND // can't see anything eye.color = eye_color AddOverlays(eye) -/obj/item/clothing/glasses/eyepatch/hud/forceMove(atom/newloc) +/obj/item/clothing/glasses/eyepatch/hud/forceMove(atom/destination) if (!ishuman(loc)) return ..() diff --git a/code/modules/heavy_vehicle/equipment/combat.dm b/code/modules/heavy_vehicle/equipment/combat.dm index c6ac1393b19..ba48870f6cb 100644 --- a/code/modules/heavy_vehicle/equipment/combat.dm +++ b/code/modules/heavy_vehicle/equipment/combat.dm @@ -421,7 +421,7 @@ flick("shield_impact", src) playsound(user, 'sound/effects/basscannon.ogg', 35, TRUE) //light up the night. - new /obj/effect/effect/smoke/illumination(get_turf(src), 5, 4, 1, "#ffffff") + new /obj/effect/smoke/illumination(get_turf(src), 5, 4, 1, "#ffffff") if(hitting_projectile.damage <= 0) return AURA_FALSE|AURA_CANCEL diff --git a/code/modules/heavy_vehicle/mech_interaction.dm b/code/modules/heavy_vehicle/mech_interaction.dm index 2d0711e7f2e..58564314bd4 100644 --- a/code/modules/heavy_vehicle/mech_interaction.dm +++ b/code/modules/heavy_vehicle/mech_interaction.dm @@ -309,7 +309,8 @@ Move(target_loc, new_direction) /mob/living/heavy_vehicle/Move() - if(..() && !istype(loc, /turf/space)) + . = ..() + if(. && !istype(loc, /turf/space)) if(legs) if(legs.mech_step_sound) playsound(src.loc, legs.mech_step_sound, 40, TRUE) diff --git a/code/modules/hydroponics/spreading/spreading_growth.dm b/code/modules/hydroponics/spreading/spreading_growth.dm index 634f4763fa6..17112f953a9 100644 --- a/code/modules/hydroponics/spreading/spreading_growth.dm +++ b/code/modules/hydroponics/spreading/spreading_growth.dm @@ -38,7 +38,7 @@ die_off() return 0 - for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) + for(var/obj/effect/smoke/chem/smoke in view(1, src)) if(smoke.reagents.has_reagent(/singleton/reagent/toxin/plantbgone)) die_off() return diff --git a/code/modules/hydroponics/trays/tray_process.dm b/code/modules/hydroponics/trays/tray_process.dm index 94289260199..8f1776dc652 100644 --- a/code/modules/hydroponics/trays/tray_process.dm +++ b/code/modules/hydroponics/trays/tray_process.dm @@ -1,7 +1,7 @@ /obj/machinery/portable_atmospherics/hydroponics/process() // Handle nearby smoke if any. - for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) + for(var/obj/effect/smoke/chem/smoke in view(1, src)) if(smoke.reagents.total_volume) smoke.reagents.trans_to_obj(src, 5, copy = 1) diff --git a/code/modules/mob/living/carbon/breathe.dm b/code/modules/mob/living/carbon/breathe.dm index 8984d960e6c..4472ddea5b3 100644 --- a/code/modules/mob/living/carbon/breathe.dm +++ b/code/modules/mob/living/carbon/breathe.dm @@ -89,7 +89,7 @@ if(wear_mask && (wear_mask.item_flags & ITEM_FLAG_BLOCK_GAS_SMOKE_EFFECT)) return - for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) + for(var/obj/effect/smoke/chem/smoke in view(1, src)) if(smoke.reagents.total_volume) smoke.reagents.trans_to_mob(src, 5, CHEM_INGEST, copy = 1) smoke.reagents.trans_to_mob(src, 5, CHEM_TOUCH, copy = 1) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 13805d4bd88..2ff752f8c86 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -165,13 +165,24 @@ emp_act return BULLET_ACT_HIT /mob/living/carbon/human/emp_act(severity) + /* + OK LISTEN UP this is absolutely shitcode but it works, basically we need the species EMP protection + to avoid antag IPCs being smoked by EMPs in one hit and the surge protection nanopaste is handled in their specie + and we have to call parent to have the signals working properly, hence we add an element to the mob to handle the protection + and then we remove it after the EMP is done. Yes this is garbage, but it works + */ + var/emp_protect_ipc = species.handle_emp_act(src, severity) + if(emp_protect_ipc) + AddElement(/datum/element/empprotection, emp_protect_ipc) + . = ..() - if(species.handle_emp_act(src, severity)) - return // blocks the EMP + if(emp_protect_ipc) + RemoveElement(/datum/element/empprotection, emp_protect_ipc) - for(var/obj/O in src) - O.emp_act(severity) + if(!(.|emp_protect_ipc & EMP_PROTECT_CONTENTS)) + for(var/obj/O in src) + O.emp_act(severity) /mob/living/carbon/human/get_attack_victim(obj/item/I, mob/living/user, var/target_zone) if(a_intent != I_HELP) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 5051ff00710..8452a2be7fe 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -855,9 +855,18 @@ return src return name -// prevents EMP damage if return it returns TRUE -/datum/species/proc/handle_emp_act(var/mob/living/carbon/human/H, var/severity) - return FALSE +/** + * Handles EMP act for a specie + * + * * hit_mob - The mob that was hit by the EMP (aka the mob that is this specie) + * * severity - The severity of the EMP, one of the EMP_ defines in empulse.dm + * + * returns a bitfield with the EMP_PROTECT_* defines to determine what should happen from the mob perspective + */ +/datum/species/proc/handle_emp_act(mob/living/carbon/human/hit_mob, severity) + SHOULD_NOT_SLEEP(TRUE) + SHOULD_CALL_PARENT(FALSE) + return NONE /** * DEPRECATED: Use `/datum/movespeed_modifier` instead diff --git a/code/modules/mob/living/carbon/human/species/station/golem.dm b/code/modules/mob/living/carbon/human/species/station/golem.dm index eb98f1c5545..d4983e3e900 100644 --- a/code/modules/mob/living/carbon/human/species/station/golem.dm +++ b/code/modules/mob/living/carbon/human/species/station/golem.dm @@ -931,6 +931,6 @@ GLOBAL_LIST_INIT(golem_types, list( stance_damage += 3 return stance_damage -/datum/species/golem/technomancer/handle_emp_act(mob/living/carbon/human/H, var/severity) - H.apply_damage(75 * (4 - severity)) // their brute_mod means damage needs to be high - return TRUE +/datum/species/golem/technomancer/handle_emp_act(mob/living/carbon/human/hit_mob, severity) + hit_mob.apply_damage(75 * (4 - severity)) // their brute_mod means damage needs to be high + return EMP_PROTECT_ALL diff --git a/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm b/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm index 9a3218a1922..2d8bae30d33 100644 --- a/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm +++ b/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm @@ -163,22 +163,22 @@ C.use(cost * sprint_cost_factor) return TRUE -/datum/species/machine/handle_emp_act(mob/living/carbon/human/H, var/severity) - var/obj/item/organ/internal/surge/S = H.internal_organs_by_name["surge"] +/datum/species/machine/handle_emp_act(mob/living/carbon/human/hit_mob, severity) + var/obj/item/organ/internal/surge/S = hit_mob.internal_organs_by_name["surge"] if(!isnull(S)) if(S.surge_left >= 1) - playsound(H.loc, 'sound/magic/LightningShock.ogg', 25, 1) + playsound(hit_mob.loc, 'sound/magic/LightningShock.ogg', 25, 1) S.surge_left -= 1 if(S.surge_left) - to_chat(H, SPAN_WARNING("Warning: EMP detected, integrated surge prevention module activated. There are [S.surge_left] preventions left.")) + to_chat(hit_mob, SPAN_WARNING("Warning: EMP detected, integrated surge prevention module activated. There are [S.surge_left] preventions left.")) else S.broken = TRUE S.icon_state = "surge_ipc_broken" - to_chat(H, SPAN_DANGER("Warning: EMP detected, integrated surge prevention module activated. The surge prevention module is fried, replacement recommended.")) - return TRUE + to_chat(hit_mob, SPAN_DANGER("Warning: EMP detected, integrated surge prevention module activated. The surge prevention module is fried, replacement recommended.")) + return EMP_PROTECT_ALL else to_chat(src, SPAN_DANGER("Warning: EMP detected, integrated surge prevention module is fried and unable to protect from EMP. Replacement recommended.")) - return FALSE + return NONE /datum/species/machine/handle_death(var/mob/living/carbon/human/H) ..() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 42662ae733b..d1f7096d094 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -350,7 +350,7 @@ default behaviour is: // ++++ROCKDTBEN++++ MOB PROCS //END /mob/proc/get_contents() - + return list() //Recursive function to find everything a mob is holding. /mob/living/get_contents(var/obj/item/storage/Storage = null) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 9dc0e051f31..9c4d798a02b 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -206,9 +206,10 @@ /mob/living/emp_act(severity) . = ..() - var/list/L = src.get_contents() - for(var/obj/O in L) - O.emp_act(severity) + //If no protection of the contents, apply the EMP effect to the contents + if(!(. & EMP_PROTECT_CONTENTS)) + for(var/obj/O in get_contents()) + O.emp_act(severity) /mob/living/flash_act(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, ignore_inherent = FALSE, type = /atom/movable/screen/fullscreen/flash, length = 2.5 SECONDS) if(is_blind() && !(override_blindness_check || affect_silicon)) diff --git a/code/modules/mob/living/simple_animal/bees.dm b/code/modules/mob/living/simple_animal/bees.dm index 9bc62c7a37e..1a8896fdf29 100644 --- a/code/modules/mob/living/simple_animal/bees.dm +++ b/code/modules/mob/living/simple_animal/bees.dm @@ -147,7 +147,7 @@ if (feral && isturf(loc)) //smoke, water and steam calms us down var/static/list/calmers = typecacheof(list( - /obj/effect/effect/smoke, + /obj/effect/smoke, /obj/effect/effect/water, /obj/effect/effect/foam, /obj/effect/effect/steam, diff --git a/code/modules/mob/living/simple_animal/friendly/adhomai.dm b/code/modules/mob/living/simple_animal/friendly/adhomai.dm index b888ea3b06a..f3beb13a0b1 100644 --- a/code/modules/mob/living/simple_animal/friendly/adhomai.dm +++ b/code/modules/mob/living/simple_animal/friendly/adhomai.dm @@ -220,8 +220,8 @@ /mob/living/simple_animal/ice_catcher/Move() if(burrowed) return - else - ..() + + . = ..() /mob/living/simple_animal/ice_catcher/proc/unburrow() burrowed = FALSE diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 25a5e6a50d6..a08b7eb011c 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -68,7 +68,7 @@ visible_message(SPAN_WARNING("[src] gets an evil-looking gleam in their eye.")) /mob/living/simple_animal/hostile/retaliate/goat/Move() - ..() + . = ..() if(!stat) for(var/obj/effect/plant/SV in loc) SV.die_off(1) diff --git a/code/modules/mob/living/simple_animal/friendly/ratking.dm b/code/modules/mob/living/simple_animal/friendly/ratking.dm index 8408cdfa902..bebb36362e0 100644 --- a/code/modules/mob/living/simple_animal/friendly/ratking.dm +++ b/code/modules/mob/living/simple_animal/friendly/ratking.dm @@ -50,7 +50,7 @@ return FALSE /mob/living/simple_animal/rat/king/Move() - ..() + . = ..() for(var/image/I in overlays) I.dir = src.dir diff --git a/code/modules/mob/living/simple_animal/friendly/schlorrgo.dm b/code/modules/mob/living/simple_animal/friendly/schlorrgo.dm index 006b50d0520..b9e42d2f6f6 100644 --- a/code/modules/mob/living/simple_animal/friendly/schlorrgo.dm +++ b/code/modules/mob/living/simple_animal/friendly/schlorrgo.dm @@ -254,7 +254,8 @@ /mob/living/simple_animal/schlorrgo/Move() if(current_size >= COLOSSAL_SCHLORRGO) return - ..() + + . = ..() /mob/living/simple_animal/schlorrgo/attempt_grab(var/mob/living/grabber) if(current_size >= WIDE_SCHLORRGO) diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index 287eee75bfd..5044d5f88fe 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -319,7 +319,8 @@ return positronic /mob/living/simple_animal/spiderbot/Move(newloc, direct) - ..(newloc,direct) + . = ..() + if (underdoor) underdoor = 0 if ((layer == UNDERDOOR))//if this is false, then we must have used hide, or had our layer changed by something else. We wont do anymore checks for this move proc diff --git a/code/modules/mob/living/simple_animal/worm.dm b/code/modules/mob/living/simple_animal/worm.dm index cb2a1663d0f..8848f18b18c 100644 --- a/code/modules/mob/living/simple_animal/worm.dm +++ b/code/modules/mob/living/simple_animal/worm.dm @@ -73,7 +73,8 @@ /mob/living/simple_animal/space_worm/Move() var/attachementNextPosition = loc - if(..()) + . = ..() + if(.) if(previous) previous.Move(attachementNextPosition) update_icon() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 7895b0c4981..df37bd9bc5a 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1277,12 +1277,12 @@ else return ..(ndir) -/mob/forceMove(atom/dest) +/mob/forceMove(atom/destination) var/old_z = GET_Z(src) var/atom/movable/AM - if (dest != loc && istype(dest, /atom/movable)) - AM = dest + if (destination != loc && istype(destination, /atom/movable)) + AM = destination LAZYADD(AM.contained_mobs, src) if(ismob(pulledby)) var/mob/M = pulledby diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 4a428e6bffc..cfb594c9e5a 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -138,92 +138,6 @@ */ return -//This proc should never be overridden elsewhere at /atom/movable to keep directions sane. -/atom/movable/Move(atom/newloc, direction, glide_size_override = 0, update_dir = TRUE) //Last 2 parameters are not used but they're caught - . = FALSE - if(!newloc || newloc == loc) - return - - if(SEND_SIGNAL(src, COMSIG_MOVABLE_PRE_MOVE, newloc) & COMPONENT_MOVABLE_BLOCK_PRE_MOVE) - return - - var/old_loc = loc - - //Diagonal move - if(direction & (direction - 1)) - if(direction & 1) - if(direction & 4) - if(step(src, NORTH)) - . = step(src, EAST) - else - if(step(src, EAST)) - . = step(src, NORTH) - else - if(direction & 8) - if(step(src, NORTH)) - . = step(src, WEST) - else - if(step(src, WEST)) - . = step(src, NORTH) - else - if(direction & 2) - if(direction & 4) - if(step(src, SOUTH)) - . = step(src, EAST) - else - if(step(src, EAST)) - . = step(src, SOUTH) - else - if(direction & 8) - if(step(src, SOUTH)) - . = step(src, WEST) - else - if(step(src, WEST)) - . = step(src, SOUTH) - - //Cardinal move - else - var/atom/A = src.loc - - var/olddir = dir //we can't override this without sacrificing the rest of movable/New() - . = ..(newloc, direction) - - if(.) - // Lighting. - if(light_sources) - var/datum/light_source/L - var/thing - for(thing in light_sources) - L = thing - L.source_atom.update_light() - - // Openturf. - if(bound_overlay) - // The overlay will handle cleaning itself up on non-openspace turfs. - bound_overlay.forceMove(get_step(src, UP)) - if(bound_overlay.dir != dir) - bound_overlay.set_dir(dir) - - if(opacity) - updateVisibility(src) - - //Mimics - if(bound_overlay) - bound_overlay.forceMove(get_step(src, UP)) - if(bound_overlay.dir != dir) - bound_overlay.set_dir(dir) - - Moved(old_loc, direction, FALSE) - - if(direction != olddir) - dir = olddir - set_dir(direction) - - src.move_speed = world.time - src.l_move_time - src.l_move_time = world.time - if ((A != src.loc && A && A.z == src.z)) - src.last_move = get_dir(A, src.loc) - /client/proc/Move_object(direct) if(mob && mob.control_object) if(mob.control_object.density) diff --git a/code/modules/multiz/zmimic/mimic_movable.dm b/code/modules/multiz/zmimic/mimic_movable.dm index cf0032c2581..ad00d33037e 100644 --- a/code/modules/multiz/zmimic/mimic_movable.dm +++ b/code/modules/multiz/zmimic/mimic_movable.dm @@ -156,9 +156,9 @@ SHOULD_CALL_PARENT(FALSE) . = associated_atom.examine(arglist(args)) // just pass all the args to the copied atom -/atom/movable/openspace/mimic/forceMove(turf/dest) +/atom/movable/openspace/mimic/forceMove(atom/destination) . = ..() - if (TURF_IS_MIMICING(dest)) + if (TURF_IS_MIMICING(destination)) if (destruction_timer) deltimer(destruction_timer) destruction_timer = null diff --git a/code/modules/overmap/overmap_object.dm b/code/modules/overmap/overmap_object.dm index 71be6fe4cee..edfe8e1b037 100644 --- a/code/modules/overmap/overmap_object.dm +++ b/code/modules/overmap/overmap_object.dm @@ -4,6 +4,8 @@ icon_state = "object" color = "#fffffe" mouse_opacity = MOUSE_OPACITY_ICON + layer = OVERMAP_SECTOR_LAYER + set_dir_on_move = FALSE //RP fluff details to appear on scan readouts for any object we want to include these details with var/scanimage = "no_data.png" @@ -19,7 +21,6 @@ var/static_vessel = FALSE //Used to expand scan details for visible space stations var/landing_site = FALSE //Used for unique landing sites that occupy the same overmap tile as another - for example, the implementation of Point Verdant and Konyang - layer = OVERMAP_SECTOR_LAYER var/list/map_z = list() diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index ee40aa220c4..cfebd4d955e 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -42,7 +42,7 @@ // You aren't allowed to move. /obj/machinery/gravity_generator/Move() - ..() + . = ..() qdel(src) /obj/machinery/gravity_generator/proc/set_broken() diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm index adc0b95c70e..c07fed34815 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm @@ -104,7 +104,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin /obj/structure/particle_accelerator/Move() - ..() + . = ..() if(master && master.active) master.toggle_power() investigate_log("was moved whilst active; it powered down.","singulo") diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index 8c88964e0ce..658550cfaf4 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -651,7 +651,7 @@ user.update_inv_back() /obj/item/gun/energy/galatea/Move() - ..() + . = ..() if(loc != source.loc) INVOKE_ASYNC(source, TYPE_PROC_REF(/obj/item/laserpack, remove_gun)) // prevent even weirder shit diff --git a/code/modules/projectiles/guns/projectile/minigun.dm b/code/modules/projectiles/guns/projectile/minigun.dm index 6c354bde267..cce8a668dd0 100644 --- a/code/modules/projectiles/guns/projectile/minigun.dm +++ b/code/modules/projectiles/guns/projectile/minigun.dm @@ -161,6 +161,6 @@ user.update_inv_back() /obj/item/gun/projectile/automatic/rifle/minigun/Move() - ..() + . = ..() if(loc != source.loc) INVOKE_ASYNC(source, TYPE_PROC_REF(/obj/item/minigunpack, remove_gun)) diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index d364e17e018..c4590f8c093 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -34,7 +34,7 @@ new /obj/effect/decal/cleanable/ash(src.loc) //always use src.loc so that ash doesn't end up inside windows single_spark(T) - new /obj/effect/effect/smoke/illumination(T, brightness=max(flash_range*2, brightness), lifetime=light_duration) + new /obj/effect/smoke/illumination(T, brightness=max(flash_range*2, brightness), lifetime=light_duration) //blinds people like the flash round, but can also be used for temporary illumination /obj/projectile/energy/flash/flare diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm index 8e35597a4f7..fd38e523686 100644 --- a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm +++ b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm @@ -317,7 +317,7 @@ return /obj/machinery/artifact/Move() - ..() + . = ..() if(my_effect) my_effect.UpdateMove() if(secondary_effect) diff --git a/code/modules/shuttles/landmarks.dm b/code/modules/shuttles/landmarks.dm index 7b71c076bcd..854471f50ed 100644 --- a/code/modules/shuttles/landmarks.dm +++ b/code/modules/shuttles/landmarks.dm @@ -57,7 +57,7 @@ if(!istype(docking_controller)) LOG_DEBUG("Could not find docking controller for shuttle waypoint '[name]', docking tag was '[docking_tag]'.") -/obj/effect/shuttle_landmark/forceMove() +/obj/effect/shuttle_landmark/forceMove(atom/destination) var/obj/effect/overmap/visitable/map_origin = GLOB.map_sectors["[z]"] . = ..() var/obj/effect/overmap/visitable/map_destination = GLOB.map_sectors["[z]"] diff --git a/code/modules/vehicles/bike.dm b/code/modules/vehicles/bike.dm index 047c5301904..26b79f83b3d 100644 --- a/code/modules/vehicles/bike.dm +++ b/code/modules/vehicles/bike.dm @@ -419,7 +419,8 @@ /obj/vehicle/bike/casino/Move(var/turf/destination) if(!paid) return - ..() + + . = ..() /obj/vehicle/bike/casino/attackby(obj/item/attacking_item, mob/user) if(istype(attacking_item, /obj/item/coin/casino)) diff --git a/code/modules/vehicles/pussywagon.dm b/code/modules/vehicles/pussywagon.dm index 0981d8cb1ff..3abcefde7bd 100644 --- a/code/modules/vehicles/pussywagon.dm +++ b/code/modules/vehicles/pussywagon.dm @@ -147,7 +147,7 @@ load_offset_x = 13 load.pixel_y = mob_offset_y load.pixel_x = load_offset_x - ..() + . = ..() /obj/vehicle/train/cargo/trolley/pussywagon name = "\improper C8000 deluxe custodial trolley" diff --git a/code/modules/vehicles/train.dm b/code/modules/vehicles/train.dm index 0de4bea5642..2a441808334 100644 --- a/code/modules/vehicles/train.dm +++ b/code/modules/vehicles/train.dm @@ -37,7 +37,8 @@ /obj/vehicle/train/Move() var/old_loc = get_turf(src) - if(..()) + . = ..() + if(.) if(tow) tow.Move(old_loc) return 1 diff --git a/html/changelogs/fluffyghost-movementv2.yml b/html/changelogs/fluffyghost-movementv2.yml new file mode 100644 index 00000000000..93862a73bf4 --- /dev/null +++ b/html/changelogs/fluffyghost-movementv2.yml @@ -0,0 +1,61 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: ChangeMe + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - refactor: "Refactored (second passage) how movement works, now it's mostly in line with TG handling and avoids calling 3 gazillion Cross() Uncross() etc. on every atom in a turf." + - bugfix: "Fixed EMP protection from species not actually protecting (this includes the surge prevention for IPCs)." + - bugfix: "Fixed EMP 3D calculation runtiming because I forgot to make the value absolute and it was doing the square root of a negative number." + - server: "It's now possible to queue the round to start with the Start Round verb even while the system is initializing, for an even faster pain train to enter the round and test things."