diff --git a/aurorastation.dme b/aurorastation.dme index cefb2ecb1f0..e21519be529 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -73,6 +73,8 @@ #include "code\__DEFINES\hydroponics.dm" #include "code\__DEFINES\icon_layering.dm" #include "code\__DEFINES\important_recursive_contents.dm" +#include "code\__DEFINES\inventory.dm" +#include "code\__DEFINES\is_helpers.dm" #include "code\__DEFINES\items_clothing.dm" #include "code\__DEFINES\jobs.dm" #include "code\__DEFINES\large_structures.dm" @@ -451,6 +453,7 @@ #include "code\datums\components\overhead_emote\overhead_emote_singleton.dm" #include "code\datums\components\turf_click\turf_hand.dm" #include "code\datums\elements\_element.dm" +#include "code\datums\elements\connect_loc.dm" #include "code\datums\elements\empprotection.dm" #include "code\datums\ert\corporate.dm" #include "code\datums\ert\outsider.dm" diff --git a/code/__DEFINES/_macros.dm b/code/__DEFINES/_macros.dm index ea53525c62d..f3b16b394d5 100644 --- a/code/__DEFINES/_macros.dm +++ b/code/__DEFINES/_macros.dm @@ -17,76 +17,6 @@ #define sequential_id(key) uniqueness_repository.Generate(/datum/uniqueness_generator/id_sequential, key) -#define isAI(A) istype(A, /mob/living/silicon/ai) -#define isDrone(A) istype(A, /mob/living/silicon/robot/drone) -#define isMatriarchDrone(A) istype(A, /mob/living/silicon/robot/drone/construction/matriarch) - -#define isalien(A) istype(A, /mob/living/carbon/alien) - -#define isanimal(A) istype(A, /mob/living/simple_animal) - -#define isairlock(A) istype(A, /obj/machinery/door/airlock) - -#define isbrain(A) istype(A, /mob/living/carbon/brain) - -#define isvirtualmob(A) istype(A, /mob/abstract/observer/virtual) - -#define iscarbon(A) istype(A, /mob/living/carbon) - -#define iscorgi(A) istype(A, /mob/living/simple_animal/corgi) - -#define isEye(A) istype(A, /mob/abstract/eye) - -#define ishuman(A) istype(A, /mob/living/carbon/human) - -#define ismech(A) istype(A, /mob/living/heavy_vehicle) - -#define isliving(A) istype(A, /mob/living) - -#define israt(A) istype(A, /mob/living/simple_animal/rat) - -#define isnewplayer(A) istype(A, /mob/abstract/new_player) - -#define isobj(A) istype(A, /obj) - -#define isspace(A) istype(A, /area/space) - -#define isspaceturf(A) istype(A, /turf/space) - -#define isobserver(A) istype(A, /mob/abstract/observer) - -#define isorgan(A) istype(A, /obj/item/organ/external) - -#define ispAI(A) istype(A, /mob/living/silicon/pai) - -#define isbot(A) istype(A, /mob/living/bot) - -#define isrobot(A) istype(A, /mob/living/silicon/robot) - -#define issilicon(A) istype(A, /mob/living/silicon) - -#define isslime(A) istype(A, /mob/living/carbon/slime) - -#define iscapacitor(A) istype(A, /obj/item/stock_parts/capacitor) - -#define ismicrolaser(A) istype(A, /obj/item/stock_parts/micro_laser) - -#define ismatterbin(A) istype(A, /obj/item/stock_parts/matter_bin) - -#define isscanner(A) istype(A, /obj/item/stock_parts/scanning_module) - -#define ismanipulator(A) istype(A, /obj/item/stock_parts/manipulator) - -#define isclient(A) istype(A, /client) - -#define isclothing(A) istype(A, /obj/item/clothing) -#define isaccessory(A) istype(A, /obj/item/clothing/accessory) - -/// Projectile helpers -#define isprojectile(A) istype(A, /obj/projectile) -#define isbeam(A) istype(A, /obj/projectile/beam) -#define isenergy(A) istype(A, /obj/projectile/energy) - /// General I/O helpers #define to_target(target, payload) target << (payload) #define from_target(target, receiver) target >> (receiver) diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm index 4bc873e76d6..c467eab2a86 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm @@ -22,3 +22,9 @@ #define COMSIG_ATOM_BUMPED "atom_bumped" ///from base of atom/has_gravity(): (turf/location, list/forced_gravities) #define COMSIG_ATOM_HAS_GRAVITY "atom_has_gravity" + +///from base of atom/throw_impact, sent by the target hit by a thrown object. (hit_atom, thrown_atom, datum/thrownthing/throwingdatum) +#define COMSIG_ATOM_PREHITBY "atom_pre_hitby" + #define COMSIG_HIT_PREVENTED (1<<0) +///from base of atom/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) +#define COMSIG_ATOM_HITBY "atom_hitby" diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm index f1e3f19de2e..dc2f07e9db5 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm @@ -6,6 +6,12 @@ #define COMSIG_MOVABLE_PRE_MOVE "movable_pre_move" #define COMPONENT_MOVABLE_BLOCK_PRE_MOVE (1<<0) +///from base of atom/movable/Cross(): (/atom/movable) +#define COMSIG_MOVABLE_CROSS "movable_cross" +///from base of atom/movable/Move(): (/atom/movable) +#define COMSIG_MOVABLE_CROSS_OVER "movable_cross_am" +///from base of atom/movable/Bump(): (/atom) +#define COMSIG_MOVABLE_BUMP "movable_bump" ///from base of atom/movable/newtonian_move(): (inertia_direction, start_delay) #define COMSIG_MOVABLE_NEWTONIAN_MOVE "movable_newtonian_move" #define COMPONENT_MOVABLE_NEWTONIAN_BLOCK (1<<0) @@ -13,6 +19,12 @@ ///from datum/component/drift/allow_final_movement(): () #define COMSIG_MOVABLE_DRIFT_BLOCK_INPUT "movable_drift_block_input" #define DRIFT_ALLOW_INPUT (1<<0) +///from base of atom/movable/throw_impact(): (/atom/hit_atom, /datum/thrownthing/throwingdatum) +#define COMSIG_MOVABLE_PRE_IMPACT "movable_pre_impact" + #define COMPONENT_MOVABLE_IMPACT_FLIP_HITPUSH (1<<0) //if true, flip if the impact will push what it hits + #define COMPONENT_MOVABLE_IMPACT_NEVERMIND (1<<1) //return true if you destroyed whatever it was you're impacting and there won't be anything for hitby() to run on +///from base of atom/movable/throw_impact() after confirming a hit: (/atom/hit_atom, /datum/thrownthing/throwingdatum) +#define COMSIG_MOVABLE_IMPACT "movable_impact" ///from base of atom/movable/throw_at(): (list/args) #define COMSIG_MOVABLE_PRE_THROW "movable_pre_throw" diff --git a/code/__DEFINES/directional.dm b/code/__DEFINES/directional.dm index e0d76122500..4df61a90a62 100644 --- a/code/__DEFINES/directional.dm +++ b/code/__DEFINES/directional.dm @@ -12,3 +12,18 @@ #define TEXT_EAST "[EAST]" /// West direction as a string "[8]" #define TEXT_WEST "[WEST]" + +//dir macros +///Returns true if the dir is diagonal, false otherwise +#define ISDIAGONALDIR(d) (d&(d-1)) +///True if the dir is north or south, false therwise +#define NSCOMPONENT(d) (d&(NORTH|SOUTH)) +///True if the dir is east/west, false otherwise +#define EWCOMPONENT(d) (d&(EAST|WEST)) +///Flips the dir for north/south directions +#define NSDIRFLIP(d) (d^(NORTH|SOUTH)) +///Flips the dir for east/west directions +#define EWDIRFLIP(d) (d^(EAST|WEST)) + +/// Inverse direction, taking into account UP|DOWN if necessary. +#define REVERSE_DIR(dir) ( ((dir & 85) << 1) | ((dir & 170) >> 1) ) diff --git a/code/__DEFINES/inventory.dm b/code/__DEFINES/inventory.dm new file mode 100644 index 00000000000..a28ca02106c --- /dev/null +++ b/code/__DEFINES/inventory.dm @@ -0,0 +1,15 @@ +/*ALL DEFINES RELATED TO INVENTORY OBJECTS, MANAGEMENT, ETC, GO HERE*/ + +//ITEM INVENTORY WEIGHT, FOR w_class +/// Usually items smaller then a human hand, (e.g. playing cards, lighter, scalpel, coins/holochips) +#define WEIGHT_CLASS_TINY 1 +/// Pockets can hold small and tiny items, (e.g. flashlight, multitool, grenades, GPS device) +#define WEIGHT_CLASS_SMALL 2 +/// Standard backpacks can carry tiny, small & normal items, (e.g. fire extinguisher, stun baton, gas mask, metal sheets) +#define WEIGHT_CLASS_NORMAL 3 +/// Items that can be wielded or equipped but not stored in an inventory, (e.g. defibrillator, backpack, space suits) +#define WEIGHT_CLASS_BULKY 4 +/// Usually represents objects that require two hands to operate, (e.g. shotgun, two-handed melee weapons) +#define WEIGHT_CLASS_HUGE 5 +/// Essentially means it cannot be picked up or placed in an inventory, (e.g. mech parts, safe) +#define WEIGHT_CLASS_GIGANTIC 6 diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm new file mode 100644 index 00000000000..12c9beccb99 --- /dev/null +++ b/code/__DEFINES/is_helpers.dm @@ -0,0 +1,72 @@ +#define is_multi_tile_object(atom) (atom.bound_width > world.icon_size || atom.bound_height > world.icon_size) + + +#define isAI(A) istype(A, /mob/living/silicon/ai) +#define isDrone(A) istype(A, /mob/living/silicon/robot/drone) +#define isMatriarchDrone(A) istype(A, /mob/living/silicon/robot/drone/construction/matriarch) + +#define isalien(A) istype(A, /mob/living/carbon/alien) + +#define isanimal(A) istype(A, /mob/living/simple_animal) + +#define isairlock(A) istype(A, /obj/machinery/door/airlock) + +#define isbrain(A) istype(A, /mob/living/carbon/brain) + +#define isvirtualmob(A) istype(A, /mob/abstract/observer/virtual) + +#define iscarbon(A) istype(A, /mob/living/carbon) + +#define iscorgi(A) istype(A, /mob/living/simple_animal/corgi) + +#define isEye(A) istype(A, /mob/abstract/eye) + +#define ishuman(A) istype(A, /mob/living/carbon/human) + +#define ismech(A) istype(A, /mob/living/heavy_vehicle) + +#define isliving(A) istype(A, /mob/living) + +#define israt(A) istype(A, /mob/living/simple_animal/rat) + +#define isnewplayer(A) istype(A, /mob/abstract/new_player) + +#define isobj(A) istype(A, /obj) + +#define isspace(A) istype(A, /area/space) + +#define isspaceturf(A) istype(A, /turf/space) + +#define isobserver(A) istype(A, /mob/abstract/observer) + +#define isorgan(A) istype(A, /obj/item/organ/external) + +#define ispAI(A) istype(A, /mob/living/silicon/pai) + +#define isbot(A) istype(A, /mob/living/bot) + +#define isrobot(A) istype(A, /mob/living/silicon/robot) + +#define issilicon(A) istype(A, /mob/living/silicon) + +#define isslime(A) istype(A, /mob/living/carbon/slime) + +#define iscapacitor(A) istype(A, /obj/item/stock_parts/capacitor) + +#define ismicrolaser(A) istype(A, /obj/item/stock_parts/micro_laser) + +#define ismatterbin(A) istype(A, /obj/item/stock_parts/matter_bin) + +#define isscanner(A) istype(A, /obj/item/stock_parts/scanning_module) + +#define ismanipulator(A) istype(A, /obj/item/stock_parts/manipulator) + +#define isclient(A) istype(A, /client) + +#define isclothing(A) istype(A, /obj/item/clothing) +#define isaccessory(A) istype(A, /obj/item/clothing/accessory) + +/// Projectile helpers +#define isprojectile(A) istype(A, /obj/projectile) +#define isbeam(A) istype(A, /obj/projectile/beam) +#define isenergy(A) istype(A, /obj/projectile/energy) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 97c1ed184c2..e7c869585cb 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -332,14 +332,6 @@ #define CARGO_CONTAINER_BOX "box" #define CARGO_CONTAINER_BODYBAG "bodybag" -// We should start using these. -#define ITEMSIZE_TINY 1 -#define ITEMSIZE_SMALL 2 -#define ITEMSIZE_NORMAL 3 -#define ITEMSIZE_LARGE 4 -#define ITEMSIZE_HUGE 5 -#define ITEMSIZE_IMMENSE 6 - // getFlatIcon function altering defines #define GFI_ROTATION_DEFAULT 0 //Don't do anything special #define GFI_ROTATION_DEFDIR 1 //Layers will have default direction of there object diff --git a/code/datums/elements/connect_loc.dm b/code/datums/elements/connect_loc.dm new file mode 100644 index 00000000000..7f88d1549e6 --- /dev/null +++ b/code/datums/elements/connect_loc.dm @@ -0,0 +1,43 @@ +/// This element hooks a signal onto the loc the current object is on. +/// When the object moves, it will unhook the signal and rehook it to the new object. +/datum/element/connect_loc + element_flags = ELEMENT_BESPOKE//|ELEMENT_NO_LIST_UNIT_TEST + argument_hash_start_idx = 2 + + /// An assoc list of signal -> procpath to register to the loc this object is on. + var/list/connections + +/datum/element/connect_loc/Attach(atom/movable/listener, list/connections) + . = ..() + if (!istype(listener)) + return ELEMENT_INCOMPATIBLE + + src.connections = connections + + RegisterSignal(listener, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved), override = TRUE) + update_signals(listener) + +/datum/element/connect_loc/Detach(atom/movable/listener) + . = ..() + unregister_signals(listener, listener.loc) + UnregisterSignal(listener, COMSIG_MOVABLE_MOVED) + +/datum/element/connect_loc/proc/update_signals(atom/movable/listener) + var/atom/listener_loc = listener.loc + if(QDELETED(listener) || QDELETED(listener_loc)) + return + + for (var/signal in connections) + //override=TRUE because more than one connect_loc element instance tracked object can be on the same loc + listener.RegisterSignal(listener_loc, signal, connections[signal], override=TRUE) + +/datum/element/connect_loc/proc/unregister_signals(datum/listener, atom/old_loc) + if(isnull(old_loc)) + return + + listener.UnregisterSignal(old_loc, connections) + +/datum/element/connect_loc/proc/on_moved(atom/movable/listener, atom/old_loc) + SIGNAL_HANDLER + unregister_signals(listener, old_loc) + update_signals(listener) diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 1cb1de962cb..8946b097b50 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -41,7 +41,7 @@ item_state = "beachball" density = 0 anchored = 0 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY force = 0 throwforce = 0.0 throw_speed = 1 diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 1f475aa5918..07bd9c5a273 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -8,7 +8,7 @@ throwforce = 2.0 throw_speed = 1 throw_range = 4 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("called", "rang") hitsound = 'sound/weapons/ring.ogg' @@ -22,7 +22,7 @@ anchored = 0.0 var/stored_matter = 0 var/mode = 1 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL /obj/item/bikehorn name = "bike horn" @@ -31,7 +31,7 @@ icon_state = "bike_horn" item_state = "bike_horn" throwforce = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 3 throw_range = 15 attack_verb = list("HONKED") @@ -53,7 +53,7 @@ obj_flags = OBJ_FLAG_CONDUCTABLE force = 15 throwforce = 7.0 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY matter = list(DEFAULT_WALL_MATERIAL = 50) attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed") var/can_support = TRUE @@ -297,7 +297,7 @@ icon = 'icons/obj/item/telecane.dmi' icon_state = "telecane" contained_sprite = TRUE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT drop_sound = 'sound/items/drop/crowbar.ogg' pickup_sound = 'sound/items/pickup/crowbar.ogg' @@ -310,7 +310,7 @@ user.visible_message(SPAN_WARNING("With a flick of their wrist, [user] extends their telescopic cane."), SPAN_WARNING("You extend the cane."), SPAN_WARNING("You hear an ominous click.")) icon_state = "telecane_1" item_state = "telestick" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = null force = 14 attack_verb = list("smacked", "struck", "slapped") @@ -319,7 +319,7 @@ user.visible_message(SPAN_NOTICE("\The [user] collapses their telescopic cane."), SPAN_NOTICE("You collapse the cane."), SPAN_NOTICE("You hear a click.")) icon_state = "telecane" item_state = "telestick_0" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT force = 3 attack_verb = list("hit", "punched") @@ -351,7 +351,7 @@ var/size = 3.0 var/obj/item/gift = null item_state = "gift" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /obj/item/gift/random_pixel/Initialize() . = ..() @@ -372,7 +372,7 @@ slot_flags = SLOT_BELT item_state = "radio" throwforce = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 4 throw_range = 20 matter = list(MATERIAL_ALUMINIUM = 25, MATERIAL_PLASTIC = 75) @@ -387,7 +387,7 @@ throwforce = 5.0 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("bludgeoned", "whacked", "disciplined") /obj/item/staff/broom @@ -413,12 +413,12 @@ throwforce = 5.0 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/module icon = 'icons/obj/module.dmi' icon_state = "std_mod" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_state = "electronic" obj_flags = OBJ_FLAG_CONDUCTABLE usesound = 'sound/items/Deconstruct.ogg' @@ -462,7 +462,7 @@ name = "camera bug" icon = 'icons/obj/device.dmi' icon_state = "flash" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY item_state = "electronic" throw_speed = 4 throw_range = 20 @@ -521,7 +521,7 @@ icon_state = "RPED" item_state = "RPED" icon = 'icons/obj/storage/misc.dmi' - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE can_hold = list(/obj/item/stock_parts,/obj/item/reagent_containers/glass/beaker) storage_slots = 50 use_to_pickup = 1 @@ -529,7 +529,7 @@ allow_quick_empty = 1 collection_mode = 1 display_contents_with_number = 1 - max_w_class = ITEMSIZE_NORMAL + max_w_class = WEIGHT_CLASS_NORMAL max_storage_space = 100 /obj/item/ectoplasm diff --git a/code/game/atom/atom_act.dm b/code/game/atom/atom_act.dm index 155d711245c..b94bb71c7ec 100644 --- a/code/game/atom/atom_act.dm +++ b/code/game/atom/atom_act.dm @@ -20,6 +20,30 @@ SEND_SIGNAL(src, COMSIG_ATOM_FIRE_ACT, exposed_temperature, exposed_volume) return +/** + * React to being hit by a thrown object + * + * Default behaviour is to call [hitby_react][/atom/proc/hitby_react] on ourselves after 2 seconds if we are dense + * and under normal gravity. + * + * Im not sure why this the case, maybe to prevent lots of hitby's if the thrown object is + * deleted shortly after hitting something (during explosions or other massive events that + * throw lots of items around - singularity being a notable example) + */ +/atom/proc/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) + SEND_SIGNAL(src, COMSIG_ATOM_HITBY, hitting_atom, skipcatch, hitpush, blocked, throwingdatum) + if(density && !has_gravity(hitting_atom)) //thrown stuff bounces off dense stuff in no grav, unless the thrown stuff ends up inside what it hit(embedding, bola, etc...). + addtimer(CALLBACK(src, PROC_REF(hitby_react), hitting_atom), 0.2 SECONDS) + +/** + * We have have actually hit the passed in atom + * + * Default behaviour is to move back from the item that hit us + */ +/atom/proc/hitby_react(atom/movable/harmed_atom) + if(harmed_atom && isturf(harmed_atom.loc)) + step(harmed_atom, REVERSE_DIR(harmed_atom.dir)) + /* THESE ARE LEGACY ONES, NOT UPDATED YET diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 7c361666043..c9765d1c67d 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -256,9 +256,6 @@ /atom/proc/melt() return -/atom/proc/hitby(atom/movable/AM as mob|obj, var/speed = THROWFORCE_SPEED_DIVISOR) - return - /atom/proc/add_hiddenprint(mob/living/M) if(isnull(M)) return if(!istype(M, /mob)) return diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 5edefb52a15..28f1117d8cf 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -142,45 +142,92 @@ Moved(oldloc, TRUE) -// This is called when this atom is prevented from moving by atom/A. -/atom/movable/proc/Collide(atom/A) +// Make sure you know what you're doing if you call this +// You probably want CanPass() +/atom/movable/Cross(atom/movable/crossed_atom) + . = TRUE + SEND_SIGNAL(src, COMSIG_MOVABLE_CROSS, crossed_atom) + SEND_SIGNAL(crossed_atom, COMSIG_MOVABLE_CROSS_OVER, src) + // return CanPass(crossed_atom, get_dir(src, crossed_atom)) + return CanPass(crossed_atom, get_step(src, get_dir(src, crossed_atom)), 1, 0) + +///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 + +/** + * `Uncross()` is a default BYOND proc that is called when something is *going* + * to exit this atom's turf. It is prefered over `Uncrossed` when you want to + * deny that movement, such as in the case of border objects, objects that allow + * you to walk through them in any direction except the one they block + * (think side windows). + * + * While being seemingly harmless, most everything doesn't actually want to + * use this, meaning that we are wasting proc calls for every single atom + * on a turf, every single time something exits it, when basically nothing + * cares. + * + * This overhead caused real problems on Sybil round #159709, where lag + * attributed to Uncross was so bad that the entire master controller + * collapsed and people made Among Us lobbies in OOC. + * + * If you want to replicate the old `Uncross()` behavior, the most apt + * replacement is [`/datum/element/connect_loc`] while hooking onto + * [`COMSIG_ATOM_EXIT`]. + */ +/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 + +/** + * default byond proc that is normally called on everything inside the previous turf + * a movable was in after moving to its current turf + * this is wasteful since the vast majority of objects do not use Uncrossed + * use connect_loc to register to COMSIG_ATOM_EXITED instead + */ +/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 + +/** + * Pretend this is `Bump()` + */ +/atom/movable/proc/Collide(atom/bumped_atom) SHOULD_NOT_SLEEP(TRUE) + + if(!bumped_atom) + CRASH("Bump was called with no argument.") + SEND_SIGNAL(src, COMSIG_MOVABLE_BUMP, bumped_atom) + // . = ..() when we turn it into Bump() + if(!QDELETED(throwing)) + throwing.finalize(hit = TRUE, target = bumped_atom) + . = TRUE + if(QDELETED(bumped_atom)) + return + bumped_atom.CollidedWith(src) + + //Aurora snowflake atom airflow hit if(airflow_speed > 0 && airflow_dest) - airflow_hit(A) + airflow_hit(bumped_atom) else airflow_speed = 0 airflow_time = 0 - if(!QDELETED(throwing)) - . = TRUE - if(!QDELETED(A)) - throw_impact(A, throwing) - A.CollidedWith(src) - throwing?.finalize(hit = TRUE, target = A) - else if (!QDELETED(A)) - A.CollidedWith(src) - -//called when src is thrown into hit_atom /atom/movable/proc/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) - if(isliving(hit_atom)) - var/mob/living/M = hit_atom - M.hitby(src, throwingdatum.speed) + var/hitpush = TRUE + var/impact_signal = SEND_SIGNAL(src, COMSIG_MOVABLE_PRE_IMPACT, hit_atom, throwingdatum) + if(impact_signal & COMPONENT_MOVABLE_IMPACT_FLIP_HITPUSH) + hitpush = FALSE // hacky, tie this to something else or a proper workaround later - else if(isobj(hit_atom)) - var/obj/O = hit_atom - if(!O.anchored) - step(O, src.last_move) - O.hitby(src, throwingdatum.speed) - - else if(isturf(hit_atom)) - throwing?.finalize(hit = FALSE) - var/turf/T = hit_atom - if(T.density) - step(src, turn(src.last_move, 180)) - if(isliving(src)) - var/mob/living/M = src - M.turf_collision(T, throwingdatum.speed) + if(impact_signal && (impact_signal & COMPONENT_MOVABLE_IMPACT_NEVERMIND)) + return // in case a signal interceptor broke or deleted the thing before we could process our hit + if(SEND_SIGNAL(hit_atom, COMSIG_ATOM_PREHITBY, src, throwingdatum) & COMSIG_HIT_PREVENTED) + return + SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, hit_atom, throwingdatum) + return hit_atom.hitby(src, throwingdatum=throwingdatum, hitpush=hitpush) //decided whether a movable atom being thrown can pass through the turf it is in. /atom/movable/proc/hit_check(var/speed, var/target) diff --git a/code/game/gamemodes/antagspawner.dm b/code/game/gamemodes/antagspawner.dm index b90b108bc48..02397cd776c 100644 --- a/code/game/gamemodes/antagspawner.dm +++ b/code/game/gamemodes/antagspawner.dm @@ -9,7 +9,7 @@ /obj/item/antag_spawner throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/uses = 1 var/mob_type var/ghost_role_id diff --git a/code/game/gamemodes/changeling/implements/items.dm b/code/game/gamemodes/changeling/implements/items.dm index 8d49bf8bf61..b50f3c8c359 100644 --- a/code/game/gamemodes/changeling/implements/items.dm +++ b/code/game/gamemodes/changeling/implements/items.dm @@ -5,7 +5,7 @@ icon_state = "arm_blade" item_state = "arm_blade" contained_sprite = TRUE - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY force = 33 sharp = TRUE edge = TRUE @@ -125,7 +125,7 @@ edge = FALSE throwforce = 15 armor_penetration = 15 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/finger_lockpick name = "finger lockpick" diff --git a/code/game/gamemodes/cult/items/armor.dm b/code/game/gamemodes/cult/items/armor.dm index 2905e880d12..8f65266ef07 100644 --- a/code/game/gamemodes/cult/items/armor.dm +++ b/code/game/gamemodes/cult/items/armor.dm @@ -39,7 +39,7 @@ icon_state = "cult_armor" item_state = "cult_armor" desc = "A bulky armored voidsuit, bristling with menacing spikes. It looks space proof." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL allowed = list(/obj/item/book/tome, /obj/item/melee/cultblade, /obj/item/gun/energy/rifle/cult, /obj/item/tank, /obj/item/device/suit_cooling_unit) slowdown = 1 armor = list( diff --git a/code/game/gamemodes/cult/items/sword.dm b/code/game/gamemodes/cult/items/sword.dm index 58076dddd76..e4779da10eb 100644 --- a/code/game/gamemodes/cult/items/sword.dm +++ b/code/game/gamemodes/cult/items/sword.dm @@ -10,7 +10,7 @@ worn_y_dimension = 64 force = 31 armor_penetration = 50 // Narsie's blessing is strong. Also needed so the cult isn't obliterated by the average voidsuit with melee resistance. - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY throwforce = 10 slot_flags = SLOT_BELT edge = TRUE diff --git a/code/game/gamemodes/cult/items/tome.dm b/code/game/gamemodes/cult/items/tome.dm index 1ff90ff11d4..5ef9fe6e841 100644 --- a/code/game/gamemodes/cult/items/tome.dm +++ b/code/game/gamemodes/cult/items/tome.dm @@ -5,7 +5,7 @@ item_state = "tome" throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL unique = TRUE slot_flags = SLOT_BELT diff --git a/code/game/gamemodes/cult/structures/gateway.dm b/code/game/gamemodes/cult/structures/gateway.dm index aa9ba058e51..2fe7f6bc14e 100644 --- a/code/game/gamemodes/cult/structures/gateway.dm +++ b/code/game/gamemodes/cult/structures/gateway.dm @@ -8,9 +8,6 @@ anchored = 1.0 var/spawnable = null -/obj/effect/gateway/Crossed(AM as mob|obj) - return - /obj/effect/gateway/active light_range=5 light_color="#ff0000" diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 2a21145b8c2..c4722312427 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -4,7 +4,7 @@ icon_state = "pinoff" obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_BELT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_state = "electronic" throw_speed = 4 throw_range = 20 diff --git a/code/game/gamemodes/technomancer/catalog.dm b/code/game/gamemodes/technomancer/catalog.dm index 121b7131577..807b1615b4c 100644 --- a/code/game/gamemodes/technomancer/catalog.dm +++ b/code/game/gamemodes/technomancer/catalog.dm @@ -26,7 +26,7 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) - requisition various things from.. where ever they came from." icon = 'icons/obj/xenoarchaeology.dmi' icon_state = "ano91" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT var/budget = 1000 var/max_budget = 1000 diff --git a/code/game/gamemodes/technomancer/core_obj.dm b/code/game/gamemodes/technomancer/core_obj.dm index 35b959edf31..b4d279b8c27 100644 --- a/code/game/gamemodes/technomancer/core_obj.dm +++ b/code/game/gamemodes/technomancer/core_obj.dm @@ -6,7 +6,7 @@ contained_sprite = TRUE icon_state = "technomancer_core" item_state = "technomancer_core" - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE slot_flags = SLOT_BACK unacidable = TRUE origin_tech = list(TECH_MATERIAL = 8, TECH_ENGINEERING = 8, TECH_POWER = 8, TECH_BLUESPACE = 10,TECH_COMBAT = 7, TECH_MAGNET = 9, TECH_DATA = 5) @@ -383,7 +383,7 @@ icon_state = "bracelet_core" item_state = "bracelet_core" contained_sprite = TRUE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_WRISTS energy = 5000 max_energy = 5000 diff --git a/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm b/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm index 8190ddca142..2d1406f9c94 100644 --- a/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm +++ b/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm @@ -11,7 +11,7 @@ icon = 'icons/obj/device.dmi' icon_state = "hand_tele" var/uses = 3.0 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY item_state = "paper" origin_tech = list(TECH_BLUESPACE = 4, TECH_POWER = 3) diff --git a/code/game/gamemodes/technomancer/equipment.dm b/code/game/gamemodes/technomancer/equipment.dm index c32de335236..5643f1169c8 100644 --- a/code/game/gamemodes/technomancer/equipment.dm +++ b/code/game/gamemodes/technomancer/equipment.dm @@ -145,7 +145,7 @@ name = "Belt of Holding" desc = "Can hold more than you'd expect." icon_state = "emsbelt" - max_w_class = ITEMSIZE_NORMAL // Can hold normal sized items. + max_w_class = WEIGHT_CLASS_NORMAL // Can hold normal sized items. storage_slots = 14 // Twice the capacity of a typical belt. max_storage_space = 16 diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index ec6e99f0b0e..bd9287ccd8d 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -1042,7 +1042,7 @@ Just a object used in constructing air alarms icon = 'icons/obj/device.dmi' icon_state = "door_electronics" desc = "Looks like a circuit. Probably is." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 50) // Fire Alarms moved to firealarm.dm diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 0ed6e8f4b1e..68d338ad677 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -11,7 +11,7 @@ density = 1 var/health = 100.0 obj_flags = OBJ_FLAG_SIGNALER | OBJ_FLAG_CONDUCTABLE - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE var/valve_open = 0 var/release_pressure = ONE_ATMOSPHERE diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index 43f2dc380a0..1aa70900fb0 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -8,7 +8,7 @@ icon = 'icons/obj/atmos.dmi' icon_state = "psiphon:0" density = TRUE - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/on = FALSE var/direction_out = 0 //0 = siphoning, 1 = releasing diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index f0fc976ffe9..7451cc63502 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -8,7 +8,7 @@ icon = 'icons/obj/atmos.dmi' icon_state = "pscrubber:0" density = TRUE - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/on = FALSE var/volume_rate = 800 diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 0558173d2e9..6e7f75236ea 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -151,10 +151,10 @@ ..() //and give it the regular chance of being deleted outright -/obj/machinery/camera/hitby(AM as mob|obj, var/speed = THROWFORCE_SPEED_DIVISOR) +/obj/machinery/camera/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) ..() - if (istype(AM, /obj)) - var/obj/O = AM + if (istype(hitting_atom, /obj)) + var/obj/O = hitting_atom if (O.throwforce >= src.toughness) visible_message(SPAN_WARNING("[src] was hit by [O].")) take_damage(O.throwforce) diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index d181a7c5daa..1443da1fb03 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -3,7 +3,7 @@ desc = "A pre-fabricated security camera kit, ready to be assembled and mounted to a surface." icon = 'icons/obj/monitors.dmi' icon_state = "cameracase" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL anchored = 0 matter = list(MATERIAL_ALUMINIUM = 700, MATERIAL_GLASS = 300) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 7c6ea215b66..24d5c17482f 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -387,7 +387,7 @@ icon = 'icons/obj/cloning.dmi' icon_state = "datadisk0" //Gosh I hope syndies don't mistake them for the nuke disk. item_state = "card-id" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/datum/dna2/record/buf = null var/read_only = 0 //Well,it's still a floppy disk diff --git a/code/game/machinery/computer/arcade_orion.dm b/code/game/machinery/computer/arcade_orion.dm index b68571ef872..64fbf2ffd81 100644 --- a/code/game/machinery/computer/arcade_orion.dm +++ b/code/game/machinery/computer/arcade_orion.dm @@ -497,7 +497,7 @@ desc = "A model spaceship, it looks like those used back in the day when travelling to Orion! It even has a miniature FX-293 reactor, which was renowned for its instability and tendency to explode..." icon = 'icons/obj/toy.dmi' icon_state = "ship" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/active = 0 //if the ship is on /obj/item/orion_ship/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 7f942748527..4dbf75e24ce 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -288,7 +288,7 @@ Deployable Kits icon = 'icons/obj/storage/briefcase.dmi' icon_state = "barrier_kit" item_state = "barrier_kit" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL kit_product = /obj/machinery/deployable/barrier/legion /obj/item/deployable_kit/surgery_table @@ -297,7 +297,7 @@ Deployable Kits icon = 'icons/obj/surgery.dmi' icon_state = "table_deployable" item_state = "table_parts" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY kit_product = /obj/machinery/optable assembly_time = 20 SECONDS @@ -322,7 +322,7 @@ Deployable Kits item_state = "table_parts" drop_sound = 'sound/items/drop/axe.ogg' pickup_sound = 'sound/items/pickup/axe.ogg' - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY kit_product = /obj/machinery/porta_turret/legion assembly_time = 15 SECONDS @@ -332,7 +332,7 @@ Deployable Kits icon = 'icons/obj/storage/briefcase.dmi' icon_state = "inf_box" item_state = "inf_box" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL kit_product = /obj/machinery/iv_drip assembly_time = 4 SECONDS @@ -342,7 +342,7 @@ Deployable Kits icon = 'icons/obj/storage/briefcase.dmi' icon_state = "barrier_kit" item_state = "barrier_kit" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY kit_product = /obj/structure/bed/stool/chair/remote/mech/portable assembly_time = 20 SECONDS diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm index 9863e28087c..4a358fb581f 100644 --- a/code/game/machinery/doors/airlock_electronics.dm +++ b/code/game/machinery/doors/airlock_electronics.dm @@ -2,7 +2,7 @@ name = "airlock electronics" icon = 'icons/obj/device.dmi' icon_state = "door_electronics" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 50) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index b598d327644..a9b21796057 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -259,13 +259,17 @@ take_damage(min(damage, 100)) -/obj/machinery/door/hitby(AM as mob|obj, var/speed=5) +/obj/machinery/door/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) ..() var/tforce = 0 - if(ismob(AM)) - tforce = 15 * (speed/5) - else - tforce = AM:throwforce * (speed/5) + if(!throwingdatum) + return + + if(ismob(hitting_atom)) + tforce = 15 * (throwingdatum.speed/5) + else if(isobj(hitting_atom)) + var/obj/O = hitting_atom + tforce = O.throwforce * (throwingdatum.speed/5) if (tforce > 0) var/volume = 100 @@ -273,7 +277,6 @@ volume *= (tforce / 20) playsound(src.loc, hitsound, volume, TRUE) take_damage(tforce) - return /obj/machinery/door/attack_ai(mob/user) if(!ai_can_interact(user)) diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 057c3c4e09a..cccd2a3ae0a 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -291,5 +291,5 @@ Just a object used in constructing fire alarms icon = 'icons/obj/device.dmi' icon_state = "door_electronics" desc = "A circuit. It has a label on it, it says \"Can handle heat levels up to 40 degrees celsius!\"" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 50) diff --git a/code/game/machinery/howitzer.dm b/code/game/machinery/howitzer.dm index 92417a950a5..4bd37ef406f 100644 --- a/code/game/machinery/howitzer.dm +++ b/code/game/machinery/howitzer.dm @@ -13,7 +13,7 @@ dir = NORTH //Big thing - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE //Can't pass through it density = TRUE diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index be1d97c65f6..6de638fb38a 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -60,6 +60,15 @@ /obj/item/stock_parts/manipulator, /obj/item/stock_parts/scanning_module) +/obj/machinery/iv_drip/Initialize(mapload) + . = ..() + + var/static/list/loc_connections = list( + COMSIG_ATOM_ENTERED = PROC_REF(on_entered), + ) + + AddElement(/datum/element/connect_loc, loc_connections) + /obj/machinery/iv_drip/Destroy() if(attached) attached = null @@ -76,9 +85,11 @@ return FALSE return ..() -/obj/machinery/iv_drip/Crossed(var/mob/H) - if(ishuman(H)) - var/mob/living/carbon/human/M = H +/obj/machinery/iv_drip/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) + SIGNAL_HANDLER + + if(ishuman(arrived)) + var/mob/living/carbon/human/M = arrived if(M.shoes?.item_flags & ITEM_FLAG_LIGHT_STEP) return if(M.incapacitated()) @@ -88,7 +99,6 @@ if(M.m_intent == M_RUN && M.a_intent == I_HURT) src.visible_message(SPAN_WARNING("[M] bumps into \the [src], knocking it over!"), SPAN_WARNING("You bump into \the [src], knocking it over!")) do_crash() - return ..() /obj/machinery/iv_drip/update_icon() ClearOverlays() diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index b40cb55625d..9cd51336f28 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -83,7 +83,7 @@ Class Procs: /obj/machinery name = "machinery" icon = 'icons/obj/stationobjs.dmi' - w_class = ITEMSIZE_IMMENSE + w_class = WEIGHT_CLASS_GIGANTIC layer = STRUCTURE_LAYER init_flags = INIT_MACHINERY_PROCESS_SELF pass_flags_self = PASSMACHINE | LETPASSCLICKS @@ -568,14 +568,14 @@ Class Procs: /obj/machinery/proc/set_emergency_state(var/new_security_level) return -/obj/machinery/hitby(atom/movable/AM, var/speed = THROWFORCE_SPEED_DIVISOR) +/obj/machinery/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) . = ..() - if(isliving(AM)) - var/mob/living/M = AM - M.turf_collision(src, speed) + if(isliving(hitting_atom)) + var/mob/living/M = hitting_atom + M.turf_collision(src, throwingdatum.speed) return else - visible_message(SPAN_DANGER("\The [src] was hit by \the [AM].")) + visible_message(SPAN_DANGER("\The [src] was hit by \the [hitting_atom].")) /obj/machinery/ui_status(mob/user, datum/ui_state/state) . = ..() diff --git a/code/game/machinery/mech_recharger.dm b/code/game/machinery/mech_recharger.dm index 4287e64baa1..2d51e05d86b 100644 --- a/code/game/machinery/mech_recharger.dm +++ b/code/game/machinery/mech_recharger.dm @@ -22,14 +22,26 @@ /obj/item/stock_parts/manipulator = 2 ) -/obj/machinery/mech_recharger/Crossed(var/mob/living/heavy_vehicle/M) +/obj/machinery/mech_recharger/Initialize(mapload) . = ..() - if(istype(M) && charging != M) - start_charging(M) -/obj/machinery/mech_recharger/Uncrossed(var/mob/living/heavy_vehicle/M) - . = ..() - if(M == charging) + var/static/list/loc_connections = list( + COMSIG_ATOM_ENTERED = PROC_REF(on_entered), + COMSIG_ATOM_EXITED = PROC_REF(on_exit), + ) + + AddElement(/datum/element/connect_loc, loc_connections) + +/obj/machinery/mech_recharger/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) + SIGNAL_HANDLER + + if(istype(arrived, /mob/living/heavy_vehicle) && charging != arrived) + start_charging(arrived) + +/obj/machinery/mech_recharger/proc/on_exit(atom/movable/gone, direction) + SIGNAL_HANDLER + + if(gone == charging) stop_charging() /obj/machinery/mech_recharger/RefreshParts() diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 5fef0152426..0d30eba307c 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -954,7 +954,7 @@ var/list/obj/machinery/newscaster/allCasters = list() icon = 'icons/obj/bureaucracy.dmi' icon_state = "newspaper" item_state = "newspaper" - w_class = ITEMSIZE_SMALL //Let's make it fit in trashbags! + w_class = WEIGHT_CLASS_SMALL //Let's make it fit in trashbags! attack_verb = list("bapped", "thwacked", "educated") drop_sound = 'sound/items/drop/wrapper.ogg' pickup_sound = 'sound/items/pickup/wrapper.ogg' diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index 21c79583c5f..73096c4af6d 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -392,7 +392,7 @@ var/bomb_set desc = "Better keep this safe." icon_state = "nucleardisk" item_state = "card-id" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/disk/nuclear/Initialize() . = ..() diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 226e71eb8be..92f084bcc5d 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -10,7 +10,7 @@ icon_state = "simple" item_state = "buildpipe" randpixel = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL level = 2 obj_flags = OBJ_FLAG_ROTATABLE @@ -1537,7 +1537,7 @@ icon = 'icons/obj/pipe-item.dmi' icon_state = "meter" item_state = "buildpipe" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /obj/item/pipe_meter/attackby(obj/item/attacking_item, mob/user) if (attacking_item.iswrench()) diff --git a/code/game/machinery/vending_items.dm b/code/game/machinery/vending_items.dm index 511f9aed918..00e353d8148 100644 --- a/code/game/machinery/vending_items.dm +++ b/code/game/machinery/vending_items.dm @@ -10,7 +10,7 @@ throwforce = 10 throw_speed = 1 throw_range = 7 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/charges = 0 /obj/item/device/vending_refill/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) diff --git a/code/game/objects/auras/auras.dm b/code/game/objects/auras/auras.dm index 94fb660c765..158e5aab426 100644 --- a/code/game/objects/auras/auras.dm +++ b/code/game/objects/auras/auras.dm @@ -27,5 +27,5 @@ They should also be used for when you want to effect the ENTIRE mob, like having /obj/aura/bullet_act(obj/projectile/P, def_zone) return FALSE -/obj/aura/hitby(atom/movable/M, speed) +/obj/aura/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) return FALSE diff --git a/code/game/objects/effects/chem/chemsmoke.dm b/code/game/objects/effects/chem/chemsmoke.dm index 10ec6fb5625..bab4bfa41eb 100644 --- a/code/game/objects/effects/chem/chemsmoke.dm +++ b/code/game/objects/effects/chem/chemsmoke.dm @@ -44,13 +44,14 @@ bound_width = 96 bound_height = 96 -/obj/effect/effect/smoke/chem/Crossed(atom/movable/AM) +/obj/effect/effect/smoke/chem/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) ..() - if(!istype(AM, /obj/effect/effect/smoke/chem)) - if(istype(AM, /obj/item/reagent_containers) && !AM.is_open_container()) + + if(!istype(arrived, /obj/effect/effect/smoke/chem)) + if(istype(arrived, /obj/item/reagent_containers) && !arrived.is_open_container()) return else - reagents.splash(AM, splash_amount, copy = 1) + reagents.splash(arrived, splash_amount, copy = 1) /obj/effect/effect/smoke/chem/proc/initial_splash() for(var/turf/T in view(1, src)) diff --git a/code/game/objects/effects/chem/foam.dm b/code/game/objects/effects/chem/foam.dm index eaa003e0327..e521f13146c 100644 --- a/code/game/objects/effects/chem/foam.dm +++ b/code/game/objects/effects/chem/foam.dm @@ -24,6 +24,12 @@ addtimer(CALLBACK(src, PROC_REF(tick)), 3 + metal * 3) addtimer(CALLBACK(src, PROC_REF(post)), solid_time) + var/static/list/loc_connections = list( + COMSIG_ATOM_ENTERED = PROC_REF(on_entered), + ) + + AddElement(/datum/element/connect_loc, loc_connections) + /obj/effect/effect/foam/proc/tick() process() checkReagents() @@ -77,11 +83,13 @@ QDEL_IN(src, 5) -/obj/effect/effect/foam/Crossed(var/atom/movable/AM) +/obj/effect/effect/foam/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) + SIGNAL_HANDLER + if(metal) return - if(istype(AM, /mob/living)) - var/mob/living/M = AM + if(istype(arrived, /mob/living)) + var/mob/living/M = arrived M.slip("the foam", 6) /obj/effect/effect/foam/spray diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm index 567005f0e8b..0ee1973d66d 100644 --- a/code/game/objects/effects/decals/Cleanable/humans.dm +++ b/code/game/objects/effects/decals/Cleanable/humans.dm @@ -59,6 +59,12 @@ if (dries) animate(src, color = "#000000", time = drytime, loop = 0, flags = ANIMATION_RELATIVE) + var/static/list/loc_connections = list( + COMSIG_ATOM_ENTERED = PROC_REF(on_entered), + ) + + AddElement(/datum/element/connect_loc, loc_connections) + /obj/effect/decal/cleanable/blood/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) if(dries && world.time > (bleed_time + drytime)) name = dryname @@ -75,9 +81,14 @@ basecolor = get_random_colour(1) color = basecolor -/obj/effect/decal/cleanable/blood/Crossed(mob/living/carbon/human/perp) - if (!istype(perp)) +/obj/effect/decal/cleanable/blood/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) + SIGNAL_HANDLER + + if (!istype(arrived, /mob/living/carbon/human)) return + + var/mob/living/carbon/human/perp = arrived + if(dries && world.time > (bleed_time + drytime)) amount = 0 if(amount < 1) diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index 2a76560fc2d..691cd3366fa 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -114,16 +114,23 @@ steam.start() -- spawns the effect time_to_live = duration addtimer(CALLBACK(src, PROC_REF(kill)), time_to_live) + var/static/list/loc_connections = list( + COMSIG_ATOM_ENTERED = PROC_REF(on_entered), + ) + + AddElement(/datum/element/connect_loc, loc_connections) + /obj/effect/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/Crossed(mob/living/carbon/M as mob ) - ..() - if(istype(M)) - affect(M) +/obj/effect/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) if (istype(M)) diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index ce46e6f5ffb..09d18749e0e 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -51,6 +51,12 @@ precision = precise + var/static/list/loc_connections = list( + COMSIG_ATOM_ENTERED = PROC_REF(on_entered), + ) + + AddElement(/datum/element/connect_loc, loc_connections) + /obj/effect/portal/Destroy() if(istype(creator, /obj/item/hand_tele)) var/obj/item/hand_tele/HT = creator @@ -63,9 +69,11 @@ if(does_teleport) teleport(bumped_atom) -/obj/effect/portal/Crossed(AM) +/obj/effect/portal/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) + SIGNAL_HANDLER + if(does_teleport) - teleport(AM) + teleport(arrived) /obj/effect/portal/attackby(obj/item/attacking_item, mob/user) if(istype(attacking_item, /obj/item/bluespace_neutralizer)) diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index 043e357f955..ab3e9d6bfe6 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -3,82 +3,173 @@ /obj/effect/step_trigger var/affect_ghosts = 0 var/stopper = 1 // stops throwers - icon = 'icons/mob/screen/generic.dmi' - icon_state = "x2" - invisibility = 101 // nope cant see this shit - anchored = 1 + var/mobs_only = FALSE + invisibility = INVISIBILITY_ABSTRACT // nope cant see this shit + anchored = TRUE -/obj/effect/step_trigger/proc/Trigger(var/atom/movable/A) +/obj/effect/step_trigger/Initialize(mapload) + . = ..() + var/static/list/loc_connections = list( + COMSIG_ATOM_ENTERED = PROC_REF(on_entered), + ) + AddElement(/datum/element/connect_loc, loc_connections) + +/obj/effect/step_trigger/proc/Trigger(atom/movable/A) return 0 -/obj/effect/step_trigger/Crossed(H as mob|obj) - ..() - if(!H) +/obj/effect/step_trigger/proc/on_entered(datum/source, H as mob|obj) + SIGNAL_HANDLER + if(!H || H == src) return - if(istype(H, /mob/abstract/observer) && !affect_ghosts) + if(isobserver(H) && !affect_ghosts) return - Trigger(H) + if(!ismob(H) && mobs_only) + return + INVOKE_ASYNC(src, PROC_REF(Trigger), H) +/obj/effect/step_trigger/singularity_act() + return + +/obj/effect/step_trigger/singularity_pull() + return + +/* Sends a message to mob when triggered*/ + +/obj/effect/step_trigger/message + var/message //the message to give to the mob + var/once = 1 + mobs_only = TRUE + +/obj/effect/step_trigger/message/Trigger(mob/M) + if(M.client) + to_chat(M, SPAN_INFO("[message]")) + if(once) + qdel(src) + /* Tosses things in a certain direction */ +// /obj/effect/step_trigger/thrower +// var/tiles = 3 // if 0: forever until atom hits a stopper +// var/immobilize = 1 // if nonzero: prevents mobs from moving while they're being flung +// var/speed = 1 // delay of movement +// var/facedir = 0 // if 1: atom faces the direction of movement +// var/nostop = 0 // if 1: will only be stopped by teleporters +// var/list/affecting = list() + +// /obj/effect/step_trigger/thrower/Trigger(var/atom/A) +// if(!A || !istype(A, /atom/movable)) +// return +// var/atom/movable/AM = A +// var/curtiles = 0 +// var/stopthrow = 0 +// for(var/obj/effect/step_trigger/thrower/T in orange(2, src)) +// if(AM in T.affecting) +// return + +// if(ismob(AM)) +// var/mob/M = AM +// if(immobilize) +// M.canmove = 0 + +// affecting.Add(AM) +// while(AM && !stopthrow) +// if(tiles) +// if(curtiles >= tiles) +// break +// if(AM.z != src.z) +// break + +// curtiles++ + +// sleep(speed) + +// // Calculate if we should stop the process +// if(!nostop) +// for(var/obj/effect/step_trigger/T in get_step(AM, dir)) +// if(T.stopper && T != src) +// stopthrow = 1 +// else +// for(var/obj/effect/step_trigger/teleporter/T in get_step(AM, dir)) +// if(T.stopper) +// stopthrow = 1 + +// if(AM) +// var/predir = AM.dir +// step(AM, dir) +// if(!facedir) +// AM.set_dir(predir) + +// affecting.Remove(AM) +// if(ismob(AM)) +// var/mob/M = AM +// if(immobilize) +// M.canmove = 1 + +/* Tosses things in a certain direction */ /obj/effect/step_trigger/thrower - var/tiles = 3 // if 0: forever until atom hits a stopper + var/direction = SOUTH // the direction of throw + var/tiles = 3 // if 0: forever until atom hits a stopper var/immobilize = 1 // if nonzero: prevents mobs from moving while they're being flung - var/speed = 1 // delay of movement + var/speed = 1 // delay of movement var/facedir = 0 // if 1: atom faces the direction of movement var/nostop = 0 // if 1: will only be stopped by teleporters + ///List of moving atoms mapped to their inital direction var/list/affecting = list() -/obj/effect/step_trigger/thrower/Trigger(var/atom/A) - if(!A || !istype(A, /atom/movable)) +/obj/effect/step_trigger/thrower/Trigger(atom/A) + if(!A || !ismovable(A)) return var/atom/movable/AM = A - var/curtiles = 0 - var/stopthrow = 0 for(var/obj/effect/step_trigger/thrower/T in orange(2, src)) if(AM in T.affecting) return - if(ismob(AM)) - var/mob/M = AM - if(immobilize) - M.canmove = 0 + if(immobilize) + // ADD_TRAIT(AM, TRAIT_IMMOBILIZED, REF(src)) + if(ismob(AM)) + var/mob/M = AM + M.canmove = FALSE - affecting.Add(AM) - while(AM && !stopthrow) - if(tiles) - if(curtiles >= tiles) - break - if(AM.z != src.z) - break + affecting[AM] = AM.dir + var/datum/move_loop/loop = GLOB.move_manager.move(AM, direction, speed, tiles ? tiles * speed : INFINITY) + RegisterSignal(loop, COMSIG_MOVELOOP_PREPROCESS_CHECK, PROC_REF(pre_move)) + RegisterSignal(loop, COMSIG_MOVELOOP_POSTPROCESS, PROC_REF(post_move)) + RegisterSignal(loop, COMSIG_QDELETING, PROC_REF(set_to_normal)) - curtiles++ +/obj/effect/step_trigger/thrower/proc/pre_move(datum/move_loop/source) + SIGNAL_HANDLER + var/atom/movable/being_moved = source.moving + affecting[being_moved] = being_moved.dir - sleep(speed) +/obj/effect/step_trigger/thrower/proc/post_move(datum/move_loop/source) + SIGNAL_HANDLER + var/atom/movable/being_moved = source.moving + if(!facedir) + being_moved.set_dir(affecting[being_moved]) + if(being_moved.z != z) + qdel(source) + return + if(!nostop) + for(var/obj/effect/step_trigger/T in get_turf(being_moved)) + if(T.stopper && T != src) + qdel(source) + return + else + for(var/obj/effect/step_trigger/teleporter/T in get_turf(being_moved)) + if(T.stopper) + qdel(source) + return - // Calculate if we should stop the process - if(!nostop) - for(var/obj/effect/step_trigger/T in get_step(AM, dir)) - if(T.stopper && T != src) - stopthrow = 1 - else - for(var/obj/effect/step_trigger/teleporter/T in get_step(AM, dir)) - if(T.stopper) - stopthrow = 1 - - if(AM) - var/predir = AM.dir - step(AM, dir) - if(!facedir) - AM.set_dir(predir) - - affecting.Remove(AM) - if(ismob(AM)) - var/mob/M = AM - if(immobilize) - M.canmove = 1 +/obj/effect/step_trigger/thrower/proc/set_to_normal(datum/move_loop/source) + SIGNAL_HANDLER + var/atom/movable/being_moved = source.moving + affecting -= being_moved + // REMOVE_TRAIT(being_moved, TRAIT_IMMOBILIZED, REF(src)) + if(ismob(being_moved)) + var/mob/M = being_moved + M.canmove = TRUE /obj/effect/step_trigger/thrower/shuttle icon_state = "dir_arrow" @@ -125,16 +216,15 @@ /* Instant teleporter */ /obj/effect/step_trigger/teleporter - var/teleport_x = 0 // teleportation coordinates (if one is null, then no teleport!) + var/teleport_x = 0 // teleportation coordinates (if one is null, then no teleport!) var/teleport_y = 0 var/teleport_z = 0 -/obj/effect/step_trigger/teleporter/Trigger(var/atom/movable/A) +/obj/effect/step_trigger/teleporter/Trigger(atom/movable/A) if(teleport_x && teleport_y && teleport_z) - A.x = teleport_x - A.y = teleport_y - A.z = teleport_z + var/turf/T = locate(teleport_x, teleport_y, teleport_z) + A.forceMove(T) /* Random teleporter, teleports atoms to locations ranging from teleport_x - teleport_x_offset, etc */ @@ -143,15 +233,56 @@ var/teleport_y_offset = 0 var/teleport_z_offset = 0 -/obj/effect/step_trigger/teleporter/random/Trigger(var/atom/movable/A) +/obj/effect/step_trigger/teleporter/random/Trigger(atom/movable/A) if(teleport_x && teleport_y && teleport_z) if(teleport_x_offset && teleport_y_offset && teleport_z_offset) - if(isliving(A)) - var/mob/M = A - M.visible_message(FONT_LARGE(SPAN_WARNING("\The [A] blinks out of reality!")), FONT_LARGE(SPAN_WARNING("You feel your stomach churn as you slip into bluespace!"))) - A.x = rand(teleport_x, teleport_x_offset) - A.y = rand(teleport_y, teleport_y_offset) - A.z = rand(teleport_z, teleport_z_offset) - if(isliving(A)) - var/mob/M = A - M.visible_message(FONT_LARGE(SPAN_WARNING("\The [A] blinks into reality!")), FONT_LARGE(SPAN_WARNING("You feel your stomach turn as you get thrown out of bluespace!"))) + + var/turf/T = locate(rand(teleport_x, teleport_x_offset), rand(teleport_y, teleport_y_offset), rand(teleport_z, teleport_z_offset)) + if (T) + A.forceMove(T) + +/* Teleports atoms directly to an offset, no randomness, looping hallways! */ + +/obj/effect/step_trigger/teleporter/offset + var/teleport_x_offset = 0 + var/teleport_y_offset = 0 + +/obj/effect/step_trigger/teleporter/offset/on_entered(datum/source, H as mob|obj, atom/old_loc) + if(!old_loc?.Adjacent(loc)) // prevents looping, if we were teleported into this then the old loc is usually not adjacent + return + return ..() + +/obj/effect/step_trigger/teleporter/offset/Trigger(atom/movable/poor_soul) + var/turf/destination = locate(x + teleport_x_offset, y + teleport_y_offset, z) + if(!destination) + return + poor_soul.forceMove(destination) + var/mob/living/living_soul = poor_soul + if(istype(living_soul) && living_soul.client) + living_soul.client.move_delay = 0 + +/* Simple sound player, Mapper friendly! */ + +/obj/effect/step_trigger/sound_effect + var/sound //eg. path to the sound, inside '' eg: 'growl.ogg' + var/volume = 100 + var/freq_vary = 1 //Should the frequency of the sound vary? + var/extra_range = 0 // eg World.view = 7, extra_range = 1, 7+1 = 8, 8 turfs radius + var/happens_once = 0 + var/triggerer_only = 0 //Whether the triggerer is the only person who hears this + + +/obj/effect/step_trigger/sound_effect/Trigger(atom/movable/A) + var/turf/T = get_turf(A) + + if(!T) + return + + if(triggerer_only && ismob(A)) + var/mob/B = A + B.playsound_local(T, sound, volume, freq_vary) + else + playsound(T, sound, volume, freq_vary, extra_range) + + if(happens_once) + qdel(src) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 0126945c665..6f1a12a2325 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1,7 +1,7 @@ /obj/item name = "item" icon = 'icons/obj/items.dmi' - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL blocks_emissive = EMISSIVE_BLOCK_GENERIC ///This saves our blood splatter overlay, which will be processed not to go over the edges of the sprite @@ -341,15 +341,15 @@ /obj/item/get_examine_text(mob/user, distance, is_adjacent, infix, suffix, get_extended = FALSE) var/size switch(src.w_class) - if (ITEMSIZE_HUGE to INFINITY) + if (WEIGHT_CLASS_HUGE to INFINITY) size = "huge" - if (ITEMSIZE_LARGE to ITEMSIZE_HUGE) + if (WEIGHT_CLASS_BULKY to WEIGHT_CLASS_HUGE) size = "bulky" - if (ITEMSIZE_NORMAL to ITEMSIZE_LARGE) + if (WEIGHT_CLASS_NORMAL to WEIGHT_CLASS_BULKY) size = "normal-sized" - if (ITEMSIZE_SMALL to ITEMSIZE_NORMAL) + if (WEIGHT_CLASS_SMALL to WEIGHT_CLASS_NORMAL) size = "small" - if (0 to ITEMSIZE_SMALL) + if (0 to WEIGHT_CLASS_SMALL) size = "tiny" //Changed this switch to ranges instead of tiered values, to cope with granularity and also //things outside its range ~Nanako @@ -450,6 +450,13 @@ return 0 /obj/item/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) + if(QDELETED(hit_atom)) + return + if(SEND_SIGNAL(src, COMSIG_MOVABLE_PRE_IMPACT, hit_atom, throwingdatum) & COMPONENT_MOVABLE_IMPACT_NEVERMIND) + return + if(SEND_SIGNAL(hit_atom, COMSIG_ATOM_PREHITBY, src, throwingdatum) & COMSIG_HIT_PREVENTED) + return + if(isliving(hit_atom)) //Living mobs handle hit sounds differently. var/mob/living/L = hit_atom if(L.in_throw_mode) @@ -467,7 +474,12 @@ playsound(hit_atom, 'sound/weapons/throwtap.ogg', 1, volume, -1) else playsound(src, drop_sound, YEET_SOUND_VOLUME) - return ..() + + var/itempush = TRUE + if(w_class < WEIGHT_CLASS_NORMAL) + itempush = FALSE //too light to push anything + + return hit_atom.hitby(src, 0, itempush, throwingdatum=throwingdatum) /** * Called when an item is removed from a `/mob` inventory (including hands and whatnot), diff --git a/code/game/objects/items/airbubble.dm b/code/game/objects/items/airbubble.dm index fc041d2fe4b..d69daa9e205 100644 --- a/code/game/objects/items/airbubble.dm +++ b/code/game/objects/items/airbubble.dm @@ -4,7 +4,7 @@ desc = "Special air bubble designed to protect people inside of it from decompressed environments. Has an integrated cooling unit to preserve a stable temperature inside. Requires a power cell to operate." icon = 'icons/obj/airbubble.dmi' icon_state = "airbubble_fact_folded" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL var/used = FALSE var/ripped = FALSE var/zipped = FALSE @@ -215,7 +215,7 @@ if(!isnull(internal_tank)) internal_tank.forceMove(bag) internal_tank = null - bag.w_class = ITEMSIZE_LARGE + bag.w_class = WEIGHT_CLASS_BULKY bag.desc = "Special air bubble designed to protect people inside of it from decompressed environments. Has an integrated cooling unit to preserve a stable temperature inside. Requires a power cell to operate." if(syndie) diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 79e13e51a34..eb92e24759b 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/item/tools/blueprints.dmi' icon_state = "blueprints" attack_verb = list("attacked", "bapped", "hit") - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/list/valid_z_levels = list() var/area_prefix ///Will these blueprints display the wire schema? diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index 7acdf66cbf2..b7a0e9a296c 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -5,7 +5,7 @@ desc = "A folded bag designed for the storage and transportation of cadavers." icon = 'icons/obj/bodybag.dmi' icon_state = "bodybag_folded" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL drop_sound = 'sound/items/drop/cloth.ogg' pickup_sound = 'sound/items/pickup/cloth.ogg' var/deploy_type = /obj/structure/closet/body_bag diff --git a/code/game/objects/items/camping.dm b/code/game/objects/items/camping.dm index 35d13b66207..79aec26c390 100644 --- a/code/game/objects/items/camping.dm +++ b/code/game/objects/items/camping.dm @@ -132,7 +132,7 @@ icon_state = "tent" item_state = "tent" contained_sprite = TRUE - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY color = "#58a178" var/width = 2 var/length = 3 @@ -142,7 +142,7 @@ /obj/item/tent/Initialize() . = ..() - w_class = min(ceil(width * length / 1.5), ITEMSIZE_IMMENSE) // 2x2 = ITEMSIZE_NORMAL + w_class = min(ceil(width * length / 1.5), WEIGHT_CLASS_GIGANTIC) // 2x2 = WEIGHT_CLASS_NORMAL desc += "\nThis one is [width] x [length] in size." /obj/item/tent/Destroy() @@ -307,7 +307,7 @@ icon_state = "sleepingbag" item_state = "sleepingbag" contained_sprite = TRUE - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /obj/item/sleeping_bag/Initialize(mapload, ...) . = ..() diff --git a/code/game/objects/items/contraband.dm b/code/game/objects/items/contraband.dm index 212b294bb95..717cead5f09 100644 --- a/code/game/objects/items/contraband.dm +++ b/code/game/objects/items/contraband.dm @@ -121,7 +121,7 @@ item_state = "powder" amount_per_transfer_from_this = 5 possible_transfer_amounts = 5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY volume = 50 /obj/item/reagent_containers/powder/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index be2e60e9bb6..05c20e33497 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -11,7 +11,7 @@ contained_sprite = TRUE force = 11 throwforce = 6 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY origin_tech = list(TECH_BIO = 4, TECH_POWER = 2) matter = list(MATERIAL_STEEL = 5000, MATERIAL_PLASTIC = 2000, MATERIAL_GLASS = 1500, MATERIAL_ALUMINIUM = 1000) action_button_name = "Toggle Paddles" @@ -184,7 +184,7 @@ desc = "A belt-equipped defibrillator that can be rapidly deployed." icon_state = "defibcompact" item_state = "defibcompact" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL slot_flags = SLOT_BELT origin_tech = list(TECH_BIO = 5, TECH_POWER = 3) @@ -216,7 +216,7 @@ gender = PLURAL force = 2 throwforce = 6 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY var/safety = TRUE //if you can zap people with the paddles on harm mode var/combat = FALSE //If it can be used to revive people wearing thick clothing (e.g. spacesuits) @@ -593,7 +593,7 @@ Shockpaddles that are linked to a base unit */ /obj/item/shockpaddles/linked - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY var/obj/item/defibrillator/base_unit /obj/item/shockpaddles/linked/Initialize(mapload, obj/item/defibrillator/defib) diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index 4ec39ac8ee8..8825fce8103 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -3,7 +3,7 @@ icon = 'icons/obj/pai.dmi' icon_state = "aicard" // aicard-full item_state = "electronic" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT origin_tech = list(TECH_DATA = 4, TECH_MATERIAL = 4) var/flush = 0 diff --git a/code/game/objects/items/devices/augment_implanter.dm b/code/game/objects/items/devices/augment_implanter.dm index a6e153bcf5c..5c9ddd49f53 100644 --- a/code/game/objects/items/devices/augment_implanter.dm +++ b/code/game/objects/items/devices/augment_implanter.dm @@ -1,7 +1,7 @@ /obj/item/device/augment_implanter name = "augment implanter" desc = "A complex single use injector that is used to implant augments without the need for surgery." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_BIO = 5, TECH_MATERIAL = 2) icon = 'icons/obj/guns/decloner.dmi' icon_state = "decloner" diff --git a/code/game/objects/items/devices/auto_cpr.dm b/code/game/objects/items/devices/auto_cpr.dm index 9ef3fdc13b2..f7983655c3f 100644 --- a/code/game/objects/items/devices/auto_cpr.dm +++ b/code/game/objects/items/devices/auto_cpr.dm @@ -13,7 +13,7 @@ icon_state = "med_harness" item_state = "med_harness" contained_sprite = TRUE - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_MAGNET = 5, TECH_BIO = 3) slot_flags = SLOT_OCLOTHING var/panel_open = FALSE diff --git a/code/game/objects/items/devices/binoculars.dm b/code/game/objects/items/devices/binoculars.dm index 5a08f1c9195..d4c4b505ee7 100644 --- a/code/game/objects/items/devices/binoculars.dm +++ b/code/game/objects/items/devices/binoculars.dm @@ -6,7 +6,7 @@ obj_flags = OBJ_FLAG_CONDUCTABLE force = 11 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throwforce = 5.0 throw_range = 15 throw_speed = 3 diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm index f80fc99dca3..a5975f72fec 100644 --- a/code/game/objects/items/devices/chameleonproj.dm +++ b/code/game/objects/items/devices/chameleonproj.dm @@ -9,7 +9,7 @@ throwforce = 5 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_ILLEGAL = 4, TECH_MAGNET = 4) var/can_use = TRUE var/obj/effect/dummy/chameleon/active_dummy = null diff --git a/code/game/objects/items/devices/cosmetic_surgery_kit.dm b/code/game/objects/items/devices/cosmetic_surgery_kit.dm index 4d0dffb2cd6..cdb5eaec326 100644 --- a/code/game/objects/items/devices/cosmetic_surgery_kit.dm +++ b/code/game/objects/items/devices/cosmetic_surgery_kit.dm @@ -7,7 +7,7 @@ throwforce = 5 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list( TECH_ESOTERIC = 3, TECH_MAGNET = 4 diff --git a/code/game/objects/items/devices/debugger.dm b/code/game/objects/items/devices/debugger.dm index 88738221fe7..d90cd0b7b36 100644 --- a/code/game/objects/items/devices/debugger.dm +++ b/code/game/objects/items/devices/debugger.dm @@ -6,7 +6,7 @@ icon_state = "hacktool-g" obj_flags = OBJ_FLAG_CONDUCTABLE force = 11 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throwforce = 5 throw_range = 15 throw_speed = 3 diff --git a/code/game/objects/items/devices/dociler.dm b/code/game/objects/items/devices/dociler.dm index d5a9296c90c..bc4014d0f76 100644 --- a/code/game/objects/items/devices/dociler.dm +++ b/code/game/objects/items/devices/dociler.dm @@ -1,7 +1,7 @@ /obj/item/device/dociler name = "dociler" desc = "A complex single use recharging injector that spreads a complex neurological serum that makes animals docile and friendly. Somewhat." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_BIO = 5, TECH_MATERIAL = 2) // To-do track down where the hell this sprite went? icon = 'icons/obj/guns/decloner.dmi' diff --git a/code/game/objects/items/devices/drop_targeter/_droptargeter.dm b/code/game/objects/items/devices/drop_targeter/_droptargeter.dm index ce7e492bc4d..c8dec43e375 100644 --- a/code/game/objects/items/devices/drop_targeter/_droptargeter.dm +++ b/code/game/objects/items/devices/drop_targeter/_droptargeter.dm @@ -5,7 +5,7 @@ icon_state = "drillpointer" item_state = "binoculars" slot_flags = SLOT_BELT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/has_dropped = 0 // Counter of how many times the targeter has been used var/drop_amount = 2 // How many times can this item be used? diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index 942589cac69..f44e66c636f 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -5,7 +5,7 @@ icon_state = "flash" item_state = "flash" throwforce = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 4 throw_range = 10 obj_flags = OBJ_FLAG_CONDUCTABLE diff --git a/code/game/objects/items/devices/geiger.dm b/code/game/objects/items/devices/geiger.dm index 1cccd23bb50..139e6b54de8 100644 --- a/code/game/objects/items/devices/geiger.dm +++ b/code/game/objects/items/devices/geiger.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/geiger_counter.dmi' icon_state = "geiger_off" item_state = "multitool" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL action_button_name = "Toggle geiger counter" matter = list(MATERIAL_PLASTIC = 100, DEFAULT_WALL_MATERIAL = 100, MATERIAL_GLASS = 50) origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1) diff --git a/code/game/objects/items/devices/hearing_aid.dm b/code/game/objects/items/devices/hearing_aid.dm index 6b6f1364331..7535a0a4dd3 100644 --- a/code/game/objects/items/devices/hearing_aid.dm +++ b/code/game/objects/items/devices/hearing_aid.dm @@ -6,7 +6,7 @@ item_state = "hearing_aid" contained_sprite = TRUE slot_flags = SLOT_EARS - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/device/hearing_aid/black icon_state = "hearing_aid-b" diff --git a/code/game/objects/items/devices/holowarrant.dm b/code/game/objects/items/devices/holowarrant.dm index 0d8d0f0fba7..14f05d2db58 100644 --- a/code/game/objects/items/devices/holowarrant.dm +++ b/code/game/objects/items/devices/holowarrant.dm @@ -6,7 +6,7 @@ icon_state = "holowarrant" item_state = "holowarrant" throwforce = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 4 throw_range = 10 obj_flags = OBJ_FLAG_CONDUCTABLE diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index 8bd3d16c17e..2af81e2de2d 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -8,7 +8,7 @@ item_state = "pen" var/pointer_icon_state slot_flags = SLOT_BELT - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/turf/pointer_loc var/obj/item/stock_parts/micro_laser/diode //cant use the laser without it diff --git a/code/game/objects/items/devices/lighting/flare.dm b/code/game/objects/items/devices/lighting/flare.dm index 471d1196013..355d6b97a6e 100644 --- a/code/game/objects/items/devices/lighting/flare.dm +++ b/code/game/objects/items/devices/lighting/flare.dm @@ -2,7 +2,7 @@ name = "flare" desc = "A red standard-issue flare. There are instructions on the side reading 'twist cap off, make light'." desc_info = "Use this item in your hand, to turn on the light." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL brightness_on = 3 // Pretty bright. light_power = 4 light_color = LIGHT_COLOR_FLARE //"#E58775" @@ -87,7 +87,7 @@ name = "torch" desc = "A rustic source of light." desc_info = "Click on a source of flame, to light the torch." - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY brightness_on = 2 light_power = 3 light_color = LIGHT_COLOR_FIRE @@ -152,7 +152,7 @@ /obj/item/torch name = "torch handle" desc = "A torch handle without its head." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL icon_state = "torch-empty" item_state = "torch-empty" icon = 'icons/obj/lighting.dmi' diff --git a/code/game/objects/items/devices/lighting/flashlight.dm b/code/game/objects/items/devices/lighting/flashlight.dm index 501cde6fb56..abd1b98b609 100644 --- a/code/game/objects/items/devices/lighting/flashlight.dm +++ b/code/game/objects/items/devices/lighting/flashlight.dm @@ -9,7 +9,7 @@ ) icon_state = "flashlight" item_state = "flashlight" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_BELT light_color = LIGHT_COLOR_HALOGEN @@ -311,7 +311,7 @@ obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_EARS brightness_on = 2 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY light_wedge = LIGHT_OMNI /obj/item/device/flashlight/drone @@ -322,7 +322,7 @@ obj_flags = OBJ_FLAG_CONDUCTABLE brightness_on = 2 efficiency_modifier = 2 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/device/flashlight/heavy name = "heavy duty flashlight" @@ -330,7 +330,7 @@ icon_state = "heavyflashlight" item_state = "heavyflashlight" brightness_on = 4 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL uv_intensity = 60 matter = list(MATERIAL_PLASTIC = 100, MATERIAL_GLASS = 70) light_wedge = LIGHT_SEMI @@ -346,7 +346,7 @@ force = 9 brightness_on = 5 efficiency_modifier = 0.8 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL uv_intensity = 70 attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed") matter = list(MATERIAL_ALUMINIUM = 200, MATERIAL_GLASS = 100) @@ -371,7 +371,7 @@ icon = 'icons/obj/lighting.dmi' icon_state = "floor1" //not a slime extract sprite but... something close enough! item_state = "slime" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY brightness_on = 6 uv_intensity = 200 on = TRUE //Bio-luminesence has one setting, on. @@ -388,7 +388,7 @@ obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_HEAD | SLOT_EARS brightness_on = 2 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY light_wedge = LIGHT_WIDE body_parts_covered = 0 diff --git a/code/game/objects/items/devices/lighting/glowstick.dm b/code/game/objects/items/devices/lighting/glowstick.dm index d7c1546893d..5c2eba0aec4 100644 --- a/code/game/objects/items/devices/lighting/glowstick.dm +++ b/code/game/objects/items/devices/lighting/glowstick.dm @@ -1,7 +1,7 @@ /obj/item/device/flashlight/flare/glowstick name = "green glowstick" desc = "A green military-grade glowstick." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL brightness_on = 1.2 flashlight_power = 2 light_color = "#49F37C" diff --git a/code/game/objects/items/devices/lighting/lamp.dm b/code/game/objects/items/devices/lighting/lamp.dm index 901e7bc936d..018bd56dfeb 100644 --- a/code/game/objects/items/devices/lighting/lamp.dm +++ b/code/game/objects/items/devices/lighting/lamp.dm @@ -8,7 +8,7 @@ center_of_mass = list("x" = 13,"y" = 11) brightness_on = 4 flashlight_power = 1.0 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE obj_flags = OBJ_FLAG_CONDUCTABLE uv_intensity = 100 power_use = FALSE diff --git a/code/game/objects/items/devices/lighting/marshalling_wand.dm b/code/game/objects/items/devices/lighting/marshalling_wand.dm index 6cb3dd8ce6c..6b06aa788c2 100644 --- a/code/game/objects/items/devices/lighting/marshalling_wand.dm +++ b/code/game/objects/items/devices/lighting/marshalling_wand.dm @@ -3,7 +3,7 @@ desc = "A marshalling wand, used to direct air or space faring vessels during takeoff and landing." icon_state = "marshallingwand" item_state = "marshallingwand" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL light_color = LIGHT_COLOR_RED light_wedge = LIGHT_OMNI brightness_on = 2 diff --git a/code/game/objects/items/devices/lightmeter.dm b/code/game/objects/items/devices/lightmeter.dm index 00e24de2e1e..5d1a137c705 100644 --- a/code/game/objects/items/devices/lightmeter.dm +++ b/code/game/objects/items/devices/lightmeter.dm @@ -9,7 +9,7 @@ // Copied from debugger.dm obj_flags = OBJ_FLAG_CONDUCTABLE force = 11 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throwforce = 5.0 throw_range = 15 throw_speed = 3 diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm index 21499d5100e..deb00309c22 100644 --- a/code/game/objects/items/devices/lightreplacer.dm +++ b/code/game/objects/items/devices/lightreplacer.dm @@ -62,7 +62,7 @@ desc = "A specialised light replacer which stores more lights, refills faster from boxes, and sucks up broken bulbs. Empty into a disposal or trashbag when full!" icon_state = "adv_lightreplacer" item_state = "adv_lightreplacer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL store_broken = 1 load_interval = 10 max_uses = 30 diff --git a/code/game/objects/items/devices/magnetic_lock.dm b/code/game/objects/items/devices/magnetic_lock.dm index daa54ac4a08..79e3ff6d44c 100644 --- a/code/game/objects/items/devices/magnetic_lock.dm +++ b/code/game/objects/items/devices/magnetic_lock.dm @@ -11,7 +11,7 @@ icon = 'icons/obj/magnetic_locks.dmi' icon_state = "inactive_CENTCOM" //icon_state = "inactive" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL req_access = list(ACCESS_CENT_SPECOPS) health = 150 @@ -44,7 +44,7 @@ name = "legion magnetic door lock" req_access = null req_one_access = list(ACCESS_LEGION, ACCESS_TCAF_SHIPS) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/device/magnetic_lock/security/legion/Initialize() . = ..() diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm index 45477ca6d5d..47de699b276 100644 --- a/code/game/objects/items/devices/megaphone.dm +++ b/code/game/objects/items/devices/megaphone.dm @@ -7,7 +7,7 @@ icon_state = "megaphone" item_state = "megaphone" contained_sprite = TRUE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL obj_flags = OBJ_FLAG_CONDUCTABLE var/spamcheck = 0 diff --git a/code/game/objects/items/devices/modkit.dm b/code/game/objects/items/devices/modkit.dm index c9cabe75fb3..e8300925c63 100644 --- a/code/game/objects/items/devices/modkit.dm +++ b/code/game/objects/items/devices/modkit.dm @@ -111,7 +111,7 @@ desc_info = "In order to convert a voidsuit simply click on voidsuit or helmet with this item\ The same process can be used to convert the voidsuit back into a regular voidsuit. Make sure not to have a helmet or tank in the suit\ or else it will be deleted." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/list/suit_options = list( /obj/item/clothing/suit/space/void/mining = /obj/item/clothing/suit/space/void/mining/himeo, /obj/item/clothing/head/helmet/space/void/mining = /obj/item/clothing/head/helmet/space/void/mining/himeo, @@ -207,7 +207,7 @@ desc_info = "This is an OOC item, don't let anyone see it! In order to convert a voidsuit simply click on voidsuit or helmet with this item \ The same process can be used to convert the voidsuit back into a regular voidsuit. Make sure not to have a helmet or tank in the suit \ or else it will be deleted." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL suit_options = list( /obj/item/clothing/head/helmet/space/void/dominia = /obj/item/clothing/head/helmet/space/void/dominia/voidsman, /obj/item/clothing/suit/space/void/dominia = /obj/item/clothing/suit/space/void/dominia/voidsman @@ -241,7 +241,7 @@ desc_info = "In order to convert a voidsuit simply click on voidsuit or helmet with this item\ The same process can be used to convert the voidsuit back into a regular voidsuit. Make sure not to have a helmet or tank in the suit\ or else it will be deleted." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/list/suit_options = list() var/list/helmet_options = list() var/list/rig_options = list() @@ -324,7 +324,7 @@ desc_info = "This is an OOC item, don't let anyone see it! In order to convert a voidsuit simply click on voidsuit or helmet with this item \ The same process can be used to convert the voidsuit back into a regular voidsuit. Make sure not to have a helmet or tank in the suit \ or else it will be deleted." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL suit_options = list( "Izharshan's Raiders" = /obj/item/clothing/suit/space/void/unathi_pirate, "Hiskyn's Revanchists" = /obj/item/clothing/suit/space/void/unathi_pirate/hiskyn, @@ -359,7 +359,7 @@ desc_info = "This is an OOC item, don't let anyone see it! In order to convert a voidsuit simply click on a hardsuit with this item \ The same process can be used to convert the hardsuit back into a regular hardsuit. Make sure not to have any modules in the suit \ or else it will be deleted." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL rig_options = list( "NanoTrasen Hardsuit" = /obj/item/rig/nanotrasen, "Corporate Auxiliary Hardsuit" = /obj/item/rig/nanotrasen/corporate_auxiliary, diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index 0148a57b9c9..421cc6631ae 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -14,7 +14,7 @@ contained_sprite = TRUE obj_flags = OBJ_FLAG_CONDUCTABLE force = 11 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throwforce = 5.0 throw_range = 15 throw_speed = 3 diff --git a/code/game/objects/items/devices/oxycandle.dm b/code/game/objects/items/devices/oxycandle.dm index 14d07e1c40f..be344f1aec9 100644 --- a/code/game/objects/items/devices/oxycandle.dm +++ b/code/game/objects/items/devices/oxycandle.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/device.dmi' icon_state = "oxycandle" item_state = "oxycandle" - w_class = ITEMSIZE_SMALL // Should fit into internal's box or maybe pocket + w_class = WEIGHT_CLASS_SMALL // Should fit into internal's box or maybe pocket var/target_pressure = ONE_ATMOSPHERE var/datum/gas_mixture/air_contents = null var/volume = 5600 // One tile has 2500 volume of air, so two tiles plus a bit extra diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 3f0f4d23838..761b1fff4a2 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -3,7 +3,7 @@ icon = 'icons/obj/pai.dmi' icon_state = "pai" item_state = "electronic" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT origin_tech = list(TECH_DATA = 2) var/list/installed_encryptionkeys = list() diff --git a/code/game/objects/items/devices/personal_shield.dm b/code/game/objects/items/devices/personal_shield.dm index d2e5b3b9c35..aa91a36579d 100644 --- a/code/game/objects/items/devices/personal_shield.dm +++ b/code/game/objects/items/devices/personal_shield.dm @@ -6,7 +6,7 @@ item_state = "personal_shield" contained_sprite = TRUE slot_flags = SLOT_BELT - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL action_button_name = "Toggle Shield" var/obj/item/cell/cell var/charge_per_shot = 200 diff --git a/code/game/objects/items/devices/pin_extractor.dm b/code/game/objects/items/devices/pin_extractor.dm index 47529e742c3..ec1e2a3a8b6 100644 --- a/code/game/objects/items/devices/pin_extractor.dm +++ b/code/game/objects/items/devices/pin_extractor.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/device.dmi' icon_state = "pin_extractor" item_state = "pin_extractor" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL obj_flags = OBJ_FLAG_CONDUCTABLE action_button_name = "Toggle extractor" var/on = 0 diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm index 663c3b0c17f..6a93e451c33 100644 --- a/code/game/objects/items/devices/powersink.dm +++ b/code/game/objects/items/devices/powersink.dm @@ -5,7 +5,7 @@ desc = "A nulling power sink which drains energy from electrical systems." icon_state = "powersink0" item_state = "powersink0" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY obj_flags = OBJ_FLAG_CONDUCTABLE throwforce = 5 throw_speed = 1 diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index 4d482d8b64a..8aa126bec45 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -5,7 +5,7 @@ item_state = "electropack" obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_BACK - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE matter = list(DEFAULT_WALL_MATERIAL = 10000, MATERIAL_GLASS = 2500) diff --git a/code/game/objects/items/devices/radio/encryptionkey.dm b/code/game/objects/items/devices/radio/encryptionkey.dm index fcee4dc7cb5..25a2fdcec7c 100644 --- a/code/game/objects/items/devices/radio/encryptionkey.dm +++ b/code/game/objects/items/devices/radio/encryptionkey.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/radio.dmi' icon_state = "cypherkey" item_state = "" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS var/translate_binary = FALSE var/translate_hivenet = FALSE diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index c39901d81ac..e103d920f46 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -25,7 +25,7 @@ pixel_x = 8; layer = ABOVE_WINDOW_LAYER anchored = TRUE appearance_flags = TILE_BOUND // prevents people from viewing the overlay through a wall - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY canhear_range = 2 atom_flags = ATOM_FLAG_NO_BLOOD obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED | OBJ_FLAG_CONDUCTABLE diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 286a127e0ac..5fb7ceb4c56 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -46,7 +46,7 @@ var/global/list/default_interrogation_channels = list( slot_flags = SLOT_BELT throw_speed = 2 throw_range = 9 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL matter = list(MATERIAL_ALUMINIUM = 75, MATERIAL_GLASS = 25) suffix = "\[3\]" var/radio_desc = "" diff --git a/code/game/objects/items/devices/radio_jammer.dm b/code/game/objects/items/devices/radio_jammer.dm index db60efe202f..add8ab959e4 100644 --- a/code/game/objects/items/devices/radio_jammer.dm +++ b/code/game/objects/items/devices/radio_jammer.dm @@ -22,7 +22,7 @@ var/list/active_radio_jammers = list() desc_info = "Use in-hand to activate or deactivate, alt-click while adjacent or in-hand to toggle whether it blocks all wireless signals, or just stationbound wireless interfacing." icon = 'icons/obj/device.dmi' icon_state = "shield0" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/active = JAMMER_OFF var/radius = 7 var/icon_state_active = "shield1" diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 53407f2c9c9..bab2bccc414 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -15,7 +15,7 @@ BREATH ANALYZER obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_BELT throwforce = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 5 throw_range = 10 matter = list(MATERIAL_ALUMINIUM = 200) @@ -377,7 +377,7 @@ BREATH ANALYZER icon_state = "analyzer" item_state = "analyzer" contained_sprite = TRUE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_BELT throwforce = 5 @@ -411,7 +411,7 @@ BREATH ANALYZER desc = "A hand-held mass spectrometer which identifies trace chemicals in a blood sample." icon_state = "spectrometer" item_state = "analyzer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL atom_flags = ATOM_FLAG_OPEN_CONTAINER obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_BELT @@ -485,7 +485,7 @@ BREATH ANALYZER desc = "A hand-held reagent scanner which identifies chemical agents." icon_state = "reagent_scanner" item_state = "analyzer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_BELT throwforce = 5 @@ -526,7 +526,7 @@ BREATH ANALYZER icon_state = "adv_spectrometer" item_state = "analyzer" origin_tech = list(TECH_BIO = 1) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL obj_flags = OBJ_FLAG_CONDUCTABLE throwforce = 0 throw_speed = 3 @@ -571,7 +571,7 @@ BREATH ANALYZER item_state = "price_scanner" item_flags = ITEM_FLAG_NO_BLUDGEON slot_flags = SLOT_BELT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throwforce = 0 throw_speed = 3 throw_range = 3 @@ -590,7 +590,7 @@ BREATH ANALYZER desc = "A hand-held breath analyzer that provides a robust amount of information about the subject's respiratory system." icon_state = "breath_analyzer" item_state = "analyzer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_BELT throwforce = 0 @@ -699,7 +699,7 @@ BREATH ANALYZER icon_state = "adv-analyzer" item_state = "adv-analyzer" slot_flags = SLOT_BELT - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 3) var/obj/machinery/body_scanconsole/connected = null //this is used to print the date and to deal with extra diff --git a/code/game/objects/items/devices/slide_projector.dm b/code/game/objects/items/devices/slide_projector.dm index 97749c9f888..56f6c79d455 100644 --- a/code/game/objects/items/devices/slide_projector.dm +++ b/code/game/objects/items/devices/slide_projector.dm @@ -4,7 +4,7 @@ desc_info = "You can use this in hand to open the interface, click-dragging it to you also works. Click anywhere with it in your hand to project at that location. Click dragging it to that location also works." icon = 'icons/obj/projector.dmi' icon_state = "projector0" - max_w_class = ITEMSIZE_SMALL + max_w_class = WEIGHT_CLASS_SMALL max_storage_space = 10 use_sound = 'sound/items/storage/toolbox.ogg' var/static/list/projection_types = list( diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm index 493ca147829..3c88e278c10 100644 --- a/code/game/objects/items/devices/spy_bug.dm +++ b/code/game/objects/items/devices/spy_bug.dm @@ -8,7 +8,7 @@ obj_flags = OBJ_FLAG_CONDUCTABLE force = 11 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS throwforce = 5.0 throw_range = 15 @@ -58,7 +58,7 @@ icon_state = "pda" item_state = "electronic" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1, TECH_ILLEGAL = 3) diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index 4eae7ac51c6..cc37826e89f 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -1,7 +1,7 @@ /obj/item/device/suit_cooling_unit name = "portable suit cooling unit" desc = "A portable heat sink and liquid cooled radiator that can be hooked up to a space suit's existing temperature controls to provide industrial levels of cooling." - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY icon = 'icons/obj/item/tools/suitcooler.dmi' icon_state = "suitcooler0" item_state = "coolingpack" @@ -166,8 +166,8 @@ if(cell) to_chat(user, SPAN_WARNING("There is \a [cell] already installed here.")) else - if(attacking_item.w_class != ITEMSIZE_NORMAL) - to_chat(user, SPAN_WARNING("\The [attacking_item] is too [attacking_item.w_class < ITEMSIZE_NORMAL ? "small" : "large"] to fit here.")) + if(attacking_item.w_class != WEIGHT_CLASS_NORMAL) + to_chat(user, SPAN_WARNING("\The [attacking_item] is too [attacking_item.w_class < WEIGHT_CLASS_NORMAL ? "small" : "large"] to fit here.")) return user.drop_from_inventory(attacking_item,src) cell = attacking_item diff --git a/code/game/objects/items/devices/t_scanner.dm b/code/game/objects/items/devices/t_scanner.dm index 688eed9fa3f..0b21879e087 100644 --- a/code/game/objects/items/devices/t_scanner.dm +++ b/code/game/objects/items/devices/t_scanner.dm @@ -8,7 +8,7 @@ item_state = "t-ray" contained_sprite = TRUE slot_flags = SLOT_BELT - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL matter = list(MATERIAL_PLASTIC = 100, MATERIAL_ALUMINIUM = 50) origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1) action_button_name = "Toggle T-Ray scanner" diff --git a/code/game/objects/items/devices/tagger.dm b/code/game/objects/items/devices/tagger.dm index aafd133b51a..71cb887d338 100644 --- a/code/game/objects/items/devices/tagger.dm +++ b/code/game/objects/items/devices/tagger.dm @@ -5,7 +5,7 @@ desc = "Used for tagging animals to be identified by a ear tag." icon_state = "animal_tagger0" force = 11 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throwforce = 5.0 throw_range = 15 throw_speed = 3 diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index 8b3f6b25ba1..1ef9968e826 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -3,7 +3,7 @@ desc = "A device that can record up to an hour of dialogue and play it back. It automatically translates the content in playback." icon_state = "taperecorderidle" item_state = "analyzer" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL matter = list(MATERIAL_ALUMINIUM = 60, MATERIAL_GLASS = 30) diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index c3807edb3a1..34a7d6c5a86 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -19,7 +19,7 @@ effective or pretty fucking useless. desc = "A strange device with twin antennas." icon_state = "batterer" throwforce = 5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throw_speed = 4 throw_range = 10 obj_flags = OBJ_FLAG_CONDUCTABLE diff --git a/code/game/objects/items/devices/tvcamera.dm b/code/game/objects/items/devices/tvcamera.dm index e8ec9136074..c7dbe5a6a0c 100644 --- a/code/game/objects/items/devices/tvcamera.dm +++ b/code/game/objects/items/devices/tvcamera.dm @@ -3,7 +3,7 @@ desc = "An Ingi Usang Entertainment Co. livestreaming press camera drone. Weapon of choice for war correspondents and reality show cameramen. It does not appear to have any internal memory storage." icon_state = "camcorder" item_state = "camcorder" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BELT var/channel = "General News Feed" var/obj/machinery/camera/network/news/camera @@ -93,7 +93,7 @@ Using robohead because of restricting to roboticist */ icon_state = "head" item_state = "head" var/buildstep = 0 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /obj/item/tv_assembly/attackby(obj/item/attacking_item, mob/user) switch(buildstep) diff --git a/code/game/objects/items/devices/uplink.dm b/code/game/objects/items/devices/uplink.dm index ed951028fb7..841a841d0a4 100644 --- a/code/game/objects/items/devices/uplink.dm +++ b/code/game/objects/items/devices/uplink.dm @@ -374,7 +374,7 @@ Then check if it's true, if true return. This will stop the normal menu appearin icon = 'icons/obj/radio.dmi' icon_state = "radio" obj_flags = OBJ_FLAG_CONDUCTABLE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/device/contract_uplink/Initialize(var/mapload, var/mind) . = ..() @@ -394,7 +394,7 @@ Then check if it's true, if true return. This will stop the normal menu appearin icon = 'icons/obj/device.dmi' icon_state = "locator" desc_antag = "This device allows you to create a single central command report. It has only one use." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/device/announcer/attack_self(mob/user as mob) if(!player_is_antag(user.mind)) @@ -419,7 +419,7 @@ Then check if it's true, if true return. This will stop the normal menu appearin icon = 'icons/obj/radio.dmi' icon_state = "radio" obj_flags = OBJ_FLAG_CONDUCTABLE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL ///Amount of starting telecrystals. Defaults to default amount if not set. var/starting_telecrystals diff --git a/code/game/objects/items/devices/versebook.dm b/code/game/objects/items/devices/versebook.dm index 79314efff62..784d0a686db 100644 --- a/code/game/objects/items/devices/versebook.dm +++ b/code/game/objects/items/devices/versebook.dm @@ -9,7 +9,7 @@ icon = 'icons/obj/library.dmi' icon_state = "dominiabook" item_state = "dominia" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/reading = FALSE drop_sound = 'sound/items/drop/book.ogg' @@ -158,5 +158,5 @@ desc = "A miniaturized edition of the Luceian Book of Scripture, a collection of historically-backed texts mixed with fables and stories detailing the reasonings, history, and \ beliefs of the Luceism religion of Assunzione. Translated into Basic by the Luceian Monastery on Biesel. This one fits nicely in a pocket or in a bag." icon_state = "luce_pocket" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY diff --git a/code/game/objects/items/devices/whistle.dm b/code/game/objects/items/devices/whistle.dm index ebb82045208..146cecf697f 100644 --- a/code/game/objects/items/devices/whistle.dm +++ b/code/game/objects/items/devices/whistle.dm @@ -3,7 +3,7 @@ desc = "Used by obese officers to save their breath for running." icon_state = "voice0" item_state = "flashbang" //looks exactly like a flash (and nothing like a flashbang) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY obj_flags = OBJ_FLAG_CONDUCTABLE var/use_message = "Halt! Security!" diff --git a/code/game/objects/items/eightball.dm b/code/game/objects/items/eightball.dm index 03cb6737021..540d93cef55 100644 --- a/code/game/objects/items/eightball.dm +++ b/code/game/objects/items/eightball.dm @@ -5,7 +5,7 @@ icon = 'icons/obj/toy.dmi' icon_state = "eightball" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/shaking = FALSE var/on_cooldown = FALSE diff --git a/code/game/objects/items/glassjar.dm b/code/game/objects/items/glassjar.dm index 0756d7163f2..e3a0197ca5f 100644 --- a/code/game/objects/items/glassjar.dm +++ b/code/game/objects/items/glassjar.dm @@ -17,7 +17,7 @@ desc_info = "Can be used to hold money, small animals, and gumballs. You can remove the lid and use it as a reagent container." icon = 'icons/obj/item/reagent_containers/glass.dmi' icon_state = "jar_lid" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL matter = list(MATERIAL_GLASS = 200) recyclable = TRUE item_flags = ITEM_FLAG_NO_BLUDGEON @@ -136,7 +136,7 @@ return TRUE if(istype(attacking_item, /obj/item/holder)) var/obj/item/holder/H = attacking_item - if(H.w_class <= ITEMSIZE_SMALL) + if(H.w_class <= WEIGHT_CLASS_SMALL) contains = JAR_HOLDER user.drop_from_inventory(H) scoop(H, user) diff --git a/code/game/objects/items/ipc_overloaders.dm b/code/game/objects/items/ipc_overloaders.dm index e3d3b2f7781..68e8b539d5b 100644 --- a/code/game/objects/items/ipc_overloaders.dm +++ b/code/game/objects/items/ipc_overloaders.dm @@ -3,7 +3,7 @@ desc_extended = "An overloader is a small disposable stick drive, commonly loaded with a program designed to temporarily reconfigure an IPC's priorities or inputs." icon = 'icons/obj/item/ipc_overloaders.dmi' icon_state = "classic" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY contained_sprite = TRUE var/uses = 2 var/effect_time = 30 SECONDS @@ -258,8 +258,8 @@ icon_state = "box" update_icon_on_init = TRUE contained_sprite = TRUE - w_class = ITEMSIZE_SMALL - max_w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_SMALL + max_w_class = WEIGHT_CLASS_TINY storage_slots = 1 can_hold = list(/obj/item/ipc_overloader) use_sound = 'sound/items/storage/briefcase.ogg' diff --git a/code/game/objects/items/knitting.dm b/code/game/objects/items/knitting.dm index 682bbc48fb1..c476c0f916c 100644 --- a/code/game/objects/items/knitting.dm +++ b/code/game/objects/items/knitting.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/item/tools/knitting.dmi' icon_state = "knittingneedles" item_state = "knittingneedles" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL contained_sprite = TRUE var/working = FALSE var/obj/item/yarn/ball @@ -121,7 +121,7 @@ desc = "A ball of yarn, this one is white." icon = 'icons/obj/item/tools/knitting.dmi' icon_state = "white_ball" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/yarn/red desc = "A ball of yarn, this one is red." diff --git a/code/game/objects/items/lore_radio.dm b/code/game/objects/items/lore_radio.dm index b091159ee89..70d77a39615 100644 --- a/code/game/objects/items/lore_radio.dm +++ b/code/game/objects/items/lore_radio.dm @@ -3,7 +3,7 @@ desc = "A portable radio capable of receiving radio waves from nearby space systems." icon = 'icons/obj/radio.dmi' icon_state = "radio" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/receiving = FALSE var/current_station = null diff --git a/code/game/objects/items/recharger_backpack.dm b/code/game/objects/items/recharger_backpack.dm index e155833d294..07e0375c0aa 100644 --- a/code/game/objects/items/recharger_backpack.dm +++ b/code/game/objects/items/recharger_backpack.dm @@ -5,7 +5,7 @@ icon_state = "recharger_backpack" item_state = "recharger_backpack" contained_sprite = TRUE - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BACK ///Power cell used to recharge the gun. Empty by default. var/obj/item/cell/powersupply diff --git a/code/game/objects/items/science_sampler.dm b/code/game/objects/items/science_sampler.dm index 8f82053082a..418f1c827a6 100644 --- a/code/game/objects/items/science_sampler.dm +++ b/code/game/objects/items/science_sampler.dm @@ -13,7 +13,7 @@ icon_state = "sampler" item_state = "sampler" contained_sprite = TRUE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /** * Which attachment we are using */ diff --git a/code/game/objects/items/skrell.dm b/code/game/objects/items/skrell.dm index 52f759555cd..6c854f94751 100644 --- a/code/game/objects/items/skrell.dm +++ b/code/game/objects/items/skrell.dm @@ -3,7 +3,7 @@ desc = "An antique and delicate looking instrument used to study the stars." icon = 'icons/obj/item/skrell/stellascope.dmi' icon_state = "starscope" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY matter = list(MATERIAL_GLASS = 200) drop_sound = 'sound/items/drop/glass.ogg' pickup_sound = 'sound/items/pickup/glass.ogg' @@ -80,7 +80,7 @@ icon = 'icons/obj/item/skrell/nralakk_projector.dmi' icon_state = "projector" light_color = LIGHT_COLOR_HALOGEN - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY matter = list(MATERIAL_GLASS = 200) drop_sound = 'sound/items/drop/glass.ogg' pickup_sound = 'sound/items/pickup/glass.ogg' @@ -231,7 +231,7 @@ /obj/item/nralakktag name = "\improper Nralakk Federation loyalty ear-tag" desc = "An ear-tag that shows the wearer is loyal to the Nralakk Federation. A small cable travels into the ear canal..." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_EARS icon = 'icons/obj/item/skrell/jargtag.dmi' icon_state = "jargtag" diff --git a/code/game/objects/items/stacks/barricades.dm b/code/game/objects/items/stacks/barricades.dm index 23811334415..66453b564b4 100644 --- a/code/game/objects/items/stacks/barricades.dm +++ b/code/game/objects/items/stacks/barricades.dm @@ -5,7 +5,7 @@ max_amount = 5 icon = 'icons/obj/barricade_stacks.dmi' icon_state = "steel-kit" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL matter = list(DEFAULT_WALL_MATERIAL = 650, MATERIAL_PHORON = 100, MATERIAL_PLASTEEL = 150) var/barricade_name = "steel" var/barricade_type = /obj/structure/barricade/metal diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 0c1840a7e31..b6c54aa7e61 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -17,7 +17,7 @@ Contains: pickup_sound = 'sound/items/pickup/cardboardbox.ogg' amount = 5 max_amount = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 4 throw_range = 20 surgerysound = 'sound/items/surgery/bonegel.ogg' diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 138eedc1770..0f61dbd293e 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -23,7 +23,7 @@ var/global/list/datum/stack_recipe/rod_recipes = list( singular_name = "metal rod" icon_state = "rods" obj_flags = OBJ_FLAG_CONDUCTABLE - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL force = 20 throwforce = 15.0 throw_speed = 5 @@ -102,7 +102,7 @@ var/global/list/datum/stack_recipe/rod_recipes = list( icon_state = "barbed_wire" singular_name = "length" max_amount = 50 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL matter = list(DEFAULT_WALL_MATERIAL = 937.5) attack_verb = list("hit", "whacked", "sliced") @@ -119,7 +119,7 @@ var/global/list/datum/stack_recipe/rod_recipes = list( max_amount = 50 icon = 'icons/obj/barricades.dmi' icon_state = "liquidbags" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL matter = list(DEFAULT_WALL_MATERIAL = 650, MATERIAL_PHORON = 100, MATERIAL_PLASTEEL = 150) /obj/item/stack/liquidbags/half_full diff --git a/code/game/objects/items/stacks/telecrystal.dm b/code/game/objects/items/stacks/telecrystal.dm index 7d848f33d61..cd2d3fc5cf3 100644 --- a/code/game/objects/items/stacks/telecrystal.dm +++ b/code/game/objects/items/stacks/telecrystal.dm @@ -7,7 +7,7 @@ desc_antag = "Crystals can be activated by utilizing them on devices with an actively running uplink. They will not activate on unactivated uplinks." singular_name = "telecrystal" icon_state = "telecrystal" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY max_amount = 50 item_flags = ITEM_FLAG_NO_BLUDGEON origin_tech = list(TECH_MATERIAL = 6, TECH_BLUESPACE = 4) diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index c11767b9a15..ccdb839614c 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -12,7 +12,7 @@ name = "tile" singular_name = "tile" desc = "A non-descript floor tile." - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL max_amount = 60 recyclable = TRUE icon = 'icons/obj/item/stacks/tiles.dmi' diff --git a/code/game/objects/items/stacks/wrap.dm b/code/game/objects/items/stacks/wrap.dm index b710851074d..5b7227f3c9a 100644 --- a/code/game/objects/items/stacks/wrap.dm +++ b/code/game/objects/items/stacks/wrap.dm @@ -30,7 +30,7 @@ if (!isturf(loc)) to_chat(user, SPAN_WARNING("The paper must be set down for you to wrap a gift!")) return - if (attacking_item.w_class < ITEMSIZE_LARGE) + if (attacking_item.w_class < WEIGHT_CLASS_BULKY) var/a_used = 2 * (src.w_class - 1) if(src.amount < a_used) to_chat(user, SPAN_WARNING("You need more paper!")) @@ -102,7 +102,7 @@ desc = "A roll of paper used to enclose an object for delivery." desc_info = "To package wrap the object for delivery, use the package wrapper on the object." singular_name = "length" - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL amount = 30 var/wrapping_tag = "Sorting Office" drop_sound = 'sound/items/drop/wrapper.ogg' @@ -210,6 +210,6 @@ ) icon_state = "c_tube" throwforce = 1 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 4 throw_range = 5 diff --git a/code/game/objects/items/sticker.dm b/code/game/objects/items/sticker.dm index bb2d48f76e8..a6b3e9557f6 100644 --- a/code/game/objects/items/sticker.dm +++ b/code/game/objects/items/sticker.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/sticker.dmi' icon_state = "sticker" item_flags = ITEM_FLAG_NO_BLUDGEON - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY vis_flags = VIS_INHERIT_LAYER | VIS_INHERIT_DIR var/datum/weakref/attached diff --git a/code/game/objects/items/tajara.dm b/code/game/objects/items/tajara.dm index 543f1aebb4f..4a0c6b572a8 100644 --- a/code/game/objects/items/tajara.dm +++ b/code/game/objects/items/tajara.dm @@ -41,7 +41,7 @@ icon_state = "tajcig" drop_sound = 'sound/items/drop/paper.ogg' pickup_sound = 'sound/items/pickup/paper.ogg' - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/list/figures = list("hadii", "tesla", "headmaster", "commissar", "almanq", "yasmin", "andrey", "paratrooper", "scout") /obj/item/tajcard/Initialize() diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 93eae88e86d..406a91d3f39 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -111,7 +111,7 @@ desc_extended = "Thanks to the joint effort of the Research and Atmospherics teams, station enviroments have been set to allow balloons to float without helium. Look, it was the end of the month and we went under budget." drop_sound = 'sound/items/drop/rubber.ogg' pickup_sound = 'sound/items/pickup/rubber.ogg' - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE var/datum/gas_mixture/air_contents = null var/status = 0 // 0 = normal, 1 = blow, 2 = burst @@ -293,7 +293,7 @@ /obj/item/toy/comic name = "comic book" desc = "A magazine presenting a fictional story through a sequence of images. Perfect for those long, boring shifts." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon_state = "comic" item_state = "comic" drop_sound = 'sound/items/drop/paper.ogg' @@ -409,7 +409,7 @@ drop_sound = 'sound/items/drop/gun.ogg' pickup_sound = 'sound/items/pickup/gun.ogg' contained_sprite = TRUE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("attacked", "struck", "hit") var/dart_count = 5 @@ -501,7 +501,7 @@ desc = "A foam dart." icon = 'icons/obj/toy.dmi' icon_state = "foamdart" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS drop_sound = 'sound/items/drop/food.ogg' pickup_sound = 'sound/items/pickup/food.ogg' @@ -532,7 +532,7 @@ var/active = 0.0 var/colorvar = "blue" var/last_active = 0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("attacked", "struck", "hit") /obj/item/toy/sword/attack_self(mob/user as mob) @@ -544,13 +544,13 @@ playsound(user, 'sound/weapons/saberon.ogg', 50, 1) src.icon_state = "sword[colorvar]" src.item_state = "sword[colorvar]" - src.w_class = ITEMSIZE_LARGE + src.w_class = WEIGHT_CLASS_BULKY else to_chat(user, SPAN_NOTICE("You push the plastic blade back down into the handle.")) playsound(user, 'sound/weapons/saberoff.ogg', 50, 1) src.icon_state = "sword0" src.item_state = "sword0" - src.w_class = ITEMSIZE_SMALL + src.w_class = WEIGHT_CLASS_SMALL if(istype(user,/mob/living/carbon/human)) var/mob/living/carbon/human/H = user @@ -579,7 +579,7 @@ slot_flags = SLOT_BELT | SLOT_BACK force = 11 throwforce = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL attack_verb = list("attacked", "slashed", "stabbed", "sliced") /* @@ -590,10 +590,18 @@ desc = "Wow!" icon = 'icons/obj/toy.dmi' icon_state = "snappop" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY drop_sound = 'sound/items/drop/food.ogg' pickup_sound = 'sound/items/pickup/food.ogg' +/obj/item/toy/snappop/Initialize() + . = ..() + var/static/list/loc_connections = list( + COMSIG_ATOM_ENTERED = PROC_REF(on_entered), + ) + + AddElement(/datum/element/connect_loc, loc_connections) + /obj/item/toy/snappop/attack_self(mob/user) user.drop_from_inventory(src) user.visible_message(SPAN_WARNING("\The [user] throws \the [src] at their feet!"), SPAN_NOTICE("You throw \the [src] at your feet.")) @@ -603,9 +611,9 @@ ..() do_pop() -/obj/item/toy/snappop/Crossed(H as mob|obj) - if((ishuman(H))) //i guess carp and shit shouldn't set them off - var/mob/living/carbon/human/M = H +/obj/item/toy/snappop/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) + if((ishuman(arrived))) //i guess carp and shit shouldn't set them off + var/mob/living/carbon/human/M = arrived if(M.shoes?.item_flags & ITEM_FLAG_LIGHT_STEP) return if(M.m_intent == M_RUN) @@ -646,7 +654,7 @@ drop_sound = 'sound/items/drop/card.ogg' pickup_sound = 'sound/items/pickup/card.ogg' var/cooldown = 0 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS /obj/item/toy/bosunwhistle/attack_self(mob/user as mob) @@ -661,7 +669,7 @@ /obj/item/toy/mech icon_state = "ripleytoy" var/cooldown = 0 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL drop_sound = 'sound/mecha/mechstep.ogg' /obj/item/toy/mech/attack_self(mob/user) @@ -731,7 +739,7 @@ name = "completely glitched action figure" desc = "A \"Space Life\" brand... wait, what the hell is this thing? It seems to be requesting the sweet release of death." icon_state = "glitched" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY drop_sound = 'sound/items/drop/accessory.ogg' pickup_sound = 'sound/items/pickup/accessory.ogg' @@ -940,7 +948,7 @@ item_state = "therapyred" var/active = 0.0 var/colorvar = "red" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/toy/plushie/therapy/Initialize() . = ..() @@ -1297,7 +1305,7 @@ icon = 'icons/obj/sword.dmi' icon_state = "cultblade" item_state = "cultblade" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY attack_verb = list("attacked", "slashed", "stabbed", "poked") contained_sprite = TRUE @@ -1393,7 +1401,7 @@ name = "party popper" desc = "Instructions : Aim away from face. Wait for appropriate timing. Pull cord, enjoy confetti." icon_state = "partypopper" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY drop_sound = 'sound/items/drop/cardboardbox.ogg' pickup_sound = 'sound/items/pickup/cardboardbox.ogg' @@ -1415,7 +1423,7 @@ desc = "A %NAME% chess piece, this one is worth %POINT% points." icon = 'icons/obj/item/chess.dmi' icon_state = "white_pawn" - w_class = ITEMSIZE_HUGE // hugh mungus + w_class = WEIGHT_CLASS_HUGE // hugh mungus var/piece_worth = 1 /obj/item/chess_piece/afterattack(atom/target, mob/user, proximity_flag, click_parameters) @@ -1481,7 +1489,7 @@ /obj/item/toy/stressball name = "stress ball" desc = "A small, squishy stress ball. This one has a squeaker inside." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon_state = "stressball" drop_sound = 'sound/items/drop/plushie.ogg' pickup_sound = 'sound/items/pickup/plushie.ogg' diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm index 9b4bf1bc92c..18d2346cf58 100644 --- a/code/game/objects/items/trash.dm +++ b/code/game/objects/items/trash.dm @@ -4,7 +4,7 @@ //Added by Jack Rost /obj/item/trash icon = 'icons/obj/trash.dmi' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY contained_sprite = TRUE item_state = "candy" desc = "General waste material, refuse or litter. Dispose responsibly." diff --git a/code/game/objects/items/umbrella.dm b/code/game/objects/items/umbrella.dm index 72d36386daa..ec60d8fa6cf 100644 --- a/code/game/objects/items/umbrella.dm +++ b/code/game/objects/items/umbrella.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/item/umbrellas.dmi' icon_state = "umbrella_yellow_closed" contained_sprite = TRUE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL matter = list(MATERIAL_PLASTIC = 1000) force = 5 sharp = TRUE @@ -29,7 +29,7 @@ if(!is_open) to_chat(user, SPAN_NOTICE("You unfurl \the [src].")) item_state = "umbrella_[umbrella_color]_open" - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY is_open = TRUE force = 1 sharp = FALSE diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index ad3660019fa..22a69e5f883 100755 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -14,7 +14,7 @@ AI MODULES desc = "An AI Module for transmitting encrypted instructions to the AI." obj_flags = OBJ_FLAG_CONDUCTABLE force = 11 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throwforce = 5.0 throw_speed = 3 throw_range = 15 diff --git a/code/game/objects/items/weapons/RFD.dm b/code/game/objects/items/weapons/RFD.dm index 5135e3fc848..5969e6c070a 100644 --- a/code/game/objects/items/weapons/RFD.dm +++ b/code/game/objects/items/weapons/RFD.dm @@ -30,7 +30,7 @@ throwforce = 10 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL origin_tech = list(TECH_ENGINEERING = 4, TECH_MATERIAL = 2) matter = list(DEFAULT_WALL_MATERIAL = 50000) drop_sound = 'sound/items/drop/gun.ogg' @@ -161,7 +161,7 @@ icon = 'icons/obj/ammo.dmi' icon_state = "rfd" item_state = "rfdammo" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MATERIAL = 2) matter = list(DEFAULT_WALL_MATERIAL = 2000, MATERIAL_GLASS = 2000) recyclable = TRUE diff --git a/code/game/objects/items/weapons/autopsy.dm b/code/game/objects/items/weapons/autopsy.dm index d7d9c713011..37a579fbf13 100644 --- a/code/game/objects/items/weapons/autopsy.dm +++ b/code/game/objects/items/weapons/autopsy.dm @@ -8,7 +8,7 @@ icon = 'icons/obj/device.dmi' icon_state = "autopsy" obj_flags = OBJ_FLAG_CONDUCTABLE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1) var/list/datum/autopsy_data_scanner/wdata = list() var/list/datum/autopsy_data_scanner/chemtraces = list() diff --git a/code/game/objects/items/weapons/candle.dm b/code/game/objects/items/weapons/candle.dm index 2cb69e17e81..72c45113e0f 100644 --- a/code/game/objects/items/weapons/candle.dm +++ b/code/game/objects/items/weapons/candle.dm @@ -6,7 +6,7 @@ item_state = "candle1" drop_sound = 'sound/items/drop/gloves.ogg' pickup_sound = 'sound/items/pickup/gloves.ogg' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY light_color = "#E09D37" var/wax = 2000 var/start_lit = FALSE diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 1b433a4ca8b..9912145aaf8 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -19,7 +19,7 @@ slot_l_hand_str = 'icons/mob/items/lefthand_card.dmi', slot_r_hand_str = 'icons/mob/items/righthand_card.dmi', ) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY var/associated_account_number = 0 var/list/files = list( ) var/last_flash = 0 //Spam limiter. diff --git a/code/game/objects/items/weapons/chaplain_items.dm b/code/game/objects/items/weapons/chaplain_items.dm index 6fcadba8629..5a7c8e3c672 100644 --- a/code/game/objects/items/weapons/chaplain_items.dm +++ b/code/game/objects/items/weapons/chaplain_items.dm @@ -15,7 +15,7 @@ throw_speed = 1 throw_range = 4 throwforce = 10 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/can_change_form = TRUE // For holodeck check. var/cooldown = 0 // Floor tap cooldown. var/list/null_choices = list( //Generic nullrods only here, religion-specific ones should be on the religion datum @@ -51,7 +51,7 @@ icon_state = "nullstaff" item_state = "nullstaff" slot_flags = SLOT_BELT | SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /obj/item/nullrod/orb name = "null sphere" @@ -78,7 +78,7 @@ throw_range = 7 throwforce = 2 slot_flags = SLOT_MASK | SLOT_WRISTS | SLOT_EARS | SLOT_TIE - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/nullrod/charm/get_mask_examine_text(mob/user) return "around [user.get_pronoun("his")] neck" @@ -91,7 +91,7 @@ item_state = "matake_spear" contained_sprite = TRUE slot_flags = SLOT_BELT | SLOT_BACK - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /obj/item/nullrod/rredouane name = "\improper Rredouane sword" @@ -156,7 +156,7 @@ icon_state = "shaman_staff" item_state = "shaman_staff" contained_sprite = TRUE - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = null /obj/item/nullrod/skakh_warrior @@ -167,7 +167,7 @@ item_state = "skakh_sword" slot_flags = SLOT_BACK|SLOT_BELT contained_sprite = TRUE - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY /obj/item/nullrod/skakh_healer name = "\improper Sk'akh staff" @@ -176,7 +176,7 @@ icon_state = "skakh_staff" item_state = "skakh_staff" contained_sprite = TRUE - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = null /obj/item/nullrod/skakh_fisher @@ -213,7 +213,7 @@ contained_sprite = TRUE force = 25 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BACK light_range = 4 light_power = 2 @@ -372,7 +372,7 @@ icon = 'icons/obj/urn.dmi' icon_state = "urn" applies_material_colour = TRUE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL item_flags = ITEM_FLAG_NO_BLUDGEON /obj/item/material/urn/afterattack(var/obj/A, var/mob/user, var/proximity) @@ -412,7 +412,7 @@ light_range = 1.4 light_power = 1.4 light_color = LIGHT_COLOR_BLUE - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL drop_sound = 'sound/items/drop/glass.ogg' pickup_sound = 'sound/items/pickup/glass.ogg' diff --git a/code/game/objects/items/weapons/chewables.dm b/code/game/objects/items/weapons/chewables.dm index 859c4c23ea0..70ce6c69699 100644 --- a/code/game/objects/items/weapons/chewables.dm +++ b/code/game/objects/items/weapons/chewables.dm @@ -86,7 +86,7 @@ throw_speed = 0.5 icon_state = "chew" type_butt = /obj/item/trash/spitwad - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS | SLOT_MASK chem_volume = 50 chewtime = 300 @@ -165,7 +165,7 @@ throw_speed = 0.5 icon_state = "chew" type_butt = /obj/item/trash/spitwad - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS | SLOT_MASK chem_volume = 50 chewtime = 300 @@ -178,7 +178,7 @@ throw_speed = 0.5 icon_state = "chew" type_butt = /obj/item/trash/spitgum - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS | SLOT_MASK chem_volume = 50 chewtime = 300 @@ -190,7 +190,7 @@ throw_speed = 0.5 icon_state = "chew" type_butt = /obj/item/trash/spitwad - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS | SLOT_MASK chem_volume = 50 chewtime = 300 diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 16002307b98..5cbfb2b297a 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -34,7 +34,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM ) var/smoketime = 5 var/type_burnt = /obj/item/trash/match - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY origin_tech = list(TECH_MATERIAL = 1) slot_flags = SLOT_EARS | SLOT_MASK attack_verb = list("burnt", "singed") @@ -298,7 +298,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon_state = "cigoff" item_state = "cigoff" throw_speed = 0.5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS | SLOT_MASK attack_verb = list("burnt", "singed") icon_on = "cigon" @@ -535,7 +535,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon = 'icons/obj/smokables.dmi' icon_state = "cigbutt" randpixel = 10 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS | SLOT_MASK throwforce = 1 drop_sound = 'sound/items/cigs_lighters/cig_snuff.ogg' @@ -587,7 +587,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon_on = "pipeon" icon_off = "pipeoff" burn_rate = 0.015 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY chem_volume = 30 matchmes = SPAN_NOTICE("USER lights their NAME with their FLAME.") lightermes = SPAN_NOTICE("USER manages to light their NAME with FLAME.") @@ -703,7 +703,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM slot_l_hand_str = 'icons/mob/items/lefthand_cigs_lighters.dmi', slot_r_hand_str = 'icons/mob/items/righthand_cigs_lighters.dmi', ) - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY throwforce = 4 obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_BELT @@ -1060,7 +1060,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM desc = "A thin piece of paper used to make smokables." icon = 'icons/obj/cigs_lighters.dmi' icon_state = "cigpaper_generic" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY can_fold = FALSE /obj/item/paper/cig/attackby(obj/item/attacking_item, mob/user) @@ -1081,7 +1081,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM desc = "A small nub like filter for cigarettes." icon = 'icons/obj/cigs_lighters.dmi' icon_state = "cigfilter" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/cigarette_filter/attackby(obj/item/attacking_item, mob/user) if(istype(attacking_item, /obj/item/clothing/mask/smokable/cigarette/rolled)) @@ -1093,7 +1093,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM //tobacco sold seperately if you're too snobby to grow it yourself. /obj/item/reagent_containers/food/snacks/grown/dried_tobacco plantname = "tobacco" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/reagent_containers/food/snacks/grown/dried_tobacco/Initialize() . = ..() @@ -1113,7 +1113,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM //oracle sold seperately if you're too snobby to grow it yourself. /obj/item/reagent_containers/food/snacks/grown/dried_oracle plantname = "oracle" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /obj/item/reagent_containers/food/snacks/grown/dried_oracle/Initialize() . = ..() diff --git a/code/game/objects/items/weapons/circuitboards/circuitboard.dm b/code/game/objects/items/weapons/circuitboards/circuitboard.dm index d217e0e4fa1..2f476bdb586 100644 --- a/code/game/objects/items/weapons/circuitboards/circuitboard.dm +++ b/code/game/objects/items/weapons/circuitboards/circuitboard.dm @@ -11,7 +11,7 @@ icon_state = "id_mod" item_state = "electronic" origin_tech = list(TECH_DATA = 2) - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL obj_flags = OBJ_FLAG_CONDUCTABLE force = 11 throwforce = 5 diff --git a/code/game/objects/items/weapons/cloaking_device.dm b/code/game/objects/items/weapons/cloaking_device.dm index c0f1e803e41..cefa2583a72 100644 --- a/code/game/objects/items/weapons/cloaking_device.dm +++ b/code/game/objects/items/weapons/cloaking_device.dm @@ -14,7 +14,7 @@ throwforce = 10.0 throw_speed = 2 throw_range = 10 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_MAGNET = 3, TECH_ILLEGAL = 4) var/power_usage = 35000//A high powered cell allows 5 minutes of continuous usage diff --git a/code/game/objects/items/weapons/cosmetics.dm b/code/game/objects/items/weapons/cosmetics.dm index 646519a2a56..cd11791489e 100644 --- a/code/game/objects/items/weapons/cosmetics.dm +++ b/code/game/objects/items/weapons/cosmetics.dm @@ -7,7 +7,7 @@ item_state = "lipstick" build_from_parts = TRUE contained_sprite = TRUE - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS update_icon_on_init = TRUE var/lipstick_color = "#DC253A" @@ -143,7 +143,7 @@ /obj/item/haircomb //sparklysheep's comb name = "plastic comb" desc = "A pristine comb made from flexible plastic." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS icon = 'icons/obj/cosmetics.dmi' icon_state = "comb" @@ -161,7 +161,7 @@ desc = "The latest and greatest power razor born from the science of shaving." icon = 'icons/obj/weapons.dmi' icon_state = "razor" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/razor/proc/shave(mob/living/carbon/human/H, location) if(location == BP_HEAD) diff --git a/code/game/objects/items/weapons/dice.dm b/code/game/objects/items/weapons/dice.dm index 5491cc5567b..f01bd4c905c 100644 --- a/code/game/objects/items/weapons/dice.dm +++ b/code/game/objects/items/weapons/dice.dm @@ -3,7 +3,7 @@ desc = "A dice with six sides." icon = 'icons/obj/dice.dmi' icon_state = "d66" - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY attack_verb = list("diced") max_amount = 6 diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 3457fef2a7f..35d183c73de 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -10,7 +10,7 @@ var/s_time = 10.0 throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS var/uses = 1 var/nofail diff --git a/code/game/objects/items/weapons/ecigs.dm b/code/game/objects/items/weapons/ecigs.dm index 31ce277af73..f55935d990b 100644 --- a/code/game/objects/items/weapons/ecigs.dm +++ b/code/game/objects/items/weapons/ecigs.dm @@ -12,7 +12,7 @@ var/cell_type = /obj/item/cell/device var/obj/item/reagent_containers/ecig_cartridge/ec_cartridge var/cartridge_type = /obj/item/reagent_containers/ecig_cartridge/med_nicotine - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY slot_flags = SLOT_EARS | SLOT_MASK attack_verb = list("attacked", "poked", "battered") body_parts_covered = 0 @@ -241,7 +241,7 @@ /obj/item/reagent_containers/ecig_cartridge name = "tobacco flavour cartridge" desc = "A small metal cartridge, used with electronic cigarettes, which contains an atomizing coil and a solution to be atomized." - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY icon = 'icons/obj/ecig.dmi' icon_state = "ecartridge" matter = list(MATERIAL_STEEL = 50, MATERIAL_GLASS = 10) diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index cd3fd132d13..edaa57e9f57 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -6,7 +6,7 @@ icon_state = "plastic-explosive0" item_state = "plasticx" item_flags = ITEM_FLAG_NO_BLUDGEON - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL origin_tech = list(TECH_ILLEGAL = 2) var/datum/wires/explosive/c4/wires = null var/detonate_time = 0 diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm index caacc4d738c..feaaecf90a8 100644 --- a/code/game/objects/items/weapons/extinguisher.dm +++ b/code/game/objects/items/weapons/extinguisher.dm @@ -8,7 +8,7 @@ atom_flags = ATOM_FLAG_OPEN_CONTAINER obj_flags = OBJ_FLAG_CONDUCTABLE throwforce = 8 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL throw_speed = 2 throw_range = 10 force = 18 @@ -92,7 +92,7 @@ hitsound = 'sound/weapons/smash.ogg' obj_flags = OBJ_FLAG_CONDUCTABLE throwforce = 10 - w_class = ITEMSIZE_HUGE + w_class = WEIGHT_CLASS_HUGE throw_speed = 2 throw_range = 10 force = 15 @@ -117,7 +117,7 @@ hitsound = null //it is much lighter, after all. atom_flags = ATOM_FLAG_OPEN_CONTAINER throwforce = 2 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL force = 2 max_water = 60 spray_amount = 10 diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index b19cc68278b..df4f909c01f 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -6,7 +6,7 @@ item_state = "flamethrower_0" contained_sprite = TRUE - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY obj_flags = OBJ_FLAG_CONDUCTABLE force = 3 throwforce = 10 diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index 6619746ab6c..81ab40167a7 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -3,7 +3,7 @@ icon_state = "chemg" item_state = "chemg" desc = "A hand made chemical grenade." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL force = 2 det_time = null unacidable = 1 diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 73807e63c60..c2ba0754549 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -1,7 +1,7 @@ /obj/item/grenade name = "grenade" desc = "A hand held grenade, with an adjustable timer." - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL icon = 'icons/obj/grenade.dmi' item_icons = list( slot_l_hand_str = 'icons/mob/items/weapons/lefthand_grenade.dmi', diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index b3e6a72e689..dd8b3ee8587 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -10,7 +10,7 @@ obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_BELT throwforce = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL throw_speed = 2 throw_range = 5 origin_tech = list(TECH_MATERIAL = 1) diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 4e970a8baa7..57c608806b7 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -6,7 +6,7 @@ abstract_type = /obj/item/implant name = "implant" icon = 'icons/obj/item/implants.dmi' - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY /** * This gives the user an action button that allows them to activate the implant. * If the implant needs no action button, then null this out. diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm index 03a720f18f8..9e2b26e91ef 100644 --- a/code/game/objects/items/weapons/implants/implantcase.dm +++ b/code/game/objects/items/weapons/implants/implantcase.dm @@ -9,7 +9,7 @@ item_state = "implantcase" throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_TINY + w_class = WEIGHT_CLASS_TINY ///The implant within the case var/obj/item/implant/imp = null diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm index 135ce8c8b56..5afac4afa77 100644 --- a/code/game/objects/items/weapons/implants/implanter.dm +++ b/code/game/objects/items/weapons/implants/implanter.dm @@ -5,7 +5,7 @@ icon_state = "implanter-0" throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL matter = list(DEFAULT_WALL_MATERIAL = 320, MATERIAL_GLASS = 800) var/obj/item/implant/imp = null diff --git a/code/game/objects/items/weapons/implants/implantpad.dm b/code/game/objects/items/weapons/implants/implantpad.dm index 8d702af6da6..462cfbdf103 100644 --- a/code/game/objects/items/weapons/implants/implantpad.dm +++ b/code/game/objects/items/weapons/implants/implantpad.dm @@ -6,7 +6,7 @@ item_state = "electronic" throw_speed = 1 throw_range = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL var/obj/item/implantcase/case = null var/broadcasting = null var/listening = TRUE diff --git a/code/game/objects/items/weapons/improvised_components.dm b/code/game/objects/items/weapons/improvised_components.dm index e56f847715e..5da731b242c 100644 --- a/code/game/objects/items/weapons/improvised_components.dm +++ b/code/game/objects/items/weapons/improvised_components.dm @@ -47,7 +47,7 @@ obj_flags = OBJ_FLAG_CONDUCTABLE force = 18 throwforce = 10 - w_class = ITEMSIZE_NORMAL + w_class = WEIGHT_CLASS_NORMAL attack_verb = list("hit", "bludgeoned", "whacked", "bonked") force_divisor = 0.1 thrown_force_divisor = 0.1 @@ -94,7 +94,7 @@ item_state = "rods" force = 11 throwforce = 3 - w_class = ITEMSIZE_LARGE + w_class = WEIGHT_CLASS_BULKY attack_verb = list("hit", "bludgeoned", "whacked", "bonked") force_divisor = 0.1 thrown_force_divisor = 0.1 @@ -123,7 +123,7 @@ icon_state = "spearhead" force = 11 throwforce = 5 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL attack_verb = list("attacked", "poked") force_divisor = 0.1 thrown_force_divisor = 0.1 @@ -169,7 +169,7 @@ icon = 'icons/obj/weapons_build.dmi' icon_state = "woodcirclet" item_state = "woodcirclet" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL /obj/item/woodcirclet/attackby(obj/item/attacking_item, mob/user) var/obj/item/complete = null diff --git a/code/game/objects/items/weapons/ipc_scanner.dm b/code/game/objects/items/weapons/ipc_scanner.dm index dfd0f93a983..caedd5bcf68 100644 --- a/code/game/objects/items/weapons/ipc_scanner.dm +++ b/code/game/objects/items/weapons/ipc_scanner.dm @@ -8,7 +8,7 @@ obj_flags = OBJ_FLAG_CONDUCTABLE slot_flags = SLOT_BELT throwforce = 3 - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL // Wiring var/datum/wires/tag_scanner/wires diff --git a/code/game/objects/items/weapons/landmines.dm b/code/game/objects/items/weapons/landmines.dm index a6feca0d791..2c9852d1525 100644 --- a/code/game/objects/items/weapons/landmines.dm +++ b/code/game/objects/items/weapons/landmines.dm @@ -7,6 +7,15 @@ var/deployed = FALSE var/deactivated = FALSE // add wire to re-activate +/obj/item/landmine/Initialize() + . = ..() + + var/static/list/loc_connections = list( + COMSIG_ATOM_ENTERED = PROC_REF(on_entered), + ) + + AddElement(/datum/element/connect_loc, loc_connections) + /obj/item/landmine/update_icon() ..() if(!deployed) @@ -74,15 +83,16 @@ explosion(loc, 0, 2, 2, 3) qdel(src) -/obj/item/landmine/Crossed(AM as mob|obj, var/ignore_deployment = FALSE) - if(deployed || ignore_deployment) - if(ishuman(AM)) - var/mob/living/carbon/human/H = AM +/obj/item/landmine/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) + SIGNAL_HANDLER + + if(deployed) + if(ishuman(arrived)) + var/mob/living/carbon/human/H = arrived if(H.shoes?.item_flags & ITEM_FLAG_LIGHT_STEP) - ..() return - if(isliving(AM)) - var/mob/living/L = AM + if(isliving(arrived)) + var/mob/living/L = arrived if(L.pass_flags & PASSTABLE) return if(L.mob_size >= 5) @@ -92,7 +102,6 @@ SPAN_DANGER("You hear a mechanical click!") ) trigger(L) - ..() /obj/item/landmine/attack_hand(mob/user as mob) if(deployed && !use_check(user, USE_DISALLOW_SILICONS)) @@ -341,6 +350,15 @@ icon_state = "standstill" var/engaged_by = null +/obj/item/landmine/standstill/Initialize() + . = ..() + + var/static/list/loc_connections = list( + COMSIG_ATOM_EXITED = PROC_REF(on_exited), + ) + + AddElement(/datum/element/connect_loc, loc_connections) + /obj/item/landmine/standstill/Destroy() STOP_PROCESSING(SSfast_process, src) engaged_by = null @@ -361,12 +379,12 @@ else late_trigger(locate(engaged_by)) -/obj/item/landmine/standstill/Uncrossed(O) - . = ..() +/obj/item/landmine/standstill/proc/on_exited(datum/source, atom/movable/gone, direction) + SIGNAL_HANDLER //Oh no... - if(engaged_by && O == locate(engaged_by)) - var/mob/living/victim = O + if(engaged_by && gone == locate(engaged_by)) + var/mob/living/victim = gone to_chat(victim, SPAN_HIGHDANGER("The mine clicks below your feet.")) addtimer(CALLBACK(src, PROC_REF(late_trigger), victim), 1 SECONDS) @@ -454,7 +472,7 @@ else . = ..() -/obj/item/landmine/claymore/Crossed(AM, ignore_deployment) +/obj/item/landmine/claymore/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) return //Does nothing with mere crossing over /obj/item/landmine/claymore/deploy(mob/deployer) diff --git a/code/game/objects/items/weapons/manuals.dm b/code/game/objects/items/weapons/manuals.dm index b5a17721079..3d278adddb5 100644 --- a/code/game/objects/items/weapons/manuals.dm +++ b/code/game/objects/items/weapons/manuals.dm @@ -1352,7 +1352,7 @@ item_state = "book4" title = "Hadiist Manifesto" author = "Al'Mari Hadii" - w_class = ITEMSIZE_SMALL + w_class = WEIGHT_CLASS_SMALL dat = {"