diff --git a/_maps/map_files/rift/rift-04-surface1.dmm b/_maps/map_files/rift/rift-04-surface1.dmm index a3459359614..a50c9ab87dc 100644 --- a/_maps/map_files/rift/rift-04-surface1.dmm +++ b/_maps/map_files/rift/rift-04-surface1.dmm @@ -125,7 +125,7 @@ /obj/item/weldingtool/mini{ desc = "It says 'keychain welder' on the side, but there's no bail to hook it on."; name = "keychain welder"; - toolspeed = 5 + tool_speed = 5 }, /turf/simulated/floor/plating, /area/maintenance/library) @@ -16060,7 +16060,7 @@ /obj/item/tool/prybar/red{ desc = "Haven't I seen this before?"; name = "old red crowbar"; - toolspeed = 3 + tool_speed = 0.5 }, /obj/machinery/light/small{ dir = 1 diff --git a/_maps/map_files/tether/tether-01-surface1.dmm b/_maps/map_files/tether/tether-01-surface1.dmm index 59f1ecfb539..e78b34bfe3e 100644 --- a/_maps/map_files/tether/tether-01-surface1.dmm +++ b/_maps/map_files/tether/tether-01-surface1.dmm @@ -30023,7 +30023,7 @@ /obj/item/tool/wrench{ desc = "The lower jaw seems to keep jiggling..."; name = "loose wrench"; - toolspeed = 3 + tool_speed = 3 }, /turf/simulated/floor/plating, /area/maintenance/lowmedbaymaint) @@ -32406,7 +32406,7 @@ /obj/item/tool/prybar/red{ desc = "Haven't I seen this before?"; name = "old red crowbar"; - toolspeed = 3 + tool_speed = 3 }, /obj/machinery/light/small{ dir = 1 @@ -33503,7 +33503,7 @@ /obj/item/tool/wirecutters{ desc = "It gets jammed a lot."; name = "janky wirecutters"; - toolspeed = 2 + tool_speed = 2 }, /turf/simulated/floor/plating, /area/maintenance/lowmedbaymaint) @@ -39049,7 +39049,7 @@ /obj/item/weldingtool/mini{ desc = "It says 'keychain welder' on the side, but there's no bail to hook it on."; name = "keychain welder"; - toolspeed = 5 + tool_speed = 5 }, /turf/simulated/floor/plating, /area/maintenance/lower/trash_pit) diff --git a/citadel.dme b/citadel.dme index 5fc26828f86..775d889bad7 100644 --- a/citadel.dme +++ b/citadel.dme @@ -95,7 +95,6 @@ #include "code\__DEFINES\tgs.dm" #include "code\__DEFINES\tgui.dm" #include "code\__DEFINES\time.dm" -#include "code\__DEFINES\tools.dm" #include "code\__DEFINES\topic.dm" #include "code\__DEFINES\traits.dm" #include "code\__DEFINES\turfs.dm" @@ -126,7 +125,7 @@ #include "code\__DEFINES\color\color.dm" #include "code\__DEFINES\color\colour_priority.dm" #include "code\__DEFINES\color\lum.dm" -#include "code\__DEFINES\combat\clickcode.dm" +#include "code\__DEFINES\combat\atom_damage.dm" #include "code\__DEFINES\controllers\_subsystems.dm" #include "code\__DEFINES\controllers\dbcore.dm" #include "code\__DEFINES\controllers\overlays.dm" @@ -142,6 +141,7 @@ #include "code\__DEFINES\dcs\signals\signals_global.dm" #include "code\__DEFINES\dcs\signals\signals_object.dm" #include "code\__DEFINES\dcs\signals\signals_storage.dm" +#include "code\__DEFINES\dcs\signals\signals_tool_system.dm" #include "code\__DEFINES\dcs\signals\signals_turf.dm" #include "code\__DEFINES\dcs\signals\datums\signals_perspective.dm" #include "code\__DEFINES\dcs\signals\items\signals_inducer.dm" @@ -181,6 +181,7 @@ #include "code\__DEFINES\mobs\silicon_privileges.dm" #include "code\__DEFINES\power\power.dm" #include "code\__DEFINES\preferences\event_antag.dm" +#include "code\__DEFINES\procs\clickcode.dm" #include "code\__DEFINES\procs\do_after.dm" #include "code\__DEFINES\procs\drain_energy.dm" #include "code\__DEFINES\procs\update_icon.dm" @@ -201,6 +202,10 @@ #include "code\__DEFINES\sound\sound.dm" #include "code\__DEFINES\species\species.dm" #include "code\__DEFINES\species\species_flags.dm" +#include "code\__DEFINES\tools\balancing.dm" +#include "code\__DEFINES\tools\functionality.dm" +#include "code\__DEFINES\tools\misc.dm" +#include "code\__DEFINES\tools\procs.dm" #include "code\__DEFINES\turfs\change_turf.dm" #include "code\__DEFINES\turfs\turfmakers.dm" #include "code\__HELPERS\_core.dm" @@ -292,14 +297,18 @@ #include "code\_globalvars\lists\species.dm" #include "code\_js\byjax.dm" #include "code\_js\menus.dm" -#include "code\_onclick\adjacent.dm" +#include "code\_onclick\adjacency.dm" +#include "code\_onclick\adjacency_legacy.dm" #include "code\_onclick\ai.dm" #include "code\_onclick\click.dm" #include "code\_onclick\cyborg.dm" #include "code\_onclick\drag_drop.dm" #include "code\_onclick\item_attack.dm" +#include "code\_onclick\items.dm" +#include "code\_onclick\mobs.dm" #include "code\_onclick\observer.dm" #include "code\_onclick\other_mobs.dm" +#include "code\_onclick\reachability.dm" #include "code\_onclick\rig.dm" #include "code\_onclick\telekinesis.dm" #include "code\_onclick\hud\_defines.dm" @@ -453,7 +462,6 @@ #include "code\datums\hierarchy.dm" #include "code\datums\mind.dm" #include "code\datums\mixed.dm" -#include "code\datums\modules.dm" #include "code\datums\mutable_appearance.dm" #include "code\datums\perspective.dm" #include "code\datums\position_point_vector.dm" @@ -682,6 +690,12 @@ #include "code\game\area\Space Station 13 areas.dm" #include "code\game\area\ss13_deprecated_areas.dm" #include "code\game\area\Tether_areas.dm" +#include "code\game\atoms\atom_defense.dm" +#include "code\game\atoms\tool_system.dm" +#include "code\game\atoms\tool_system_items.dm" +#include "code\game\atoms\tool_system_multitool.dm" +#include "code\game\atoms\tool_system_wrappers.dm" +#include "code\game\atoms\tool_system_z_legacy.dm" #include "code\game\dna\dna2.dm" #include "code\game\dna\dna2_domutcheck.dm" #include "code\game\dna\dna2_helpers.dm" @@ -1125,12 +1139,12 @@ #include "code\game\mecha\working\ripley.dm" #include "code\game\mecha\working\ripley_vr.dm" #include "code\game\mecha\working\working.dm" +#include "code\game\objects\_items.dm" #include "code\game\objects\banners.dm" #include "code\game\objects\buckling.dm" #include "code\game\objects\empulse.dm" #include "code\game\objects\explosion.dm" #include "code\game\objects\explosion_recursive.dm" -#include "code\game\objects\items.dm" #include "code\game\objects\mob_spawner.dm" #include "code\game\objects\objs.dm" #include "code\game\objects\structures.dm" @@ -1309,6 +1323,13 @@ #include "code\game\objects\items\storage\toolbox.dm" #include "code\game\objects\items\storage\uplink_kits.dm" #include "code\game\objects\items\storage\wallets.dm" +#include "code\game\objects\items\tools\_tool.dm" +#include "code\game\objects\items\tools\crowbar.dm" +#include "code\game\objects\items\tools\screwdriver.dm" +#include "code\game\objects\items\tools\switchtool.dm" +#include "code\game\objects\items\tools\weldingtool.dm" +#include "code\game\objects\items\tools\wirecutters.dm" +#include "code\game\objects\items\tools\wrench.dm" #include "code\game\objects\items\weapons\AI_modules.dm" #include "code\game\objects\items\weapons\autopsy.dm" #include "code\game\objects\items\weapons\barrier_tape.dm" @@ -1426,12 +1447,6 @@ #include "code\game\objects\items\weapons\tanks\jetpack.dm" #include "code\game\objects\items\weapons\tanks\tank_types.dm" #include "code\game\objects\items\weapons\tanks\tanks.dm" -#include "code\game\objects\items\weapons\tools\crowbar.dm" -#include "code\game\objects\items\weapons\tools\holotool.dm" -#include "code\game\objects\items\weapons\tools\screwdriver.dm" -#include "code\game\objects\items\weapons\tools\weldingtool.dm" -#include "code\game\objects\items\weapons\tools\wirecutters.dm" -#include "code\game\objects\items\weapons\tools\wrench.dm" #include "code\game\objects\random\_random.dm" #include "code\game\objects\random\guns_and_ammo.dm" #include "code\game\objects\random\maintenance.dm" @@ -2665,6 +2680,7 @@ #include "code\modules\mining\ore_redemption_machine\equipment_vendor.dm" #include "code\modules\mining\ore_redemption_machine\mine_point_items.dm" #include "code\modules\mining\ore_redemption_machine\survey_vendor.dm" +#include "code\modules\mob\action_feedback.dm" #include "code\modules\mob\animations.dm" #include "code\modules\mob\death.dm" #include "code\modules\mob\emote.dm" diff --git a/code/__DEFINES/_flags/item_flags.dm b/code/__DEFINES/_flags/item_flags.dm index 5ff56899b0b..aef4de44d6a 100644 --- a/code/__DEFINES/_flags/item_flags.dm +++ b/code/__DEFINES/_flags/item_flags.dm @@ -28,6 +28,8 @@ #define IN_STORAGE (1<<14) /// we can't be caught when hitting a mob on throw #define ITEM_THROW_UNCATCHABLE (1<<15) +/// we cannot be used a tool on click, no matter what +#define ITEM_NO_TOOL_ATTACK (1<<16) DEFINE_BITFIELD(item_flags, list( BITFIELD(IN_INVENTORY), diff --git a/code/__DEFINES/_flags/obj_flags.dm b/code/__DEFINES/_flags/obj_flags.dm index 37eca89f455..3056bb2cf2f 100644 --- a/code/__DEFINES/_flags/obj_flags.dm +++ b/code/__DEFINES/_flags/obj_flags.dm @@ -33,6 +33,11 @@ #define SHOVABLE_ONTO (1<<13) /// Makes the Examine proc not read out this item. #define EXAMINE_SKIP (1<<14) / +*/ + +#define OBJ_PREVENT_CLICK_UNDER (1<<23) + +/* /// Integrity defines for clothing (not flags but close enough) /// We have no damage on the clothing #define CLOTHING_PRISTINE 0 @@ -51,4 +56,5 @@ DEFINE_BITFIELD(obj_flags, list( BITFIELD(EMAGGED), BITFIELD(CAN_BE_HIT), BITFIELD(ON_BLUEPRINTS), + BITFIELD(OBJ_PREVENT_CLICK_UNDER), )) diff --git a/code/__DEFINES/combat/atom_damage.dm b/code/__DEFINES/combat/atom_damage.dm new file mode 100644 index 00000000000..5dd16daa4db --- /dev/null +++ b/code/__DEFINES/combat/atom_damage.dm @@ -0,0 +1,11 @@ +//! Atom destruction types, used in /deconstruct() and its derived/child/called functions. +/// Atom was neatly deconstructed +#define ATOM_DECONSTRUCT_DISASSEMBLED 0 +/// Atom received excess kinetic energy, usually through weaponry +#define ATOM_DECONSTRUCT_DESTROYED 1 +/// Atom was the victim of a corrosive or caustic chemical +#define ATOM_DECONSTRUCT_ACID 2 +/// Atom was put out of commission by an unexpected thermal event +#define ATOM_DECONSTRUCT_FIRE 3 + + diff --git a/code/__DEFINES/combat/clickcode.dm b/code/__DEFINES/combat/clickcode.dm deleted file mode 100644 index 74214b7318d..00000000000 --- a/code/__DEFINES/combat/clickcode.dm +++ /dev/null @@ -1,18 +0,0 @@ -/** - * flags passed around click procs including: - * ClickOn - * tool_act - * attempt_dynamic_tool - * melee_attack_chain - * attackby - * pre_attack - * afterattack - * MouseDrop - * OnMouseDrop - * MouseDroppedOn - */ - -/// stop the click chain from proceeding past this point -#define CLICKCHAIN_DO_NOT_PROPAGATE (1<<0) - -// TODO: roll proximity flags into this oh god oh fuck 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 61fa885ac3b..62b93db1624 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm @@ -61,10 +61,6 @@ ////#define COMSIG_ATOM_CONTENTS_DEL "atom_contents_del" /// From base of atom/has_gravity(): (turf/location, list/forced_gravities) ////#define COMSIG_ATOM_HAS_GRAVITY "atom_has_gravity" -/// From internal loop in atom/movable/proc/CanReach(): (list/next) -////#define COMSIG_ATOM_CANREACH "atom_can_reach" - ////#define COMPONENT_ALLOW_REACH (1<<0) - ////#define COMPONENT_BLOCK_REACH (1<<1) /// For when an atom has been created through processing (atom/original_atom, list/chosen_processing_option) ////#define COMSIG_ATOM_CREATEDBY_PROCESSING "atom_createdby_processing" /// When an atom is processed (mob/living/user, obj/item/I, list/atom/results) diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm index 12d79830e7f..2630f05d6ee 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm @@ -37,32 +37,6 @@ ////#define COMSIG_ATOM_BSA_BEAM "atom_bsa_beam_pass" ////#define COMSIG_ATOM_BLOCKS_BSA_BEAM (1<<0) -//! ## Tool Act Signals -/// For any tool behaviors: (mob/living/user, obj/item/I, list/recipes) -////#define COMSIG_ATOM_TOOL_ACT(tooltype) "tool_act_[tooltype]" - ////#define COMPONENT_BLOCK_TOOL_ATTACK (1<<0) -/// For any rightclick tool behaviors: (mob/living/user, obj/item/I) -////#define COMSIG_ATOM_SECONDARY_TOOL_ACT(tooltype) "tool_secondary_act_[tooltype]" - //? We have the same returns here as COMSIG_ATOM_TOOL_ACT - ////#define COMPONENT_BLOCK_TOOL_ATTACK (1<<0) - -//TODO: Convert to above system. -//! ## Legacy Tool Act Signals -/// From base of atom/screwdriver_act(): (mob/living/user, obj/item/I) -#define COMSIG_ATOM_SCREWDRIVER_ACT "atom_screwdriver_act" -/// From base of atom/wrench_act(): (mob/living/user, obj/item/I) -#define COMSIG_ATOM_WRENCH_ACT "atom_wrench_act" -/// From base of atom/multitool_act(): (mob/living/user, obj/item/I) -#define COMSIG_ATOM_MULTITOOL_ACT "atom_multitool_act" -/// From base of atom/welder_act(): (mob/living/user, obj/item/I) -#define COMSIG_ATOM_WELDER_ACT "atom_welder_act" -/// From base of atom/wirecutter_act(): (mob/living/user, obj/item/I) -#define COMSIG_ATOM_WIRECUTTER_ACT "atom_wirecutter_act" -/// From base of atom/crowbar_act(): (mob/living/user, obj/item/I) -#define COMSIG_ATOM_CROWBAR_ACT "atom_crowbar_act" -/// From base of atom/analyser_act(): (mob/living/user, obj/item/I) -#define COMSIG_ATOM_ANALYSER_ACT "atom_analyser_act" - #define COMPONENT_BLOCK_TOOL_ATTACK (1<<0) /// Called when teleporting into a protected turf: (channel, turf/origin) #define COMSIG_ATOM_INTERCEPT_TELEPORT "intercept_teleport" #define COMPONENT_BLOCK_TELEPORT (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_tool_system.dm b/code/__DEFINES/dcs/signals/signals_tool_system.dm new file mode 100644 index 00000000000..24163dae2d1 --- /dev/null +++ b/code/__DEFINES/dcs/signals/signals_tool_system.dm @@ -0,0 +1,2 @@ +/// from base of _tool_act: (I, user, function, flags, hint) where I = item, user = user, function = tool behaviour, flags = tool operation flags, hint = set by dynamic tool system +#define COMSIG_ATOM_TOOL_ACT "tool_act" diff --git a/code/__DEFINES/logging.dm b/code/__DEFINES/logging.dm index 70fb84e5890..df0069c0abe 100644 --- a/code/__DEFINES/logging.dm +++ b/code/__DEFINES/logging.dm @@ -1,15 +1,15 @@ // helpers /// sets up a simple log. only use this for dumber logs that don't need any special logic. -#define SIMPLE_LOG_BOILERPLATE(type) \ -/world/_setup_logs_boilerplate(){ \ - GLOB.##type_log = "[GLOB.log_directory]/[#type].log"; \ - start_log(GLOB.##type_log); \ -} \ -/proc/log_##type(text){ \ - WRITE_LOG(GLOB.##type_log, text); \ -} \ -GLOBAL_PROTECT(##type_log); \ -GLOBAL_VAR(##type_log); +#define SIMPLE_LOG_BOILERPLATE(gvar, name) \ +/world/_setup_logs_boilerplate(){ \ + GLOB.##gvar = "[GLOB.log_directory]/[#name].log"; \ + start_log(GLOB.##gvar); \ +} \ +/proc/log_##name(text){ \ + WRITE_LOG(GLOB.##gvar, text); \ +} \ +GLOBAL_PROTECT(##gvar); \ +GLOBAL_VAR(##gvar); //Investigate logging defines #define INVESTIGATE_ATMOS "atmos" diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index fc88b4d6c4c..67046e5f110 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -90,7 +90,6 @@ Will print: "/mob/living/carbon/human/death" (you can optionally embed it in a s #define SHELTER_DEPLOY_BAD_AREA "bad area" #define SHELTER_DEPLOY_ANCHORED_OBJECTS "anchored objects" - // Setting this much higher than 1024 could allow spammers to DOS the server easily. /// I'm not sure about "easily". It can be a lot longer. #define MAX_MESSAGE_LEN 4096 @@ -561,3 +560,13 @@ GLOBAL_LIST_EMPTY(##LIST_NAME);\ "purple" = "darkslateblue", \ "pink" = "lightgrey" \ ) + +//! Window construction stages +/// window construction isn't started at all +#define WINDOW_STATE_UNSECURED 0 +/// frame is screwed to floor +#define WINDOW_STATE_SCREWED_TO_FLOOR 1 +/// window is crowbarred in +#define WINDOW_STATE_CROWBRARED_IN 2 +/// window is secured to frame +#define WINDOW_STATE_SECURED_TO_FRAME 3 diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 3ab7e9646ae..80cba5abdbb 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -319,4 +319,3 @@ #define EXAMINE_MORE_TIME 1 SECONDS #define SLEEP_CHECK_DEATH(X) sleep(X); if(QDELETED(src) || stat == DEAD) return; -#define INTERACTING_WITH(X, Y) (Y in X.do_afters) diff --git a/code/__DEFINES/procs/clickcode.dm b/code/__DEFINES/procs/clickcode.dm new file mode 100644 index 00000000000..2f2a5343f59 --- /dev/null +++ b/code/__DEFINES/procs/clickcode.dm @@ -0,0 +1,26 @@ +//! Clickchain Flags +/** + * flags passed around click procs including: + * ClickOn + * melee_attack_chain + * ranged_attack_chain + * attackby + * pre_attack + * afterattack + * MouseDrop + * OnMouseDrop + * MouseDroppedOn + */ + +/// stop the click chain from proceeding past this point +#define CLICKCHAIN_DO_NOT_PROPAGATE (1<<0) +/// person can reach us normally +#define CLICKCHAIN_HAS_PROXIMITY (1<<1) +/// in tool act - used to check if we should do default proximity checks when none are specified +#define CLICKCHAIN_TOOL_ACT (1<<2) +/// redirected by something - like when a switchtool to another item +#define CLICKCHAIN_REDIRECTED (1<<3) + +//! Reachability Depths - checked from level of DirectAccess and turf adjacency. +/// default reachability depth +#define DEFAULT_REACHABILITY_DEPTH 3 // enough to reach into pill bottles in box in backpack diff --git a/code/__DEFINES/procs/do_after.dm b/code/__DEFINES/procs/do_after.dm index 26802736cf6..86096a168bb 100644 --- a/code/__DEFINES/procs/do_after.dm +++ b/code/__DEFINES/procs/do_after.dm @@ -30,3 +30,18 @@ #define DO_AFTER_PROGRESSING 2 /// Stage - Last check of a do_after #define DO_AFTER_FINISHING 3 + +//! Interaction Checks +#define INTERACTING_WITH(M, A) M.interacting_with?[A] +#define INTERACTING_WITH_FOR(M, A, T) (M.interacting_with?[A]?[T]) +#define START_INTERACTING_WITH(M, A, T) do {if(!M.interacting_with){M.interacting_with = list();}; var/list/_L = M.interacting_with; if(!_L[A]){_L[A] = list()}; ++_L[A][T]; if(!A.interacting_mobs){A.interacting_mobs = list()}; ++A.interacting_mobs[M];} while(FALSE); +#define STOP_INTERACTING_WITH(M, A, T) do {if(M.interacting_with?[A]?[T]){--M.interacting_with[A][T]; if(M.interacting_with[A][T] <= 0){M.interacting_with[A] -= T}; if(!length(M.interacting_with[A])){M.interacting_with -= A};}; if(!length(M.interacting_with)){M.interacting_with = null}; if(A.interacting_mobs){--A.interacting_mobs[M]; if(A.interacting_mobs[M] <= 0){A.interacting_mobs -= M};}; if(!length(A.interacting_mobs)){A.interacting_mobs = null};} while(FALSE); +#define INTERRUPT_INTERACTION(M, A) M.interacting_with?.Remove(A) +#define INTERRUPT_INTERACTION_FOR(M, A, T) M.interacting_with?[A]?.Remove(T) +#define IS_INTERACTING_WITH_SOMETHING(M) !!length(M.interacting_with) + +//! Interactiong Types +/// Generic do after +#define INTERACTING_FOR_DO_AFTER "do_after" +/// Dynaimc tool usage in progress +#define INTERACTING_FOR_DYNAMIC_TOOL "dynamic_tools" diff --git a/code/__DEFINES/text.dm b/code/__DEFINES/text.dm index eb92ce7ee13..4b67fe8d9cd 100644 --- a/code/__DEFINES/text.dm +++ b/code/__DEFINES/text.dm @@ -2,11 +2,6 @@ /// Does 4 spaces. Used as a makeshift tabulator. #define FOURSPACES "    " -/// Prepares a text to be used for maptext. Use this so it doesn't look hideous. -#define MAPTEXT(text) {"[##text]"} - -/// Macro from Lummox used to get height from a MeasureText proc -#define WXH_TO_HEIGHT(x) text2num(copytext(x, findtextEx(x, "x") + 1)) */ /// Removes characters incompatible with file names. #define SANITIZE_FILENAME(text) (GLOB.filename_forbidden_chars.Replace(text, "")) @@ -61,3 +56,11 @@ /// File location for cult shuttle curse descriptions #define CULT_SHUTTLE_CURSE "cult_shuttle_curse.json" */ + +//! Maptext +/// Prepares a text to be used for maptext. Use this so it doesn't look hideous. +#define MAPTEXT(text) {"[##text]"} +/// Prepares a text to be used for maptext. Use this so it doesn't look hideous. +#define MAPTEXT_CENTER(text) {"[##text]"} +/// Macro from Lummox used to get height from a MeasureText proc +#define WXH_TO_HEIGHT(x) text2num(copytext(x, findtextEx(x, "x") + 1)) diff --git a/code/__DEFINES/tools.dm b/code/__DEFINES/tools.dm deleted file mode 100644 index a472e83795d..00000000000 --- a/code/__DEFINES/tools.dm +++ /dev/null @@ -1,24 +0,0 @@ -// Tool types -#define TOOL_CROWBAR "crowbar" -#define TOOL_MULTITOOL "multitool" -#define TOOL_SCREWDRIVER "screwdriver" -#define TOOL_WIRECUTTER "wirecutter" -#define TOOL_WRENCH "wrench" -#define TOOL_WELDER "welder" -#define TOOL_ANALYZER "analyzer" -#define TOOL_MINING "mining" -#define TOOL_SHOVEL "shovel" -#define TOOL_RETRACTOR "retractor" -#define TOOL_HEMOSTAT "hemostat" -#define TOOL_CAUTERY "cautery" -#define TOOL_DRILL "drill" -#define TOOL_SCALPEL "scalpel" -#define TOOL_SAW "saw" -//Glasswork Tools -#define TOOL_BLOW "blowing_rod" -#define TOOL_GLASS_CUT "glasskit" -#define TOOL_BONESET "bonesetter" - -// If delay between the start and the end of tool operation is less than MIN_TOOL_SOUND_DELAY, -// tool sound is only played when op is started. If not, it's played twice. -#define MIN_TOOL_SOUND_DELAY 20 diff --git a/code/__DEFINES/tools/balancing.dm b/code/__DEFINES/tools/balancing.dm new file mode 100644 index 00000000000..b2a9cdb61bd --- /dev/null +++ b/code/__DEFINES/tools/balancing.dm @@ -0,0 +1,11 @@ +//! Tool qualities - MUST BE > 0! +/// Default +#define TOOL_QUALITY_DEFAULT 20 + +//! Tool speeds +/// Default +#define TOOL_SPEED_DEFAULT 1 + +//! Tool costs +/// default cost of welding fuel per decisecond welded +#define TOOL_WELDING_FUEL_PER_DS 0.5 diff --git a/code/__DEFINES/tools/functionality.dm b/code/__DEFINES/tools/functionality.dm new file mode 100644 index 00000000000..d8d4be0f056 --- /dev/null +++ b/code/__DEFINES/tools/functionality.dm @@ -0,0 +1,57 @@ +//! Tool Behaviours - make these human readable! + +//? Engineering +#define TOOL_CROWBAR "crowbar" +#define TOOL_MULTITOOL "multitool" +#define TOOL_SCREWDRIVER "screwdriver" +#define TOOL_WIRECUTTER "wirecutter" +#define TOOL_WRENCH "wrench" +#define TOOL_WELDER "welder" +#define TOOL_ANALYZER "analyzer" +//? Mining +#define TOOL_MINING "mining" +#define TOOL_SHOVEL "shovel" +//? Surgery +#define TOOL_RETRACTOR "retractor" +#define TOOL_HEMOSTAT "hemostat" +#define TOOL_CAUTERY "cautery" +#define TOOL_DRILL "drill" +#define TOOL_SCALPEL "scalpel" +#define TOOL_SAW "saw" +//? Glassworking +#define TOOL_BLOW "blowing_rod" +#define TOOL_GLASS_CUT "glasskit" +#define TOOL_BONESET "bonesetter" + +/// Yes, this is a real global. No, you shouldn't touch this for no reason. +/// Add tools to this when they get states in the default icon file for: +/// - neutral (no append) +/// - forwards (append _up) +/// - backwards (append _down) +GLOBAL_REAL_VAR(_dyntool_image_states) = list( + null = "unknown", + TOOL_CROWBAR = "crowbar", + TOOL_SCREWDRIVER = "screwdriver" +) + +//! Tool usage flags + +//? None yet! Waiting on skill-system design. + +//! Tool hints - make these human readable! + +#define TOOL_HINT_UNSCREWING_WINDOW_FRAME "unsecure frame" +#define TOOL_HINT_SCREWING_WINDOW_FRAME "secure frame" +#define TOOL_HINT_UNSCREWING_WINDOW_PANE "unfasten pane" +#define TOOL_HINT_SCREWING_WINDOW_PANE "fasten pane" +#define TOOL_HINT_CROWBAR_WINDOW_IN "pane in" +#define TOOL_HINT_CROWBAR_WINDOW_OUT "pane out" +#define TOOL_HINT_WRENCH_WINDOW_DISASSEMBLY "dismantle" + +//! tool_locked var +/// unlocked - use dynamic tool system +#define TOOL_LOCKING_DYNAMIC 1 +/// use static behavior +#define TOOL_LOCKING_STATIC 2 +/// automatically, if we only have one dynamic behavior, use that +#define TOOL_LOCKING_AUTO 3 diff --git a/code/__DEFINES/tools/misc.dm b/code/__DEFINES/tools/misc.dm new file mode 100644 index 00000000000..de37d2842b8 --- /dev/null +++ b/code/__DEFINES/tools/misc.dm @@ -0,0 +1,21 @@ +//! switchtool tool types; separate from tool functionality + +#define SWITCHTOOL_SCREWDRIVER "screwdriver" +#define SWITCHTOOL_WRENCH "wrench" +#define SWITCHTOOL_CROWBAR "crowbar" +#define SWITCHTOOL_WIRECUTTERS "wirecutters" +#define SWITCHTOOL_MULTITOOL "multitool" +#define SWITCHTOOL_WELDER "welder" + +#define SWITCHTOOL_SCALPEL "scalpel" +#define SWITCHTOOL_CAUTERY "cautery" +#define SWITCHTOOL_HEMOSTAT "hemostat" +#define SWITCHTOOL_RETRACTOR "retractor" +#define SWITCHTOOL_BONECLAMP "boneclamp" +#define SWITCHTOOL_SAW "saw" +#define SWITCHTOOL_DRILL "drill" + +#define SWITCHTOOL_LIGHT "light" +#define SWITCHTOOL_SOAP "soap" +#define SWITCHTOOL_SHIELD "shield" +#define SWITCHTOOL_SWORD "sword" diff --git a/code/__DEFINES/tools/procs.dm b/code/__DEFINES/tools/procs.dm new file mode 100644 index 00000000000..0e7cb014d7c --- /dev/null +++ b/code/__DEFINES/tools/procs.dm @@ -0,0 +1,26 @@ +//! Tool usage flags +/// do not make message +#define TOOL_OP_NO_MESSAGE (1<<0) +/// do not make audio +#define TOOL_OP_NO_AUDIO (1<<1) +/// do not make standard message +#define TOOL_OP_NO_STANDARD_MESSAGE (1<<2) +/// do not make standard audio +#define TOOL_OP_NO_STANDARD_AUDIO (1<<3) +/// bypass delay +#define TOOL_OP_INSTANT (1<<4) +/// initiated through dynamic tool system +#define TOOL_OP_DYNAMIC (1<<5) +/// initiated through auto-use-tool system +#define TOOL_OP_AUTOPILOT (1<<6) +/// actually doing it as opposed to a check; feel free to do user feedback +#define TOOL_OP_REAL (1<<7) +/// silent - do not give audible or visual feedbcak +#define TOOL_OP_SILENT (TOOL_OP_NO_AUDIO | TOOL_OP_NO_MESSAGE) +/// do not do standard feedback +#define TOOL_OP_NO_STANDARD_FEEDBACK (TOOL_OP_NO_STANDARD_MESSAGE | TOOL_OP_NO_STANDARD_AUDIO) + +//! Misc +// If delay between the start and the end of tool operation is less than MIN_TOOL_SOUND_DELAY, +// tool sound is only played when op is started. If not, it's played twice. +#define MIN_TOOL_SOUND_DELAY 20 diff --git a/code/__HELPERS/do_after.dm b/code/__HELPERS/do_after.dm index 25fcf72dafb..4abf45aa185 100644 --- a/code/__HELPERS/do_after.dm +++ b/code/__HELPERS/do_after.dm @@ -6,8 +6,7 @@ var/user_loc = user.loc var/target_loc = target.loc - LAZYADD(user.do_afters, target) - LAZYADD(target.targeted_by, user) + START_INTERACTING_WITH(user, target, INTERACTING_FOR_DO_AFTER) var/holding = user.get_active_held_item() var/datum/progressbar/progbar @@ -27,11 +26,7 @@ if(uninterruptible) continue - if(!(target in user.do_afters)) - . = FALSE - break - - if(!(target in user.do_afters)) + if(!INTERACTING_WITH_FOR(user, target, INTERACTING_FOR_DO_AFTER)) . = FALSE break @@ -58,9 +53,7 @@ if(!QDELETED(progbar)) qdel(progbar) - if(!QDELETED(target)) - LAZYREMOVE(user.do_afters, target) - LAZYREMOVE(target.targeted_by, user) + STOP_INTERACTING_WITH(user, target, INTERACTING_FOR_DO_AFTER) /proc/do_after(mob/user, delay, atom/target = null, needhand = TRUE, progress = TRUE, incapacitation_flags = INCAPACITATION_DEFAULT, ignore_movement = FALSE, max_distance = null, ignore_resist = FALSE) if(!user) @@ -70,10 +63,7 @@ var/atom/target_loc = null if(target) target_loc = target.loc - - if(target) - LAZYADD(user.do_afters, target) - LAZYADD(target.targeted_by, user) + START_INTERACTING_WITH(user, target, INTERACTING_FOR_DO_AFTER) var/atom/original_loc = user.loc @@ -118,7 +108,7 @@ . = FALSE break - if(target && !(target in user.do_afters)) + if(target && !INTERACTING_WITH_FOR(user, target, INTERACTING_FOR_DO_AFTER)) . = FALSE break @@ -134,6 +124,4 @@ if(!QDELETED(progbar)) qdel(progbar) - if(!QDELETED(target)) - LAZYREMOVE(user.do_afters, target) - LAZYREMOVE(target.targeted_by, user) + STOP_INTERACTING_WITH(user, target, INTERACTING_FOR_DO_AFTER) diff --git a/code/_globalvars/logging.dm b/code/_globalvars/logging.dm index 6988c15e6f1..b1f043ed3c8 100644 --- a/code/_globalvars/logging.dm +++ b/code/_globalvars/logging.dm @@ -36,7 +36,8 @@ GLOBAL_PROTECT(subsystem_log) GLOBAL_VAR(tgui_log) GLOBAL_PROTECT(tgui_log) -SIMPLE_LOG_BOILERPLATE(inventory) +SIMPLE_LOG_BOILERPLATE(inventory_log, inventory) +SIMPLE_LOG_BOILERPLATE(click_log, click) /// Picture logging GLOBAL_VAR(picture_log_directory) diff --git a/code/_globalvars/sensitive.dm b/code/_globalvars/sensitive.dm index 8de09f4f3a0..7ab67d08eed 100644 --- a/code/_globalvars/sensitive.dm +++ b/code/_globalvars/sensitive.dm @@ -1,11 +1,2 @@ -// MySQL configuration -GLOBAL_REAL_VAR(sqladdress) = "localhost" -GLOBAL_REAL_VAR(sqlport) = "3306" -GLOBAL_REAL_VAR(sqldb) = "tgstation" -GLOBAL_REAL_VAR(sqllogin) = "root" -GLOBAL_REAL_VAR(sqlpass) = "" -// Feedback gathering sql connection -GLOBAL_REAL_VAR(sqlfdbkdb) = "test" -GLOBAL_REAL_VAR(sqlfdbklogin) = "root" -GLOBAL_REAL_VAR(sqlfdbkpass) = "" -GLOBAL_REAL_VAR(sqllogging) = 0 // Should we log deaths, population stats, etc.? +// currently empty because nothing needs it +// put stuff that shouldn't be fucked with or read by admins in here diff --git a/code/_onclick/adjacency.dm b/code/_onclick/adjacency.dm new file mode 100644 index 00000000000..a1630fa75c7 --- /dev/null +++ b/code/_onclick/adjacency.dm @@ -0,0 +1,105 @@ +//! Adjacency System + +/** + * checks simple adjacency, aka "are we semantically next to something and can reach them" + * This will not automatically get turf if you're nested in something else, e.g. in a closet! + * + * **DO NOT** default recursion to on. + * + * @params + * - neighbor - what we're trying to reach + * - recurse - levels we're allowed to recurse up if we're not on a turf + */ +/atom/proc/Adjacent(atom/neighbor, recurse) + return FALSE + +/area/Adjacent(atom/neighbor, recurse) + CRASH("Call to /area/Adjacent; this is wrong.") + +/atom/movable/Adjacent(atom/neighbor, recurse) + if(neighbor == loc) + return TRUE + var/turf/T = loc + if(!istype(T)) + if(recurse) + return loc? loc.Adjacent(neighbor, recurse - 1) : FALSE + return FALSE + for(T in locs) + if(T.TurfAdjacency(get_turf(neighbor), neighbor, src)) + return TRUE + return FALSE + +/turf/Adjacent(atom/neighbor, recurse) + return TurfAdjacency(get_turf(neighbor), neighbor, null) + +/** + * Turf adjacency + * + * - Always true if you're in the same turf + * - If you're vertically/horizontally adjacent, ensure there's no border obects + * - If you're diagonally adjacent, ensure you can pass to it with mutually adjacent squares + */ +/turf/proc/TurfAdjacency(turf/neighbor_turf, atom/target, atom/movable/mover) + if(neighbor_turf == src) + return TRUE + if(get_dist(src, neighbor_turf) > 1 || z != neighbor_turf.z) + return FALSE + // non diagonal + if(neighbor_turf.x == x || neighbor_turf.y == y) + return ClickCross(get_dir(src, neighbor_turf), TRUE, target, mover) && neighbor_turf.ClickCross(get_dir(neighbor_turf, src), TRUE, target, mover) + + // diagonal + var/reverse_dir = get_dir(neighbor_turf, src) + var/d1 = NSCOMPONENT(reverse_dir) + var/d2 = EWCOMPONENT(reverse_dir) + var/turf/checking + + // because byond's parser is awful and doesn't let us skip lines on ifs with comments after '\'s, + // we're going to comment above: + // criteria in order for both are: + // - not dense + // - could leave target + // - could go from diagonal to self + // - could go from diagonal to target + // - could leave self + checking = get_step(neighbor_turf, d1) + if(!checking.density && \ + neighbor_turf.ClickCross(d1, TRUE, target, mover) && \ + checking.ClickCross(d2, FALSE, target, mover) && \ + checking.ClickCross(turn(d1, 180), FALSE, target, mover) && \ + ClickCross(turn(d2, 180), TRUE, target, mover)) + return TRUE + checking = get_step(neighbor_turf, d2) + if(!checking.density && \ + neighbor_turf.ClickCross(d2, TRUE, target, mover) && \ + checking.ClickCross(d1, FALSE, target, mover) && \ + checking.ClickCross(turn(d2, 180), FALSE, target, mover) && \ + ClickCross(turn(d1, 180), TRUE, target, mover)) + return TRUE + return FALSE + +/** + * Checks if there's uninterrupted airspace from this turf to another + * + * Interrputions: + * Dense objects without ATOM_PASS_CLICK + */ +/turf/proc/ClickCross(d, border_only, atom/target, atom/movable/mover) + var/turf/going_to = get_step(src, d) + if(border_only) + for(var/obj/O in src) + if(!(O.flags & ON_BORDER)) + continue + if(O == target || O == mover || (O.pass_flags_self & ATOM_PASS_CLICK)) + continue + if(mover? O.CheckExit(mover, going_to) : !O.density) + continue + return FALSE + else + for(var/obj/O in src) + if(O == target || O == mover || (O.pass_flags_self & ATOM_PASS_CLICK)) + continue + if(mover? O.CanPass(mover, src) : !O.density) + continue + return FALSE + return TRUE diff --git a/code/_onclick/adjacency_legacy.dm b/code/_onclick/adjacency_legacy.dm new file mode 100644 index 00000000000..63d7b147ed8 --- /dev/null +++ b/code/_onclick/adjacency_legacy.dm @@ -0,0 +1,15 @@ +//! random stuff that still needs rethinking +/* +Quick adjacency (to turf): +* If you are in the same turf, always true +* If you are not adjacent, then false +*/ +/turf/proc/AdjacentQuick(var/atom/neighbor, var/atom/target = null) + var/turf/T0 = get_turf(neighbor) + if(T0 == src) + return 1 + + if(get_dist(src,T0) > 1) + return 0 + + return 1 diff --git a/code/_onclick/adjacent.dm b/code/_onclick/adjacent.dm deleted file mode 100644 index 23836249333..00000000000 --- a/code/_onclick/adjacent.dm +++ /dev/null @@ -1,145 +0,0 @@ -/* - Adjacency proc for determining touch range - - This is mostly to determine if a user can enter a square for the purposes of touching something. - Examples include reaching a square diagonally or reaching something on the other side of a glass window. - - This is calculated by looking for border items, or in the case of clicking diagonally from yourself, dense items. - This proc will NOT notice if you are trying to attack a window on the other side of a dense object in its turf. There is a window helper for that. - - Note that in all cases the neighbor is handled simply; this is usually the user's mob, in which case it is up to you - to check that the mob is not inside of something -*/ -/atom/proc/Adjacent(var/atom/neighbor) // basic inheritance, unused - return 0 - -// Not a sane use of the function and (for now) indicative of an error elsewhere -/area/Adjacent(var/atom/neighbor) - CRASH("Call to /area/Adjacent(), unimplemented proc") - - -/* - Adjacency (to turf): - * If you are in the same turf, always true - * If you are vertically/horizontally adjacent, ensure there are no border objects - * If you are diagonally adjacent, ensure you can pass through at least one of the mutually adjacent square. - * Passing through in this case ignores anything with the throwpass flag, such as tables, racks, and morgue trays. -*/ -/turf/Adjacent(var/atom/neighbor, var/atom/target = null) - var/turf/T0 = get_turf(neighbor) - if(T0 == src) - return 1 - if(get_dist(src,T0) > 1) - return 0 - if(T0.z != z) - return 0 - if(T0.x == x || T0.y == y) - // Check for border blockages - return T0.ClickCross(get_dir(T0,src), border_only = 1) && src.ClickCross(get_dir(src,T0), border_only = 1, target_atom = target) - - // Not orthagonal - var/in_dir = get_dir(neighbor,src) // eg. northwest (1+8) - var/d1 = in_dir&(in_dir-1) // eg west (1+8)&(8) = 8 - var/d2 = in_dir - d1 // eg north (1+8) - 8 = 1 - - for(var/d in list(d1,d2)) - if(!T0.ClickCross(d, border_only = 1)) - continue // could not leave T0 in that direction - - var/turf/T1 = get_step(T0,d) - if(!T1 || T1.density || !T1.ClickCross(get_dir(T1,T0) | get_dir(T1,src), border_only = 0)) - continue // couldn't enter or couldn't leave T1 - - if(!src.ClickCross(get_dir(src,T1), border_only = 1, target_atom = target)) - continue // could not enter src - - return 1 // we don't care about our own density - return 0 - -/* -Quick adjacency (to turf): -* If you are in the same turf, always true -* If you are not adjacent, then false -*/ -/turf/proc/AdjacentQuick(var/atom/neighbor, var/atom/target = null) - var/turf/T0 = get_turf(neighbor) - if(T0 == src) - return 1 - - if(get_dist(src,T0) > 1) - return 0 - - return 1 - -/* - Adjacency (to anything else): - * Must be on a turf - * In the case of a multiple-tile object, all valid locations are checked for adjacency. - - Note: Multiple-tile objects are created when the bound_width and bound_height are creater than the tile size. - This is not used in stock /tg/station currently. -*/ -/atom/movable/Adjacent(var/atom/neighbor) - if(neighbor == loc) return 1 - if(!isturf(loc)) return 0 - for(var/turf/T in locs) - if(isnull(T)) continue - if(T.Adjacent(neighbor,src)) return 1 - return 0 - -// This is necessary for storage items not on your person. -/obj/item/Adjacent(var/atom/neighbor, var/recurse = 1) - if(neighbor == loc) return 1 - if(istype(loc,/obj/item)) - if(recurse > 0) - return loc.Adjacent(neighbor,recurse - 1) - return 0 - return ..() -/* - Special case: This allows you to reach a door when it is visally on top of, - but technically behind, a fire door - - You could try to rewrite this to be faster, but I'm not sure anything would be. - This can be safely removed if border firedoors are ever moved to be on top of doors - so they can be interacted with without opening the door. -*/ -/obj/machinery/door/Adjacent(var/atom/neighbor) - var/obj/machinery/door/firedoor/border_only/BOD = locate() in loc - if(BOD && !(BOD.pass_flags_self & ATOM_PASS_CLICK)) - BOD.pass_flags_self |= ATOM_PASS_CLICK // allow click to pass - . = ..() - BOD.pass_flags_self &= ATOM_PASS_CLICK - return . - return ..() - - -/* - This checks if you there is uninterrupted airspace between that turf and this one. - This is defined as any dense ON_BORDER object, or any dense object without throwpass. - The border_only flag allows you to not objects (for source and destination squares) -*/ -/turf/proc/ClickCross(var/target_dir, var/border_only, var/target_atom = null) - for(var/obj/O in src) - if( !O.density || O == target_atom || (O.pass_flags_self & ATOM_PASS_CLICK)) continue // throwpass is used for anything you can click through - - if( O.flags&ON_BORDER) // windows have throwpass but are on border, check them first - if( O.dir & target_dir || O.dir&(O.dir-1) ) // full tile windows are just diagonals mechanically - var/obj/structure/window/W = target_atom - if(istype(W)) - if(!W.is_fulltile()) //exception for breaking full tile windows on top of single pane windows - return 0 - else - return 0 - - else if( !border_only ) // dense, not on border, cannot pass over - return 0 - return 1 -/* - Aside: throwpass does not do what I thought it did originally, and is only used for checking whether or not - a thrown object should stop after already successfully entering a square. Currently the throw code involved - only seems to affect hitting mobs, because the checks performed against objects are already performed when - entering or leaving the square. Since throwpass isn't used on mobs, but only on objects, it is effectively - useless. Throwpass may later need to be removed and replaced with a passcheck (bitfield on movable atom passflags). - - Since I don't want to complicate the click code rework by messing with unrelated systems it won't be changed here. -*/ diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index fd482ea7418..833f075cc67 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -51,30 +51,34 @@ /mob/proc/ClickOn(var/atom/A, var/params) if(world.time < next_click) // Hard check, before anything else, to avoid crashing return - next_click = world.time + 1 if(client.buildmode) build_click(src, client.buildmode, params, A) return - var/list/modifiers = params2list(params) - if(modifiers["shift"] && modifiers["ctrl"]) + // params are sent as a list directly to item procs + // because WHY + // would you do the work of list-allocing and unpacking and then send a + // packed version things have to unpack a second or even third time + // because they can't check the test version??? + var/list/unpacked_params = params2list(params) + if(unpacked_params["shift"] && unpacked_params["ctrl"]) CtrlShiftClickOn(A) return 1 - if(modifiers["shift"] && modifiers["middle"]) + if(unpacked_params["shift"] && unpacked_params["middle"]) ShiftMiddleClickOn(A) return 1 - if(modifiers["middle"]) + if(unpacked_params["middle"]) MiddleClickOn(A) return 1 - if(modifiers["shift"]) + if(unpacked_params["shift"]) ShiftClickOn(A) return 0 - if(modifiers["alt"]) // alt and alt-gr (rightalt) + if(unpacked_params["alt"]) // alt and alt-gr (rightalt) AltClickOn(A) return 1 - if(modifiers["ctrl"]) + if(unpacked_params["ctrl"]) CtrlClickOn(A) return 1 @@ -105,69 +109,38 @@ return 1 throw_mode_off() - var/obj/item/W = get_active_held_item() + //? Grab click semantics + var/obj/item/I = get_active_held_item() - if(W == A) // Handle attack_self - W.attack_self(src) + //? Handle special cases + if(I == A) + // attack_self + I.attack_self(src) + // todo: refactor trigger_aiming(TARGET_CAN_CLICK) - update_inv_active_hand(0) - return 1 - - //Atoms on your person - // A is your location but is not a turf; or is on you (backpack); or is on something on you (box in backpack); sdepth is needed here because contents depth does not equate inventory storage depth. - var/sdepth = A.storage_depth(src) - if((!isturf(A) && A == loc) || (sdepth <= MAX_STORAGE_REACH)) - if(W) - var/resolved = W.resolve_attackby(A, src, params) - if(!resolved && A && W) - W.afterattack(A, src, 1, params) // 1 indicates adjacency - else - if(ismob(A)) // No instant mob attacking - setClickCooldown(get_attack_speed()) - UnarmedAttack(A, 1) - - trigger_aiming(TARGET_CAN_CLICK) - return 1 - - // Inbelly item interaction - if(isbelly(loc) && (loc == A.loc)) - if(W) - var/resolved = W.resolve_attackby(A, src, params) - if(!resolved && A && W) - W.afterattack(A, src, 1, params) // 1: clicking something Adjacent - else - if(ismob(A)) // No instant mob attacking - setClickCooldown(get_attack_speed()) - UnarmedAttack(A, 1) return - if(!isturf(loc)) // This is going to stop you from telekinesing from inside a closet, but I don't shed many tears for that + //? check if we can click from our current location + var/ranged_generics_allowed = loc?.AllowClick(src, A, I) + + if(Reachability(A, null, I?.reach, I)) + //? attempt melee attack chain + if(I) + I.melee_attack_chain(A, src, CLICKCHAIN_HAS_PROXIMITY, unpacked_params) + else + melee_attack_chain(A, CLICKCHAIN_HAS_PROXIMITY, unpacked_params) + // todo: refactor aiming + trigger_aiming(TARGET_CAN_CLICK) + return + else if(ranged_generics_allowed) + //? attempt ranged attack chain + if(I) + I.ranged_attack_chain(A, src, NONE, params) + else + ranged_attack_chain(A, NONE, unpacked_params) + // todo: refactor aiming + trigger_aiming(TARGET_CAN_CLICK) return - - //Atoms on turfs (not on your person) - // A is a turf or is on a turf, or in something on a turf (pen in a box); but not something in something on a turf (pen in a box in a backpack) - sdepth = A.storage_depth_turf() - if(isturf(A) || isturf(A.loc) || (sdepth <= MAX_STORAGE_REACH)) - if(A.Adjacent(src) || (W && W.attack_can_reach(src, A, W.reach)) ) // see adjacent.dm - if(W) - // Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example) - var/resolved = W.resolve_attackby(A, src, params) - if(!resolved && A && W) - W.afterattack(A, src, 1, params) // 1: clicking something Adjacent - else - if(ismob(A)) // No instant mob attacking - setClickCooldown(get_attack_speed()) - UnarmedAttack(A, 1) - trigger_aiming(TARGET_CAN_CLICK) - return - else // non-adjacent click - if(W) - W.afterattack(A, src, 0, params) // 0: not Adjacent - else - RangedAttack(A, params) - - trigger_aiming(TARGET_CAN_CLICK) - return 1 /mob/proc/setClickCooldown(var/timeout) next_move = max(world.time + timeout, next_move) diff --git a/code/_onclick/hud/radial.dm b/code/_onclick/hud/radial.dm index b9efc932922..576e326c7f5 100644 --- a/code/_onclick/hud/radial.dm +++ b/code/_onclick/hud/radial.dm @@ -50,6 +50,7 @@ GLOBAL_LIST_EMPTY(radial_menus) /atom/movable/screen/radial/center/Click(location, control, params) if(usr.client == parent.current_user) + parent.hide() parent.finished = TRUE /datum/radial_menu @@ -279,7 +280,6 @@ GLOBAL_LIST_EMPTY(radial_menus) /datum/radial_menu/Destroy() Reset() hide() - QDEL_NULL(custom_check_callback) . = ..() /* diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 91179fb49fd..148cd2fac20 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -1,3 +1,6 @@ +//! the below call sequence is no longer accurate +//! converted code goes into items.dm +//! this is a legacy file because i don't want to rewrite the entire click system in one go /* === Item Click Call Sequences === These are the default click code call sequences used when clicking on stuff with an item. @@ -35,14 +38,14 @@ avoid code duplication. This includes items that may sometimes act as a standard return A.attackby(src, user, params, NONE, attack_modifier) // No comment -/atom/proc/attackby(obj/item/I, mob/living/user, params, attackchain_flags, damage_multiplier) +/atom/proc/attackby(obj/item/I, mob/living/user, params, clickchain_flags, damage_multiplier) return -/atom/movable/attackby(obj/item/I, mob/living/user, params, attackchain_flags, damage_multiplier) +/atom/movable/attackby(obj/item/I, mob/living/user, params, clickchain_flags, damage_multiplier) if(!(I.item_flags & NOBLUDGEON)) visible_message("[src] has been hit by [user] with [I].") -/mob/living/attackby(obj/item/I, mob/living/user, params, attackchain_flags, damage_multiplier) +/mob/living/attackby(obj/item/I, mob/living/user, params, clickchain_flags, damage_multiplier) if(!ismob(user)) return 0 if(can_operate(src) && I.do_surgery(src,user)) diff --git a/code/_onclick/items.dm b/code/_onclick/items.dm new file mode 100644 index 00000000000..1bfa532eb38 --- /dev/null +++ b/code/_onclick/items.dm @@ -0,0 +1,50 @@ +/** + * Called when trying to click something that the user can Reachability() to. + * + * @params + * - target - thing hitting + * - user - user using us + * - clickchain_flags - see [code/__DEFINES/procs/clickcode.dm] + * - params - params as list. + */ +/obj/item/proc/melee_attack_chain(atom/target, mob/user, clickchain_flags, list/params) + . = clickchain_flags + + if((. |= tool_attack_chain(target, user, ., params)) & CLICKCHAIN_DO_NOT_PROPAGATE) + return + + // todo: NO. MORE. LIST. PARAMS. WHY. ARE. WE. UNPACKING. THE. LIST. MULTIPLE. TIMES? + var/stupid_fucking_shim = list2params(params) + + // todo: refactor + if(resolve_attackby(target, user, stupid_fucking_shim)) + return CLICKCHAIN_DO_NOT_PROPAGATE + + afterattack(target, user, clickchain_flags & CLICKCHAIN_HAS_PROXIMITY, stupid_fucking_shim) + +/** + * Called when trying to click something that the user can't Reachability() to. + * + * @params + * - target - thing hitting + * - user - user using us + * - clickchain_flags - see [code/__DEFINES/procs/clickcode.dm] + * - params - params as list. + */ +/obj/item/proc/ranged_attack_chain(atom/target, mob/user, clickchain_flags, params) + . = clickchain_flags + + // todo: NO. MORE. LIST. PARAMS. WHY. ARE. WE. UNPACKING. THE. LIST. MULTIPLE. TIMES? + var/stupid_fucking_shim = list2params(params) + + afterattack(target, user, clickchain_flags & CLICKCHAIN_HAS_PROXIMITY, stupid_fucking_shim) + +/** + * Called when trying to click something that the user can Reachability() to, + * to allow for the tool system to intercept the attack as a tool action. + */ +/obj/item/proc/tool_attack_chain(atom/target, mob/user, clickchain_flags, list/params) + // are we on harm intent? if so, lol no + if(user && (user.a_intent == INTENT_HARM)) + return NONE + return target.tool_interaction(src, user, clickchain_flags | CLICKCHAIN_TOOL_ACT) diff --git a/code/_onclick/mobs.dm b/code/_onclick/mobs.dm new file mode 100644 index 00000000000..422b14593c4 --- /dev/null +++ b/code/_onclick/mobs.dm @@ -0,0 +1,26 @@ +/** + * Called when trying to click on someone we can Reachability() to without an item in hand. + * + * @params + * - target - thing we're clicking + * - clickchain_flags - see [code/__DEFINES/procs/clickcode.dm] + * - params - parameters of click, as list + */ +/mob/proc/melee_attack_chain(atom/target, clickchain_flags, list/params) + // todo: refactor cooldown handling + if(ismob(target)) + setClickCooldown(get_attack_speed()) + UnarmedAttack(target, clickchain_flags & CLICKCHAIN_HAS_PROXIMITY) + +/** + * Called when trying to click on someone we can't Reachability() to without an item in hand. + * + * @params + * - target - thing we're clicking + * - clickchain_flags - see [code/__DEFINES/procs/clickcode.dm] + * - params - parameters of click, as list + */ +/mob/proc/ranged_attack_chain(atom/target, clickchain_flags, list/params) + // todo: NO. MORE. LIST. PARAMS. WHY. ARE. WE. UNPACKING. THE. LIST. MULTIPLE. TIMES? + var/stupid_fucking_shim = list2params(params) + RangedAttack(target, stupid_fucking_shim) diff --git a/code/_onclick/reachability.dm b/code/_onclick/reachability.dm new file mode 100644 index 00000000000..fdf2a31d55e --- /dev/null +++ b/code/_onclick/reachability.dm @@ -0,0 +1,260 @@ +//! Reachability System +/** + * Checks if we can reach something. + * + * How this works: + * - we check our direct access + * - we "reach outwards" as much as we can. If we reach the turf, cool! if not, those atoms are added + * to direct access list. this sounds slow, but isn't bad worst case unless someone's somehow nested + * in a thousand atoms or a proc breaks. + * - max depth is a thing; it applies to both reaching out, and reaching in. + * it however applies separately, e.g. you can reach out of a backpack inside a locker + * (you can't in game because those objects set their procs but for the sake of argument pretend you can) + * you can still reach a pill bottle inside a box inside a backpack as opposed to just on the turf + * or in the backpack, assuming max_depth is set to 3 + * - range: when we reach the turf, we'll do our best-estimate byond step_towards path-cast + * to try to get TurfAdjacency to the user + * + * time complexity analysis of + * "person tries to reach into a 3 nested deep item in + * a pill bottle in a box in a backpack from standing" + * + * - directaccesscache cost + * - first check fails + * - first for loop runs; we're on turf, so tadj gets set and we return + * - isarea check runs and fails + * - check cache list init, same with other vars + * - for loop runs 3 times, hits turf, doesn't add turf area + * - TurfAdjacency is checked since it isn't a ranged attack + * + * @params + * - target - the target + * - depth - max depth + * - range - max range + * - tool - the item we're using to reach; not important + */ +/atom/movable/proc/Reachability(atom/target, depth = DEFAULT_REACHABILITY_DEPTH, range = 1, obj/item/tool) + if(!target) + // apologies sir, you may not grasp the void... + return FALSE + // direct cache - check if we can access something using if dc[atom] + var/list/dc = DirectAccessCache() + // optimization - a lot of the time we're clicking on ourselves/things on ourselves + if(dc[target]) + return TRUE + // turf adjacency enabled? stores if we can try to path to our turf + var/turf/tadj + // loc checking + var/atom/l = loc + // reach out from where we are as far as we can bound by depth + for(var/i in 1 to depth) + if(!l) + break + if(isturf(l)) + tadj = l + break + if(!l.CanReachOut(src, target, tool, dc)) + break + l = l.loc + // if target isn't anywhere (this should be at the top but maybe someone + // snowflakes a clickable object in directaccess but without loc someday) + // we can only access through DC + if(!target.loc) + return !!dc[target] + // special checks + if(isarea(target)) + // area checks don't support range, because + // 1. why are you trying to reach an are awith this proc + // 2. it would be expensive as shit and require a snowflake check + // that i have no intention of writing right now + return tadj && (l.loc == target) + else if(isturf(target)) + // turf checks are just an adjacency check + return tadj?.TurfAdjacency(target) + + // now that cache is assembled and turf is set, go to main loop + + // we don't cut or make lists because heehoo byond speed ecks dee + // we just advance + // this has the advantage of sped up protection against infinite recursion + // in the old system we used a closed_cache[thing] = true to prevent + // infinite loops, now it's built in, and iteration is just as fast! + + // check cache + var/list/cc = list(target.loc = TRUE) + // current index in check cache + var/i = 1 + // did we reach turf? turf heuristic - usually the first turf we found + var/turf/th + // current length + var/cl = 1 + // reach *upwards* from the target + for(var/d in 1 to depth) + cl = length(cc) + if(i > cl) + // hit top, didn't find, break + break + for(i in i to cl) + l = cc[i] + // process the rest of checking + if(!l.CanReachIn(src, target, tool, cc)) + // couldn't reach in, l is irrelevant + continue + if(dc[l]) + // found + return TRUE + if(isturf(l) && !th) + // is turf; turf adjacency enabled + th = l + if(isarea(l.loc)) + // don't recurse into areas + continue + cc[l.loc] = TRUE + // don't overlap + ++i + if(!(tadj && th)) + // didn't hit both, fail + return FALSE + // at this point, we're on a turf + if(range == 1) + // most common case: reach directly aronud yourself + return tadj.TurfAdjacency(th, target, src) + else if(!range) + // rare but cheap case: only stuff on your tile + return th == tadj + else + // less common but expensive case - long range tool reach + var/atom/movable/reachability_delegate/D = new(tadj) + D.pass_flags |= pass_flags + // next turf + var/turf/n = D.loc + for(i in 1 to range) + ASSERT(isturf(n)) + if(n.TurfAdjacency(th)) + // succeeded + qdel(D) + return TRUE + // dumb directional pathfinding both for cheapness and for practical purposes + // so you can't snake-arms round a row of windows or something crazy + n = get_step(D, get_dir(D, th)) + if(!D.Move(n)) + // failed + qdel(D) + return FALSE + // keep going + // at this point, we failed + qdel(D) + return FALSE + +/** + * quick and dirty reachability check + */ +/atom/movable/proc/CheapReachability(atom/target, depth = DEFAULT_REACHABILITY_DEPTH, range, obj/item/tool) + var/turf/curr = target.loc + var/turf/source + if(isturf(curr)) + source = get_turf(src) + if(!source) + return FALSE + return curr.TurfAdjacency(source) + do + if(curr == src) + return TRUE + if(!curr) + return FALSE + curr = curr.loc + while(!isturf(curr)) + source = get_turf(src) + if(!source) + return FALSE + return curr.TurfAdjacency(source) + +/atom/movable/reachability_delegate + pass_flags = ATOM_PASS_CLICK | ATOM_PASS_TABLE + invisibility = INVISIBILITY_ABSTRACT + +//! Direct Access +/** + * checks what we can directly reach + */ +/atom/movable/proc/DirectAccess() + return list(src, loc) + +/mob/DirectAccess() + return ..() + get_equipped_items() + +/** + * gets DirectAccess as a hashed list for quick lookups + */ +/atom/movable/proc/DirectAccessCache() + . = list() + // procs like these make me wish ss13 was run on node.js or something equally stupid + // return Object.assign({}, ...data.map((atom) => ({[atom]: true}))); + for(var/i in DirectAccess()) + .[i] = TRUE + +//! Reaching out of +/** + * called to see if we can reach out of this atom + * + * **When overriding, DO NOT FUCK WITH CACHE unless you KNOW WHAT YOU ARE DOING.** + * + * @params + * - mover - thing reaching + * - target - what we're reaching at + * - tool - what mover is using to reach with if applicable + * - cache - direct access to the "directly open" cache list. Add things to this with cache[obj] = TRUE + */ +/atom/proc/CanReachOut(atom/movable/mover, atom/target, obj/item/tool, list/cache) + // todo: signal when we care about signals + return FALSE + +//! Reaching into +/** + * called to see if we can reach into this atom + * + * **When overriding, DO NOT FUCK WITH CACHE unless you KNOW WHAT YOU ARE DOING.** + * + * @params + * - mover - thing reaching + * - target - what we're reaching at + * - tool - what mover is using to reach with if applicable + * - cache - direct access to the "checking" cache list. Add things to this with cache[obj] = TRUE + */ +/atom/proc/CanReachIn(atom/movable/mover, atom/target, obj/item/tool, list/cache) + // todo: signal when we care about signals + return TRUE + +//! Clicking out of - for ranged attack chains +/** + * called to see if we're allowed to proc ranged_attack_chain from in here at a target + * + * this proc needs refactored at some point to allow for complexity if necessary + * but for now it works so don't fuck with it + */ +/atom/proc/AllowClick(atom/movable/mover, atom/target, obj/item/tool) + return FALSE + +/turf/AllowClick(atom/movable/mover, atom/target, obj/item/tool) + return TRUE + +//! Obfuscation +/** + * is the atom obscured by a OBJ_PREVENT_CLICK_UNDER object above it + */ +/atom/proc/IsObsecured() + if(!isturf(loc)) + return FALSE + var/turf/T = get_turf_pixel(src) + if(!T) + return FALSE + for(var/obj/O in T) + if((O.obj_flags & OBJ_PREVENT_CLICK_UNDER) && O.layer > layer && O.plane >= plane) + return TRUE + return FALSE + +/turf/IsObsecured() + for(var/obj/O in contents) + if(O.obj_flags & OBJ_PREVENT_CLICK_UNDER) + return TRUE + return FALSE diff --git a/code/controllers/configuration_old/configuration.dm b/code/controllers/configuration_old/configuration.dm index dd2316182d9..feccd4217e0 100644 --- a/code/controllers/configuration_old/configuration.dm +++ b/code/controllers/configuration_old/configuration.dm @@ -2,8 +2,6 @@ config_legacy = new /datum/configuration_legacy() config_legacy.load("config/legacy/config.txt") config_legacy.load("config/legacy/game_options.txt","game_options") - config_legacy.loadsql("config/legacy/dbconfig.txt") - config_legacy.loadforumsql("config/legacy/forumdbconfig.txt") /datum/configuration_legacy var/server_name = null // server name (for world name / status) @@ -889,94 +887,6 @@ else log_misc("Unknown setting in configuration: '[name]'") -/datum/configuration_legacy/proc/loadsql(filename) // -- TLE - var/list/Lines = world.file2list(filename) - for(var/t in Lines) - if(!t) continue - - t = trim(t) - if (length(t) == 0) - continue - else if (copytext(t, 1, 2) == "#") - continue - - var/pos = findtext(t, " ") - var/name = null - var/value = null - - if (pos) - name = lowertext(copytext(t, 1, pos)) - value = copytext(t, pos + 1) - else - name = lowertext(t) - - if (!name) - continue - - switch (name) - if ("address") - sqladdress = value - if ("port") - sqlport = value - if ("database") - sqldb = value - if ("login") - sqllogin = value - if ("password") - sqlpass = value - if ("feedback_database") - sqlfdbkdb = value - if ("feedback_login") - sqlfdbklogin = value - if ("feedback_password") - sqlfdbkpass = value - if ("enable_stat_tracking") - sqllogging = 1 - else - log_misc("Unknown setting in configuration: '[name]'") - -/datum/configuration_legacy/proc/loadforumsql(filename) // -- TLE - var/list/Lines = world.file2list(filename) - for(var/t in Lines) - if(!t) continue - - t = trim(t) - if (length(t) == 0) - continue - else if (copytext(t, 1, 2) == "#") - continue - - var/pos = findtext(t, " ") - var/name = null - var/value = null - - if (pos) - name = lowertext(copytext(t, 1, pos)) - value = copytext(t, pos + 1) - else - name = lowertext(t) - - if (!name) - continue - - switch (name) - if ("address") - forumsqladdress = value - if ("port") - forumsqlport = value - if ("database") - forumsqldb = value - if ("login") - forumsqllogin = value - if ("password") - forumsqlpass = value - if ("activatedgroup") - forum_activated_group = value - if ("authenticatedgroup") - forum_authenticated_group = value - else - log_misc("Unknown setting in configuration: '[name]'") - /datum/configuration_legacy/proc/pick_mode(mode_name) // I wish I didn't have to instance the game modes in order to look up // their information, but it is the only way (at least that I know of). diff --git a/code/datums/modules.dm b/code/datums/modules.dm deleted file mode 100644 index f2193c5e7b7..00000000000 --- a/code/datums/modules.dm +++ /dev/null @@ -1,63 +0,0 @@ -// module datum. -// this is per-object instance, and shows the condition of the modules in the object -// actual modules needed is referenced through modulestypes and the object type - -/datum/module - var/status // bits set if working, 0 if broken - var/installed // bits set if installed, 0 if missing - -// moduletypes datum -// this is per-object type, and shows the modules needed for a type of object - -/datum/moduletypes - var/list/modcount = list() // assoc list of the count of modules for a type - - -var/list/modules = list( // global associative list -"/obj/machinery/power/apc" = "card_reader,power_control,id_auth,cell_power,cell_charge") - - -/datum/module/New(var/obj/O) - - var/type = O.type // the type of the creating object - - var/mneed = mods.inmodlist(type) // find if this type has modules defined - - if(!mneed) // not found in module list? - qdel(src) - return - - var/needed = mods.getbitmask(type) // get a bitmask for the number of modules in this object - status = needed - installed = needed - -/datum/moduletypes/proc/addmod(var/type, var/modtextlist) - modules += type // index by type text - modules[type] = modtextlist - -/datum/moduletypes/proc/inmodlist(var/type) - return ("[type]" in modules) - -/datum/moduletypes/proc/getbitmask(var/type) - var/count = modcount["[type]"] - if(count) - return 2**count-1 - - var/modtext = modules["[type]"] - var/num = 1 - var/pos = 1 - - while(1) - pos = findtext(modtext, ",", pos, 0) - if(!pos) - break - else - pos++ - num++ - - modcount += "[type]" - modcount["[type]"] = num - - return 2**num-1 - - diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index 8a99fea0b3f..08b7ea0404d 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -170,7 +170,7 @@ to_chat(user, "You need wirecutters!") return - playsound(holder, I.usesound, 20, 1) + playsound(holder, I.tool_sound, 20, 1) cut_color(color) return TRUE diff --git a/code/defines/procs/statistics.dm b/code/defines/procs/statistics.dm index 5509efb2444..b454b28ad4c 100644 --- a/code/defines/procs/statistics.dm +++ b/code/defines/procs/statistics.dm @@ -1,6 +1,4 @@ proc/sql_poll_population() - if(!sqllogging) - return var/admincount = admins.len var/playercount = 0 for(var/mob/M in player_list) @@ -22,18 +20,7 @@ proc/sql_poll_population() log_game("SQL ERROR during population polling. Error : \[[err]\]\n") qdel(query) -proc/sql_report_round_start() - // TODO - if(!sqllogging) - return -proc/sql_report_round_end() - // TODO - if(!sqllogging) - return - proc/sql_report_death(var/mob/living/carbon/human/H) - if(!sqllogging) - return if(!H) return if(!H.key || !H.mind) @@ -86,8 +73,6 @@ proc/sql_report_death(var/mob/living/carbon/human/H) qdel(query) proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H) - if(!sqllogging) - return if(!H) return if(!H.key || !H.mind) @@ -139,8 +124,6 @@ proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H) proc/statistic_cycle() - if(!sqllogging) - return while(1) sql_poll_population() sleep(6000) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index f5112de091d..544a5f9f76f 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -106,8 +106,8 @@ var/relative_layer = 0 //! Misc - ///Mobs that are currently do_after'ing this atom, to be cleared from on Destroy() - var/list/targeted_by + /// What mobs are interacting with us right now, associated directly to concurrent interactions. (use defines) + var/list/interacting_mobs /** * Called when an atom is created in byond (built in engine proc) @@ -725,22 +725,6 @@ blood_DNA = null return 1 -/atom/proc/get_global_map_pos() - if(!islist(global_map) || !length(global_map)) return - var/cur_x = null - var/cur_y = null - var/list/y_arr = null - for(cur_x=1,cur_x<=global_map.len,cur_x++) - y_arr = global_map[cur_x] - cur_y = y_arr.Find(src.z) - if(cur_y) - break -// to_chat(world, "X = [cur_x]; Y = [cur_y]") - if(cur_x && cur_y) - return list("x"=cur_x,"y"=cur_y) - else - return 0 - /atom/proc/isinspace() if(istype(get_turf(src), /turf/space)) return 1 @@ -954,55 +938,6 @@ /atom/proc/is_incorporeal() return FALSE -/// Tool behavior procedure. Redirects to tool-specific procs by default. -/// You can override it to catch all tool interactions, for use in complex deconstruction procs. -/// Just don't forget to return ..() in the end. -/atom/proc/tool_act(mob/living/user, obj/item/I, tool_type) - switch(tool_type) - if(TOOL_CROWBAR) - return crowbar_act(user, I) - if(TOOL_MULTITOOL) - return multitool_act(user, I) - if(TOOL_SCREWDRIVER) - return screwdriver_act(user, I) - if(TOOL_WRENCH) - return wrench_act(user, I) - if(TOOL_WIRECUTTER) - return wirecutter_act(user, I) - if(TOOL_WELDER) - return welder_act(user, I) - if(TOOL_ANALYZER) - return analyzer_act(user, I) - -// Tool-specific behavior procs. To be overridden in subtypes. -/atom/proc/crowbar_act(mob/living/user, obj/item/I) - return - -/atom/proc/multitool_act(mob/living/user, obj/item/I) - return - -/atom/proc/multitool_check_buffer(user, obj/item/I, silent = FALSE) - if(!I.tool_behaviour == TOOL_MULTITOOL) - if(user && !silent) - to_chat(user, SPAN_WARNING("[I] has no data buffer!")) - return FALSE - return TRUE - -/atom/proc/screwdriver_act(mob/living/user, obj/item/I) - SEND_SIGNAL(src, COMSIG_ATOM_SCREWDRIVER_ACT, user, I) - -/atom/proc/wrench_act(mob/living/user, obj/item/I) - return - -/atom/proc/wirecutter_act(mob/living/user, obj/item/I) - return - -/atom/proc/welder_act(mob/living/user, obj/item/I) - return - -/atom/proc/analyzer_act(mob/living/user, obj/item/I) - return - /atom/proc/CheckParts(list/parts_list) for(var/A in parts_list) if(istype(A, /datum/reagent)) diff --git a/code/game/atoms/atom_defense.dm b/code/game/atoms/atom_defense.dm new file mode 100644 index 00000000000..4a1a3534981 --- /dev/null +++ b/code/game/atoms/atom_defense.dm @@ -0,0 +1,40 @@ +//! Welcome to the atom damage module. +//! Enjoy the bitfield and #define vomit. + +/** + * called to semantically deconstruct an atom + * + * @params + * - method - how we were deconstructed + */ +/atom/proc/deconstruct(method = ATOM_DECONSTRUCT_DISASSEMBLED) + SHOULD_NOT_OVERRIDE(TRUE) + + // send signal + // todo: signal + // do da funny logic + deconstructed(method) + // drop things after so things that rely on having objects don't break + drop_products(method) + // goodbye, cruel world + qdel(src) + +/** + * called when we are deconstructed + * + * **do not drop products in here** + * + * @params + * - method - how we were deconstructed + */ +/atom/proc/deconstructed() + return + +/** + * called to drop the products of deconstruction + * + * @params + * - method - how we were deconstructed + */ +/atom/proc/drop_products(method) + return diff --git a/code/game/atoms/tool_system.dm b/code/game/atoms/tool_system.dm new file mode 100644 index 00000000000..9e52e02e4c5 --- /dev/null +++ b/code/game/atoms/tool_system.dm @@ -0,0 +1,309 @@ +/** + * ? Atom Tool API + * + * ! Tool System: + * static tool usage: only react to the default tool type of something used on us + * dynamic tool usage: provide list of act-able functions, so dynamic tools and static tools may both work + * + * prefer dynamic tool usage whenever possible. + * this lets us make things like switchtools much more natural to use for the user. + * + * ! APIs: + * + * intended api for static tool usage: + * + * - override necessary _act for that tool type + * .../function_act(...) + * if(use_(...)) + * # success code + * else + * # failure code + * return TRUE // halt attack chain + * + * intended api for dynamic tool usage: + * - override dynamic_tool_functions() to return the functions and minimal qualities for a user + * - override dynamic_tool_act() if needed, otherwise it will simply go into tool_act + * - override dynamic_tool_image() to return the image to render for a specific tool function for radials + * - realistically, you just need to override dynamic_tool_functions. + * - if you don't override dynamic_tool_image you are a lemming and it'll probabl be ugly. + * + * It's That Simple (tm)! + * + * todo: find hardcoded usages with `istype\(([a-z_A-Z]+),(\s*)/obj/item/(tool/crowbar|tool/wrench|tool/screwdriver|tool/wirecutters|multitool|weldingtool)\)` and get rid of them. + */ + +//! Entrypoint +/** + * call to have the user attempt a tool interaction with the given item. + * + * returns a set of clickchain flags + * + * warning: this proc is not necessarily called only within clickcode. + * + * @params + * - I - the item + * - user - the user + * - clickchain_flags - the clickchain flags given + * - function - forced function - used in automation + * - hint - forced hint - used in automation + * - reachability_check - a callback used for reachability checks. if none, defaults to mob.Reachability when in clickcode, can always reach otherwise. + */ +/atom/proc/tool_interaction(obj/item/I, mob/user, clickchain_flags, function, hint, datum/callback/reachability_check) + SHOULD_NOT_OVERRIDE(TRUE) + return _tool_interaction_entrypoint(I, user, clickchain_flags, function, hint, reachability_check) + +/atom/proc/_tool_interaction_entrypoint(obj/item/provided_item, mob/user, clickchain_flags, function, hint, datum/callback/reachability_check) + SHOULD_NOT_OVERRIDE(TRUE) + PRIVATE_PROC(TRUE) + if(isnull(reachability_check)) + if(clickchain_flags & CLICKCHAIN_TOOL_ACT) + // provided_item should never be null + reachability_check = CALLBACK(user, /atom/movable/proc/Reachability, src, null, provided_item.reach, provided_item) + if(reachability_check && !reachability_check.Invoke()) + return NONE + // from click chain + if(provided_item) + if(function) + // automation, just go + return _dynamic_tool_act(provided_item, user, function, TOOL_OP_AUTOPILOT | TOOL_OP_REAL, hint) + // used in clickchain + var/list/possibilities = dynamic_tool_functions(provided_item, user) + if(!length(possibilities) || (provided_item.tool_locked == TOOL_LOCKING_STATIC)) + // no dynamic tool functionality, or dynamic functionality disabled, route normally. + function = provided_item.tool_behaviour() + if(!function) + return NONE + return _tool_act(provided_item, user, function, TOOL_OP_REAL) + // enumerate + var/list/functions = provided_item.tool_query(user, src) + if((provided_item.tool_locked == TOOL_LOCKING_AUTO) && (length(functions) == 1)) + // use first function + function = functions[1] + if(!(function in possibilities)) + // not found, route normally + return _tool_act(provided_item, user, function, TOOL_OP_REAL) + else + for(var/i in possibilities) + if(functions[i]) + continue + possibilities -= i + if(!length(possibilities)) + // none can be used, just go to static tool act if possible + function = provided_item.tool_behaviour() + if(!function) + return NONE + return _tool_act(provided_item, user, function, TOOL_OP_REAL) + // everything in possibilities is valid for the tool + var/list/transformed = list() + if(!function) + // we're about to sleep; if we're already breaking from this, maybe like, don't + if(INTERACTING_WITH_FOR(user, src, INTERACTING_FOR_DYNAMIC_TOOL)) + return CLICKCHAIN_DO_NOT_PROPAGATE + // if we didn't pick function already + for(var/i in possibilities) + // is there only one hint? + var/list/associated = possibilities[i] + if(associated && (!islist(associated) || (length(associated) == 1))) + // yes there is! + associated = islist(associated)? associated[1] : associated + else + associated = null + var/image/I = dynamic_tool_image(i, associated) + I.maptext = MAPTEXT_CENTER(associated || i) + I.maptext_x = -16 + I.maptext_y = 32 + I.maptext_width = 64 + transformed[i] = I + // todo: radial menu at some point should be made to automatically close when they click something else. + START_INTERACTING_WITH(user, src, INTERACTING_FOR_DYNAMIC_TOOL) + function = show_radial_menu(user, src, transformed, custom_check = reachability_check) + STOP_INTERACTING_WITH(user, src, INTERACTING_FOR_DYNAMIC_TOOL) + if(!function || (reachability_check && !reachability_check.Invoke())) + return CLICKCHAIN_DO_NOT_PROPAGATE + // determine hint + var/list/hints = possibilities[function] + if(!islist(hints)) + // is a direct hint or null + return _dynamic_tool_act(provided_item, user, function, TOOL_OP_REAL, hints) + else if(length(hints) <= 1) + // no hint, or only one hint + return _dynamic_tool_act(provided_item, user, function, TOOL_OP_REAL, length(hints)? hints[1] : null) + // we're about to sleep; if we're already breaking from this, maybe like, don't + if(INTERACTING_WITH_FOR(user, src, INTERACTING_FOR_DYNAMIC_TOOL)) + return CLICKCHAIN_DO_NOT_PROPAGATE + transformed.len = 0 + for(var/i in hints) + var/image/I = dynamic_tool_image(function, i) + I.maptext = MAPTEXT_CENTER(i) + I.maptext_x = -16 + I.maptext_y = 32 + I.maptext_width = 64 + transformed[i] = I + START_INTERACTING_WITH(user, src, INTERACTING_FOR_DYNAMIC_TOOL) + hint = show_radial_menu(user, src, transformed, custom_check = reachability_check) + STOP_INTERACTING_WITH(user, src, INTERACTING_FOR_DYNAMIC_TOOL) + if(!hint || (reachability_check && !reachability_check.Invoke())) + return CLICKCHAIN_DO_NOT_PROPAGATE + // use hint + return _dynamic_tool_act(provided_item, user, function, TOOL_OP_REAL, hint) | CLICKCHAIN_DO_NOT_PROPAGATE + else + // in the future, we might have situations where clicking something with an empty hand + // yet having organs that server as built-in tools can do something with + // the dynamic tool system. for now, this does nothing. + return NONE + +//! Primary Tool API +/atom/proc/_tool_act(obj/item/I, mob/user, function, flags, hint) + PRIVATE_PROC(TRUE) + SHOULD_NOT_OVERRIDE(TRUE) + SEND_SIGNAL(src, COMSIG_ATOM_TOOL_ACT, I, user, function, flags, hint) + return tool_act(I, user, function, flags, hint) + +/** + * primary proc to be used when calling an interaction with a tool with an atom + * + * everything in this proc and procs it calls: + * - should not verify that the item is on the user + * - can, but doesn't need to verify that the item has the function in question (assumed it does) + * - should not require a user to run (do not runtime without user) + * - should handle functions with helpers in tihs file whenever possibl + * + * default behaviour: route the call to _act, which interrupts the melee attack chain if it returns TRUE. + * + * @params + * - I - the tool in question + * - user - the user in question, if they exist + * - function - the tool function used + * - flags - tool operation flags + * - hint - the operation hint, if the calling system is the dynamic tool system. + */ +/atom/proc/tool_act(obj/item/I, mob/user, function, flags, hint) + switch(function) + if(TOOL_CROWBAR) + return crowbar_act(I, user, flags, hint)? CLICKCHAIN_DO_NOT_PROPAGATE : NONE + if(TOOL_MULTITOOL) + return multitool_act(I, user, flags, hint)? CLICKCHAIN_DO_NOT_PROPAGATE : NONE + if(TOOL_SCREWDRIVER) + return screwdriver_act(I, user, flags, hint)? CLICKCHAIN_DO_NOT_PROPAGATE : NONE + if(TOOL_WRENCH) + return wrench_act(I, user, flags, hint)? CLICKCHAIN_DO_NOT_PROPAGATE : NONE + if(TOOL_WELDER) + return welder_act(I, user, flags, hint)? CLICKCHAIN_DO_NOT_PROPAGATE : NONE + if(TOOL_WIRECUTTER) + return wirecutter_act(I, user, flags, hint)? CLICKCHAIN_DO_NOT_PROPAGATE : NONE + if(TOOL_ANALYZER) + return analyzer_act(I, user, flags, hint)? CLICKCHAIN_DO_NOT_PROPAGATE : NONE + //? Add more tool_acts as necessary. + +/** + * standard use tool + * + * @params + * - function - tool function + * - I - the tool + * - user - the person using it + * - flags - tool operation flags + * - delay - how long it'll take to use the tool + * - cost - optional; cost multiplier to the default cost of 1 per second. + * - usage - optional; usage flags for tool speed/quality checks. + */ +/atom/proc/use_tool_standard(function, obj/item/I, mob/user, flags, delay, cost, usage) + return use_tool(function, I, user, flags, delay, cost, usage) + +/** + * primary proc called by wrappers to use a tool on us + * + * @params + * - function - tool function + * - I - the tool + * - user - the person using it + * - flags - tool operation flags + * - delay - how long it'll take to use the tool + * - cost - optional; cost multiplier to the default cost of 1 per second. + * - usage - optional; usage flags for tool speed/quality checks. + */ +/atom/proc/use_tool(function, obj/item/I, mob/user, flags, delay, cost = 1, usage) + SHOULD_NOT_OVERRIDE(TRUE) + var/quality = I.tool_check(function, user, src, flags, usage) + if(!quality) + return FALSE + var/speed = I.tool_speed(function, user, src, flags, usage) + //! this currently makes tools more efficient if you have more toolspeed. + //! this is probably a bad thing. + // todo: automatically adjust cost to rectify this. + // todo: tool_cost()? potentially invert cost multiplier automagically, or invert it in this proc. + delay = delay * speed + if(!I.using_as_tool(function, flags, user, src, delay, cost, usage)) + return FALSE + I.tool_feedback_start(function, flags, user, src, delay, cost, usage) + if(!do_after(user, delay, src)) + I.used_as_tool(function, flags, user, src, delay, cost, usage, FALSE) + I.tool_feedback_end(function, flags, user, src, delay, cost, usage, FALSE) + return FALSE + if(!I.used_as_tool(function, flags, user, src, delay, cost, usage, TRUE)) + I.tool_feedback_end(function, flags, user, src, delay, cost, usage, FALSE) + return FALSE + I.tool_feedback_end(function, flags, user, src, delay, cost, usage, TRUE) + return TRUE + +//! Dynamic Tool API +/** + * returns a list of behaviours that can be used on us in our current state + * the behaviour may be associated to a list of "hints" for multiple possible actions per behaviour. + * the hint should be human readable. + * associating directly to a single hint is allowed. + * + * **warning**: by default, the provided list is mutable + * if you're caching your own list, make sure to return cache.Copy()! + * + * @params + * - I - the tool used, if any + * - user - the user, if any + */ +/atom/proc/dynamic_tool_functions(obj/item/I, mob/user) + return list() + +/atom/proc/_dynamic_tool_act(obj/item/I, mob/user, function, flags, hint) + PRIVATE_PROC(TRUE) + SHOULD_NOT_OVERRIDE(TRUE) + flags |= TOOL_OP_DYNAMIC + SEND_SIGNAL(src, COMSIG_ATOM_TOOL_ACT, I, user, function, flags, hint) + return dynamic_tool_act(I, user, function, flags, hint) + +/** + * called when we are acted on by the dynamic tool system + * defualt behaviour: just call tool_act + * + * this must return a set of clickchain flags! + * + * @params + * - I - the tool used + * - user - the user, if any + * - function - the tool behaviour used + * - flags - tool operation flags + * - hint - the hint of what operation to do + */ +/atom/proc/dynamic_tool_act(obj/item/I, mob/user, function, flags, hint) + return tool_act(I, user, function, flags, hint) + +/** + * builds the image used for the radial icon + * + * WARNING: If you use tool **and** hint, you need to implement a hintless, or return to base to use the default. + * + * @params + * - function - the tool behaviour + * - hint - the context provided when you want to implement multiple actions for a tool + */ +/atom/proc/dynamic_tool_image(function, hint) + return dyntool_image_neutral(function) + +//! Dynamic Tools - default images +/proc/dyntool_image_neutral(function) + return image('icons/screen/radial/tools/generic.dmi', icon_state = _dyntool_image_states[function] || "unknown") + +/proc/dyntool_image_forward(function) + return image('icons/screen/radial/tools/generic.dmi', icon_state = "[_dyntool_image_states[function] || "unknown"]_up") + +/proc/dyntool_image_backward(function) + return image('icons/screen/radial/tools/generic.dmi', icon_state = "[_dyntool_image_states[function] || "unknown"]_down") diff --git a/code/game/atoms/tool_system_items.dm b/code/game/atoms/tool_system_items.dm new file mode 100644 index 00000000000..03bffcd9c60 --- /dev/null +++ b/code/game/atoms/tool_system_items.dm @@ -0,0 +1,244 @@ +/** + * item tool API: allows items to be one or more types of generic tool-functionalities + * with arbitrary tool speeds and qualities, while allowing the item to hook usages. + * + * ! Warning: Unlike other things, the standard API for this only promises to return specific types + * ! of values; not to obey original variables like tool_behaviour and tool_override. + * ! This is a necessary drawback of optimizaiton. + */ +/obj/item + /// static tool behavior + var/tool_behaviour + /// static tool quality + var/tool_quality = TOOL_QUALITY_DEFAULT + /// tool speed - multiplies delay (e.g. 0.5 for twixe as fast). also the default for dynamic tools. + var/tool_speed = TOOL_SPEED_DEFAULT + /// dynamic tool locking - if set, dynamic tool behaviour (including confirmation radials) are entirely disregarded to use this item as a normal tool with whatever tool_behaviour() returns. + var/tool_locked = TOOL_LOCKING_AUTO + /// the sound to play (compatible with getsfx()) when we are used as a tool, if the function is the same as tool_behaviour. + var/tool_sound + /// override for dynamic tool support - varedit only, and not always supported. + VAR_PRIVATE/list/tool_override + +/** + * queries for tool functions + * returns a list of functions associated to their qualities, or null. + * + * when overriding, make sure to take into account tool_quality_transform()! + * that's where things like skill checks are done. + * + * @params + * - user - person using tool, can be null + * - target - atom being used on, can be null + * - flags - tool operation flags + * - usage - what we're being used for, bitfield + */ +/obj/item/proc/tool_query(mob/user, atom/target, flags, usage) + RETURN_TYPE(/list) + . = list() + // if normal tool behavior + if(tool_behaviour) + .[tool_behaviour] = tool_quality + // if overriding, overwrite + if(tool_override) + . |= tool_override + for(var/i in .) + .[i] = tool_quality_transform(.[i], user, target, flags, usage) + +/** + * checks for a tool function + * returns quality of function, or null if not found + * + * when overriding, make sure to take into account tool_quality_transform()! + * that's where things like skill checks are done. + * + * @params + * - function - tool function enum + * - user - person using tool, if any + * - target - atom tool being used on, if any + * - flags - tool operation flags + * - usage - what we're being used for, bitfield + */ +/obj/item/proc/tool_check(function, mob/user, atom/target, flags, usage) + ASSERT(function) + if(tool_override && tool_override[function]) + return tool_quality_transform(tool_override[function], user, target, flags, usage) + return (function == tool_behaviour)? tool_quality_transform(tool_quality, user, target, flags, usage) : null + +/** + * transforms tool quality according to a user's skill + * + * @params + * - original - original quality + * + * - user - user, if any + * - target - target, if any + * - flags - tool operation flags + * - usage - what we're being used for, bitfield + */ +/obj/item/proc/tool_quality_transform(original, user, target, flags, usage) + return original + +/** + * gets our tool speed + * returns float in (0, infinity] + * + * when overriding, make sure to take into account previous calls! + * that is where things like skill checks are done. + * + * @params + * - function - tool function enum + * - user - person using tool, if any + * - target - atom tool being used on, if any + * - flags - tool operation flags + * - usage - what we're being used for, bitfield + */ +/obj/item/proc/tool_speed(function, mob/user, atom/target, flags, usage) + SHOULD_CALL_PARENT(TRUE) + return (flags & TOOL_OP_INSTANT)? 0 : tool_speed + +/** + * gets the static functionality of this tool. + * used for legacy wrappers as well. make sure this is defined on your dynamic tool, + * or only dynamic tools will work. + * + * some dynamic tools will return the locked-in behaviour if locking is enabled + */ +/obj/item/proc/tool_behaviour() + return tool_behaviour + +/** + * gets the quality of this tool + * returns number, or null if non existant. + * + * @params + * - function - tool function enum; if null, defaults to static tool behaviour. + * - user - person using tool, if any + * - target - atom tool being used on, if any + * - flags - tool operation flags + * - usage - what we're being used for + */ +/obj/item/proc/tool_quality(function = tool_behaviour(), mob/user, atom/target, flags, usage) + // this is just a wrapper, the only difference is function is automatically provided. + return tool_check(function, user, target, flags, usage) + +/** + * called when we start being used as a tool + * return FALSE to cancel + * + * @params + * - function - tool function enum + * - flags - tool operation flags + * - user - person using tool, if any + * - target - atom tool being used on, if any + * - time - approximated duration of the action in deciseconds + * - cost - cost multiplier + * - usage - usage flags, if any + */ +/obj/item/proc/using_as_tool(function, flags, mob/user, atom/target, time, cost, usage) + SHOULD_CALL_PARENT(TRUE) + return TRUE + +/** + * called when we stop being used as a tool (aka finish of say, a window unfasten) + * return FALSE to cancel + * + * @params + * - function - tool function enum + * - flags - tool operation flags + * - user - person using tool, if any + * - target - atom tool being used on, if any + * - time - duration of the action in deciseconds + * - cost - cost multiplier + * - usage - usage flags, if any + * - success - was it successful? + */ +/obj/item/proc/used_as_tool(function, flags, mob/user, atom/target, time, cost, usage, success) + SHOULD_CALL_PARENT(TRUE) + return TRUE + +/** + * standard feedback for starting a tool usage + * + * @params + * - function - tool function enum + * - flags - tool operation flags + * - user - person using tool, if any + * - target - atom tool being used on, if any + * - time - duration of the action in deciseconds + * - cost - cost multiplier + * - usage - usage flags, if any + */ +/obj/item/proc/tool_feedback_start(function, flags, mob/user, atom/target, time, cost, usage) + SHOULD_CALL_PARENT(TRUE) + if(!(flags & TOOL_OP_NO_STANDARD_AUDIO)) + standard_tool_feedback_sound(function, flags, user, target, time, cost, usage) + +/** + * standard feedback for ending a tool usage + * + * @params + * - function - tool function enum + * - flags - tool operation flags + * - user - person using tool, if any + * - target - atom tool being used on, if any + * - time - duration of the action in deciseconds + * - cost - cost multiplier + * - usage - usage flags, if any + * - success - was it successful? + */ +/obj/item/proc/tool_feedback_end(function, flags, mob/user, atom/target, time, cost, usage, success) + SHOULD_CALL_PARENT(TRUE) + if(!(flags & TOOL_OP_NO_STANDARD_AUDIO)) + standard_tool_feedback_sound(function, flags, user, target, time, cost, usage, success) + +/** + * plays tool sound + * + * @params + * - function - tool function enum + * - flags - tool operation flags + * - user - person using tool, if any + * - target - atom tool being used on, if any + * - time - duration of the action in deciseconds + * - cost - cost multiplier + * - usage - usage flags, if any + * - success - was it successful? null if we're just starting + */ +/obj/item/proc/standard_tool_feedback_sound(function, flags, mob/user, atom/target, time, cost, usage, success) + if(isnull(success)) + // starting + playsound(src, tool_sound(function, flags, user, target, time, cost, usage, success), 50, TRUE) + else + // finishing + if(time >= MIN_TOOL_SOUND_DELAY) + playsound(src, tool_sound(function, flags, user, target, time, cost, usage, success), 50, TRUE) + +/** + * gets sound to play on tool usage + * + * @params + * - function - tool function enum + * - flags - tool operation flags + * - user - person using tool, if any + * - target - atom tool being used on, if any + * - time - duration of the action in deciseconds + * - cost - cost multiplier + * - usage - usage flags, if any + * - success - was it successful? null if we're just starting + */ +/obj/item/proc/tool_sound(function, flags, mob/user, atom/target, time, cost, usage, success) + if(tool_sound) + return tool_sound + // return default + switch(function) + if(TOOL_SCREWDRIVER) + return 'sound/items/screwdriver.ogg' + if(TOOL_WIRECUTTER) + return 'sound/items/wirecutter.ogg' + if(TOOL_CROWBAR) + return 'sound/items/crowbar.ogg' + if(TOOL_WELDER) + return 'sound/items/Welder2.ogg' + if(TOOL_WRENCH) + return 'sound/items/ratchet.ogg' diff --git a/code/game/atoms/tool_system_multitool.dm b/code/game/atoms/tool_system_multitool.dm new file mode 100644 index 00000000000..00dd1f985fe --- /dev/null +++ b/code/game/atoms/tool_system_multitool.dm @@ -0,0 +1 @@ +// todo: unified multitool buffer handling diff --git a/code/game/atoms/tool_system_wrappers.dm b/code/game/atoms/tool_system_wrappers.dm new file mode 100644 index 00000000000..233664c9b3d --- /dev/null +++ b/code/game/atoms/tool_system_wrappers.dm @@ -0,0 +1,213 @@ +//! ON GOD, READ tool_system.dm's use_tool_standard to learn how to use these! + +/** + * Called when a crowbar is used on us. + * + * @params + * - I - tool + * - user - user, can be null + * - flags - tool operation flags + * - hint - operation hint, if using dynamic tool system + */ +/atom/proc/crowbar_act(obj/item/I, mob/user, flags, hint) + return FALSE + +/** + * Standard helper to have a timed crowbar usage. + * + * See tool_system.dm's use_tool_standard to know how to use this. + * + * The system handles sound playback for you unless you specify to skip that, but you must manually give visible_message feedback. + * + * @params + * - I - the item + * - user - the user, if any + * - flags - tool operation flags + * - delay - how long this should take + * - cost - multiplier for cost, standard tool "cost" is 1 per second of usage. + * - usage - usage flags for skill system checks. + */ +/atom/proc/use_crowbar(obj/item/I, mob/user, flags, delay, cost, usage) + return use_tool_standard(TOOL_CROWBAR, I, user, flags, delay, cost, usage) + +/** + * Called when a wrench is used on us. + * + * @params + * - I - tool + * - user - user, can be null + * - flags - tool operation flags + * - hint - operation hint, if using dynamic tool system + */ +/atom/proc/wrench_act(obj/item/I, mob/user, flags, hint) + return FALSE + +/** + * Standard helper to have a timed wrench usage. + * + * See tool_system.dm's use_tool_standard to know how to use this. + * + * The system handles sound playback for you unless you specify to skip that, but you must manually give visible_message feedback. + * + * @params + * - I - the item + * - user - the user, if any + * - flags - tool operation flags + * - delay - how long this should take + * - cost - multiplier for cost, standard tool "cost" is 1 per second of usage. + * - usage - usage flags for skill system checks. + */ +/atom/proc/use_wrench(obj/item/I, mob/user, flags, delay, cost, usage) + return use_tool_standard(TOOL_WRENCH, I, user, flags, delay, cost, usage) + +/** + * Called when a welder is used on us. + * + * @params + * - I - tool + * - user - user, can be null + * - flags - tool operation flags + * - hint - operation hint, if using dynamic tool system + */ +/atom/proc/welder_act(obj/item/I, mob/user, flags, hint) + return FALSE + +/** + * Standard helper to have a timed welder usage. + * + * See tool_system.dm's use_tool_standard to know how to use this. + * + * The system handles sound playback for you unless you specify to skip that, but you must manually give visible_message feedback. + * + * @params + * - I - the item + * - user - the user, if any + * - flags - tool operation flags + * - delay - how long this should take + * - cost - multiplier for cost, standard tool "cost" is 1 per second of usage. + * - usage - usage flags for skill system checks. + */ +/atom/proc/use_welder(obj/item/I, mob/user, flags, delay, cost, usage) + return use_tool_standard(TOOL_WELDER, I, user, flags, delay, cost, usage) + +/** + * Called when a pair of wirecutters is used on us. + * + * @params + * - I - tool + * - user - user, can be null + * - flags - tool operation flags + * - hint - operation hint, if using dynamic tool system + */ +/atom/proc/wirecutter_act(obj/item/I, mob/user, flags, hint) + return FALSE + +/** + * Standard helper to have a timed usage of wirecutters. + * + * See tool_system.dm's use_tool_standard to know how to use this. + * + * The system handles sound playback for you unless you specify to skip that, but you must manually give visible_message feedback. + * + * @params + * - I - the item + * - user - the user, if any + * - flags - tool operation flags + * - delay - how long this should take + * - cost - multiplier for cost, standard tool "cost" is 1 per second of usage. + * - usage - usage flags for skill system checks. + */ +/atom/proc/use_wirecutter(obj/item/I, mob/user, flags, delay, cost, usage) + return use_tool_standard(TOOL_WIRECUTTER, I, user, flags, delay, cost, usage) + +/** + * Called when a screwdriver is used on us. + * + * @params + * - I - tool + * - user - user, can be null + * - flags - tool operation flags + * - hint - operation hint, if using dynamic tool system + */ +/atom/proc/screwdriver_act(obj/item/I, mob/user, flags, hint) + return FALSE + +/** + * Standard helper to have a timed screwdriver usage. + * + * See tool_system.dm's use_tool_standard to know how to use this. + * + * The system handles sound playback for you unless you specify to skip that, but you must manually give visible_message feedback. + * + * @params + * - I - the item + * - user - the user, if any + * - flags - tool operation flags + * - delay - how long this should take + * - cost - multiplier for cost, standard tool "cost" is 1 per second of usage. + * - usage - usage flags for skill system checks. + */ +/atom/proc/use_screwdriver(obj/item/I, mob/user, flags, delay, cost, usage) + return use_tool_standard(TOOL_SCREWDRIVER, I, user, flags, delay, cost, usage) + +/** + * Called when a analyzer is used on us. + * + * @params + * - I - tool + * - user - user, can be null + * - flags - tool operation flags + * - hint - operation hint, if using dynamic tool system + */ +/atom/proc/analyzer_act(obj/item/I, mob/user, flags, hint) + return FALSE + +/** + * Standard helper to have a timed analyzer usage. + * + * See tool_system.dm's use_tool_standard to know how to use this. + * + * The system handles sound playback for you unless you specify to skip that, but you must manually give visible_message feedback. + * + * @params + * - I - the item + * - user - the user, if any + * - flags - tool operation flags + * - delay - how long this should take + * - cost - multiplier for cost, standard tool "cost" is 1 per second of usage. + * - usage - usage flags for skill system checks. + */ +/atom/proc/use_analyzer(obj/item/I, mob/user, flags, delay, cost, usage) + return use_tool_standard(TOOL_ANALYZER, I, user, flags, delay, cost, usage) + + +/** + * Called when a multitool is used on us. + * + * @params + * - I - tool + * - user - user, can be null + * - flags - tool operation flags + * - hint - operation hint, if using dynamic tool system + */ +/atom/proc/multitool_act(obj/item/I, mob/user, flags, hint) + return FALSE + +/** + * Standard helper to have a timed multitool usage. + * + * See tool_system.dm's use_tool_standard to know how to use this. + * + * The system handles sound playback for you unless you specify to skip that, but you must manually give visible_message feedback. + * + * @params + * - I - the item + * - user - the user, if any + * - flags - tool operation flags + * - delay - how long this should take + * - cost - multiplier for cost, standard tool "cost" is 1 per second of usage. + * - usage - usage flags for skill system checks. + */ +/atom/proc/use_multitool(obj/item/I, mob/user, flags, delay, cost, usage) + return use_tool_standard(TOOL_MULTITOOL, I, user, flags, delay, cost, usage) + diff --git a/code/game/atoms/tool_system_z_legacy.dm b/code/game/atoms/tool_system_z_legacy.dm new file mode 100644 index 00000000000..4f67004a445 --- /dev/null +++ b/code/game/atoms/tool_system_z_legacy.dm @@ -0,0 +1,23 @@ +//! these wrappers are used for things that still check tools on attackby() +//! new usages are prohibited. + +/* + * Assorted tool procs, so any item can emulate any tool, if coded +*/ +/obj/item/proc/is_screwdriver() + return tool_behaviour() == TOOL_SCREWDRIVER + +/obj/item/proc/is_wrench() + return tool_behaviour() == TOOL_WRENCH + +/obj/item/proc/is_crowbar() + return tool_behaviour() == TOOL_CROWBAR + +/obj/item/proc/is_wirecutter() + return tool_behaviour() == TOOL_WIRECUTTER + +/obj/item/proc/is_multitool() + return tool_behaviour() == TOOL_MULTITOOL + +/obj/item/proc/is_welder() + return tool_behaviour() == TOOL_WELDER diff --git a/code/game/atoms_movable_movement.dm b/code/game/atoms_movable_movement.dm index 9dfe841e000..0ebc8e78d9f 100644 --- a/code/game/atoms_movable_movement.dm +++ b/code/game/atoms_movable_movement.dm @@ -15,7 +15,7 @@ // Here's where we rewrite how byond handles movement except slightly different // To be removed on step_ conversion // All this work to prevent a second bump -/atom/movable/Move(atom/newloc, direct=0) +/atom/movable/Move(atom/newloc, direct = NONE) . = FALSE if(!newloc || newloc == loc) return diff --git a/code/game/atoms_vv.dm b/code/game/atoms_vv.dm index 16c7eb1eee1..aec5b3a0dad 100644 --- a/code/game/atoms_vv.dm +++ b/code/game/atoms_vv.dm @@ -56,7 +56,7 @@ switch(var_name) if(NAMEOF(src, base_layer)) if(isnull(base_layer)) - return debug_variable(NAMEOF(src, layer), layer, 0, src) + return debug_variable(NAMEOF(src, base_layer), layer, 0, src) else return debug_variable(NAMEOF(src, base_layer), base_layer, 0, src) return ..() diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm index 5e884378050..5d657f82ee8 100644 --- a/code/game/machinery/CableLayer.dm +++ b/code/game/machinery/CableLayer.dm @@ -41,7 +41,7 @@ m = min(m, cable.amount) m = min(m, 30) if(m) - playsound(src.loc, O.usesound, 50, 1) + playsound(src.loc, O.tool_sound, 50, 1) use_cable(m) var/obj/item/stack/cable_coil/CC = new (get_turf(src)) CC.amount = m diff --git a/code/game/machinery/_frame.dm b/code/game/machinery/_frame.dm index 72594b6a8cb..69d5ed828bb 100644 --- a/code/game/machinery/_frame.dm +++ b/code/game/machinery/_frame.dm @@ -295,8 +295,8 @@ if(P.is_wrench()) if(state == FRAME_PLACED && !anchored) to_chat(user, SPAN_NOTICE("You start to wrench the frame into place.")) - playsound(src, P.usesound, 50, TRUE) - if(do_after(user, 20 * P.toolspeed)) + playsound(src, P.tool_sound, 50, TRUE) + if(do_after(user, 20 * P.tool_speed)) anchored = TRUE if(!need_circuit && circuit) state = FRAME_FASTENED @@ -307,8 +307,8 @@ to_chat(user, SPAN_NOTICE("You wrench the frame into place.")) else if(state == FRAME_PLACED && anchored) - playsound(src, P.usesound, 50, TRUE) - if(do_after(user, 20 * P.toolspeed)) + playsound(src, P.tool_sound, 50, TRUE) + if(do_after(user, 20 * P.tool_speed)) to_chat(user, SPAN_NOTICE("You unfasten the frame.")) anchored = FALSE @@ -316,8 +316,8 @@ if(state == FRAME_PLACED) var/obj/item/weldingtool/WT = P if(WT.remove_fuel(0, user)) - playsound(src, P.usesound, 50, TRUE) - if(do_after(user, 20 * P.toolspeed)) + playsound(src, P.tool_sound, 50, TRUE) + if(do_after(user, 20 * P.tool_speed)) if(src && WT.isOn()) to_chat(user, SPAN_NOTICE("You deconstruct the frame.")) new /obj/item/stack/material/steel(loc, frame_type.frame_size) @@ -348,18 +348,18 @@ else if(P.is_screwdriver()) if(state == FRAME_UNFASTENED) if(need_circuit && circuit) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You screw the circuit board into place.")) state = FRAME_FASTENED else if(state == FRAME_FASTENED) if(need_circuit && circuit) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You unfasten the circuit board.")) state = FRAME_UNFASTENED else if(!need_circuit && circuit) - playsound(src, P.usesound, 50, 1) + playsound(src, P.tool_sound, 50, 1) to_chat(user, SPAN_NOTICE("You unfasten the outer cover.")) state = FRAME_PLACED @@ -371,7 +371,7 @@ component_check = 0 break if(component_check) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) var/obj/machinery/new_machine = new circuit.build_path(loc, dir) // Handle machines that have allocated default parts in thier constructor. if(new_machine.component_parts) @@ -381,7 +381,7 @@ else new_machine.component_parts = list() - circuit.construct(new_machine) + circuit.after_construct(new_machine) for(var/obj/O in components) if(circuit.contain_parts) @@ -401,13 +401,13 @@ return else if(frame_type.frame_class == FRAME_CLASS_ALARM) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You fasten the cover.")) var/obj/machinery/B = new circuit.build_path(loc) B.pixel_x = pixel_x B.pixel_y = pixel_y B.setDir(dir) - circuit.construct(B) + circuit.after_construct(B) circuit.loc = null B.circuit = circuit qdel(src) @@ -415,26 +415,26 @@ else if(state == FRAME_PANELED) if(frame_type.frame_class == FRAME_CLASS_COMPUTER) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You connect the monitor.")) var/obj/machinery/B = new circuit.build_path(loc) B.pixel_x = pixel_x B.pixel_y = pixel_y B.setDir(dir) - circuit.construct(B) + circuit.after_construct(B) circuit.loc = null B.circuit = circuit qdel(src) return else if(frame_type.frame_class == FRAME_CLASS_DISPLAY) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You connect the monitor.")) var/obj/machinery/B = new circuit.build_path(loc) B.pixel_x = pixel_x B.pixel_y = pixel_y B.setDir(dir) - circuit.construct(B) + circuit.after_construct(B) circuit.loc = null B.circuit = circuit qdel(src) @@ -443,7 +443,7 @@ else if(P.is_crowbar()) if(state == FRAME_UNFASTENED) if(need_circuit && circuit) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You remove the circuit board.")) state = FRAME_PLACED circuit.forceMove(loc) @@ -453,7 +453,7 @@ else if(state == FRAME_WIRED) if(frame_type.frame_class == FRAME_CLASS_MACHINE) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) if(components.len == 0) to_chat(user, SPAN_NOTICE("There are no components to remove.")) else @@ -466,13 +466,13 @@ else if(state == FRAME_PANELED) if(frame_type.frame_class == FRAME_CLASS_COMPUTER) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You remove the glass panel.")) state = FRAME_WIRED new /obj/item/stack/material/glass(loc, 2) else if(frame_type.frame_class == FRAME_CLASS_DISPLAY) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You remove the glass panel.")) state = FRAME_WIRED new /obj/item/stack/material/glass(loc, 2) @@ -520,25 +520,25 @@ else if(P.is_wirecutter()) if(state == FRAME_WIRED) if(frame_type.frame_class == FRAME_CLASS_COMPUTER) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You remove the cables.")) state = FRAME_FASTENED new /obj/item/stack/cable_coil(loc, 5) else if(frame_type.frame_class == FRAME_CLASS_DISPLAY) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You remove the cables.")) state = FRAME_FASTENED new /obj/item/stack/cable_coil(loc, 5) else if(frame_type.frame_class == FRAME_CLASS_ALARM) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You remove the cables.")) state = FRAME_FASTENED new /obj/item/stack/cable_coil(loc, 5) else if(frame_type.frame_class == FRAME_CLASS_MACHINE) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You remove the cables.")) state = FRAME_FASTENED new /obj/item/stack/cable_coil(loc, 5) diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 91794bbed8e..b6d258dc046 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -387,8 +387,8 @@ return FALSE if(panel_open) return FALSE // Close panel first! - playsound(loc, W.usesound, 50, 1) - var/actual_time = W.toolspeed * time + playsound(loc, W.tool_sound, 50, 1) + var/actual_time = W.tool_speed * time if(actual_time != 0) user.visible_message( \ "\The [user] begins [anchored ? "un" : ""]securing \the [src].", \ @@ -403,6 +403,8 @@ return TRUE /obj/machinery/proc/default_deconstruction_crowbar(var/mob/user, var/obj/item/C) + + if(!C.is_crowbar()) return 0 if(!panel_open) @@ -412,7 +414,7 @@ /obj/machinery/proc/default_deconstruction_screwdriver(var/mob/user, var/obj/item/S) if(!S.is_screwdriver()) return 0 - playsound(src, S.usesound, 50, 1) + playsound(src, S.tool_sound, 50, 1) panel_open = !panel_open to_chat(user, "You [panel_open ? "open" : "close"] the maintenance hatch of [src].") update_appearance() @@ -424,8 +426,8 @@ if(!circuit) return 0 to_chat(user, "You start disconnecting the monitor.") - playsound(src, S.usesound, 50, 1) - if(do_after(user, 20 * S.toolspeed)) + playsound(src, S.tool_sound, 50, 1) + if(do_after(user, 20 * S.tool_speed)) if(machine_stat & BROKEN) to_chat(user, "The broken glass falls out.") new /obj/item/material/shard(src.loc) @@ -436,7 +438,7 @@ /obj/machinery/proc/alarm_deconstruction_screwdriver(var/mob/user, var/obj/item/S) if(!S.is_screwdriver()) return 0 - playsound(src, S.usesound, 50, 1) + playsound(src, S.tool_sound, 50, 1) panel_open = !panel_open to_chat(user, "The wires have been [panel_open ? "exposed" : "unexposed"]") update_appearance() @@ -448,7 +450,7 @@ if(!panel_open) return 0 user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].") - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) new/obj/item/stack/cable_coil(get_turf(src), 5) . = dismantle() @@ -496,6 +498,6 @@ A.update_desc() A.update_appearance() M.loc = null - M.deconstruct(src) + M.after_deconstruct(src) qdel(src) return 1 diff --git a/code/game/machinery/atm_ret_field.dm b/code/game/machinery/atm_ret_field.dm index 54335d4c975..b9bc61c678e 100644 --- a/code/game/machinery/atm_ret_field.dm +++ b/code/game/machinery/atm_ret_field.dm @@ -73,8 +73,8 @@ to_chat(user, "You need more fuel to complete this task.") return user.visible_message("[user] starts to disassemble \the [src].", "You start to disassemble \the [src].") - playsound(src, WT.usesound, 50, 1) - if(do_after(user,15 * W.toolspeed)) + playsound(src, WT.tool_sound, 50, 1) + if(do_after(user,15 * W.tool_speed)) if(!src || !user || !WT.remove_fuel(5, user)) return to_chat(user, "You fully disassemble \the [src]. There were no salvageable parts.") qdel(src) diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index 705b6ff7097..d471c18f113 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -95,9 +95,9 @@ /obj/machinery/meter/attackby(var/obj/item/W, var/mob/user) if(W.is_wrench()) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm index e137d991ea8..763ace9a7e7 100644 --- a/code/game/machinery/atmoalter/portable_atmospherics.dm +++ b/code/game/machinery/atmoalter/portable_atmospherics.dm @@ -116,7 +116,7 @@ disconnect() to_chat(user, "You disconnect \the [src] from the port.") update_icon() - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) return else var/obj/machinery/atmospherics/portables_connector/possible_port = locate(/obj/machinery/atmospherics/portables_connector/) in loc @@ -124,7 +124,7 @@ if(connect(possible_port)) to_chat(user, "You connect \the [src] to the port.") update_icon() - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) return else to_chat(user, "\The [src] failed to connect to the port.") @@ -202,7 +202,7 @@ return user.visible_message("[user] opens the panel on [src] and removes [cell].", "You open the panel on [src] and remove [cell].") - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) cell.add_fingerprint(user) cell.forceMove(drop_location()) cell = null diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index a6391c9e64a..b51a2e5ffe6 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -282,7 +282,7 @@ return anchored = !anchored - playsound(get_turf(src), I.usesound, 50, 1) + playsound(get_turf(src), I.tool_sound, 50, 1) to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") return diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index fcc6c71af24..28a61cba07f 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -232,7 +232,7 @@ return anchored = !anchored - playsound(src.loc, I.usesound, 50, 1) + playsound(src.loc, I.tool_sound, 50, 1) to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") return diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 3ada2a0ee37..2d9d7fff705 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -162,7 +162,7 @@ panel_open = !panel_open user.visible_message("[user] screws the camera's panel [panel_open ? "open" : "closed"]!", "You screw the camera's panel [panel_open ? "open" : "closed"].") - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) else if((W.is_wirecutter() || istype(W, /obj/item/multitool)) && panel_open) interact(user) @@ -363,10 +363,10 @@ // Do after stuff here to_chat(user, "You start to weld [src]..") - playsound(src.loc, WT.usesound, 50, 1) + playsound(src.loc, WT.tool_sound, 50, 1) WT.eyecheck(user) busy = 1 - if(do_after(user, 100 * WT.toolspeed)) + if(do_after(user, 100 * WT.tool_speed)) busy = 0 if(!WT.isOn()) return 0 diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index e0055677486..01771103502 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -30,7 +30,7 @@ if(0) // State 0 if(W.is_wrench() && isturf(src.loc)) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You wrench the assembly into place.") anchored = 1 state = 1 @@ -48,7 +48,7 @@ return else if(W.is_wrench()) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You unattach the assembly from its place.") anchored = 0 update_icon() @@ -78,7 +78,7 @@ if(3) // State 3 if(W.is_screwdriver()) - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) var/input = sanitize(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+GLOB.using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT)) if(!input) @@ -118,7 +118,7 @@ else if(W.is_wirecutter()) new/obj/item/stack/cable_coil(get_turf(src), 2) - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) to_chat(user, "You cut the wires from the circuits.") state = 2 return @@ -136,7 +136,7 @@ var/obj/U = locate(/obj) in upgrades if(U) to_chat(user, "You unattach an upgrade from the assembly.") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) user.grab_item_from_interacted_with(U, src) upgrades -= U return @@ -161,10 +161,10 @@ return 0 to_chat(user, "You start to weld the [src]..") - playsound(src.loc, WT.usesound, 50, 1) + playsound(src.loc, WT.tool_sound, 50, 1) WT.eyecheck(user) busy = 1 - if(do_after(user, 20 * WT.toolspeed)) + if(do_after(user, 20 * WT.tool_speed)) busy = 0 if(!WT.isOn()) return 0 diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 85df59d48ca..0aeffafdd1d 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -76,7 +76,7 @@ anchored = !anchored to_chat(user, "You [anchored ? "attach" : "detach"] [src] [anchored ? "to" : "from"] the ground.") - playsound(src, W.usesound, 75, TRUE) + playsound(src, W.tool_sound, 75, TRUE) else if(default_deconstruction_screwdriver(user, W)) return diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 435b2fa8eed..90708b2a040 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -261,7 +261,7 @@ connected = null else anchored = TRUE - playsound(src, W.usesound, 100, TRUE) + playsound(src, W.tool_sound, 100, TRUE) if(anchored) user.visible_message("[user] secures [src] to the floor.", "You secure [src] to the floor.") else diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 1a357d2c32b..b2437bf6b41 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -15,8 +15,8 @@ switch(state) if(0) if(P.is_wrench()) - playsound(loc, P.usesound, 50, 1) - if(do_after(user, 20 * P.toolspeed)) + playsound(loc, P.tool_sound, 50, 1) + if(do_after(user, 20 * P.tool_speed)) to_chat(user, "You wrench the frame into place.") anchored = 1 state = 1 @@ -25,16 +25,16 @@ if(!WT.isOn()) to_chat(user, "The welder must be on for this task.") return - playsound(loc, WT.usesound, 50, 1) - if(do_after(user, 20 * WT.toolspeed)) + playsound(loc, WT.tool_sound, 50, 1) + if(do_after(user, 20 * WT.tool_speed)) if(!src || !WT.remove_fuel(0, user)) return to_chat(user, "You deconstruct the frame.") new /obj/item/stack/material/plasteel( loc, 4) qdel(src) if(1) if(P.is_wrench()) - playsound(loc, P.usesound, 50, 1) - if(do_after(user, 20 * P.toolspeed)) + playsound(loc, P.tool_sound, 50, 1) + if(do_after(user, 20 * P.tool_speed)) to_chat(user, "You unfasten the frame.") anchored = 0 state = 0 @@ -46,12 +46,12 @@ icon_state = "1" circuit = P if(P.is_screwdriver() && circuit) - playsound(loc, P.usesound, 50, 1) + playsound(loc, P.tool_sound, 50, 1) to_chat(user, "You screw the circuit board into place.") state = 2 icon_state = "2" if(P.is_crowbar() && circuit) - playsound(loc, P.usesound, 50, 1) + playsound(loc, P.tool_sound, 50, 1) to_chat(user, "You remove the circuit board.") state = 1 icon_state = "0" @@ -59,7 +59,7 @@ circuit = null if(2) if(P.is_screwdriver() && circuit) - playsound(loc, P.usesound, 50, 1) + playsound(loc, P.tool_sound, 50, 1) to_chat(user, "You unfasten the circuit board.") state = 1 icon_state = "1" @@ -81,7 +81,7 @@ if (brain) to_chat(user, "Get that brain out of there first") else - playsound(loc, P.usesound, 50, 1) + playsound(loc, P.tool_sound, 50, 1) to_chat(user, "You remove the cables.") state = 2 icon_state = "2" @@ -144,7 +144,7 @@ icon_state = "3b" if(P.is_crowbar() && brain) - playsound(loc, P.usesound, 50, 1) + playsound(loc, P.tool_sound, 50, 1) to_chat(user, "You remove the brain.") brain.loc = loc brain = null @@ -152,7 +152,7 @@ if(4) if(P.is_crowbar()) - playsound(loc, P.usesound, 50, 1) + playsound(loc, P.tool_sound, 50, 1) to_chat(user, "You remove the glass panel.") state = 3 if (brain) @@ -163,7 +163,7 @@ return if(P.is_screwdriver()) - playsound(loc, P.usesound, 50, 1) + playsound(loc, P.tool_sound, 50, 1) to_chat(user, "You connect the monitor.") if(!brain) var/open_for_latejoin = alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", "Yes", "Yes", "No") == "Yes" @@ -233,8 +233,8 @@ GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactiva else if(W.is_wrench()) if(anchored) user.visible_message("\The [user] starts to unbolt \the [src] from the plating...") - playsound(src, W.usesound, 50, 1) - if(!do_after(user,40 * W.toolspeed)) + playsound(src, W.tool_sound, 50, 1) + if(!do_after(user,40 * W.tool_speed)) user.visible_message("\The [user] decides not to unbolt \the [src].") return user.visible_message("\The [user] finishes unfastening \the [src]!") @@ -242,8 +242,8 @@ GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactiva return else user.visible_message("\The [user] starts to bolt \the [src] to the plating...") - playsound(src, W.usesound, 50, 1) - if(!do_after(user,40 * W.toolspeed)) + playsound(src, W.tool_sound, 50, 1) + if(!do_after(user,40 * W.tool_speed)) user.visible_message("\The [user] decides not to bolt \the [src].") return user.visible_message("\The [user] finishes fastening down \the [src]!") diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 3212982773a..d9c90553af4 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -13,8 +13,8 @@ switch(state) if(0) if(P.is_wrench()) - playsound(src.loc, P.usesound, 50, 1) - if(do_after(user, 20 * P.toolspeed)) + playsound(src.loc, P.tool_sound, 50, 1) + if(do_after(user, 20 * P.tool_speed)) to_chat(user, "You wrench the frame into place.") src.anchored = 1 src.state = 1 @@ -23,16 +23,16 @@ if(!WT.remove_fuel(0, user)) to_chat(user, "The welding tool must be on to complete this task.") return - playsound(src.loc, WT.usesound, 50, 1) - if(do_after(user, 20 * WT.toolspeed)) + playsound(src.loc, WT.tool_sound, 50, 1) + if(do_after(user, 20 * WT.tool_speed)) if(!src || !WT.isOn()) return to_chat(user, "You deconstruct the frame.") new /obj/item/stack/material/steel( src.loc, 5 ) qdel(src) if(1) if(P.is_wrench()) - playsound(src.loc, P.usesound, 50, 1) - if(do_after(user, 20 * P.toolspeed)) + playsound(src.loc, P.tool_sound, 50, 1) + if(do_after(user, 20 * P.tool_speed)) to_chat(user, "You unfasten the frame.") src.anchored = 0 src.state = 0 @@ -48,12 +48,12 @@ else to_chat(user, "This frame does not accept circuit boards of this type!") if(P.is_screwdriver() && circuit) - playsound(src.loc, P.usesound, 50, 1) + playsound(src.loc, P.tool_sound, 50, 1) to_chat(user, "You screw the circuit board into place.") src.state = 2 src.icon_state = "2" if(P.is_crowbar()) && circuit) - playsound(src.loc, P.usesound, 50, 1) + playsound(src.loc, P.tool_sound, 50, 1) to_chat(user, "You remove the circuit board.") src.state = 1 src.icon_state = "0" @@ -61,7 +61,7 @@ src.circuit = null if(2) if(P.is_screwdriver() && circuit) - playsound(src.loc, P.usesound, 50, 1) + playsound(src.loc, P.tool_sound, 50, 1) to_chat(user, "You unfasten the circuit board.") src.state = 1 src.icon_state = "1" @@ -79,7 +79,7 @@ icon_state = "3" if(3) if(P.is_wirecutter()) - playsound(src.loc, P.usesound, 50, 1) + playsound(src.loc, P.tool_sound, 50, 1) to_chat(user, "You remove the cables.") src.state = 2 src.icon_state = "2" @@ -100,14 +100,14 @@ src.icon_state = "4" if(4) if(P.is_crowbar()) - playsound(src.loc, P.usesound, 50, 1) + playsound(src.loc, P.tool_sound, 50, 1) to_chat(user, "You remove the glass panel.") src.state = 3 src.icon_state = "3" new /obj/item/stack/material/glass( src.loc, 2 ) if(P.is_screwdriver()) - playsound(src.loc, P.usesound, 50, 1) + playsound(src.loc, P.tool_sound, 50, 1) to_chat(user, "You connect the monitor.") - var/B = new src.circuit.build_path ( src.loc ) - src.circuit.construct(B) + var/B = new circuit.build_path ( src.loc ) + circuit.after_contruct(B) qdel(src) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index a10e3398700..e2dd968faf1 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -116,7 +116,7 @@ text = replacetext(text, "\n", "
") return text -/obj/machinery/computer/attackby(obj/item/I, mob/living/user, params, attackchain_flags, damage_multiplier) +/obj/machinery/computer/attackby(obj/item/I, mob/living/user, params, clickchain_flags, damage_multiplier) if(computer_deconstruction_screwdriver(user, I)) return else @@ -129,6 +129,6 @@ var/B_held = B.get_item() to_chat(user, "You use \the [B] to use \the [B_held] with \the [src].") playsound(src, "keyboard", 100, 1, 0) - attackby(B.get_item(), user, params, attackchain_flags, damage_multiplier) + attackby(B.get_item(), user, params, clickchain_flags, damage_multiplier) return return ..() diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 8d02611bbce..722f0a30da3 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -41,7 +41,7 @@ icon_state = "box_1" else if(P.is_wrench()) - playsound(src, W.usesound, 75, TRUE) + playsound(src, W.tool_sound, 75, TRUE) to_chat(user, SPAN_NOTICE("You dismantle the frame")) new /obj/item/stack/material/steel(src.loc, 5) qdel(src) @@ -71,7 +71,7 @@ to_chat(user, SPAN_WARNING("This frame does not accept circuit boards of this type!")) else if(P.is_wirecutter()) - playsound(src.loc, P.usesound, 50, TRUE) + playsound(src.loc, P.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You remove the cables.")) state = 1 icon_state = "box_0" @@ -80,7 +80,7 @@ if(3) if(P.is_crowbar()) - playsound(src, P.usesound, 50, TRUE) + playsound(src, P.tool_sound, 50, TRUE) state = 2 circuit.loc = src.loc circuit = null @@ -102,7 +102,7 @@ component_check = 0 break if(component_check) - playsound(src.loc, P.usesound, 50, TRUE) + playsound(src.loc, P.tool_sound, 50, TRUE) var/obj/machinery/new_machine = new src.circuit.build_path(src.loc, src.dir) if(new_machine.component_parts) @@ -131,7 +131,7 @@ for(var/I in req_components) if(istype(P, text2path(I)) && (req_components[I] > 0)) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, TRUE) - if(P.is_cable_coil)) + if(istype(P, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/CP = P if(CP.get_amount() > 1) var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 5137eca3c85..6cfbe01e387 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1088,7 +1088,7 @@ About the new airlock wires panel: src.welded = 1 else src.welded = null - playsound(src.loc, C.usesound, 75, 1) + playsound(src.loc, C.tool_sound, 75, 1) src.update_icon() return else @@ -1099,10 +1099,10 @@ About the new airlock wires panel: to_chat(usr, "The panel is broken and cannot be closed.") else src.p_open = 0 - playsound(src, C.usesound, 50, 1) + playsound(src, C.tool_sound, 50, 1) else src.p_open = 1 - playsound(src, C.usesound, 50, 1) + playsound(src, C.tool_sound, 50, 1) src.update_icon() else if(C.is_wirecutter()) return src.attack_hand(user) @@ -1115,9 +1115,9 @@ About the new airlock wires panel: cable.plugin(src, user) else if(!repairing && C.is_crowbar()) if(can_remove_electronics()) - playsound(src, C.usesound, 75, 1) + playsound(src, C.tool_sound, 75, 1) user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.") - if(do_after(user,40 * C.toolspeed)) + if(do_after(user,40 * C.tool_speed)) to_chat(user, "You removed the airlock electronics!") var/obj/structure/door_assembly/da = new assembly_type(src.loc) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index e5b25108a0d..7c693b89240 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -252,8 +252,8 @@ var/obj/item/weldingtool/welder = I if(welder.remove_fuel(0,user)) to_chat(user, "You start to fix dents and weld \the [get_material_name()] into place.") - playsound(src, welder.usesound, 50, 1) - if(do_after(user, (5 * repairing) * welder.toolspeed) && welder && welder.isOn()) + playsound(src, welder.tool_sound, 50, 1) + if(do_after(user, (5 * repairing) * welder.tool_speed) && welder && welder.isOn()) to_chat(user, "You finish repairing the damage to \the [src].") health = between(health, health + repairing*DOOR_REPAIR_AMOUNT, maxhealth) update_icon() @@ -266,7 +266,7 @@ repairing_sheet.amount += repairing-1 repairing = 0 to_chat(user, "You remove \the [repairing_sheet].") - playsound(src, I.usesound, 100, 1) + playsound(src, I.tool_sound, 100, 1) return //psa to whoever coded this, there are plenty of objects that need to call attack() on doors without bludgeoning them. diff --git a/code/game/machinery/doors/door_vr.dm b/code/game/machinery/doors/door_vr.dm index 64b12a3b98b..3d92964373e 100644 --- a/code/game/machinery/doors/door_vr.dm +++ b/code/game/machinery/doors/door_vr.dm @@ -81,8 +81,8 @@ var/obj/item/weldingtool/welder = I if(welder.remove_fuel(0,user)) to_chat(user, "You start weld \the plasteel into place.") - playsound(src, welder.usesound, 50, 1) - if(do_after(user, 10 * welder.toolspeed) && welder && welder.isOn()) + playsound(src, welder.tool_sound, 50, 1) + if(do_after(user, 10 * welder.tool_speed) && welder && welder.isOn()) to_chat(user, "You finish reinforcing \the [src].") heat_proof = 1 update_icon() @@ -94,7 +94,7 @@ reinforcing_sheet.amount = reinforcing reinforcing = 0 to_chat(user, "You remove \the [reinforcing_sheet].") - playsound(src, I.usesound, 100, 1) + playsound(src, I.tool_sound, 100, 1) return TRUE return FALSE diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 0c2eca3db18..5decfa37486 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -256,13 +256,13 @@ user.visible_message("\The [user] [blocked ? "welds" : "unwelds"] \the [src] with \a [W].",\ "You [blocked ? "weld" : "unweld"] \the [src] with \the [W].",\ "You hear something being welded.") - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) update_icon() return if(density && C.is_screwdriver()) hatch_open = !hatch_open - playsound(src, C.usesound, 50, 1) + playsound(src, C.tool_sound, 50, 1) user.visible_message("[user] has [hatch_open ? "opened" : "closed"] \the [src] maintenance hatch.", "You have [hatch_open ? "opened" : "closed"] the [src] maintenance hatch.") update_icon() @@ -276,7 +276,7 @@ "You start to remove the electronics from [src].") if(do_after(user,30)) if(blocked && density && hatch_open) - playsound(src, C.usesound, 50, 1) + playsound(src, C.tool_sound, 50, 1) user.visible_message("[user] has removed the electronics from \the [src].", "You have removed the electronics from [src].") @@ -321,8 +321,8 @@ "You hear metal strain.") prying = 1 update_icon() - playsound(src, C.usesound, 100, 1) - if(do_after(user,30 * C.toolspeed)) + playsound(src, C.tool_sound, 100, 1) + if(do_after(user,30 * C.tool_speed)) if(C.is_crowbar()) if(machine_stat & (BROKEN|NOPOWER) || !density) user.visible_message("\The [user] forces \the [src] [density ? "open" : "closed"] with \a [C]!",\ diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm index 9ae89d38626..69ce41b43a0 100644 --- a/code/game/machinery/doors/firedoor_assembly.dm +++ b/code/game/machinery/doors/firedoor_assembly.dm @@ -27,7 +27,7 @@ obj/structure/firedoor_assembly/attackby(obj/item/C, mob/user as mob) to_chat(user, "You wire \the [src].") else if(C.is_wirecutter() && wired ) - playsound(src.loc, C.usesound, 100, 1) + playsound(src.loc, C.tool_sound, 100, 1) user.visible_message("[user] cuts the wires from \the [src].", "You start to cut the wires from \the [src].") if(do_after(user, 40)) @@ -48,7 +48,7 @@ obj/structure/firedoor_assembly/attackby(obj/item/C, mob/user as mob) to_chat(user, "You must secure \the [src] first!") else if(C.is_wrench()) anchored = !anchored - playsound(src.loc, C.usesound, 50, 1) + playsound(src.loc, C.tool_sound, 50, 1) user.visible_message("[user] has [anchored ? "" : "un" ]secured \the [src]!", "You have [anchored ? "" : "un" ]secured \the [src]!") update_icon() diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 56962a6a583..fc7ad7f2d5f 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -103,7 +103,7 @@ return ..() || (check_access(ID) && inoperable()) || (dir != to_dir) /obj/machinery/door/window/CheckExit(atom/movable/AM, atom/newLoc) - if(!(get_dir(loc, newLoc) & dir)) + if(!(get_dir(src, newLoc) & dir)) return TRUE if(check_standard_flag_pass(AM)) return TRUE @@ -197,8 +197,8 @@ if(health < maxhealth) if(WT.remove_fuel(1 ,user)) to_chat(user, "You begin repairing [src]...") - playsound(src, WT.usesound, 50, 1) - if(do_after(user, 40 * WT.toolspeed, target = src)) + playsound(src, WT.tool_sound, 50, 1) + if(do_after(user, 40 * WT.tool_speed, target = src)) health = maxhealth update_icon() to_chat(user, "You repair [src].") @@ -219,9 +219,9 @@ //If it's opened/emagged, crowbar can pry it out of its frame. if (!density && I.is_crowbar()) - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) user.visible_message("[user] begins prying the windoor out of the frame.", "You start to pry the windoor out of the frame.") - if (do_after(user,40 * I.toolspeed)) + if (do_after(user,40 * I.tool_speed)) to_chat(user,"You pried the windoor out of the frame!") var/obj/structure/windoor_assembly/wa = new/obj/structure/windoor_assembly(src.loc) diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm index d97c173e47d..eb8a3663bed 100644 --- a/code/game/machinery/floor_light.dm +++ b/code/game/machinery/floor_light.dm @@ -32,8 +32,8 @@ var/list/floor_light_cache = list() if(!WT.remove_fuel(0, user)) to_chat(user, SPAN_WARNING("\The [src] must be on to complete this task.")) return - playsound(src.loc, WT.usesound, 50, TRUE) - if(!do_after(user, 20 * WT.toolspeed)) + playsound(src.loc, WT.tool_sound, 50, TRUE) + if(!do_after(user, 20 * WT.tool_speed)) return if(!src || !WT.isOn()) return @@ -44,7 +44,7 @@ var/list/floor_light_cache = list() else if(istype(W, /obj/item/multitool)) var/obj/item/multitool/MT = W - playsound(src.loc, MT.usesound, 50, TRUE) + playsound(src.loc, MT.tool_sound, 50, TRUE) if(!on) to_chat(user, SPAN_WARNING("\The [src] must be on to complete this task.")) return diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index d6f18d5616e..5962623fb81 100644 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -69,7 +69,7 @@ if(W.is_screwdriver()) add_fingerprint(user) disable = !disable - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) if(disable) user.visible_message( \ SPAN_WARNING("[user] has disabled \the [src]!"), \ diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 9409dfbb974..4a35fddcd80 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -72,7 +72,7 @@ return if(W.is_screwdriver()) - playsound(src, W.usesound, 50, TRUE) + playsound(src, W.tool_sound, 50, TRUE) to_chat(user, SPAN_NOTICE("You start to dismantle the IV drip.")) if(do_after(user, 15)) to_chat(user, SPAN_NOTICE("You dismantle the IV drip.")) diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm index 5f91d11e070..5cf87a159c9 100644 --- a/code/game/machinery/jukebox.dm +++ b/code/game/machinery/jukebox.dm @@ -169,7 +169,7 @@ SPAN_NOTICE("You [anchored ? "un" : ""]secure \the [src].")) anchored = !anchored - playsound(src, W.usesound, 50, TRUE) + playsound(src, W.tool_sound, 50, TRUE) power_change() update_icon() if(!anchored) @@ -333,7 +333,7 @@ SPAN_NOTICE("You [anchored ? "un" : ""]secure \the [src].")) anchored = !anchored - playsound(src, W.usesound, 50, TRUE) + playsound(src, W.tool_sound, 50, TRUE) power_change() update_icon() return diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 620dc677b2e..7586394a946 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -80,7 +80,7 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w if(I.is_screwdriver()) open = !open - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.") updateicon() diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index 52004746466..afcb435e61d 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -56,7 +56,7 @@ var/bomb_set /obj/machinery/nuclearbomb/attackby(obj/item/O, mob/user) if(O.is_screwdriver()) - playsound(src, O.usesound, 50, TRUE) + playsound(src, O.tool_sound, 50, TRUE) add_fingerprint(user) if(auth) if(opened == FALSE) @@ -104,7 +104,7 @@ var/bomb_set user.visible_message("[user] starts cutting loose the anchoring bolt covers on [src].", "You start cutting loose the anchoring bolt covers with [O]...") - if(do_after(user,40 * WT.toolspeed)) + if(do_after(user,40 * WT.tool_speed)) if(!src || !user || !WT.remove_fuel(5, user)) return user.visible_message("[user] cuts through the bolt covers on [src].", "You cut through the bolt cover.") removal_stage = 1 @@ -114,8 +114,8 @@ var/bomb_set if(O.is_crowbar()) user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [O]...") - playsound(src, O.usesound, 50, 1) - if(do_after(user,15 * O.toolspeed)) + playsound(src, O.tool_sound, 50, 1) + if(do_after(user,15 * O.tool_speed)) if(!src || !user) return user.visible_message("[user] forces open the bolt covers on [src].", "You force open the bolt covers.") removal_stage = 2 @@ -131,8 +131,8 @@ var/bomb_set return user.visible_message("[user] starts cutting apart the anchoring system sealant on [src].", "You start cutting apart the anchoring system's sealant with [O]...") - playsound(src, WT.usesound, 50, 1) - if(do_after(user,40 * WT.toolspeed)) + playsound(src, WT.tool_sound, 50, 1) + if(do_after(user,40 * WT.tool_speed)) if(!src || !user || !WT.remove_fuel(5, user)) return user.visible_message("[user] cuts apart the anchoring system sealant on [src].", "You cut apart the anchoring system's sealant.") removal_stage = 3 @@ -142,8 +142,8 @@ var/bomb_set if(O.is_wrench()) user.visible_message("[user] begins unwrenching the anchoring bolts on [src].", "You begin unwrenching the anchoring bolts...") - playsound(src, O.usesound, 50, 1) - if(do_after(user,50 * O.toolspeed)) + playsound(src, O.tool_sound, 50, 1) + if(do_after(user,50 * O.tool_speed)) if(!src || !user) return user.visible_message("[user] unwrenches the anchoring bolts on [src].", "You unwrench the anchoring bolts.") removal_stage = 4 @@ -153,8 +153,8 @@ var/bomb_set if(O.is_crowbar()) user.visible_message("[user] begins lifting [src] off of the anchors.", "You begin lifting the device off the anchors...") - playsound(src, O.usesound, 50, 1) - if(do_after(user,80 * O.toolspeed)) + playsound(src, O.tool_sound, 50, 1) + if(do_after(user,80 * O.tool_speed)) if(!src || !user) return user.visible_message("[user] crowbars [src] off of the anchors. It can now be moved.", "You jam the crowbar under the nuclear device and lift it off its anchors. You can now move it!") anchored = 0 diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 11f28ce8407..3a20f46d359 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -206,7 +206,7 @@ Buildable meters return TRUE transfer_fingerprints_to(A) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) user.visible_message( \ "[user] fastens \the [src].", \ "You fasten \the [src].", \ @@ -276,7 +276,7 @@ Buildable meters to_chat(user, "You need to fasten it to a pipe!") return TRUE new /obj/machinery/meter(loc, piping_layer) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You fasten the meter to the pipe.") qdel(src) diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index 2bc31c96a12..665ccaaf783 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -112,9 +112,9 @@ else if(W.is_wrench()) add_fingerprint(usr) if (unwrenched==0) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, SPAN_NOTICE("You begin to unfasten \the [src] from the floor...")) - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ SPAN_NOTICE("[user] unfastens \the [src]."), \ SPAN_NOTICE("You have unfastened \the [src]. Now it can be pulled somewhere else."), \ @@ -125,9 +125,9 @@ if (usr.machine==src) usr << browse(null, "window=pipedispenser") else /*if (unwrenched==1)*/ - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, SPAN_NOTICE("You begin to fasten \the [src] to the floor...")) - if (do_after(user, 20 * W.toolspeed)) + if (do_after(user, 20 * W.tool_speed)) user.visible_message( \ SPAN_NOTICE("[user] fastens \the [src]."), \ SPAN_NOTICE("You have fastened \the [src]. Now it can dispense pipes."), \ diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 1ff9cb08cf0..0ff63945500 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -580,15 +580,15 @@ ) wrenching = TRUE - if(do_after(user, 50 * I.toolspeed)) + if(do_after(user, 50 * I.tool_speed)) //This code handles moving the turret around. After all, it's a portable turret! if(!anchored) - playsound(loc, I.usesound, 100, 1) + playsound(loc, I.tool_sound, 100, 1) anchored = TRUE update_icon() to_chat(user, "You secure the exterior bolts on the turret.") else if(anchored) - playsound(loc, I.usesound, 100, 1) + playsound(loc, I.tool_sound, 100, 1) anchored = FALSE to_chat(user, "You unsecure the exterior bolts on the turret.") update_icon() @@ -993,14 +993,14 @@ switch(build_step) if(0) //first step if(I.is_wrench() && !anchored) - playsound(loc, I.usesound, 100, 1) + playsound(loc, I.tool_sound, 100, 1) to_chat(user, "You secure the external bolts.") anchored = TRUE build_step = 1 return else if(I.is_crowbar() && !anchored) - playsound(loc, I.usesound, 75, 1) + playsound(loc, I.tool_sound, 75, 1) to_chat(user, "You dismantle the turret construction.") new /obj/item/stack/material/steel(loc, 5) qdel(src) @@ -1018,7 +1018,7 @@ return else if(I.is_wrench()) - playsound(loc, I.usesound, 75, 1) + playsound(loc, I.tool_sound, 75, 1) to_chat(user, "You unfasten the external bolts.") anchored = FALSE build_step = 0 @@ -1026,7 +1026,7 @@ if(2) if(I.is_wrench()) - playsound(loc, I.usesound, 100, 1) + playsound(loc, I.tool_sound, 100, 1) to_chat(user, "You bolt the metal armor into place.") build_step = 3 return @@ -1039,8 +1039,8 @@ to_chat(user, "You need more fuel to complete this task.") return - playsound(loc, I.usesound, 50, 1) - if(do_after(user, 20 * I.toolspeed)) + playsound(loc, I.tool_sound, 50, 1) + if(do_after(user, 20 * I.tool_speed)) if(!src || !WT.remove_fuel(5, user)) return build_step = 1 to_chat(user, "You remove the turret's interior metal armor.") @@ -1062,7 +1062,7 @@ return else if(I.is_wrench()) - playsound(loc, I.usesound, 100, 1) + playsound(loc, I.tool_sound, 100, 1) to_chat(user, "You remove the turret's metal armor bolts.") build_step = 2 return @@ -1079,7 +1079,7 @@ if(5) if(I.is_screwdriver()) - playsound(loc, I.usesound, 100, 1) + playsound(loc, I.tool_sound, 100, 1) build_step = 6 to_chat(user, "You close the internal access hatch.") return @@ -1097,7 +1097,7 @@ return else if(I.is_screwdriver()) - playsound(loc, I.usesound, 100, 1) + playsound(loc, I.tool_sound, 100, 1) build_step = 5 to_chat(user, "You open the internal access hatch.") return @@ -1109,8 +1109,8 @@ if(WT.get_fuel() < 5) to_chat(user, "You need more fuel to complete this task.") - playsound(loc, WT.usesound, 50, 1) - if(do_after(user, 30 * WT.toolspeed)) + playsound(loc, WT.tool_sound, 50, 1) + if(do_after(user, 30 * WT.tool_speed)) if(!src || !WT.remove_fuel(5, user)) return build_step = 8 @@ -1127,7 +1127,7 @@ qdel(src) // qdel else if(I.is_crowbar()) - playsound(loc, I.usesound, 75, 1) + playsound(loc, I.tool_sound, 75, 1) to_chat(user, "You pry off the turret's exterior armor.") new /obj/item/stack/material/steel(loc, 2) build_step = 6 diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 4abee078887..78d1b394546 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -96,7 +96,7 @@ return anchored = !anchored to_chat(user, "You [anchored ? "attached" : "detached"] [src].") - playsound(loc, G.usesound, 75, 1) + playsound(loc, G.tool_sound, 75, 1) else if(default_deconstruction_screwdriver(user, G)) return else if(default_deconstruction_crowbar(user, G)) diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index ffe42b0d1e4..220e83848c7 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -64,7 +64,7 @@ return else if(I.is_screwdriver()) panel_open = !panel_open - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) user.visible_message("[user] [panel_open ? "opens" : "closes"] the hatch on the [src].", "You [panel_open ? "open" : "close"] the hatch on the [src].") update_icon() if(!panel_open && user.machine == src) @@ -218,7 +218,7 @@ if(I.is_wrench()) anchored = !anchored visible_message("\The [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].") - playsound(src, I.usesound, 75, 1) + playsound(src, I.tool_sound, 75, 1) if(anchored) connect_to_network() else diff --git a/code/game/machinery/suit_storage/suit_cycler.dm b/code/game/machinery/suit_storage/suit_cycler.dm index ff666835e21..6b88b752b0b 100644 --- a/code/game/machinery/suit_storage/suit_cycler.dm +++ b/code/game/machinery/suit_storage/suit_cycler.dm @@ -186,7 +186,7 @@ else if(I.is_screwdriver()) panel_open = !panel_open - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.") updateUsrDialog() return diff --git a/code/game/machinery/suit_storage/suit_storage_massive.dm b/code/game/machinery/suit_storage/suit_storage_massive.dm index 8752d4343ed..1d112846dd1 100644 --- a/code/game/machinery/suit_storage/suit_storage_massive.dm +++ b/code/game/machinery/suit_storage/suit_storage_massive.dm @@ -200,7 +200,7 @@ return /*if(I.is_screwdriver()) panelopen = !panelopen - playsound(src, I.usesound, 100, 1) + playsound(src, I.tool_sound, 100, 1) to_chat(user, "You [panelopen ? "open up" : "close"] the unit's maintenance panel.") updateUsrDialog() return*/ diff --git a/code/game/machinery/suit_storage/suit_storage_unit.dm b/code/game/machinery/suit_storage/suit_storage_unit.dm index 6768493baef..e109bd198e9 100644 --- a/code/game/machinery/suit_storage/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage/suit_storage_unit.dm @@ -463,7 +463,7 @@ return if(I.is_screwdriver()) panelopen = !panelopen - playsound(src, I.usesound, 100, 1) + playsound(src, I.tool_sound, 100, 1) to_chat(user, "You [panelopen ? "open up" : "close"] the unit's maintenance panel.") updateUsrDialog() return diff --git a/code/game/machinery/supplybeacon.dm b/code/game/machinery/supplybeacon.dm index 29aa8c172ba..ec7268d2fab 100644 --- a/code/game/machinery/supplybeacon.dm +++ b/code/game/machinery/supplybeacon.dm @@ -50,7 +50,7 @@ return anchored = !anchored user.visible_message("\The [user] [anchored ? "secures" : "unsecures"] \the [src].") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) return return ..() diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index 08359cfe000..e49367f94ad 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -124,7 +124,7 @@ if(anchored) anchored = 0 to_chat(user, "You unscrew the beacon from the floor.") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) disconnect_from_network() return else @@ -133,7 +133,7 @@ return anchored = 1 to_chat(user, "You screw the beacon to the floor and attach the cable.") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) return ..() return diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index a39343cbb30..58732926307 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -214,7 +214,7 @@ else if(W.is_screwdriver()) panel_open = !panel_open to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) overlays.Cut() if(panel_open) overlays += image(icon, "[initial(icon_state)]-panel") @@ -234,13 +234,13 @@ SSnanoui.update_uis(src) return else if(W.is_wrench()) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) if(anchored) user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") else user.visible_message("[user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.") - if(do_after(user, 20 * W.toolspeed)) + if(do_after(user, 20 * W.tool_speed)) if(!src) return to_chat(user, "You [anchored? "un" : ""]secured \the [src]!") anchored = !anchored diff --git a/code/game/objects/items.dm b/code/game/objects/_items.dm similarity index 94% rename from code/game/objects/items.dm rename to code/game/objects/_items.dm index 4f793638cc2..d3826fa0837 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/_items.dm @@ -20,8 +20,6 @@ var/burning = null /// Sound to play on hit. Set to [HITSOUND_UNSET] to have it automatically set on init. var/hitsound = HITSOUND_UNSET - /// Like hitsound, but for when used properly and not to kill someone. - var/usesound = null var/storage_cost = null /// This is used to determine on which slots an item can fit. var/slot_flags = 0 @@ -57,8 +55,6 @@ /// If 1, bypass the restrained, lying, and stunned checks action buttons normally test for var/action_button_is_hands_free = 0 - var/tool_behaviour = NONE - /// 0 prevents all transfers, 1 is invisible //var/heat_transfer_coefficient = 1 /// For leaking gas from turf to mask and vice-versa (for masks right now, but at some point, i'd like to include space helmets) @@ -82,8 +78,6 @@ /// 0 won't embed, and 100 will always embed var/embed_chance = EMBED_CHANCE_UNSET - /// This is a multipler on how 'fast' a tool works. e.g. setting this to 0.5 will make the tool work twice as fast. - var/toolspeed = 1.0 /// How long click delay will be when using this, in 1/10ths of a second. Checked in the user's get_attack_speed(). var/attackspeed = DEFAULT_ATTACK_COOLDOWN /// Length of tiles it can reach, 1 is adjacent. @@ -103,9 +97,6 @@ /// Drop sound - played when dropping something onto the floor. var/drop_sound = 'sound/items/drop/device.ogg' - /// Deploytype for switchtools. Only really used on switchtool subtype items, but this is on a general item level - /// in case admins want to do some wierd fucky shit with custom switchtools. - var/deploytype = null /// Whether or not we are heavy. Used for some species to determine if they can two-hand it. var/heavy = FALSE @@ -681,43 +672,10 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. /obj/item/proc/pwr_drain() return 0 // Process Kill -/// Used for non-adjacent melee attacks with specific weapons capable of reaching more than one tile. -/// This uses changeling range string A* but for this purpose its also applicable. -/obj/item/proc/attack_can_reach(var/atom/us, var/atom/them, var/range) - if(us.Adjacent(them)) - return TRUE // Already adjacent. - if(AStar(get_turf(us), get_turf(them), /turf/proc/AdjacentTurfsRangedSting, /turf/proc/Distance, max_nodes=25, max_node_depth=range)) - return TRUE - return FALSE - /// Check if an object should ignite others, like a lit lighter or candle. /obj/item/proc/is_hot() return FALSE -/* - * Assorted tool procs, so any item can emulate any tool, if coded -*/ -/obj/item/proc/is_screwdriver() - return FALSE - -/obj/item/proc/is_wrench() - return FALSE - -/obj/item/proc/is_crowbar() - return FALSE - -/obj/item/proc/is_wirecutter() - return FALSE - -/obj/item/proc/is_cable_coil() - return FALSE - -/obj/item/proc/is_multitool() - return FALSE - -/obj/item/proc/is_welder() - return FALSE - // These procs are for RPEDs and part ratings. The concept for this was borrowed from /vg/station. // Gets the rating of the item, used in stuff like machine construction. /obj/item/proc/get_rating() diff --git a/code/game/objects/effects/decals/contraband.dm b/code/game/objects/effects/decals/contraband.dm index 070acac3fef..05026780317 100644 --- a/code/game/objects/effects/decals/contraband.dm +++ b/code/game/objects/effects/decals/contraband.dm @@ -149,7 +149,7 @@ /obj/structure/sign/poster/attackby(obj/item/W as obj, mob/user as mob) if(W.is_wirecutter()) - playsound(src.loc, W.usesound, 100, 1) + playsound(src.loc, W.tool_sound, 100, 1) if(ruined) to_chat(user, "You remove the remnants of the poster.") qdel(src) diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index 43ea6e4f71c..15045895b1f 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -56,7 +56,7 @@ panel_open = !panel_open user.visible_message("[user] very carefully screws the mine's panel [panel_open ? "open" : "closed"].", "You very carefully screw the mine's panel [panel_open ? "open" : "closed"].") - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) else if((W.is_wirecutter() || istype(W, /obj/item/multitool)) && panel_open) interact(user) diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 8a15a38f16b..83b25591ac4 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -35,7 +35,7 @@ if(WT.remove_fuel(0, user)) damage = 15 - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) health -= damage healthcheck() diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index eafa39321d4..a33174b01df 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -44,12 +44,12 @@ return user.visible_message("\The [user] starts trying to repair \the [src]'s bulb.") repairing = TRUE - if(do_after(user, (40 SECONDS + rand(0, 20 SECONDS)) * W.toolspeed) && can_repair) + if(do_after(user, (40 SECONDS + rand(0, 20 SECONDS)) * W.tool_speed) && can_repair) if(prob(30)) user.visible_message("\The [user] successfully repairs \the [src]!") broken = FALSE update_icon() - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) else user.visible_message("\The [user] fails to repair \the [src].") repairing = FALSE diff --git a/code/game/objects/items/devices/hacktool.dm b/code/game/objects/items/devices/hacktool.dm index fb81ab88cb1..d2dee7532af 100644 --- a/code/game/objects/items/devices/hacktool.dm +++ b/code/game/objects/items/devices/hacktool.dm @@ -26,7 +26,7 @@ /obj/item/multitool/hacktool/attackby(var/obj/item/W, var/mob/user) if(W.is_screwdriver()) in_hack_mode = !in_hack_mode - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) else ..() diff --git a/code/game/objects/items/devices/modkit.dm b/code/game/objects/items/devices/modkit.dm index 968976c0d16..daa2c254d9b 100644 --- a/code/game/objects/items/devices/modkit.dm +++ b/code/game/objects/items/devices/modkit.dm @@ -47,7 +47,7 @@ to_chat(user, "[O] must be safely placed on the ground for modification.") return - playsound(src.loc, O.usesound, 100, 1) + playsound(src.loc, O.tool_sound, 100, 1) user.visible_message("\The [user] opens \the [src] and modifies \the [O].","You open \the [src] and modify \the [O].") diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index 1cc9cb55fc9..873dd497add 100755 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -31,7 +31,7 @@ var/datum/weakref_wiring //Used to store weak references for integrated circuitry. This is now the Omnitool. var/colorable = 1 var/color_overlay = null - toolspeed = 1 + tool_speed = 1 /obj/item/multitool/Initialize(mapload) . = ..() @@ -86,7 +86,7 @@ /obj/item/multitool/cyborg name = "multitool" desc = "Optimised and stripped-down version of a regular multitool." - toolspeed = 0.5 + tool_speed = 0.5 colorable = 0 /datum/category_item/catalogue/anomalous/precursor_a/alien_multitool @@ -107,7 +107,7 @@ catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_multitool) icon = 'icons/obj/abductor.dmi' icon_state = "multitool" - toolspeed = 0.1 + tool_speed = 0.1 origin_tech = list(TECH_MAGNET = 5, TECH_ENGINEERING = 5) colorable = 0 diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm index b87570cc7a7..1af86131741 100644 --- a/code/game/objects/items/devices/powersink.dm +++ b/code/game/objects/items/devices/powersink.dm @@ -47,7 +47,7 @@ anchored = 1 mode = 1 src.visible_message("[user] attaches [src] to the cable!") - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) return else to_chat(user, "Device must be placed over an exposed cable to attach to it.") @@ -60,7 +60,7 @@ mode = 0 src.visible_message("[user] detaches [src] from the cable!") set_light(0) - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) icon_state = "powersink0" return diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 2f363569977..fd779c25a00 100755 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -391,7 +391,7 @@ recalculateChannels() to_chat(user, "You pop out the encryption keys in the headset!") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) else to_chat(user, "This headset doesn't have any encryption keys! How useless...") diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 16ff30cb9af..26a1aeb230b 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -134,7 +134,7 @@ if(W.is_screwdriver()) // Opening the intercom up. wiresexposed = !wiresexposed to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) if(wiresexposed) if(!on) icon_state = "intercom-p_open" @@ -145,7 +145,7 @@ return if(wiresexposed && W.is_wirecutter()) user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) new/obj/item/stack/cable_coil(get_turf(src), 5) var/obj/structure/frame/A = new /obj/structure/frame(src.loc) var/obj/item/circuitboard/M = circuit @@ -157,7 +157,7 @@ A.anchored = 1 A.state = 2 A.update_icon() - M.deconstruct(src) + M.after_deconstruct(src) qdel(src) else src.attack_hand(user) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 5d1c55b2539..251de16a75c 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -664,7 +664,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list( var/datum/robot_component/C = R.components["radio"] R.cell_use_power(C.active_usage) -/obj/item/radio/borg/attackby(obj/item/I, mob/living/user, params, attackchain_flags, damage_multiplier) +/obj/item/radio/borg/attackby(obj/item/I, mob/living/user, params, clickchain_flags, damage_multiplier) user.set_machine(src) if (!(I.is_screwdriver() || istype(I, /obj/item/encryptionkey))) return ..() @@ -685,7 +685,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list( recalculateChannels() to_chat(user, "You pop out the encryption key in the radio!") - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) else to_chat(user, "This radio doesn't have any encryption keys!") diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index a707128b8fd..c68859f2929 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -152,7 +152,7 @@ else cover_open = 1 to_chat(user, "You unscrew the panel.") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) updateicon() return diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index 5c61c0ad917..0c27edc9d43 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -416,8 +416,8 @@ /obj/item/cassette_tape/attackby(obj/item/I, mob/user, params) if(ruined && I.is_screwdriver()) to_chat(user, "You start winding the tape back in...") - playsound(src, I.usesound, 50, 1) - if(do_after(user, 120 * I.toolspeed, target = src)) + playsound(src, I.tool_sound, 50, 1) + if(do_after(user, 120 * I.tool_speed, target = src)) to_chat(user, "You wound the tape back in.") fix() return diff --git a/code/game/objects/items/inducer.dm b/code/game/objects/items/inducer.dm index d5ce7e772ba..53b50dd071a 100644 --- a/code/game/objects/items/inducer.dm +++ b/code/game/objects/items/inducer.dm @@ -83,7 +83,7 @@ /obj/item/inducer/attackby(obj/item/W, mob/user) if(W.is_screwdriver()) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) if(!opened) to_chat(user, "You open the battery compartment.") opened = TRUE diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm index 9b3981a57d9..1299d762e7d 100644 --- a/code/game/objects/items/stacks/nanopaste.dm +++ b/code/game/objects/items/stacks/nanopaste.dm @@ -6,7 +6,7 @@ icon_state = "nanopaste" origin_tech = list(TECH_MATERIAL = 4, TECH_ENGINEERING = 3) amount = 10 - toolspeed = 0.75 //Used in surgery, shouldn't be the same speed as a normal screwdriver on mechanical organ repair. + tool_speed = 0.75 //Used in surgery, shouldn't be the same speed as a normal screwdriver on mechanical organ repair. w_class = ITEMSIZE_SMALL no_variants = FALSE var/restoration_external = 5 @@ -19,7 +19,7 @@ if (istype(M,/mob/living/silicon/robot)) //Repairing cyborgs var/mob/living/silicon/robot/R = M if (R.getBruteLoss() || R.getFireLoss()) - if(do_after(user,7 * toolspeed)) + if(do_after(user,7 * tool_speed)) R.adjustBruteLoss(-15) R.adjustFireLoss(-15) R.updatehealth() @@ -38,9 +38,9 @@ else if(can_use(1)) user.setClickCooldown(user.get_attack_speed(src)) if(S.open >= 2) - if(do_after(user,5 * toolspeed)) + if(do_after(user,5 * tool_speed)) S.heal_damage(restoration_internal, restoration_internal, robo_repair = 1) - else if(do_after(user,5 * toolspeed)) + else if(do_after(user,5 * tool_speed)) S.heal_damage(restoration_external,restoration_external, robo_repair =1) H.updatehealth() use(1) diff --git a/code/game/objects/items/storage/_storage.dm b/code/game/objects/items/storage/_storage.dm index 1e1f4766e66..f041b3e937a 100644 --- a/code/game/objects/items/storage/_storage.dm +++ b/code/game/objects/items/storage/_storage.dm @@ -59,7 +59,7 @@ src.close(user) // I would think there should be some incap check here or something // But MouseDrop doesn't use one (as of this writing), so... - else if(isliving(user) && Adjacent(user)) + else if(isliving(user) && user.Reachability(src)) src.open(user) else return ..() @@ -69,7 +69,7 @@ return ..() if(user in is_seeing) close(user) - else if(isliving(user) && Adjacent(user)) + else if(isliving(user) && user.Reachability(src)) open(user) else return ..() @@ -455,8 +455,8 @@ H.r_store = null return - if (src.loc == user) - src.open(user) + if (loc == user) + open(user) else ..() for(var/mob/M in range(1)) diff --git a/code/game/objects/items/storage/secure.dm b/code/game/objects/items/storage/secure.dm index 9c87e5d612c..eae58c5cd37 100644 --- a/code/game/objects/items/storage/secure.dm +++ b/code/game/objects/items/storage/secure.dm @@ -41,9 +41,9 @@ playsound(src.loc, "sparks", 50, 1) return if (W.is_screwdriver()) - if (do_after(user, 20 * W.toolspeed)) + if (do_after(user, 20 * W.tool_speed)) src.open =! src.open - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) user.show_message(text("You [] the service panel.", (src.open ? "open" : "close"))) return if (istype(W, /obj/item/multitool) && (src.open == 1)&& (!src.l_hacking)) diff --git a/code/game/objects/items/tools/_tool.dm b/code/game/objects/items/tools/_tool.dm new file mode 100644 index 00000000000..a7e03577ba5 --- /dev/null +++ b/code/game/objects/items/tools/_tool.dm @@ -0,0 +1,6 @@ +/** + * just a tool supertype + * + * the tool system is implemented at /item level + */ +/obj/item/tool diff --git a/code/game/objects/items/weapons/tools/crowbar.dm b/code/game/objects/items/tools/crowbar.dm similarity index 90% rename from code/game/objects/items/weapons/tools/crowbar.dm rename to code/game/objects/items/tools/crowbar.dm index 0d625708647..79982ff6ccb 100644 --- a/code/game/objects/items/weapons/tools/crowbar.dm +++ b/code/game/objects/items/tools/crowbar.dm @@ -18,14 +18,10 @@ origin_tech = list(TECH_ENGINEERING = 1) matter = list(MAT_STEEL = 50) attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked") - usesound = 'sound/items/crowbar.ogg' + tool_sound = 'sound/items/crowbar.ogg' drop_sound = 'sound/items/drop/crowbar.ogg' pickup_sound = 'sound/items/pickup/crowbar.ogg' - toolspeed = 1 - - -/obj/item/tool/crowbar/is_crowbar() - return TRUE + tool_speed = 1 /obj/item/tool/crowbar/red icon = 'icons/obj/tools.dmi' @@ -37,14 +33,14 @@ desc = "A sturdy, carved bone used to remove floors and to pry open doors." icon = 'icons/obj/tools.dmi' icon_state = "crowbar_bone" - toolspeed = 1.25 + tool_speed = 1.25 /obj/item/tool/crowbar/brass name = "brass crowbar" desc = "An etched piece of brass plated metal, used to remove floors and to pry open doors." icon = 'icons/obj/tools.dmi' icon_state = "crowbar_brass" - toolspeed = 0.75 + tool_speed = 0.75 /datum/category_item/catalogue/anomalous/precursor_a/alien_crowbar name = "Precursor Alpha Object - Hard Light Pry Tool" @@ -64,9 +60,9 @@ desc = "A hard-light crowbar. It appears to pry by itself, without any effort required." catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_crowbar) icon = 'icons/obj/abductor.dmi' - usesound = 'sound/weapons/sonic_jackhammer.ogg' + tool_sound = 'sound/weapons/sonic_jackhammer.ogg' icon_state = "crowbar" - toolspeed = 0.1 + tool_speed = 0.1 origin_tech = list(TECH_COMBAT = 4, TECH_ENGINEERING = 4) /obj/item/tool/crowbar/hybrid @@ -74,23 +70,23 @@ desc = "A crowbar whose head seems to phase in and out of view." catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_crowbar) icon_state = "hybcrowbar" - usesound = 'sound/weapons/sonic_jackhammer.ogg' - toolspeed = 0.4 + tool_sound = 'sound/weapons/sonic_jackhammer.ogg' + tool_speed = 0.4 origin_tech = list(TECH_COMBAT = 4, TECH_ENGINEERING = 3) reach = 2 /obj/item/tool/crowbar/cyborg name = "hydraulic crowbar" desc = "A hydraulic prying tool, compact but powerful. Designed to replace crowbars in industrial synthetics." - usesound = 'sound/items/jaws_pry.ogg' + tool_sound = 'sound/items/jaws_pry.ogg' force = 10 - toolspeed = 0.5 + tool_speed = 0.5 /obj/item/tool/crowbar/RIGset name = "integrated prybar" desc = "If you're seeing this, someone did a dum-dum." - usesound = 'sound/items/jaws_pry.ogg' - toolspeed = 0.7 + tool_sound = 'sound/items/jaws_pry.ogg' + tool_speed = 0.7 /obj/item/tool/crowbar/power name = "jaws of life" @@ -99,9 +95,9 @@ item_state = "jawsoflife" matter = list(MAT_METAL=150, MAT_SILVER=50) origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) - usesound = 'sound/items/jaws_pry.ogg' + tool_sound = 'sound/items/jaws_pry.ogg' force = 15 - toolspeed = 0.25 + tool_speed = 0.25 var/obj/item/tool/wirecutters/power/counterpart = null /obj/item/tool/crowbar/power/Initialize(mapload, no_counterpart = TRUE) @@ -142,8 +138,8 @@ origin_tech = list(TECH_ENGINEERING = 1) matter = list(MAT_STEEL = 30) attack_verb = list("whapped", "smacked", "swatted", "thwacked", "hit") - usesound = 'sound/items/crowbar.ogg' - toolspeed = 1 + tool_sound = 'sound/items/crowbar.ogg' + tool_speed = 1 var/random_color = TRUE /obj/item/tool/prybar/red diff --git a/code/game/objects/items/weapons/tools/screwdriver.dm b/code/game/objects/items/tools/screwdriver.dm similarity index 92% rename from code/game/objects/items/weapons/tools/screwdriver.dm rename to code/game/objects/items/tools/screwdriver.dm index bb35a156643..91b905355d0 100644 --- a/code/game/objects/items/weapons/tools/screwdriver.dm +++ b/code/game/objects/items/tools/screwdriver.dm @@ -15,13 +15,13 @@ throw_speed = 3 throw_range = 5 hitsound = 'sound/weapons/bladeslice.ogg' - usesound = 'sound/items/screwdriver.ogg' + tool_sound = 'sound/items/screwdriver.ogg' drop_sound = 'sound/items/drop/screwdriver.ogg' pickup_sound = 'sound/items/pickup/screwdriver.ogg' matter = list(MAT_STEEL = 75) attack_verb = list("stabbed") sharp = 1 - toolspeed = 1 + tool_speed = 1 var/random_color = TRUE /obj/item/tool/screwdriver/suicide_act(mob/user) @@ -68,22 +68,18 @@ M = user return eyestab(M,user) -/obj/item/tool/screwdriver/is_screwdriver() - return TRUE - - /obj/item/tool/screwdriver/bone name = "primitive screwdriver" desc = "A whittled bone with a tapered point, used to remove screws, or stab." icon_state = "screwdriver_bone" random_color = FALSE - toolspeed = 1.25 + tool_speed = 1.25 /obj/item/tool/screwdriver/brass name = "brass screwdriver" desc = "A screwdriver with a very sharp tip, that ensures fine deliberate adjustments." icon_state = "screwdriver_brass" - toolspeed = 0.75 + tool_speed = 0.75 random_color = FALSE /datum/category_item/catalogue/anomalous/precursor_a/alien_screwdriver @@ -106,8 +102,8 @@ icon = 'icons/obj/abductor.dmi' icon_state = "screwdriver_a" item_state = "screwdriver_black" - usesound = 'sound/items/pshoom.ogg' - toolspeed = 0.1 + tool_sound = 'sound/items/pshoom.ogg' + tool_speed = 0.1 random_color = FALSE /obj/item/tool/screwdriver/hybrid @@ -119,8 +115,8 @@ origin_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 3) slowdown = 0.1 w_class = ITEMSIZE_NORMAL - usesound = 'sound/effects/uncloak.ogg' - toolspeed = 0.4 + tool_sound = 'sound/effects/uncloak.ogg' + tool_speed = 0.4 random_color = FALSE reach = 2 @@ -129,14 +125,14 @@ /obj/item/tool/screwdriver/cyborg name = "powered screwdriver" desc = "An electrical screwdriver, designed to be both precise and quick." - usesound = 'sound/items/drill_use.ogg' - toolspeed = 0.5 + tool_sound = 'sound/items/drill_use.ogg' + tool_speed = 0.5 /obj/item/tool/screwdriver/RIGset name = "integrated screwdriver" desc = "If you're seeing this, someone did a dum-dum." - usesound = 'sound/items/drill_use.ogg' - toolspeed = 0.7 + tool_sound = 'sound/items/drill_use.ogg' + tool_speed = 0.7 /obj/item/tool/screwdriver/power name = "hand drill" @@ -153,8 +149,8 @@ throw_range = 3//it's heavier than a screw driver/wrench, so it does more damage, but can't be thrown as far attack_verb = list("drilled", "screwed", "jabbed", "whacked") hitsound = 'sound/items/drill_hit.ogg' - usesound = 'sound/items/drill_use.ogg' - toolspeed = 0.25 + tool_sound = 'sound/items/drill_use.ogg' + tool_speed = 0.25 random_color = FALSE var/obj/item/tool/wrench/power/counterpart = null diff --git a/code/game/objects/items/tools/switchtool.dm b/code/game/objects/items/tools/switchtool.dm new file mode 100644 index 00000000000..37a3e739af0 --- /dev/null +++ b/code/game/objects/items/tools/switchtool.dm @@ -0,0 +1,538 @@ +/** + * switchtools! + * + * supports both the dynamic tool system by providing the necessary tool behaviours, as well as + * the normal attackby system by passing melee_attack_chain down if necessary. + */ +/obj/item/switchtool + name = "switchtool" + icon = 'icons/obj/switchtool.dmi' + icon_state = "switchtool" + item_state = "switchtool" + desc = "A multi-deployable, multi-instrument, finely crafted multi-purpose tool. The envy of engineers everywhere." + siemens_coefficient = 1 + force = 3 + w_class = ITEMSIZE_SMALL + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_switchtool.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_switchtool.dmi') + throw_force = 6 + throw_speed = 3 + throw_range = 6 + var/deploy_sound = "sound/weapons/switchblade.ogg" + var/undeploy_sound = "sound/weapons/switchblade.ogg" + + /// modules; initial modules are as typepath. will associate object to module type at runtime + var/list/tools = list( + /obj/item/tool/screwdriver/switchy = SWITCHTOOL_SCREWDRIVER, + /obj/item/tool/wrench/switchy = SWITCHTOOL_WRENCH, + /obj/item/tool/wirecutters/switchy = SWITCHTOOL_WIRECUTTERS, + /obj/item/tool/crowbar/switchy = SWITCHTOOL_CROWBAR, + /obj/item/multitool/switchy = SWITCHTOOL_MULTITOOL + ) + + /// tool functions + var/list/tool_functions = list( + TOOL_SCREWDRIVER, + TOOL_CROWBAR, + TOOL_WIRECUTTER, + TOOL_WRENCH, + TOOL_MULTITOOL + ) + + tool_speed = 1 + tool_quality = TOOL_QUALITY_DEFAULT + + /// currently deployed item + var/obj/item/deployed + /// currently used dynamic tool function + var/deploying_function + + var/static/list/default_switchtool_radials = _default_switchtool_radials() + +/proc/_default_switchtool_radials() + return list( + SWITCHTOOL_SCREWDRIVER = image(icon = 'icons/obj/tools.dmi', icon_state = "screwdriver"), + SWITCHTOOL_WRENCH = image(icon = 'icons/obj/tools.dmi', icon_state = "wrench"), + SWITCHTOOL_CROWBAR = image(icon = 'icons/obj/tools.dmi', icon_state = "crowbar"), + SWITCHTOOL_WIRECUTTERS = image(icon = 'icons/obj/tools.dmi', icon_state = "cutters"), + SWITCHTOOL_MULTITOOL = image(icon = 'icons/obj/device.dmi', icon_state = "multitool"), + SWITCHTOOL_WELDER = image(icon = 'icons/obj/tools.dmi', icon_state = "tubewelder"), + SWITCHTOOL_SCALPEL = image(icon = 'icons/obj/surgery.dmi', icon_state = "scalpel"), + SWITCHTOOL_CAUTERY = image(icon = 'icons/obj/surgery.dmi', icon_state = "cautery"), + SWITCHTOOL_HEMOSTAT = image(icon = 'icons/obj/surgery.dmi', icon_state = "hemostat"), + SWITCHTOOL_RETRACTOR = image(icon = 'icons/obj/surgery.dmi', icon_state = "retractor"), + SWITCHTOOL_BONECLAMP = image(icon = 'icons/obj/surgery.dmi', icon_state = "bone_setter"), + SWITCHTOOL_SAW = image(icon = 'icons/obj/surgery.dmi', icon_state = "saw"), + SWITCHTOOL_DRILL = image(icon = 'icons/obj/surgery.dmi', icon_state = "drill"), + SWITCHTOOL_LIGHT = image(icon = 'icons/obj/lighting.dmi', icon_state = "flashlight_yellow-on"), + SWITCHTOOL_SOAP = image(icon = 'icons/obj/device.dmi', icon_state = "uv_on"), + SWITCHTOOL_SHIELD = image(icon = 'icons/obj/weapons.dmi', icon_state = "riot_alt"), + SWITCHTOOL_SWORD = image(icon = 'icons/obj/weapons.dmi', icon_state = "blade"), + ) + +/obj/item/switchtool/Initialize(mapload) + . = ..() + var/list/adding = list() + for(var/path in tools) + if(isdatum(path)) + // wtf? + continue + if(!ispath(path)) + // wtf? + continue + adding[path] = tools[path] + tools -= path + for(var/path in adding) + var/enum = adding[path] + add_module(new path(src), enum) + +/obj/item/switchtool/examine(mob/user) + . = ..() + . += "This holds [get_formatted_modules()]." + +//makes the string list of modules ie "a screwdriver, a knife, and a clown horn" +//does not end with a full stop, but does contain commas +/obj/item/switchtool/proc/get_formatted_modules() + var/counter = 0 + var/module_string = "" + for(var/obj/item/module in tools) + counter++ + if(counter == tools.len) + module_string += "and \a [module.name]" + else + module_string += "\a [module.name], " + return module_string + +/obj/item/switchtool/attack_self(mob/user) + if(!user) + return + if(deployed) + to_chat(user, "You store \the [deployed].") + undeploy() + return + else + choose_deploy(user) + +/obj/item/switchtool/proc/add_module(obj/item/module, switchtool_enum) + if(module.loc != src) + module.forceMove(src) + tools[module] = switchtool_enum + +/obj/item/switchtool/proc/remove_module(obj/item/module) + if(module == deployed) + undeploy() + tools -= module + +/obj/item/switchtool/proc/undeploy() + playsound(src, undeploy_sound, 10, 1) + if(istype(deployed, /obj/item/weldingtool)) + var/obj/item/weldingtool/W = deployed + W.setWelding(FALSE) + deployed = null + cut_overlays() + w_class = initial(w_class) + update_icon() + tool_locked = FALSE + +/obj/item/switchtool/proc/deploy(obj/item/I) + if(!(I in tools)) + return FALSE + if(deployed) + return FALSE + playsound(src, deploy_sound, 10, 1) + deployed = I + update_icon() + if(istype(I, /obj/item/weldingtool)) + var/obj/item/weldingtool/W = I + W.setWelding(TRUE) + tool_locked = TRUE + return TRUE + +/obj/item/switchtool/proc/choose_deploy(mob/user) + var/list/options = list() + for(var/obj/item/I as anything in tools) + var/enum = tools[I] + options[I] = default_switchtool_radials[enum] + if(options.len < 1) + to_chat(user, "\The [src] doesn't have any available modules!") + return + var/obj/item/choice + choice = show_radial_menu(user, src, options) + if(deploy(choice)) + to_chat(user, "You deploy \the [deployed].") + return TRUE + +/obj/item/switchtool/proc/get_switchtool_enum(obj/item/I) + return tools[I] + +/obj/item/switchtool/handle_shield(mob/user) + if(get_switchtool_enum(deployed) == SWITCHTOOL_SHIELD) + return TRUE + return FALSE + +/obj/item/switchtool/update_overlays() + . = ..() + if(!deployed) + return + var/enum = get_switchtool_enum(deploying_function? tool_function_to_enum(deploying_function) : deployed) + if(!enum) + return + var/state_append = switchtool_enum_to_state(enum) + if(!state_append) + return + var/mutable_appearance/MA = mutable_appearance(icon, "[icon_state]_[state_append]") + if(light_color) + MA.color = light_color + . += MA + +/obj/item/switchtool/proc/tool_function_to_enum(function) + switch(function) + if(TOOL_SCREWDRIVER) + return SWITCHTOOL_SCREWDRIVER + if(TOOL_WRENCH) + return SWITCHTOOL_WRENCH + if(TOOL_CROWBAR) + return SWITCHTOOL_CROWBAR + if(TOOL_MULTITOOL) + return SWITCHTOOL_MULTITOOL + if(TOOL_WELDER) + return SWITCHTOOL_WELDER + if(TOOL_WIRECUTTER) + return SWITCHTOOL_WIRECUTTERS + if(TOOL_CAUTERY) + return SWITCHTOOL_CAUTERY + if(TOOL_SAW) + return SWITCHTOOL_SAW + if(TOOL_DRILL) + return SWITCHTOOL_DRILL + if(TOOL_BONESET) + return SWITCHTOOL_BONECLAMP + if(TOOL_SCALPEL) + return SWITCHTOOL_SCALPEL + if(TOOL_RETRACTOR) + return SWITCHTOOL_RETRACTOR + if(TOOL_HEMOSTAT) + return SWITCHTOOL_HEMOSTAT + +/obj/item/switchtool/proc/switchtool_enum_to_state(enum) + switch(enum) + if(SWITCHTOOL_SCREWDRIVER) + return "driver" + if(SWITCHTOOL_WRENCH) + return "wrench" + if(SWITCHTOOL_CROWBAR) + return "crowbar" + if(SWITCHTOOL_WIRECUTTERS) + return "cutter" + if(SWITCHTOOL_MULTITOOL) + return "multitool" + if(SWITCHTOOL_WELDER) + return "welder" + if(SWITCHTOOL_LIGHT) + return "light" + if(SWITCHTOOL_SOAP) + return "soap" + if(SWITCHTOOL_SCALPEL) + return "scalpel" + if(SWITCHTOOL_BONECLAMP) + return "boneclamp" + if(SWITCHTOOL_HEMOSTAT) + return "hemostat" + if(SWITCHTOOL_RETRACTOR) + return "retractor" + if(SWITCHTOOL_CAUTERY) + return "cautery" + if(SWITCHTOOL_SAW) + return "saw" + if(SWITCHTOOL_DRILL) + return "drill" + if(SWITCHTOOL_SWORD) + return "blade" + if(SWITCHTOOL_SHIELD) + return "shield" + +//? tool redirection +/obj/item/switchtool/tool_check(function, mob/user, atom/target, flags, usage) + return (function in tool_functions)? tool_quality : null + +//? tool redirection +/obj/item/switchtool/tool_query(mob/user, atom/target, flags, usage) + . = list() + for(var/i in tool_functions) + .[i] = tool_quality + +//? tool redirection +/obj/item/switchtool/tool_behaviour() + return deployed?.tool_behaviour() + +//? tool redirection +/obj/item/switchtool/tool_feedback_start(function, flags, mob/user, atom/target, time, cost, usage) + . = ..() + deploying_function = function + update_icon() + +//? tool redirection +/obj/item/switchtool/tool_feedback_end(function, flags, mob/user, atom/target, time, cost, usage, success) + . = ..() + deploying_function = null + update_icon() + +//? click redirection +/obj/item/switchtool/melee_attack_chain(atom/target, mob/user, clickchain_flags, params) + if(!deployed) + return ..() + . = deployed.melee_attack_chain(target, user, clickchain_flags | CLICKCHAIN_REDIRECTED, params) + if(deployed && deployed.loc != src) + deployed.forceMove(src) + undeploy() + +//? click redirection +/obj/item/switchtool/ranged_attack_chain(atom/target, mob/user, clickchain_flags, params) + if(!deployed) + return ..() + . = deployed.ranged_attack_chain(target, user, clickchain_flags | CLICKCHAIN_REDIRECTED, params) + if(deployed.loc != src) + deployed.forceMove(src) + undeploy() + +/obj/item/switchtool/surgery + name = "surgeon's switchtool" + icon_state = "surgeryswitchtool" + item_state = "surgeryswitchtool" + desc = "A switchtool containing most of the necessary items for impromptu surgery. For the surgeon on the go." + tools = list(/obj/item/surgical/scalpel/switchy = SWITCHTOOL_SCALPEL, + /obj/item/surgical/hemostat/switchy = SWITCHTOOL_HEMOSTAT, + /obj/item/surgical/retractor/switchy = SWITCHTOOL_RETRACTOR, + /obj/item/surgical/bonesetter/switchy = SWITCHTOOL_BONECLAMP) + tool_functions = list( + TOOL_SCALPEL, + TOOL_HEMOSTAT, + TOOL_RETRACTOR, + TOOL_BONESET + ) + +//Unique adminspawn switchtool. Has all the tools. +/obj/item/switchtool/holo + name = "Tool" + icon_state = "holoswitchtool" + item_state = "holoswitchtool" + desc = "An object that can take on the holographic hardlight form of nearly any tool in use today." + description_fluff = "Mankind's first tool was likely a blade crudely shaped from flint. Versatile, at the time - one could skin creatures, use it as a weapon, hack at trees and cut plants. This is, potentially, mankind's last tool- able to be dynamically upgraded to support different holoprojector setups, allowing even more tools to be used by one device, once a working holoprojector setup for an application is implemented." + var/brightness_max = 4 + var/brightness_min = 2 + deploy_sound = "sound/weapons/switchsound.ogg" + undeploy_sound = "sound/weapons/switchsound.ogg" + light_color = LIGHT_COLOR_CYAN + tool_speed = 0.8 + tools = list( + /obj/item/surgical/scalpel/laser3/holoswitch = SWITCHTOOL_SCALPEL, + /obj/item/surgical/hemostat/holoswitch = SWITCHTOOL_HEMOSTAT, + /obj/item/surgical/retractor/holoswitch = SWITCHTOOL_RETRACTOR, + /obj/item/surgical/bone_clamp/holoswitch = SWITCHTOOL_BONECLAMP, + /obj/item/surgical/circular_saw/holoswitch = SWITCHTOOL_SAW, + /obj/item/surgical/surgicaldrill/holoswitch = SWITCHTOOL_DRILL, + /obj/item/surgical/cautery/holoswitch = SWITCHTOOL_CAUTERY, + /obj/item/tool/screwdriver/holoswitch = SWITCHTOOL_SCREWDRIVER, + /obj/item/tool/wrench/holoswitch = SWITCHTOOL_WRENCH, + /obj/item/tool/crowbar/holoswitch = SWITCHTOOL_CROWBAR, + /obj/item/tool/wirecutters/holoswitch = SWITCHTOOL_WIRECUTTERS, + /obj/item/weldingtool/holoswitch = SWITCHTOOL_WELDER, + /obj/item/multitool/holoswitch = SWITCHTOOL_MULTITOOL, + /obj/item/flashlight/holoswitch = SWITCHTOOL_LIGHT, + /obj/item/soap/holoswitch = SWITCHTOOL_SOAP, + /obj/item/melee/energy/sword/holoswitch = SWITCHTOOL_SWORD, + /obj/item/shield/holoswitch = SWITCHTOOL_SHIELD + ) + tool_functions = list( + TOOL_SCALPEL, + TOOL_HEMOSTAT, + TOOL_RETRACTOR, + TOOL_BONESET, + TOOL_WELDER, + TOOL_WRENCH, + TOOL_CROWBAR, + TOOL_WIRECUTTER, + TOOL_MULTITOOL, + TOOL_SCREWDRIVER, + TOOL_SAW, + TOOL_DRILL + ) + +/obj/item/switchtool/holo/Initialize(mapload) + . = ..() + add_atom_colour(light_color, FIXED_COLOUR_PRIORITY) + +/obj/item/switchtool/holo/deploy(var/obj/item/module) //We lightin' it up in here + ..() + if(get_switchtool_enum(module) == SWITCHTOOL_LIGHT) + set_light(brightness_max, 4, light_color) + else + set_light(brightness_min, 1, light_color) + +/obj/item/switchtool/holo/undeploy() + ..() + set_light(0) + +/obj/item/switchtool/holo/CE + name = "holotool" + icon_state = "holoswitchtool" + item_state = "holoswitchtool" + desc = "A finely crafted device that uses a micro-scale hardlight emitter to form hardlight manipulators in the form of tools. Can also operate in low-power mode as a flashlight and in high-power mode as a UV cleaner." + light_color = "#FED8B1" //lightcolororange sucks lmao + tools = list( + /obj/item/tool/screwdriver/holoswitch = SWITCHTOOL_SCREWDRIVER, + /obj/item/tool/wrench/holoswitch = SWITCHTOOL_WRENCH, + /obj/item/tool/crowbar/holoswitch = SWITCHTOOL_CROWBAR, + /obj/item/tool/wirecutters/holoswitch = SWITCHTOOL_WIRECUTTERS, + /obj/item/weldingtool/holoswitch = SWITCHTOOL_WELDER, + /obj/item/multitool/holoswitch = SWITCHTOOL_MULTITOOL, + /obj/item/flashlight/holoswitch = SWITCHTOOL_LIGHT, + /obj/item/soap/holoswitch = SWITCHTOOL_SOAP, + ) + tool_functions = list( + TOOL_WELDER, + TOOL_WRENCH, + TOOL_CROWBAR, + TOOL_WIRECUTTER, + TOOL_MULTITOOL, + TOOL_SCREWDRIVER + ) + +//Actual tools go here. + +/obj/item/soap/holoswitch + name = "holographically contained UV light" + desc = "This should not exist." + +/obj/item/flashlight/holoswitch + name = "low-power holoemitter" + desc = "This should not exist" + power_use = 0 + +/obj/item/tool/screwdriver/holoswitch + name = "hardlight screwdriver" + desc = "This should not exist." + tool_speed = 0.9 + +/obj/item/tool/wrench/holoswitch + name = "hardlight bolt driver" + desc = "This should not exist." + tool_speed = 0.9 + +/obj/item/tool/crowbar/holoswitch + name = "hardlight pry bar" + desc = "This should not exist." + tool_speed = 0.9 + +/obj/item/tool/wirecutters/holoswitch + name = "hardlight wire cutting tool" + desc = "This should not exist." + tool_speed = 0.9 + +/obj/item/weldingtool/holoswitch + name = "laser welding tool" + desc = "This should not exist." + tool_speed = 0.9 + var/nextrefueltick = 0 + +/obj/item/weldingtool/holoswitch/process(delta_time) + ..() + if(get_fuel() < get_max_fuel() && nextrefueltick < world.time) + nextrefueltick = world.time + 10 + reagents.add_reagent("fuel", 1) + +/obj/item/multitool/holoswitch + name = "hardlight electromagnetic microinducer" + desc = "This should not exist." + +/obj/item/surgical/scalpel/laser3/holoswitch + name = "hybrid hardlight-laser scalpel" + desc = "This should not exist." + tool_speed = 0.9 + +/obj/item/surgical/retractor/holoswitch + name = "hardlight retractor" + desc = "This should not exist." + tool_speed = 0.9 + +/obj/item/surgical/hemostat/holoswitch + name = "hardlight haemostat" + desc = "This should not exist." + tool_speed = 0.9 + +/obj/item/surgical/cautery/holoswitch + name = "laser cautery" + desc = "This should not exist." + tool_speed = 0.9 + +/obj/item/surgical/circular_saw/holoswitch + name = "hardlight saw" + desc = "This should not exist." + tool_speed = 0.9 + +/obj/item/surgical/surgicaldrill/holoswitch + name = "hardlight surgical drill" + desc = "This should not exist." + tool_speed = 0.9 + +/obj/item/surgical/bone_clamp/holoswitch + name = "hardlight bone rectifier" + desc = "This should not exist." + tool_speed = 0.9 + +/obj/item/melee/energy/sword/holoswitch + name = "hardlight blade" + desc = "This should not exist." + +/obj/item/shield/holoswitch + name = "hardlight shield" + desc = "This should not exist." + +/obj/item/soap/holoswitch/pre_attack() + wet() + return ..() + +/obj/item/tool/screwdriver/switchy + name = "switchtool screwdriver" + desc = "This should not exist." + tool_speed = 1.2 + +/obj/item/tool/wrench/switchy + name = "switchtool wrench" + desc = "This should not exist." + tool_speed = 1.2 + +/obj/item/tool/crowbar/switchy + name = "switchtool crowbar" + desc = "This should not exist." + tool_speed = 1.2 + +/obj/item/tool/wirecutters/switchy + name = "switchtool cutters" + desc = "This should not exist." + tool_speed = 1.2 + +/obj/item/multitool/switchy + name = "switchtool micro-multitool" + desc = "This should not exist." + +/obj/item/surgical/scalpel/switchy + name = "switchtool scalpel" + desc = "This should not exist." + tool_speed = 1.2 + +/obj/item/surgical/hemostat/switchy + name = "switchtool hemostat" + desc = "This should not exist." + tool_speed = 1.2 + +/obj/item/surgical/retractor/switchy + name = "switchtool retractor" + desc = "This should not exist." + tool_speed = 1.2 + +/obj/item/surgical/bonesetter/switchy + name = "switchtool bone setter" + desc = "This should not exist." + tool_speed = 1.2 diff --git a/code/game/objects/items/weapons/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm similarity index 95% rename from code/game/objects/items/weapons/tools/weldingtool.dm rename to code/game/objects/items/tools/weldingtool.dm index 94b60a928d7..0b1e5a1c029 100644 --- a/code/game/objects/items/weapons/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -30,14 +30,14 @@ var/acti_sound = 'sound/items/welderactivate.ogg' var/deac_sound = 'sound/items/welderdeactivate.ogg' - usesound = 'sound/items/Welder2.ogg' + tool_sound = 'sound/items/Welder2.ogg' var/change_icons = TRUE var/flame_intensity = 2 //how powerful the emitted light is when used. var/flame_color = "#FF9933" // What color the welder light emits when its on. Default is an orange-ish color. var/eye_safety_modifier = 0 // Increasing this will make less eye protection needed to stop eye damage. IE at 1, sunglasses will fully protect. var/burned_fuel_for = 0 // Keeps track of how long the welder's been on, used to gradually empty the welder if left one, without RNG. var/always_process = FALSE // If true, keeps the welder on the process list even if it's off. Used for when it needs to regenerate fuel. - toolspeed = 1 + tool_speed = 1 drop_sound = 'sound/items/drop/weldingtool.ogg' pickup_sound = 'sound/items/pickup/weldingtool.ogg' @@ -148,6 +148,7 @@ L.IgniteMob() if (istype(location, /turf)) location.hotspot_expose(700, 50, 1) + /obj/item/weldingtool/attack_self(mob/user) setWelding(!welding, user) @@ -158,6 +159,25 @@ /obj/item/weldingtool/proc/get_max_fuel() return max_fuel +/obj/item/weldingtool/using_as_tool(function, flags, mob/user, atom/target, time, cost, usage) + . = ..() + if(!. || function != TOOL_WELDER) + return + if(!isOn()) + user.action_feedback(SPAN_WARNING("[src] must be on to be used to weld!"), target) + return FALSE + // floor + var/computed = round(cost * time * TOOL_WELDING_FUEL_PER_DS) + if(get_fuel() < computed) + user.action_feedback(SPAN_WARNING("[src] doesn't have enough fuel left to do that!"), target) + return FALSE + +/obj/item/weldingtool/used_as_tool(function, flags, mob/user, atom/target, time, cost, usage, success) + . = ..() + if(!.) + return + remove_fuel(round(cost * time * TOOL_WELDING_FUEL_PER_DS)) + //Removes fuel from the welding tool. If a mob is passed, it will perform an eyecheck on the mob. This should probably be renamed to use() /obj/item/weldingtool/proc/remove_fuel(var/amount = 1, var/mob/M = null) if(!welding) @@ -313,7 +333,7 @@ /obj/item/weldingtool/largetank/cyborg name = "integrated welding tool" desc = "An advanced welder designed to be used in robotic systems." - toolspeed = 0.5 + tool_speed = 0.5 /obj/item/weldingtool/hugetank name = "upgraded welding tool" @@ -332,7 +352,7 @@ w_class = ITEMSIZE_SMALL matter = list(MAT_METAL = 30, MAT_GLASS = 10) change_icons = 0 - toolspeed = 2 + tool_speed = 2 eye_safety_modifier = 1 // Safer on eyes. /obj/item/weldingtool/bone @@ -341,7 +361,7 @@ icon_state = "ashwelder" max_fuel = 20 matter = list(MAT_METAL = 30, MAT_BONE = 10) - toolspeed = 1.5 + tool_speed = 1.5 eye_safety_modifier = 1 // Safer on eyes. /obj/item/weldingtool/brass @@ -350,7 +370,7 @@ icon_state = "brasswelder" max_fuel = 40 matter = list(MAT_STEEL = 70, "brass" = 60) - toolspeed = 0.75 + tool_speed = 0.75 /datum/category_item/catalogue/anomalous/precursor_a/alien_welder name = "Precursor Alpha Object - Self Refueling Exothermic Tool" @@ -382,7 +402,7 @@ catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_welder) icon = 'icons/obj/abductor.dmi' icon_state = "welder" - toolspeed = 0.1 + tool_speed = 0.1 flame_color = "#6699FF" // Light bluish. eye_safety_modifier = 2 change_icons = 0 @@ -402,7 +422,7 @@ w_class = ITEMSIZE_NORMAL origin_tech = list(TECH_ENGINEERING = 4, TECH_PHORON = 3) matter = list(MAT_STEEL = 70, MAT_GLASS = 120) - toolspeed = 0.5 + tool_speed = 0.5 change_icons = 0 flame_intensity = 3 always_process = TRUE @@ -421,7 +441,7 @@ max_fuel = 80 eye_safety_modifier = -2 // Brighter than the sun. Literally, you can look at the sun with a welding mask of proper grade, this will burn through that. slowdown = 0.1 - toolspeed = 0.25 + tool_speed = 0.25 w_class = ITEMSIZE_LARGE flame_intensity = 5 origin_tech = list(TECH_ENGINEERING = 5, TECH_PHORON = 4, TECH_PRECURSOR = 1) @@ -438,7 +458,7 @@ max_fuel = 10 w_class = ITEMSIZE_NO_CONTAINER matter = null - toolspeed = 1.25 + tool_speed = 1.25 change_icons = 0 flame_intensity = 1 eye_safety_modifier = 1 @@ -487,7 +507,7 @@ desc = "A bulky, cooler-burning welding tool that draws from a worn welding tank." icon_state = "tubewelder" max_fuel = 5 - toolspeed = 1.75 + tool_speed = 1.75 eye_safety_modifier = 2 //Welder Spear @@ -498,7 +518,7 @@ max_fuel = 10 w_class = ITEMSIZE_NORMAL matter = list(MAT_METAL = 50, MAT_GLASS = 10) - toolspeed = 1.5 + tool_speed = 1.5 eye_safety_modifier = 1 // Safer on eyes. reach = 2 @@ -632,12 +652,12 @@ use_external_power = 1 /obj/item/weldingtool/electric/mounted/cyborg - toolspeed = 0.5 + tool_speed = 0.5 /obj/item/weldingtool/electric/mounted/RIGset name = "arc welder" - toolspeed = 0.7 // Let's see if this works with RIGs + tool_speed = 0.7 // Let's see if this works with RIGs desc = "If you're seeing this, someone did a dum-dum." /obj/item/weldingtool/electric/mounted/exosuit diff --git a/code/game/objects/items/weapons/tools/wirecutters.dm b/code/game/objects/items/tools/wirecutters.dm similarity index 92% rename from code/game/objects/items/weapons/tools/wirecutters.dm rename to code/game/objects/items/tools/wirecutters.dm index cdee52947d0..ff1dd5df3a1 100644 --- a/code/game/objects/items/weapons/tools/wirecutters.dm +++ b/code/game/objects/items/tools/wirecutters.dm @@ -17,12 +17,12 @@ matter = list(MAT_STEEL = 80) attack_verb = list("pinched", "nipped") hitsound = 'sound/items/wirecutter.ogg' - usesound = 'sound/items/wirecutter.ogg' + tool_sound = 'sound/items/wirecutter.ogg' drop_sound = 'sound/items/drop/wirecutter.ogg' pickup_sound = 'sound/items/pickup/wirecutter.ogg' sharp = 1 edge = 1 - toolspeed = 1 + tool_speed = 1 var/random_color = TRUE /obj/item/tool/wirecutters/Initialize(mapload) @@ -55,21 +55,18 @@ else ..() -/obj/item/tool/wirecutters/is_wirecutter() - return TRUE - /obj/item/tool/wirecutters/bone name = "primitive wirecutters" desc = "Dull wirecutters knapped from bone." icon_state = "cutters_bone" - toolspeed = 1.25 + tool_speed = 1.25 random_color = FALSE /obj/item/tool/wirecutters/brass name = "brass wirecutters" desc = "Brass plated wirecutters that never seem to lose their edge." icon_state = "cutters_brass" - toolspeed = 0.75 + tool_speed = 0.75 random_color = FALSE /datum/category_item/catalogue/anomalous/precursor_a/alien_wirecutters @@ -91,21 +88,21 @@ catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_wirecutters) icon = 'icons/obj/abductor.dmi' icon_state = "cutters" - toolspeed = 0.1 + tool_speed = 0.1 origin_tech = list(TECH_MATERIAL = 5, TECH_ENGINEERING = 4) random_color = FALSE /obj/item/tool/wirecutters/cyborg name = "wirecutters" desc = "This cuts wires. With science." - usesound = 'sound/items/jaws_cut.ogg' - toolspeed = 0.5 + tool_sound = 'sound/items/jaws_cut.ogg' + tool_speed = 0.5 /obj/item/tool/wirecutters/RIGset name = "integrated wirecutters" desc = "If you're seeing this, someone did a dum-dum." - usesound = 'sound/items/jaws_cut.ogg' - toolspeed = 0.7 + tool_sound = 'sound/items/jaws_cut.ogg' + tool_speed = 0.7 /obj/item/tool/wirecutters/hybrid name = "strange wirecutters" @@ -116,8 +113,8 @@ slowdown = 0.1 origin_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 3, TECH_PHORON = 2) attack_verb = list("pinched", "nipped", "warped", "blasted") - usesound = 'sound/effects/stealthoff.ogg' - toolspeed = 0.4 + tool_sound = 'sound/effects/stealthoff.ogg' + tool_speed = 0.4 reach = 2 @@ -128,9 +125,9 @@ item_state = "jawsoflife" origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) matter = list(MAT_METAL=150, MAT_SILVER=50) - usesound = 'sound/items/jaws_cut.ogg' + tool_sound = 'sound/items/jaws_cut.ogg' force = 15 - toolspeed = 0.25 + tool_speed = 0.25 random_color = FALSE var/obj/item/tool/crowbar/power/counterpart = null diff --git a/code/game/objects/items/weapons/tools/wrench.dm b/code/game/objects/items/tools/wrench.dm similarity index 91% rename from code/game/objects/items/weapons/tools/wrench.dm rename to code/game/objects/items/tools/wrench.dm index 428ff47217b..5be1584d901 100644 --- a/code/game/objects/items/weapons/tools/wrench.dm +++ b/code/game/objects/items/tools/wrench.dm @@ -15,8 +15,8 @@ origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1) matter = list(MAT_STEEL = 150) attack_verb = list("bashed", "battered", "bludgeoned", "whacked") - usesound = 'sound/items/ratchet.ogg' - toolspeed = 1 + tool_sound = 'sound/items/ratchet.ogg' + tool_speed = 1 drop_sound = 'sound/items/drop/wrench.ogg' pickup_sound = 'sound/items/pickup/wrench.ogg' var/random_color = TRUE @@ -36,9 +36,6 @@ if ("blue") icon_state = "wrench_blue" -/obj/item/tool/wrench/is_wrench() - return TRUE - /obj/item/tool/wrench/red icon_state = "wrench_red" @@ -52,28 +49,28 @@ name = "primitive wrench" desc = "A primitive wrench carved from bone. It does not grip consistently." icon_state = "wrench_bone" - toolspeed = 1.25 + tool_speed = 1.25 random_color = FALSE /obj/item/tool/wrench/brass name = "brass wrench" desc = "A brass plated wrench. Its finely tuned mechanism allows for a strong grip." icon_state = "wrench_brass" - toolspeed = 0.75 + tool_speed = 0.75 random_color = FALSE /obj/item/tool/wrench/cyborg name = "automatic wrench" desc = "An advanced robotic wrench. Can be found in industrial synthetic shells." - usesound = 'sound/items/drill_use.ogg' - toolspeed = 0.5 + tool_sound = 'sound/items/drill_use.ogg' + tool_speed = 0.5 random_color = FALSE /obj/item/tool/wrench/RIGset name = "integrated wrench" desc = "If you're seeing this, someone did a dum-dum." - usesound = 'sound/items/drill_use.ogg' - toolspeed = 0.7 + tool_sound = 'sound/items/drill_use.ogg' + tool_speed = 0.7 /obj/item/tool/wrench/hybrid // Slower and bulkier than normal power tools, but it has the power of reach. name = "strange wrench" @@ -87,8 +84,8 @@ slowdown = 0.1 origin_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 3, TECH_PHORON = 2) attack_verb = list("bashed", "battered", "bludgeoned", "whacked", "warped", "blasted") - usesound = 'sound/effects/stealthoff.ogg' - toolspeed = 0.5 + tool_sound = 'sound/effects/stealthoff.ogg' + tool_speed = 0.5 reach = 2 random_color = FALSE @@ -113,8 +110,8 @@ catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_wrench) icon = 'icons/obj/abductor.dmi' icon_state = "wrench" - usesound = 'sound/effects/empulse.ogg' - toolspeed = 0.1 + tool_sound = 'sound/effects/empulse.ogg' + tool_speed = 0.1 origin_tech = list(TECH_MATERIAL = 5, TECH_ENGINEERING = 5) random_color = FALSE @@ -123,14 +120,14 @@ desc = "A simple powered hand drill. It's fitted with a bolt bit." icon_state = "drill_bolt" item_state = "drill" - usesound = 'sound/items/drill_use.ogg' + tool_sound = 'sound/items/drill_use.ogg' matter = list(MAT_STEEL = 150, MAT_SILVER = 50) origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) force = 8 w_class = ITEMSIZE_SMALL throw_force = 8 attack_verb = list("drilled", "screwed", "jabbed") - toolspeed = 0.25 + tool_speed = 0.25 var/obj/item/tool/screwdriver/power/counterpart = null random_color = FALSE diff --git a/code/game/objects/items/uav.dm b/code/game/objects/items/uav.dm index 0cb9776a658..e861ecf4ed2 100644 --- a/code/game/objects/items/uav.dm +++ b/code/game/objects/items/uav.dm @@ -110,7 +110,7 @@ else if(I.is_screwdriver() && cell) if(do_after(user, 3 SECONDS, src)) to_chat(user, SPAN_NOTICE("You remove [cell] into [nickname].")) - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) power_down() cell.forceMove(get_turf(src)) cell = null diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index 3a808512bc8..e2393a346dc 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -202,7 +202,7 @@ playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) - var/true_delay = rcd_results[RCD_VALUE_DELAY] * toolspeed + var/true_delay = rcd_results[RCD_VALUE_DELAY] * tool_speed var/datum/beam/rcd_beam = null if(ranged) @@ -258,7 +258,7 @@ Reload with compressed matter cartridges." icon_state = "adv_rcd" ranged = TRUE - toolspeed = 0.5 // Twice as fast. + tool_speed = 0.5 // Twice as fast. max_stored_matter = RCD_MAX_CAPACITY * 3 // Three times capacity. /obj/item/rcd/advanced/loaded/Initialize(mapload) @@ -343,13 +343,13 @@ can_remove_rwalls = TRUE desc = "A device used to rapidly build and deconstruct. It runs directly off of electricity, drawing directly from your cell." electric_cost_coefficent = 41.66 // Twice as efficent, out of pity. - toolspeed = 0.5 // Twice as fast, since borg versions typically have this. + tool_speed = 0.5 // Twice as fast, since borg versions typically have this. /obj/item/rcd/electric/mounted/borg/swarm can_remove_rwalls = FALSE name = "Rapid Assimilation Device" ranged = TRUE - toolspeed = 0.7 + tool_speed = 0.7 material_to_use = MAT_STEELHULL /obj/item/rcd/electric/mounted/borg/lesser @@ -375,7 +375,7 @@ // RCDs for Mechs. /obj/item/rcd/electric/mounted/mecha ranged = TRUE - toolspeed = 0.5 + tool_speed = 0.5 // Infinite use RCD for debugging/adminbuse. /obj/item/rcd/debug @@ -386,7 +386,7 @@ ranged = TRUE can_remove_rwalls = TRUE allow_concurrent_building = TRUE - toolspeed = 0.25 // Four times as fast. + tool_speed = 0.25 // Four times as fast. /obj/item/rcd/debug/can_afford(amount) return TRUE diff --git a/code/game/objects/items/weapons/barrier_tape.dm b/code/game/objects/items/weapons/barrier_tape.dm index 5cdb89d9d3d..c5e7e8e8b9a 100644 --- a/code/game/objects/items/weapons/barrier_tape.dm +++ b/code/game/objects/items/weapons/barrier_tape.dm @@ -5,7 +5,7 @@ icon_state = "tape" w_class = ITEMSIZE_SMALL - toolspeed = 3 //You can use it in surgery. It's stupid, but you can. + tool_speed = 3 //You can use it in surgery. It's stupid, but you can. var/turf/start var/turf/end diff --git a/code/game/objects/items/weapons/circuitboards/circuitboard.dm b/code/game/objects/items/weapons/circuitboards/circuitboard.dm index b599e271606..cb4f9ee3680 100644 --- a/code/game/objects/items/weapons/circuitboards/circuitboard.dm +++ b/code/game/objects/items/weapons/circuitboards/circuitboard.dm @@ -5,6 +5,12 @@ #define T_BOARD(name) "circuit board (" + (name) + ")" // TODO: split into machine, computer, etc circuits +/** + * circuitboards + * + * used in frames to construct arbitrary objects with arbitrary components. + * this will usually be /obj/machinery, but other things are possible. + */ /obj/item/circuitboard name = "circuit board" icon = 'icons/obj/module.dmi' @@ -27,18 +33,22 @@ var/contain_parts = TRUE -//Called when the circuitboard is used to contruct a new machine. -/obj/item/circuitboard/proc/construct(var/obj/machinery/M) - if(istype(M, build_path)) - return 1 - return 0 +/** + * called when we are used to construct something. + * + * put your synchronization code in here. + */ +/obj/item/circuitboard/proc/after_construct(atom/A) + return -//Called when a computer is deconstructed to produce a circuitboard. -//Only used by computers, as other machines store their circuitboard instance. -/obj/item/circuitboard/proc/deconstruct(var/obj/machinery/M) - if(istype(M, build_path)) - return 1 - return 0 +/** + * called when what we were used to construct is deconstructed. + * + * put your synchronization code in here. + * + */ +/obj/item/circuitboard/proc/after_deconstruct(atom/A) + return //Should be called from the constructor of any machine to automatically populate the default parts /obj/item/circuitboard/proc/apply_default_parts(var/obj/machinery/M) diff --git a/code/game/objects/items/weapons/circuitboards/computer/air_management.dm b/code/game/objects/items/weapons/circuitboards/computer/air_management.dm index 55a9e7ac062..f09644b0c61 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/air_management.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/air_management.dm @@ -1,5 +1,5 @@ #ifndef T_BOARD -#error T_BOARD macro is not defined but we need it! +#error T_BOARD macro is not defined but we need it! #endif /obj/item/circuitboard/air_management @@ -18,10 +18,16 @@ name = T_BOARD("injector control") build_path = /obj/machinery/computer/general_air_control/fuel_injection -/obj/item/circuitboard/air_management/construct(var/obj/machinery/computer/general_air_control/C) - if (..(C)) - C.frequency = frequency +/obj/item/circuitboard/air_management/after_construct(atom/A) + . = ..() + if(!istype(A, /obj/machinery/computer/general_air_control)) + return + var/obj/machinery/computer/general_air_control/C = A + C.frequency = frequency -/obj/item/circuitboard/air_management/deconstruct(var/obj/machinery/computer/general_air_control/C) - if (..(C)) - frequency = C.frequency +/obj/item/circuitboard/air_management/after_deconstruct(atom/A) + . = ..() + if(!istype(A, /obj/machinery/computer/general_air_control)) + return + var/obj/machinery/computer/general_air_control/C = A + frequency = C.frequency diff --git a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm index 80313f6828c..a7a2411edcb 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm @@ -43,13 +43,19 @@ . = ..() network = NETWORK_THUNDER -/obj/item/circuitboard/security/construct(var/obj/machinery/computer/security/C) - if (..(C)) - C.set_network(network.Copy()) +/obj/item/circuitboard/security/after_construct(atom/A) + . = ..() + if(!istype(A, /obj/machinery/computer/security)) + return + var/obj/machinery/computer/security/S = A + S.set_network(network.Copy()) -/obj/item/circuitboard/security/deconstruct(var/obj/machinery/computer/security/C) - if (..(C)) - network = C.network.Copy() +/obj/item/circuitboard/security/after_deconstruct(atom/A) + . = ..() + if(!istype(A, /obj/machinery/computer/security)) + return + var/obj/machinery/computer/security/S = A + network = S.network.Copy() /obj/item/circuitboard/security/emag_act(var/remaining_charges, var/mob/user) if(emagged) diff --git a/code/game/objects/items/weapons/circuitboards/computer/research.dm b/code/game/objects/items/weapons/circuitboards/computer/research.dm index 75010220178..d3f483c9f5e 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/research.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/research.dm @@ -8,7 +8,7 @@ /obj/item/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob) if(I.is_screwdriver()) - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) user.visible_message("\The [user] adjusts the jumper on \the [src]'s access protocol pins.", "You adjust the jumper on the access protocol pins.") if(build_path == /obj/machinery/computer/rdconsole/core) name = T_BOARD("RD Console - Robotics") diff --git a/code/game/objects/items/weapons/circuitboards/computer/shuttle.dm b/code/game/objects/items/weapons/circuitboards/computer/shuttle.dm index 4893f8f458a..2f1ef2237a3 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/shuttle.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/shuttle.dm @@ -10,18 +10,26 @@ var/shuttle_category = null // Shuttle datum's category must exactly equal this to auto-detect var/shuttle_tag = null // If set, link constructed console to this shuttle. If null, auto-detect. -/obj/item/circuitboard/shuttle_console/deconstruct(obj/machinery/computer/shuttle_control/M) - shuttle_tag = M.shuttle_tag +/obj/item/circuitboard/shuttle_console/after_deconstruct(atom/A) + . = ..() + if(!istype(A, /obj/machinery/computer/shuttle_control)) + return + var/obj/machinery/computer/shuttle_control/C = A + shuttle_tag = C.shuttle_tag if(shuttle_tag) name = T_BOARD("[shuttle_tag] control console") // Try to auto-link the shuttle computer if it is constructed on a shuttle (and not pre-programmed) -/obj/item/circuitboard/shuttle_console/construct(obj/machinery/computer/shuttle_control/M) +/obj/item/circuitboard/shuttle_console/after_construct(atom/A) + . = ..() + if(!istype(A, /obj/machinery/computer/shuttle_control)) + return + var/obj/machinery/computer/shuttle_control/C = A if(!shuttle_tag) - shuttle_tag = auto_detect_shuttle(M) // We don't have a preset tag, so lets try to auto-link. - if(shuttle_tag && M.set_shuttle_tag(shuttle_tag)) - log_and_message_admins("[key_name_admin(usr)] built a [M] for [shuttle_tag] at [ADMIN_COORDJMP(M)]") - M.ping("[M] auto-links with shuttle [shuttle_tag]") + shuttle_tag = auto_detect_shuttle(C) // We don't have a preset tag, so lets try to auto-link. + if(shuttle_tag && C.set_shuttle_tag(shuttle_tag)) + log_and_message_admins("[key_name_admin(usr)] built a [C] for [shuttle_tag] at [ADMIN_COORDJMP(C)]") + C.ping("[C] auto-links with shuttle [shuttle_tag]") // Return shuttle_tag of shuttle of current area /obj/item/circuitboard/shuttle_console/proc/auto_detect_shuttle(obj/machinery/computer/shuttle_control/M) diff --git a/code/game/objects/items/weapons/circuitboards/computer/supply.dm b/code/game/objects/items/weapons/circuitboards/computer/supply.dm index c5b704f1893..a8797197576 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/supply.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/supply.dm @@ -13,13 +13,19 @@ build_path = /obj/machinery/computer/supplycomp/control origin_tech = list(TECH_DATA = 3) -/obj/item/circuitboard/supplycomp/construct(var/obj/machinery/computer/supplycomp/SC) - if (..(SC)) - SC.can_order_contraband = contraband_enabled +/obj/item/circuitboard/supplycomp/after_construct(atom/A) + . = ..() + if(!istype(A, /obj/machinery/computer/supplycomp)) + return + var/obj/machinery/computer/supplycomp/S = A + S.can_order_contraband = contraband_enabled -/obj/item/circuitboard/supplycomp/deconstruct(var/obj/machinery/computer/supplycomp/SC) - if (..(SC)) - contraband_enabled = SC.can_order_contraband +/obj/item/circuitboard/supplycomp/after_deconstruct(atom/A) + . = ..() + if(!istype(A, /obj/machinery/computer/supplycomp)) + return + var/obj/machinery/computer/supplycomp/S = A + contraband_enabled = S.can_order_contraband /obj/item/circuitboard/supplycomp/attackby(obj/item/I as obj, mob/user as mob) if(istype(I,/obj/item/multitool)) diff --git a/code/game/objects/items/weapons/circuitboards/machinery/power.dm b/code/game/objects/items/weapons/circuitboards/machinery/power.dm index 2dd46a05aae..e3eca0b0ae0 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/power.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/power.dm @@ -9,9 +9,12 @@ origin_tech = list(TECH_POWER = 6, TECH_ENGINEERING = 4) req_components = list(/obj/item/smes_coil = 1, /obj/item/stack/cable_coil = 30) -/obj/item/circuitboard/smes/construct(var/obj/machinery/power/smes/buildable/S) - if(..(S)) - S.output_attempt = 0 //built SMES default to off +/obj/item/circuitboard/smes/after_construct(atom/A) + . = ..() + if(!istype(A, /obj/machinery/power/smes/buildable)) + return + var/obj/machinery/power/smes/buildable/S = A + S.output_attempt = FALSE /obj/item/circuitboard/batteryrack name = T_BOARD("battery rack PSU") diff --git a/code/game/objects/items/weapons/circuitboards/machinery/research.dm b/code/game/objects/items/weapons/circuitboards/machinery/research.dm index dbf8453a8a1..15f1404eff2 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/research.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/research.dm @@ -13,7 +13,7 @@ obj/item/circuitboard/rdserver obj/item/circuitboard/rdserver/attackby(obj/item/I as obj, mob/user as mob) if(I.is_screwdriver()) - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) user.visible_message("\The [user] adjusts the jumper on \the [src]'s access protocol pins.", "You adjust the jumper on the access protocol pins.") if(build_path == /obj/machinery/r_n_d/server/core) name = T_BOARD("RD Console - Robotics") diff --git a/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm b/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm index 60dbf3b8338..ac8810dff74 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm @@ -5,7 +5,11 @@ /obj/item/circuitboard/unary_atmos board_type = new /datum/frame/frame_types/machine -/obj/item/circuitboard/unary_atmos/construct(var/obj/machinery/atmospherics/component/unary/U) +/obj/item/circuitboard/unary_atmos/after_construct(atom/A) + . = ..() + if(!istype(A, /obj/machinery/atmospherics/component/unary)) + return + var/obj/machinery/atmospherics/component/unary/U = A //TODO: Move this stuff into the relevant constructor when pipe/construction.dm is cleaned up. U.atmos_init() U.build_network() diff --git a/code/game/objects/items/weapons/duct_tape.dm b/code/game/objects/items/weapons/duct_tape.dm index 8a48b23c299..a56227ee83b 100644 --- a/code/game/objects/items/weapons/duct_tape.dm +++ b/code/game/objects/items/weapons/duct_tape.dm @@ -8,7 +8,7 @@ pickup_sound = 'sound/items/pickup/cardboardbox.ogg' var/amount = 20 - toolspeed = 2 //It is now used in surgery as a not awful, but probably dangerous option, due to speed. + tool_speed = 2 //It is now used in surgery as a not awful, but probably dangerous option, due to speed. /obj/item/duct_tape_roll/attack(var/mob/living/carbon/human/H, var/mob/user) if(istype(H)) diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 586b41c5a93..9b92f32e4a9 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -32,7 +32,7 @@ if(I.is_screwdriver()) open_panel = !open_panel to_chat(user, "You [open_panel ? "open" : "close"] the wire panel.") - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) else if(I.is_wirecutter() || istype(I, /obj/item/multitool) || istype(I, /obj/item/assembly/signaler )) wires.Interact(user) else diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index 799708d1baf..55e1f73d3da 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -86,7 +86,7 @@ // to_chat(user, "You need to add at least one beaker before locking the assembly.") to_chat(user, "You lock the empty assembly.") name = "fake grenade" - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) icon_state = initial(icon_state) +"_locked" stage = 2 else if(stage == 2) @@ -96,7 +96,7 @@ return else to_chat(user, "You unlock the assembly.") - playsound(src.loc, W.usesound, 50, -3) + playsound(src.loc, W.tool_sound, 50, -3) name = "unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]" icon_state = initial(icon_state) + (detonator?"_ass":"") stage = 1 diff --git a/code/game/objects/items/weapons/improvised_components.dm b/code/game/objects/items/weapons/improvised_components.dm index ba61a1d64bc..ce9f7eff959 100644 --- a/code/game/objects/items/weapons/improvised_components.dm +++ b/code/game/objects/items/weapons/improvised_components.dm @@ -9,7 +9,7 @@ /obj/item/material/butterflyconstruction/attackby(obj/item/W as obj, mob/user as mob) if(W.is_screwdriver()) to_chat(user, "You finish the concealed blade weapon.") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) new /obj/item/material/butterfly(user.loc, material.name) qdel(src) return diff --git a/code/game/objects/items/weapons/material/gravemarker.dm b/code/game/objects/items/weapons/material/gravemarker.dm index 24dc13cfb00..9ceca9e05a7 100644 --- a/code/game/objects/items/weapons/material/gravemarker.dm +++ b/code/game/objects/items/weapons/material/gravemarker.dm @@ -16,20 +16,20 @@ var/carving_1 = sanitizeSafe(input(user, "Who is \the [src.name] for?", "Gravestone Naming", null) as text, MAX_NAME_LEN) if(carving_1) user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].") - if(do_after(user, material.hardness * W.toolspeed)) + if(do_after(user, material.hardness * W.tool_speed)) user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].") grave_name += carving_1 update_icon() var/carving_2 = sanitizeSafe(input(user, "What message should \the [src.name] have?", "Epitaph Carving", null) as text, MAX_NAME_LEN) if(carving_2) user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].") - if(do_after(user, material.hardness * W.toolspeed)) + if(do_after(user, material.hardness * W.tool_speed)) user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].") epitaph += carving_2 update_icon() if(W.is_wrench()) user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].") - if(do_after(user, material.hardness * W.toolspeed)) + if(do_after(user, material.hardness * W.tool_speed)) material.place_dismantled_product(get_turf(src)) user.visible_message("[user] dismantles down \the [src.name].", "You dismantle \the [src.name].") qdel(src) diff --git a/code/game/objects/items/weapons/material/knives.dm b/code/game/objects/items/weapons/material/knives.dm index b2e5ea55f3d..e1abeea14d6 100644 --- a/code/game/objects/items/weapons/material/knives.dm +++ b/code/game/objects/items/weapons/material/knives.dm @@ -206,7 +206,7 @@ item_state = "knife" applies_material_colour = FALSE default_material = "plasteel" - toolspeed = 2 // Use a real axe if you want to chop logs. + tool_speed = 2 // Use a real axe if you want to chop logs. /obj/item/material/knife/tacknife/survival/bone name = "primitive survival knife" @@ -229,7 +229,7 @@ item_state = "knife" applies_material_colour = FALSE default_material = "plasteel" - toolspeed = 2 // Use a real axe if you want to chop logs. + tool_speed = 2 // Use a real axe if you want to chop logs. var/gps_tag = "DAT&#%F0" var/emped = FALSE var/tracking = TRUE // Will not show other signals or emit its own signal if false. diff --git a/code/game/objects/items/weapons/material/misc.dm b/code/game/objects/items/weapons/material/misc.dm index 719039795f1..202d4953d75 100644 --- a/code/game/objects/items/weapons/material/misc.dm +++ b/code/game/objects/items/weapons/material/misc.dm @@ -117,7 +117,7 @@ /obj/item/material/snow/snowball/reinforced name = "snowball" desc = "A well-formed and fun snowball. It looks kind of dangerous." - //icon_state = "reinf-snowball" + //icon_state = "considered_reinforced-snowball" force_divisor = 0.20 thrown_force_divisor = 0.25 diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm index 34525e1aef4..189bdb79e70 100644 --- a/code/game/objects/items/weapons/surgery_tools.dm +++ b/code/game/objects/items/weapons/surgery_tools.dm @@ -136,7 +136,7 @@ icon_state = "organ_ripper" item_state = "bone_setter" force = 15.0 - toolspeed = 0.75 + tool_speed = 0.75 origin_tech = list(TECH_MATERIAL = 5, TECH_BIO = 3, TECH_ILLEGAL = 2) /* @@ -169,7 +169,7 @@ origin_tech = list(TECH_BIO = 4, TECH_MATERIAL = 6, TECH_MAGNET = 6) matter = list(MAT_STEEL = 12500) attack_verb = list("attacked", "slashed", "seared", "cut") - toolspeed = 0.75 + tool_speed = 0.75 //misc, formerly from code/defines/weapons.dm /obj/item/surgical/bonegel @@ -220,65 +220,65 @@ // Cyborg Tools /obj/item/surgical/retractor/cyborg - toolspeed = 0.5 + tool_speed = 0.5 /obj/item/surgical/hemostat/cyborg - toolspeed = 0.5 + tool_speed = 0.5 /obj/item/surgical/cautery/cyborg - toolspeed = 0.5 + tool_speed = 0.5 /obj/item/surgical/surgicaldrill/cyborg - toolspeed = 0.5 + tool_speed = 0.5 /obj/item/surgical/scalpel/cyborg - toolspeed = 0.5 + tool_speed = 0.5 /obj/item/surgical/circular_saw/cyborg - toolspeed = 0.5 + tool_speed = 0.5 /obj/item/surgical/bonegel/cyborg - toolspeed = 0.5 + tool_speed = 0.5 /obj/item/surgical/FixOVein/cyborg - toolspeed = 0.5 + tool_speed = 0.5 /obj/item/surgical/bonesetter/cyborg - toolspeed = 0.5 + tool_speed = 0.5 // Alien Tools /obj/item/surgical/retractor/alien icon = 'icons/obj/abductor.dmi' - toolspeed = 0.25 + tool_speed = 0.25 /obj/item/surgical/hemostat/alien icon = 'icons/obj/abductor.dmi' - toolspeed = 0.25 + tool_speed = 0.25 /obj/item/surgical/cautery/alien icon = 'icons/obj/abductor.dmi' - toolspeed = 0.25 + tool_speed = 0.25 /obj/item/surgical/surgicaldrill/alien icon = 'icons/obj/abductor.dmi' - toolspeed = 0.25 + tool_speed = 0.25 /obj/item/surgical/scalpel/alien icon = 'icons/obj/abductor.dmi' - toolspeed = 0.25 + tool_speed = 0.25 /obj/item/surgical/circular_saw/alien icon = 'icons/obj/abductor.dmi' - toolspeed = 0.25 + tool_speed = 0.25 /obj/item/surgical/FixOVein/alien icon = 'icons/obj/abductor.dmi' - toolspeed = 0.25 + tool_speed = 0.25 /obj/item/surgical/bone_clamp/alien icon = 'icons/obj/abductor.dmi' - toolspeed = 0.75 + tool_speed = 0.75 // Primitive Items diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm index 389a3c87e68..2d5afbe3d24 100644 --- a/code/game/objects/items/weapons/swords_axes_etc.dm +++ b/code/game/objects/items/weapons/swords_axes_etc.dm @@ -221,7 +221,7 @@ var/new_name = stripped_input(user, "What do you wish to name [src]?", "New Name", "bokken", 30) if(new_name) name = new_name - if(I.tool_behaviour == TOOL_WELDER) + if(I.is_welder()) var/new_burn = stripped_input(user, "What do you wish to burn into [src]?", "Burnt Inscription","", 140) if(new_burn) burned_in = new_burn diff --git a/code/game/objects/items/weapons/syndie.dm b/code/game/objects/items/weapons/syndie.dm index 50426010920..7ceb7fa83f5 100644 --- a/code/game/objects/items/weapons/syndie.dm +++ b/code/game/objects/items/weapons/syndie.dm @@ -109,5 +109,5 @@ /obj/item/flame/lighter/zippo/c4detonator/attackby(obj/item/W, mob/user as mob) if(W.is_screwdriver()) detonator_mode = !detonator_mode - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You unscrew the top panel of \the [src] revealing a button.") diff --git a/code/game/objects/items/weapons/tools/combitool.dm b/code/game/objects/items/weapons/tools/combitool.dm deleted file mode 100644 index 5170dc50627..00000000000 --- a/code/game/objects/items/weapons/tools/combitool.dm +++ /dev/null @@ -1,66 +0,0 @@ -// File is unticked because this is entirely untested old code - - -/* - * Combitool - */ -/obj/item/combitool - name = "combi-tool" - desc = "It even has one of those nubbins for doing the thingy." - icon = 'icons/obj/items.dmi' - icon_state = "combitool" - item_state = "combitool" - w_class = ITEMSIZE_SMALL - drop_sound = 'sound/items/drop/multitool.ogg' - pickup_sound = 'sound/items/pickup/multitool.ogg' - - var/list/spawn_tools = list( - /obj/item/tool/screwdriver, - /obj/item/tool/wrench, - /obj/item/tool/wirecutters, - /obj/item/material/knife, - /obj/item/material/kitchen/utensil/fork, - /obj/item/material/knife/machete/hatchet - ) - var/list/tools = list() - var/current_tool = 1 - -/obj/item/combitool/examine() - ..() - if(loc == usr && tools.len) - to_chat(usr, "It has the following fittings:") - for(var/obj/item/tool in tools) - to_chat(usr, "[icon2html(thing = tool, target = usr)] - [tool.name][tools[current_tool]==tool?" (selected)":""]") - -/obj/item/combitool/Initialize(mapload) - . = ..() - for(var/type in spawn_tools) - tools |= new type(src) - -/obj/item/combitool/attack_self(mob/user as mob) - if(++current_tool > tools.len) current_tool = 1 - var/obj/item/tool = tools[current_tool] - if(!tool) - to_chat(user, "You can't seem to find any fittings in \the [src].") - else - to_chat(user, "You switch \the [src] to the [tool.name] fitting.") - return 1 - -/obj/item/combitool/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) - if(!M.Adjacent(user)) - return 0 - var/obj/item/tool = tools[current_tool] - if(!tool) return 0 - return (tool ? tool.attack(M,user) : 0) - -/obj/item/combitool/afterattack(var/atom/target, var/mob/living/user, proximity, params) - if(!proximity) - return 0 - var/obj/item/tool = tools[current_tool] - if(!tool) return 0 - tool.loc = user - var/resolved = target.attackby(tool,user) - if(!resolved && tool && target) - tool.afterattack(target,user,1) - if(tool) - tool.loc = src diff --git a/code/game/objects/items/weapons/tools/holotool.dm b/code/game/objects/items/weapons/tools/holotool.dm deleted file mode 100644 index faa3ddca770..00000000000 --- a/code/game/objects/items/weapons/tools/holotool.dm +++ /dev/null @@ -1,534 +0,0 @@ -//A switchblade with a little switch to switch blades, to switch from a six to a sixteen inch blade -//Switchtools and holotools, ported from vg and updated a bit. Switchtools are from R&D, surgery switchtool is also from R&D, admin holotool is self-explainitory, CE holotool is CE-only in his locker. -/obj/item/switchtool - name = "switchtool" - icon = 'icons/obj/switchtool.dmi' - icon_state = "switchtool" - item_state = "switchtool" - desc = "A multi-deployable, multi-instrument, finely crafted multi-purpose tool. The envy of engineers everywhere." - siemens_coefficient = 1 - force = 3 - w_class = ITEMSIZE_SMALL - item_icons = list( - slot_l_hand_str = 'icons/mob/items/lefthand_switchtool.dmi', - slot_r_hand_str = 'icons/mob/items/righthand_switchtool.dmi') - var/deploy_sound = "sound/weapons/switchblade.ogg" - var/undeploy_sound = "sound/weapons/switchblade.ogg" - throw_force = 6.0 - throw_speed = 3 - throw_range = 6 - - //the colon separates the typepath from the name - var/list/obj/item/start_modules = list(/obj/item/tool/screwdriver/switchy = null, - /obj/item/tool/wrench/switchy = null, - /obj/item/tool/wirecutters/switchy = null, - /obj/item/tool/crowbar/switchy = null, - /obj/item/multitool/switchy = null) - var/list/obj/item/stored_modules = list() - var/obj/item/deployed //what's currently in use - var/switchingtype = "basic"//type for update_icon - - var/static/radial_driver = image(icon = 'icons/obj/tools.dmi', icon_state = "screwdriver") //AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - var/static/radial_wrench = image(icon = 'icons/obj/tools.dmi', icon_state = "wrench") - var/static/radial_wirecutters = image(icon = 'icons/obj/tools.dmi', icon_state = "cutters") - var/static/radial_crowbar = image(icon = 'icons/obj/tools.dmi', icon_state = "crowbar") - var/static/radial_welder = image(icon = 'icons/obj/tools.dmi', icon_state = "tubewelder") - var/static/radial_multitool = image(icon = 'icons/obj/device.dmi', icon_state = "multitool") - var/static/radial_scalpel = image(icon = 'icons/obj/surgery.dmi', icon_state = "scalpel") - var/static/radial_laserscalpel = image(icon = 'icons/obj/surgery.dmi', icon_state = "scalpel_laser3_on") - var/static/radial_hemostat = image(icon = 'icons/obj/surgery.dmi', icon_state = "hemostat") - var/static/radial_retractor = image(icon = 'icons/obj/surgery.dmi', icon_state = "retractor") - var/static/radial_saw = image(icon = 'icons/obj/surgery.dmi', icon_state = "saw") - var/static/radial_drill = image(icon = 'icons/obj/surgery.dmi', icon_state = "drill") - var/static/radial_boneclamp = image(icon = 'icons/obj/surgery.dmi', icon_state = "bone_setter") - var/static/radial_cautery = image(icon = 'icons/obj/surgery.dmi', icon_state = "cautery") - var/static/radial_light = image(icon = 'icons/obj/lighting.dmi', icon_state = "flashlight_yellow-on") - var/static/radial_soap = image(icon = 'icons/obj/device.dmi', icon_state = "uv_on") - var/static/radial_shield = image(icon = 'icons/obj/weapons.dmi', icon_state = "riot_alt") - var/static/radial_sword = image(icon = 'icons/obj/weapons.dmi', icon_state = "blade") - -/obj/item/switchtool/resolve_attackby(atom/A, mob/user, params, attack_modifier = 1) - if(deployed && !istype(A, /obj/item/storage)) - deployed.resolve_attackby(A, user, params, attack_modifier = 1) - if(deployed.loc != src) - deployed.forceMove(src) - undeploy() - return ..() - return - ..() - -/obj/item/switchtool/Initialize(mapload) - . = ..() - for(var/module in start_modules)//making the modules - stored_modules |= new module(src) - -/obj/item/switchtool/examine() - . = ..() - . += "This one is capable of holding [get_formatted_modules()]." - -/obj/item/switchtool/attack_self(mob/user) - if(!user) - return - if(deployed) - to_chat(user, "You store \the [deployed].") - undeploy() - return - else - choose_deploy(user) - -//makes the string list of modules ie "a screwdriver, a knife, and a clown horn" -//does not end with a full stop, but does contain commas -/obj/item/switchtool/proc/get_formatted_modules() - var/counter = 0 - var/module_string = "" - for(var/obj/item/module in stored_modules) - counter++ - if(counter == stored_modules.len) - module_string += "and \a [module.name]" - else - module_string += "\a [module.name], " - return module_string - -/obj/item/switchtool/proc/undeploy() - playsound(get_turf(src), undeploy_sound, 10, 1) - deployed = null - cut_overlays() - w_class = initial(w_class) - update_icon() - -/obj/item/switchtool/proc/deploy(var/module) - if(!(module in stored_modules)) - return FALSE - if(deployed) - return FALSE - playsound(get_turf(src), deploy_sound, 10, 1) - deployed = module - update_icon() - if(istype(deployed, /obj/item/weldingtool)) - var/obj/item/weldingtool/W = deployed - W.setWelding(1) - return TRUE - -/obj/item/switchtool/proc/choose_deploy(mob/user) - var/list/options = list() - switch(switchingtype) - if("basic") - options["screwdriver"] = radial_driver - options["wrench"] = radial_wrench - options["wirecutters"] = radial_wirecutters - options["crowbar"] = radial_crowbar - options["multitool"] = radial_multitool - if("surgery") - options["scalpel"] = radial_scalpel - options["hemostat"] = radial_hemostat - options["retractor"] = radial_retractor - options["boneclamp"] = radial_boneclamp - if("ce") - options["screwdriver"] = radial_driver - options["wrench"] = radial_wrench - options["wirecutters"] = radial_wirecutters - options["crowbar"] = radial_crowbar - options["multitool"] = radial_multitool - options["welder"] = radial_welder - options["soap"] = radial_soap - options["light"] = radial_light - if("adminholo") - options["screwdriver"] = radial_driver - options["wrench"] = radial_wrench - options["wirecutters"] = radial_wirecutters - options["crowbar"] = radial_crowbar - options["multitool"] = radial_multitool - options["welder"] = radial_welder - options["scalpel"] = radial_laserscalpel - options["hemostat"] = radial_hemostat - options["retractor"] = radial_retractor - options["saw"] = radial_saw - options["drill"] = radial_drill - options["boneclamp"] = radial_boneclamp - options["cautery"] = radial_cautery - options["soap"] = radial_soap - options["light"] = radial_light - options["sword"] = radial_sword - options["shield"] = radial_shield - - if(options.len < 1) - to_chat(user, "The [src] doesn't have any available modules!") - return - var/list/choice = list() - choice = show_radial_menu(user, src, options) - for(var/obj/item/module in stored_modules) - if(module.deploytype == choice) - if(deploy(module)) - to_chat(user, "You deploy \the [deployed].") - return TRUE - - - - - -/obj/item/switchtool/handle_shield(mob/user) - if(deployed.deploytype == "shield") - return TRUE - return FALSE - -/obj/item/switchtool/is_crowbar() - if(deployed && deployed.deploytype == "crowbar") - return TRUE - return FALSE - -/obj/item/switchtool/is_screwdriver() - if(deployed && deployed.deploytype == "screwdriver") - return TRUE - return FALSE - -/obj/item/switchtool/is_wrench() - if(deployed && deployed.deploytype == "wrench") - return TRUE - return FALSE - -/obj/item/switchtool/is_wirecutter() - if(deployed && deployed.deploytype == "wirecutters") - return TRUE - return FALSE - -/obj/item/switchtool/is_multitool() - if(deployed && deployed.deploytype == "multitool") - return TRUE - return FALSE - -/obj/item/switchtool/is_welder() - if(deployed && deployed.deploytype == "welder") - return TRUE - return FALSE - -/obj/item/switchtool/update_icon()//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - . = ..() - var/mutable_appearance/tool_overlay - cut_overlays() //So that it doesn't keep stacking overlays non-stop on top of each other - if(deployed) - switch(switchingtype) - if("basic") - switch(deployed.deploytype) - if("screwdriver") - tool_overlay = mutable_appearance(icon, "[icon_state]_driver") - if("wrench") - tool_overlay = mutable_appearance(icon, "[icon_state]_wrench") - if("crowbar") - tool_overlay = mutable_appearance(icon, "[icon_state]_crowbar") - if("wirecutters") - tool_overlay = mutable_appearance(icon, "[icon_state]_cutter") - if("multitool") - tool_overlay = mutable_appearance(icon, "[icon_state]_multitool") - if("surgery") - switch(src.deployed.deploytype) - if("scalpel") - tool_overlay = mutable_appearance(icon, "[icon_state]_scalpel") - if("cautery") - tool_overlay = mutable_appearance(icon, "[icon_state]_cautery") - if("hemostat") - tool_overlay = mutable_appearance(icon, "[icon_state]_hemostat") - if("retractor") - tool_overlay = mutable_appearance(icon, "[icon_state]_retractor") - if("boneclamp") - tool_overlay = mutable_appearance(icon, "[icon_state]_boneclamp") - if("ce") - switch(src.deployed.deploytype) - if("screwdriver") - tool_overlay = mutable_appearance(icon, "[icon_state]_driver") - if("wrench") - tool_overlay = mutable_appearance(icon, "[icon_state]_wrench") - if("crowbar") - tool_overlay = mutable_appearance(icon, "[icon_state]_crowbar") - if("wirecutters") - tool_overlay = mutable_appearance(icon, "[icon_state]_cutter") - if("multitool") - tool_overlay = mutable_appearance(icon, "[icon_state]_multitool") - if("welder") - tool_overlay = mutable_appearance(icon, "[icon_state]_welder") - if("light") - tool_overlay = mutable_appearance(icon, "[icon_state]_light") - if("soap") - tool_overlay = mutable_appearance(icon, "[icon_state]_soap") - if("adminholo") - switch(src.deployed.deploytype) - if("light") - tool_overlay = mutable_appearance(icon, "[icon_state]_light") - if("soap") - tool_overlay = mutable_appearance(icon, "[icon_state]_soap") - if("scalpel") - tool_overlay = mutable_appearance(icon, "[icon_state]_scalpel") - if("saw") - tool_overlay = mutable_appearance(icon, "[icon_state]_saw") - if("drill") - tool_overlay = mutable_appearance(icon, "[icon_state]_drill") - if("cautery") - tool_overlay = mutable_appearance(icon, "[icon_state]_cautery") - if("hemostat") - tool_overlay = mutable_appearance(icon, "[icon_state]_hemostat") - if("retractor") - tool_overlay = mutable_appearance(icon, "[icon_state]_retractor") - if("boneclamp") - tool_overlay = mutable_appearance(icon, "[icon_state]_boneclamp") - if("screwdriver") - tool_overlay = mutable_appearance(icon, "[icon_state]_driver") - if("wrench") - tool_overlay = mutable_appearance(icon, "[icon_state]_wrench") - if("crowbar") - tool_overlay = mutable_appearance(icon, "[icon_state]_crowbar") - if("wirecutters") - tool_overlay = mutable_appearance(icon, "[icon_state]_cutter") - if("multitool") - tool_overlay = mutable_appearance(icon, "[icon_state]_multitool") - if("welder") - tool_overlay = mutable_appearance(icon, "[icon_state]_welder") - if("shield") - tool_overlay = mutable_appearance(icon, "[icon_state]_shield") - if("sword") - tool_overlay = mutable_appearance(icon, "[icon_state]_blade") - if(light_color) - tool_overlay.color = light_color - add_overlay(tool_overlay) - if(istype(usr,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = usr - H.update_inv_l_hand() - H.update_inv_r_hand() - -/obj/item/switchtool/surgery - name = "surgeon's switchtool" - icon_state = "surgeryswitchtool" - item_state = "surgeryswitchtool" - desc = "A switchtool containing most of the necessary items for impromptu surgery. For the surgeon on the go." - start_modules = list(/obj/item/surgical/scalpel/switchy = null, - /obj/item/surgical/hemostat/switchy = null, - /obj/item/surgical/retractor/switchy = null, - /obj/item/surgical/bonesetter/switchy = null) - switchingtype = "surgery" - -//Unique adminspawn switchtool. Has all the tools. -/obj/item/switchtool/holo - name = "Tool" - icon_state = "holoswitchtool" - item_state = "holoswitchtool" - desc = "An object that can take on the holographic hardlight form of nearly any tool in use today." - description_fluff = "Mankind's first tool was likely a blade crudely shaped from flint. Versatile, at the time - one could skin creatures, use it as a weapon, hack at trees and cut plants. This is, potentially, mankind's last tool- able to be dynamically upgraded to support different holoprojector setups, allowing even more tools to be used by one device, once a working holoprojector setup for an application is implemented." - var/brightness_max = 4 - var/brightness_min = 2 - deploy_sound = "sound/weapons/switchsound.ogg" - undeploy_sound = "sound/weapons/switchsound.ogg" - light_color = LIGHT_COLOR_CYAN - switchingtype = "adminholo" - start_modules = list( - /obj/item/surgical/scalpel/laser3/holoswitch = null, - /obj/item/surgical/circular_saw/holoswitch = null, - /obj/item/surgical/surgicaldrill/holoswitch = null, - /obj/item/surgical/cautery/holoswitch = null, - /obj/item/surgical/hemostat/holoswitch = null, - /obj/item/surgical/retractor/holoswitch = null, - /obj/item/surgical/bone_clamp/holoswitch = null, - /obj/item/tool/screwdriver/holoswitch = null, - /obj/item/tool/wrench/holoswitch = null, - /obj/item/tool/crowbar/holoswitch = null, - /obj/item/tool/wirecutters/holoswitch = null, - /obj/item/weldingtool/holoswitch = null, - /obj/item/multitool/holoswitch = null, - /obj/item/flashlight/holoswitch = null, - /obj/item/soap/holoswitch = null, - /obj/item/melee/energy/sword/holoswitch = null, - /obj/item/shield/holoswitch = null) - -/obj/item/switchtool/holo/Initialize(mapload) - . = ..() - add_atom_colour(light_color, FIXED_COLOUR_PRIORITY) - -/obj/item/switchtool/holo/deploy(var/obj/item/module) //We lightin' it up in here - ..() - if(module.deploytype == "flashlight") - set_light(brightness_max, 4, light_color) - else - set_light(brightness_min, 1, light_color) - -/obj/item/switchtool/holo/undeploy() - ..() - set_light(0) - -/obj/item/switchtool/holo/CE - name = "Chief Engineer's holotool" - icon_state = "holoswitchtool" - item_state = "holoswitchtool" - desc = "A finely crafted device that uses a micro-scale hardlight emitter to form hardlight manipulators in the form of tools. Can also operate in low-power mode as a flashlight and in high-power mode as a UV cleaner." - description_fluff = "A holotool used by the Chief Engineer." - light_color = "#FED8B1" //lightcolororange sucks lmao - start_modules = list( - /obj/item/tool/screwdriver/holoswitch = null, - /obj/item/tool/wrench/holoswitch = null, - /obj/item/tool/crowbar/holoswitch = null, - /obj/item/tool/wirecutters/holoswitch = null, - /obj/item/weldingtool/holoswitch = null, - /obj/item/multitool/holoswitch = null, - /obj/item/flashlight/holoswitch = null, - /obj/item/soap/holoswitch = null) - switchingtype = "ce" - -//Actual tools go here. - -/obj/item/soap/holoswitch - name = "holographically contained UV light" - desc = "This should not exist." - deploytype = "soap" - -/obj/item/flashlight/holoswitch - name = "low-power holoemitter" - desc = "This should not exist" - power_use = 0 - deploytype = "light" - -/obj/item/tool/screwdriver/holoswitch - name = "hardlight screwdriver" - desc = "This should not exist." - deploytype = "screwdriver" - toolspeed = 0.9 - -/obj/item/tool/wrench/holoswitch - name = "hardlight bolt driver" - desc = "This should not exist." - deploytype = "wrench" - toolspeed = 0.9 - -/obj/item/tool/crowbar/holoswitch - name = "hardlight pry bar" - desc = "This should not exist." - deploytype = "crowbar" - toolspeed = 0.9 - -/obj/item/tool/wirecutters/holoswitch - name = "hardlight wire cutting tool" - desc = "This should not exist." - deploytype = "wirecutters" - toolspeed = 0.9 - -/obj/item/weldingtool/holoswitch - name = "laser welding tool" - desc = "This should not exist." - deploytype = "welder" - toolspeed = 0.9 - var/nextrefueltick = 0 - -/obj/item/multitool/holoswitch - name = "hardlight electromagnetic microinducer" - desc = "This should not exist." - deploytype = "multitool" - -/obj/item/weldingtool/holoswitch/process(delta_time) - ..() - if(get_fuel() < get_max_fuel() && nextrefueltick < world.time) - nextrefueltick = world.time + 10 - reagents.add_reagent("fuel", 1) - -/obj/item/surgical/scalpel/laser3/holoswitch - name = "hybrid hardlight-laser scalpel" - desc = "This should not exist." - deploytype = "scalpel" - toolspeed = 0.9 - -/obj/item/surgical/retractor/holoswitch - name = "hardlight retractor" - desc = "This should not exist." - deploytype = "retractor" - toolspeed = 0.9 - -/obj/item/surgical/hemostat/holoswitch - name = "hardlight haemostat" - desc = "This should not exist." - deploytype = "hemostat" - toolspeed = 0.9 - -/obj/item/surgical/cautery/holoswitch - name = "laser cautery" - desc = "This should not exist." - deploytype = "cautery" - toolspeed = 0.9 - -/obj/item/surgical/circular_saw/holoswitch - name = "hardlight saw" - desc = "This should not exist." - deploytype = "saw" - toolspeed = 0.9 - -/obj/item/surgical/surgicaldrill/holoswitch - name = "hardlight surgical drill" - desc = "This should not exist." - deploytype = "drill" - toolspeed = 0.9 - -/obj/item/surgical/bone_clamp/holoswitch - name = "hardlight bone rectifier" - desc = "This should not exist." - deploytype = "boneclamp" - toolspeed = 0.9 - -/obj/item/melee/energy/sword/holoswitch - name = "hardlight blade" - desc = "This should not exist." - deploytype = "sword" - -/obj/item/shield/holoswitch - name = "hardlight shield" - desc = "This should not exist." - deploytype = "shield" - -/obj/item/soap/holoswitch/pre_attack() - . = ..() - wet() - -/obj/item/tool/screwdriver/switchy - name = "switchtool screwdriver" - desc = "This should not exist." - deploytype = "screwdriver" - toolspeed = 1.2 - -/obj/item/tool/wrench/switchy - name = "switchtool wrench" - desc = "This should not exist." - deploytype = "wrench" - toolspeed = 1.2 - -/obj/item/tool/crowbar/switchy - name = "switchtool crowbar" - desc = "This should not exist." - deploytype = "crowbar" - toolspeed = 1.2 - -/obj/item/tool/wirecutters/switchy - name = "switchtool cutters" - desc = "This should not exist." - deploytype = "wirecutters" - toolspeed = 1.2 - -/obj/item/multitool/switchy - name = "switchtool micro-multitool" - desc = "This should not exist." - deploytype = "multitool" - -/obj/item/surgical/scalpel/switchy - name = "switchtool scalpel" - desc = "This should not exist." - deploytype = "scalpel" - toolspeed = 1.2 - -/obj/item/surgical/hemostat/switchy - name = "switchtool hemostat" - desc = "This should not exist." - deploytype = "hemostat" - toolspeed = 1.2 - -/obj/item/surgical/retractor/switchy - name = "switchtool retractor" - desc = "This should not exist." - deploytype = "retractor" - toolspeed = 1.2 - -/obj/item/surgical/bonesetter/switchy - name = "switchtool bone setter" - desc = "This should not exist." - deploytype = "boneclamp" - toolspeed = 1.2 diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 192e5ba62da..2a7293fe974 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -1,4 +1,5 @@ /obj + layer = OBJ_LAYER plane = OBJ_PLANE pass_flags_self = ATOM_PASS_OVERHEAD_THROW diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index f8c056a0cef..e8c94ed5c6c 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -271,7 +271,7 @@ else to_chat(user, "You need more welding fuel to complete this task.") return - playsound(src, WT.usesound, 50) + playsound(src, WT.tool_sound, 50) new /obj/item/stack/material/steel(src.loc) for(var/mob/M in viewers(src)) M.show_message("\The [src] has been cut apart by [user] with \the [WT].", 3, "You hear welding.", 2) @@ -308,10 +308,10 @@ else to_chat(user, "You need more welding fuel to complete this task.") return - if(do_after(user, 20 * S.toolspeed)) + if(do_after(user, 20 * S.tool_speed)) if(opened) return - playsound(src, S.usesound, 50) + playsound(src, S.tool_sound, 50) src.sealed = !src.sealed src.update_icon() for(var/mob/M in viewers(src)) @@ -322,8 +322,8 @@ user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") else user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.") - playsound(src, W.usesound, 50) - if(do_after(user, 20 * W.toolspeed)) + playsound(src, W.tool_sound, 50) + if(do_after(user, 20 * W.tool_speed)) if(!src) return to_chat(user, "You [anchored? "un" : ""]secured \the [src]!") anchored = !anchored @@ -492,3 +492,9 @@ dump_contents() spawn(1) qdel(src) return 1 + +/obj/structure/closet/CanReachOut(atom/movable/mover, atom/target, obj/item/tool, list/cache) + return FALSE + +/obj/structure/closet/CanReachIn(atom/movable/mover, atom/target, obj/item/tool, list/cache) + return FALSE diff --git a/code/game/objects/structures/crates_lockers/closets/coffin.dm b/code/game/objects/structures/crates_lockers/closets/coffin.dm index a2fa5be5dda..d8504a584c9 100644 --- a/code/game/objects/structures/crates_lockers/closets/coffin.dm +++ b/code/game/objects/structures/crates_lockers/closets/coffin.dm @@ -80,7 +80,7 @@ user.visible_message("[user] piles dirt into \the [src.name].", \ "You start to pile dirt into \the [src.name].", \ "You hear dirt being moved.") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) user.visible_message("[user] pats down the dirt on top of \the [src.name].", \ "You finish filling in \the [src.name].") close() @@ -116,7 +116,7 @@ user.visible_message("[user] begins to smoothe out the dirt of \the [src.name].", \ "You start to smoothe out the dirt of \the [src.name].", \ "You hear dirt being moved.") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) user.visible_message("[user] finishes smoothing out \the [src.name].", \ "You finish smoothing out \the [src.name].") if(LAZYLEN(contents)) @@ -132,7 +132,7 @@ user.visible_message("[user] begins to unearth \the [src.name].", \ "You start to unearth \the [src.name].", \ "You hear dirt being moved.") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) user.visible_message("[user] reaches the bottom of \the [src.name].", \ "You finish digging out \the [src.name].") break_open() diff --git a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm index 40c39149a1f..3168db1621c 100644 --- a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm +++ b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm @@ -34,7 +34,7 @@ if(istype(O, /obj/item/multitool)) to_chat(user, "Resetting circuitry...") playsound(user, 'sound/machines/lockreset.ogg', 50, 1) - if(do_after(user, 20 * O.toolspeed)) + if(do_after(user, 20 * O.tool_speed)) src.locked = 0 to_chat(user, SPAN_CAUTION("You disable the locking modules.")) update_icon() @@ -93,7 +93,7 @@ else to_chat(user, "Resetting circuitry...") playsound(user, 'sound/machines/lockenable.ogg', 50, 1) - if(do_after(user,20 * O.toolspeed)) + if(do_after(user,20 * O.tool_speed)) src.locked = 1 to_chat(user, SPAN_CAUTION("You re-enable the locking modules.")) return diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index 954b4386f79..fa7e3fb0e06 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -92,7 +92,7 @@ user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") else user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.") - if(do_after(user, 20 * W.toolspeed)) + if(do_after(user, 20 * W.tool_speed)) if(!src) return to_chat(user, "You [anchored? "un" : ""]secured \the [src]!") anchored = !anchored diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 2cfbb8b723c..3de18609619 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -102,7 +102,7 @@ else if(W.is_wirecutter()) if(rigged) to_chat(user, "You cut away the wiring.") - playsound(src.loc, W.usesound, 100, 1) + playsound(src.loc, W.tool_sound, 100, 1) rigged = 0 return else if(istype(W, /obj/item/extraction_pack)) @@ -403,12 +403,12 @@ if(W.is_wrench() && !src.opened) if(anchored) user.show_message(text("[src] can now be moved.")) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) anchored = FALSE else if(!anchored) user.show_message(text("[src] is now secured.")) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) anchored = TRUE else ..() diff --git a/code/game/objects/structures/crates_lockers/vehiclecage.dm b/code/game/objects/structures/crates_lockers/vehiclecage.dm index 273ce9451dd..6dc8940ab56 100644 --- a/code/game/objects/structures/crates_lockers/vehiclecage.dm +++ b/code/game/objects/structures/crates_lockers/vehiclecage.dm @@ -31,12 +31,12 @@ var/turf/T = get_turf(src) if(!T) to_chat(user, "You can't open this here!") - if(W.is_wrench() && do_after(user, 60 * W.toolspeed, src)) - playsound(loc, W.usesound, 50, 1) + if(W.is_wrench() && do_after(user, 60 * W.tool_speed, src)) + playsound(loc, W.tool_sound, 50, 1) disassemble(W, user) user.visible_message("[user] begins loosening \the [src]'s bolts.") - if(W.is_wirecutter() && do_after(user, 70 * W.toolspeed, src)) - playsound(loc, W.usesound, 50, 1) + if(W.is_wirecutter() && do_after(user, 70 * W.tool_speed, src)) + playsound(loc, W.tool_sound, 50, 1) disassemble(W, user) user.visible_message("[user] begins cutting \the [src]'s bolts.") else diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm index 16009454b57..cc1e088d919 100644 --- a/code/game/objects/structures/curtains.dm +++ b/code/game/objects/structures/curtains.dm @@ -38,7 +38,7 @@ /obj/structure/curtain/attackby(obj/item/P, mob/user) if(P.is_wirecutter()) - playsound(src, P.usesound, 50, 1) + playsound(src, P.tool_sound, 50, 1) to_chat(user, "You start to cut the shower curtains.") if(do_after(user, 10)) to_chat(user, "You cut the shower curtains.") diff --git a/code/game/objects/structures/dancepole.dm b/code/game/objects/structures/dancepole.dm index 0c59613a7d5..de5f609d741 100644 --- a/code/game/objects/structures/dancepole.dm +++ b/code/game/objects/structures/dancepole.dm @@ -19,7 +19,7 @@ if(istype(O, /obj/item/weldingtool)) var/obj/item/weldingtool/WT = O if(WT.remove_fuel(0, user)) - playsound(src, WT.usesound, 25, 1) + playsound(src, WT.tool_sound, 25, 1) for (var/mob/M in viewers(src)) M.show_message("[user.name] deconstructed \the [src].", 3, "You hear welding.", 2) new /obj/item/stack/material/steel(loc) diff --git a/code/game/objects/structures/decorations.dm b/code/game/objects/structures/decorations.dm index 725b41e8067..9d4b8f6eeca 100644 --- a/code/game/objects/structures/decorations.dm +++ b/code/game/objects/structures/decorations.dm @@ -15,7 +15,7 @@ /obj/structure/shrine_seal/attackby(obj/item/P, mob/user) if(P.is_wirecutter()) - playsound(src, P.usesound, 50, 1) + playsound(src, P.tool_sound, 50, 1) to_chat(user, "You start to cut the hanging rope.") if(do_after(user, 10)) to_chat(user, "You cut the hanging rope.") diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index d4bb695bc9c..10af3ca0ce7 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -174,10 +174,10 @@ if(istype(W, /obj/item/weldingtool) && ( (istext(glass)) || (glass == 1) || (!anchored) )) var/obj/item/weldingtool/WT = W if (WT.remove_fuel(0, user)) - playsound(src, WT.usesound, 50, 1) + playsound(src, WT.tool_sound, 50, 1) if(istext(glass)) user.visible_message("[user] welds the [glass] plating off the airlock assembly.", "You start to weld the [glass] plating off the airlock assembly.") - if(do_after(user, 40 * WT.toolspeed)) + if(do_after(user, 40 * WT.tool_speed)) if(!src || !WT.isOn()) return to_chat(user, "You welded the [glass] plating off!") var/M = text2path("/obj/item/stack/material/[glass]") @@ -185,14 +185,14 @@ glass = 0 else if(glass == 1) user.visible_message("[user] welds the glass panel out of the airlock assembly.", "You start to weld the glass panel out of the airlock assembly.") - if(do_after(user, 40 * WT.toolspeed)) + if(do_after(user, 40 * WT.tool_speed)) if(!src || !WT.isOn()) return to_chat(user, "You welded the glass panel out!") new /obj/item/stack/material/glass/reinforced(src.loc) glass = 0 else if(!anchored) user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.") - if(do_after(user, 40 * WT.toolspeed)) + if(do_after(user, 40 * WT.tool_speed)) if(!src || !WT.isOn()) return to_chat(user, "You dissasembled the airlock assembly!") new /obj/item/stack/material/steel(src.loc, 4) @@ -202,13 +202,13 @@ return else if(W.is_wrench() && state == 0) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) if(anchored) user.visible_message("[user] begins unsecuring the airlock assembly from the floor.", "You starts unsecuring the airlock assembly from the floor.") else user.visible_message("[user] begins securing the airlock assembly to the floor.", "You starts securing the airlock assembly to the floor.") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) if(!src) return to_chat(user, "You [anchored? "un" : ""]secured the airlock assembly!") anchored = !anchored @@ -225,17 +225,17 @@ to_chat(user, "You wire the airlock.") else if(W.is_wirecutter() && state == 1 ) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) if(!src) return to_chat(user, "You cut the airlock wires.!") new/obj/item/stack/cable_coil(src.loc, 1) src.state = 0 else if(istype(W, /obj/item/airlock_electronics) && state == 1) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.") if(do_after(user, 40, src)) @@ -252,10 +252,10 @@ src.state = 1 return - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) user.visible_message("\The [user] starts removing the electronics from the airlock assembly.", "You start removing the electronics from the airlock assembly.") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) if(!src) return to_chat(user, "You removed the airlock electronics!") @@ -289,10 +289,10 @@ glass = material_name else if(W.is_screwdriver() && state == 2 ) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "Now finishing the airlock.") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) if(!src) return to_chat(user, "You finish the airlock!") var/path diff --git a/code/game/objects/structures/electricchair.dm b/code/game/objects/structures/electricchair.dm index 76e9abb5370..8b3140ffe84 100644 --- a/code/game/objects/structures/electricchair.dm +++ b/code/game/objects/structures/electricchair.dm @@ -13,7 +13,7 @@ /obj/structure/bed/chair/e_chair/attackby(obj/item/W as obj, mob/user as mob) if(W.is_wrench()) var/obj/structure/bed/chair/C = new /obj/structure/bed/chair(loc) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) C.setDir(dir) part.loc = loc part.master = null diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index 861512a98e4..f3db596537c 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -34,8 +34,8 @@ if(O.is_wrench()) if(!has_extinguisher) to_chat(user, "You start to unwrench the extinguisher cabinet.") - playsound(src.loc, O.usesound, 50, 1) - if(do_after(user, 15 * O.toolspeed)) + playsound(src.loc, O.tool_sound, 50, 1) + if(do_after(user, 15 * O.tool_speed)) to_chat(user, "You unwrench the extinguisher cabinet.") new /obj/item/frame/extinguisher_cabinet( src.loc ) qdel(src) diff --git a/code/game/objects/structures/fence.dm b/code/game/objects/structures/fence.dm index e0424d68609..a3bd6b4f0f8 100644 --- a/code/game/objects/structures/fence.dm +++ b/code/game/objects/structures/fence.dm @@ -86,9 +86,9 @@ user.visible_message(SPAN_DANGER("\The [user] starts cutting through \the [src] with \the [W]."),\ SPAN_DANGER("You start cutting through \the [src] with \the [W].")) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) - if(do_after(user, CUT_TIME * W.toolspeed, target = src)) + if(do_after(user, CUT_TIME * W.tool_speed, target = src)) if(current_stage == hole_size) switch(++hole_size) if(MEDIUM_HOLE) diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm index 3750526dd3b..4b50af60a29 100644 --- a/code/game/objects/structures/fireaxe.dm +++ b/code/game/objects/structures/fireaxe.dm @@ -33,7 +33,7 @@ if(istype(O, /obj/item/multitool)) to_chat(user, "Resetting circuitry...") playsound(user, 'sound/machines/lockreset.ogg', 50, 1) - if(do_after(user, 20 * O.toolspeed)) + if(do_after(user, 20 * O.tool_speed)) locked = 0 to_chat(user, SPAN_CAUTION("You disable the locking modules.")) update_icon() @@ -84,7 +84,7 @@ else to_chat(user, "Resetting circuitry...") playsound(user, 'sound/machines/lockenable.ogg', 50, 1) - if(do_after(user,20 * O.toolspeed)) + if(do_after(user,20 * O.tool_speed)) locked = 1 to_chat(user, SPAN_CAUTION("You re-enable the locking modules.")) return diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm index 5f1f701f6d4..5aaa8e0ac85 100644 --- a/code/game/objects/structures/flora.dm +++ b/code/game/objects/structures/flora.dm @@ -100,7 +100,7 @@ /obj/structure/flora/ausbushes/attackby(obj/item/W as obj, mob/user as mob) // Dismantle if(istype(W, /obj/item/shovel)) - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) if(do_after(user, 10, src)) user.visible_message("\The [user] digs up \the [src].", "You dig up \the [src].") new /obj/item/stack/tile/grass(get_turf(usr), 1) diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 42174c18b14..ba968a2c69a 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -146,22 +146,22 @@ /obj/structure/girder/attackby(obj/item/W as obj, mob/user as mob) if(W.is_wrench() && state == 0) if(anchored && !reinf_material) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "Now disassembling the girder...") - if(do_after(user,(35 + round(max_health/50)) * W.toolspeed)) + if(do_after(user,(35 + round(max_health/50)) * W.tool_speed)) if(!src) return to_chat(user, "You dissasembled the girder!") dismantle() else if(!anchored) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "Now securing the girder...") - if(do_after(user, 40 * W.toolspeed, src)) + if(do_after(user, 40 * W.tool_speed, src)) to_chat(user, "You secured the girder!") reset_girder() else if(istype(W, /obj/item/pickaxe/plasmacutter)) to_chat(user, "Now slicing apart the girder...") - if(do_after(user,30 * W.toolspeed)) + if(do_after(user,30 * W.tool_speed)) if(!src) return to_chat(user, "You slice apart the girder!") dismantle() @@ -172,21 +172,21 @@ else if(W.is_screwdriver()) if(state == 2) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "Now unsecuring support struts...") - if(do_after(user,40 * W.toolspeed)) + if(do_after(user,40 * W.tool_speed)) if(!src) return to_chat(user, "You unsecured the support struts!") state = 1 else if(anchored && !reinf_material) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) reinforcing = !reinforcing to_chat(user, "\The [src] can now be [reinforcing? "reinforced" : "constructed"]!") else if(W.is_wirecutter() && state == 1) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "Now removing support struts...") - if(do_after(user,40 * W.toolspeed)) + if(do_after(user,40 * W.tool_speed)) if(!src) return to_chat(user, "You removed the support struts!") reinf_material.place_dismantled_product(get_turf(src), 2) @@ -194,9 +194,9 @@ reset_girder() else if(W.is_crowbar() && state == 0 && anchored) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "Now dislodging the girder...") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) if(!src) return to_chat(user, "You dislodged the girder!") displace() @@ -338,15 +338,15 @@ /obj/structure/girder/cult/attackby(obj/item/W as obj, mob/user as mob) if(W.is_wrench()) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "Now disassembling the girder...") - if(do_after(user,40 * W.toolspeed)) + if(do_after(user,40 * W.tool_speed)) to_chat(user, "You dissasembled the girder!") dismantle() else if(istype(W, /obj/item/pickaxe/plasmacutter)) to_chat(user, "Now slicing apart the girder...") - if(do_after(user,30 * W.toolspeed)) + if(do_after(user,30 * W.tool_speed)) to_chat(user, "You slice apart the girder!") dismantle() diff --git a/code/game/objects/structures/gravemarker.dm b/code/game/objects/structures/gravemarker.dm index 4c1b9f9969a..f0586495c28 100644 --- a/code/game/objects/structures/gravemarker.dm +++ b/code/game/objects/structures/gravemarker.dm @@ -44,7 +44,7 @@ return ..() /obj/structure/gravemarker/CheckExit(atom/movable/AM, atom/newLoc) - if(!(get_dir(AM.loc, newLoc) & dir)) + if(!(get_dir(src, newLoc) & dir)) return TRUE if(check_standard_flag_pass(AM)) return TRUE @@ -55,21 +55,21 @@ var/carving_1 = sanitizeSafe(input(user, "Who is \the [src.name] for?", "Gravestone Naming", null) as text, MAX_NAME_LEN) if(carving_1) user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].") - if(do_after(user, material.hardness * W.toolspeed)) + if(do_after(user, material.hardness * W.tool_speed)) user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].") grave_name += carving_1 update_icon() var/carving_2 = sanitizeSafe(input(user, "What message should \the [src.name] have?", "Epitaph Carving", null) as text, MAX_NAME_LEN) if(carving_2) user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].") - if(do_after(user, material.hardness * W.toolspeed)) + if(do_after(user, material.hardness * W.tool_speed)) user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].") epitaph += carving_2 update_icon() return if(W.is_wrench()) user.visible_message("[user] starts taking down \the [src.name].", "You start taking down \the [src.name].") - if(do_after(user, material.hardness * W.toolspeed)) + if(do_after(user, material.hardness * W.tool_speed)) user.visible_message("[user] takes down \the [src.name].", "You take down \the [src.name].") dismantle() ..() diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 6b1ccc4caeb..bdf96f37d54 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -95,12 +95,12 @@ return FALSE else if(W.is_wirecutter()) if(!shock(user, 100)) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) new /obj/item/stack/rods(get_turf(src), destroyed ? 1 : 2) qdel(src) else if((W.is_screwdriver()) && (istype(loc, /turf/simulated) || anchored)) if(!shock(user, 90)) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) anchored = !anchored user.visible_message("[user] [anchored ? "fastens" : "unfastens"] the grille.", \ "You have [anchored ? "fastened the grille to" : "unfastened the grille from"] the floor.") diff --git a/code/game/objects/structures/ledges.dm b/code/game/objects/structures/ledges.dm index 18dffe73a1e..7aaef0e63f9 100644 --- a/code/game/objects/structures/ledges.dm +++ b/code/game/objects/structures/ledges.dm @@ -39,7 +39,7 @@ /obj/structure/ledge/CanAllowThrough(atom/movable/mover, turf/target) if(!solidledge) return TRUE - if(get_dir(mover, target) != turn(dir, 180)) + if(!(get_dir(mover, target) & turn(dir, 180))) return TRUE return ..() @@ -48,7 +48,7 @@ return TRUE if(!solidledge) return TRUE - if(get_dir(AM, AM) != turn(dir, 180)) + if(!(get_dir(src, newLoc) & dir)) return TRUE return FALSE diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 5e7c3de07b2..c41a12a9d5e 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -51,8 +51,8 @@ /obj/structure/mirror/attackby(obj/item/I as obj, mob/user as mob) if(I.is_wrench()) if(!glass) - playsound(src.loc, I.usesound, 50, 1) - if(do_after(user, 20 * I.toolspeed)) + playsound(src.loc, I.tool_sound, 50, 1) + if(do_after(user, 20 * I.tool_speed)) to_chat(user, "You unfasten the frame.") new /obj/item/frame/mirror( src.loc ) qdel(src) @@ -65,7 +65,7 @@ new /obj/item/material/shard( src.loc ) return if(!shattered && glass) - playsound(src.loc, I.usesound, 50, 1) + playsound(src.loc, I.tool_sound, 50, 1) to_chat(user, "You remove the glass.") glass = !glass icon_state = "mirror_frame" diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 070e89267df..05abbc1fbe6 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -134,11 +134,11 @@ if(istype(W, /obj/item/tool/wrench)) if(anchored) user.show_message(text("[src] can now be moved.")) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) anchored = FALSE else if(!anchored) user.show_message(text("[src] is now secured.")) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) anchored = TRUE src.add_fingerprint(user) return diff --git a/code/game/objects/structures/noticeboard.dm b/code/game/objects/structures/noticeboard.dm index adfd632d5ab..fa615047e4c 100644 --- a/code/game/objects/structures/noticeboard.dm +++ b/code/game/objects/structures/noticeboard.dm @@ -37,8 +37,8 @@ to_chat(user, "You reach to pin your paper to the board but hesitate. You are certain your paper will not be seen among the many others already attached.") if(O.is_wrench()) to_chat(user, "You start to unwrench the noticeboard.") - playsound(src.loc, O.usesound, 50, 1) - if(do_after(user, 15 * O.toolspeed)) + playsound(src.loc, O.tool_sound, 50, 1) + if(do_after(user, 15 * O.tool_speed)) to_chat(user, "You unwrench the noticeboard.") new /obj/item/frame/noticeboard( src.loc ) qdel(src) diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm index 50db3138fd5..d94bf73f4bb 100644 --- a/code/game/objects/structures/plasticflaps.dm +++ b/code/game/objects/structures/plasticflaps.dm @@ -18,9 +18,9 @@ /obj/structure/plasticflaps/attackby(obj/item/P, mob/user) if(P.is_wirecutter()) - playsound(src, P.usesound, 50, 1) + playsound(src, P.tool_sound, 50, 1) to_chat(user, "You start to cut the plastic flaps.") - if(do_after(user, 10 * P.toolspeed)) + if(do_after(user, 10 * P.tool_speed)) to_chat(user, "You cut the plastic flaps.") var/obj/item/stack/material/plastic/A = new /obj/item/stack/material/plastic( src.loc ) A.amount = 4 diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm index f505202b435..50ae13c3454 100644 --- a/code/game/objects/structures/railing.dm +++ b/code/game/objects/structures/railing.dm @@ -4,7 +4,7 @@ desc = "A standard steel railing. Play stupid games, win stupid prizes." icon = 'icons/obj/railing.dmi' density = TRUE - pass_flags_self = ATOM_PASS_THROWN | ATOM_PASS_CLICK | ATOM_PASS_TABLE | ATOM_PASS_OVERHEAD_THROW + pass_flags_self = ATOM_PASS_THROWN | ATOM_PASS_CLICK | ATOM_PASS_TABLE | ATOM_PASS_OVERHEAD_THROW | ATOM_PASS_CLICK climbable = TRUE layer = WINDOW_LAYER anchored = TRUE @@ -44,7 +44,7 @@ /obj/structure/railing/CheckExit(atom/movable/mover, atom/newLoc) if(check_standard_flag_pass(mover)) return TRUE - if(!(get_dir(mover, newLoc) & dir)) + if(!(get_dir(src, newLoc) & dir)) return TRUE return !density @@ -196,7 +196,7 @@ /obj/structure/railing/attackby(obj/item/W as obj, mob/user as mob) // Dismantle if(W.is_wrench() && !anchored) - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) if(do_after(user, 20, src)) user.visible_message("\The [user] dismantles \the [src].", "You dismantle \the [src].") new /obj/item/stack/material/steel(get_turf(usr), 2) @@ -207,7 +207,7 @@ if(health < maxhealth && istype(W, /obj/item/weldingtool)) var/obj/item/weldingtool/F = W if(F.welding) - playsound(src.loc, F.usesound, 50, 1) + playsound(src.loc, F.tool_sound, 50, 1) if(do_after(user, 20, src)) user.visible_message("\The [user] repairs some damage to \the [src].", "You repair some damage to \the [src].") health = min(health+(maxhealth/5), maxhealth) // 20% repair per application @@ -216,7 +216,7 @@ // Install if(W.is_screwdriver()) user.visible_message(anchored ? "\The [user] begins unscrewing \the [src]." : "\The [user] begins fasten \the [src]." ) - playsound(loc, W.usesound, 75, 1) + playsound(loc, W.tool_sound, 75, 1) if(do_after(user, 10, src)) to_chat(user, (anchored ? "You have unfastened \the [src] from the floor." : "You have fastened \the [src] to the floor.")) anchored = !anchored diff --git a/code/game/objects/structures/salvageable.dm b/code/game/objects/structures/salvageable.dm index fef31bbc394..3af9339e84c 100644 --- a/code/game/objects/structures/salvageable.dm +++ b/code/game/objects/structures/salvageable.dm @@ -15,8 +15,8 @@ /obj/structure/salvageable/attackby(obj/item/I, mob/user) if(I.is_crowbar()) - playsound(src, I.usesound, 50, 1) - var/actual_time = I.toolspeed * 170 + playsound(src, I.tool_sound, 50, 1) + var/actual_time = I.tool_speed * 170 user.visible_message( \ "\The [user] begins salvaging from \the [src].", \ "You start salvaging from \the [src].") diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm index 5e2d19ee0c3..26d2c238b15 100644 --- a/code/game/objects/structures/signs.dm +++ b/code/game/objects/structures/signs.dm @@ -23,7 +23,7 @@ /obj/structure/sign/attackby(obj/item/tool as obj, mob/user as mob) //deconstruction if(tool.is_screwdriver() && !istype(src, /obj/structure/sign/double)) - playsound(src, tool.usesound, 50, 1) + playsound(src, tool.tool_sound, 50, 1) to_chat(user, "You unfasten the sign with your [tool].") var/obj/item/sign/S = new(src.loc) S.name = name diff --git a/code/game/objects/structures/statues.dm b/code/game/objects/structures/statues.dm index 5b7d54ba4ab..bb7cdb3dfad 100644 --- a/code/game/objects/structures/statues.dm +++ b/code/game/objects/structures/statues.dm @@ -22,7 +22,7 @@ playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) user.visible_message("[user] is loosening the [name]'s bolts.", \ "You are loosening the [name]'s bolts...") - if(do_after(user,40/W.toolspeed, target = src)) + if(do_after(user,40/W.tool_speed, target = src)) if(!src.loc || !anchored) return user.visible_message("[user] loosened the [name]'s bolts!", \ @@ -35,7 +35,7 @@ playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) user.visible_message("[user] is securing the [name]'s bolts...", \ "You are securing the [name]'s bolts...") - if(do_after(user, 40/W.toolspeed, target = src)) + if(do_after(user, 40/W.tool_speed, target = src)) if(!src.loc || anchored) return user.visible_message("[user] has secured the [name]'s bolts.", \ @@ -69,7 +69,7 @@ playsound(loc, 'sound/items/Welder.ogg', 40, 1) user.visible_message("[user] is slicing apart the [name].", \ "You are slicing apart the [name]...") - if(do_after(user, 40/W.toolspeed, target = src)) + if(do_after(user, 40/W.tool_speed, target = src)) if(!src.loc) return playsound(loc, 'sound/items/Welder2.ogg', 50, 1) diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 09387a4b884..39e4d94a416 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -85,7 +85,7 @@ /obj/structure/bed/attackby(obj/item/W as obj, mob/user as mob) if(W.is_wrench()) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) dismantle() qdel(src) else if(istype(W,/obj/item/stack)) @@ -113,7 +113,7 @@ to_chat(user, "\The [src] has no padding to remove.") return to_chat(user, "You remove the padding from \the [src].") - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) remove_padding() else if(istype(W, /obj/item/grab)) diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm index 9dac3593187..da42a60e9ee 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm @@ -106,7 +106,7 @@ var/global/list/stool_cache = list() //haha stool /obj/item/stool/attackby(obj/item/W as obj, mob/user as mob) if(W.is_wrench()) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) dismantle() qdel(src) else if(istype(W,/obj/item/stack)) @@ -135,7 +135,7 @@ var/global/list/stool_cache = list() //haha stool to_chat(user, "\The [src] has no padding to remove.") return to_chat(user, "You remove the padding from \the [src].") - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) remove_padding() else ..() diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index ed54083bbc1..cf75c9ac29f 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -176,8 +176,8 @@ if(I.is_wrench()) var/newtemp = input(user, "What setting would you like to set the temperature valve to?", "Water Temperature Valve") in temperature_settings to_chat(user, "You begin to adjust the temperature valve with \the [I].") - playsound(src.loc, I.usesound, 50, 1) - if(do_after(user, 50 * I.toolspeed)) + playsound(src.loc, I.tool_sound, 50, 1) + if(do_after(user, 50 * I.tool_speed)) watertemp = newtemp user.visible_message("[user] adjusts the shower with \the [I].", "You adjust the shower with \the [I].") add_fingerprint(user) diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index e67c46ba30c..5ede8b79368 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -62,7 +62,7 @@ obj/structure/windoor_assembly/Destroy() return ..() /obj/structure/windoor_assembly/CheckExit(atom/movable/AM, atom/newLoc) - if(!(get_dir(loc, AM) & dir)) + if(!(get_dir(src, newLoc) & dir)) // ditto return TRUE if(check_standard_flag_pass(AM)) @@ -91,9 +91,9 @@ obj/structure/windoor_assembly/Destroy() var/obj/item/weldingtool/WT = W if (WT.remove_fuel(0,user)) user.visible_message("[user] disassembles the windoor assembly.", "You start to disassemble the windoor assembly.") - playsound(src.loc, WT.usesound, 50, 1) + playsound(src.loc, WT.tool_sound, 50, 1) - if(do_after(user, 40 * WT.toolspeed)) + if(do_after(user, 40 * WT.tool_speed)) if(!src || !WT.isOn()) return to_chat(user,"You disassembled the windoor assembly!") if(secure) @@ -107,10 +107,10 @@ obj/structure/windoor_assembly/Destroy() //Wrenching an unsecure assembly anchors it in place. Step 4 complete if(W.is_wrench() && !anchored) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor.") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) if(!src) return to_chat(user,"You've secured the windoor assembly!") src.anchored = 1 @@ -118,10 +118,10 @@ obj/structure/windoor_assembly/Destroy() //Unwrenching an unsecure assembly un-anchors it. Step 4 undone else if(W.is_wrench() && anchored) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) user.visible_message("[user] unsecures the windoor assembly to the floor.", "You start to unsecure the windoor assembly to the floor.") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) if(!src) return to_chat(user,"You've unsecured the windoor assembly!") src.anchored = 0 @@ -144,10 +144,10 @@ obj/structure/windoor_assembly/Destroy() //Removing wire from the assembly. Step 5 undone. if(W.is_wirecutter() && !src.electronics) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) if(!src) return to_chat(user,"You cut the windoor wires.!") @@ -173,10 +173,10 @@ obj/structure/windoor_assembly/Destroy() //Screwdriver to remove airlock electronics. Step 6 undone. else if(W.is_screwdriver() && src.electronics) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to uninstall electronics from the airlock assembly.") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) if(!src || !src.electronics) return to_chat(user,"You've removed the airlock electronics!") step = 1 @@ -193,10 +193,10 @@ obj/structure/windoor_assembly/Destroy() to_chat(usr,"The assembly has broken airlock electronics.") return user << browse(null, "window=windoor_access") //Not sure what this actually does... -Ner - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) user.visible_message("[user] pries the windoor into the frame.", "You start prying the windoor into the frame.") - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.tool_speed)) if(!src) return diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 7784070a98f..26bb60f0af7 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -9,30 +9,40 @@ layer = WINDOW_LAYER pressure_resistance = 4*ONE_ATMOSPHERE - anchored = 1.0 + anchored = TRUE flags = ON_BORDER + + /// are we reinforced? this is only to modify our construction state/steps. + var/considered_reinforced = FALSE + /// construction state + var/construction_state = WINDOW_STATE_SECURED_TO_FRAME + /// determines if we're a full tile window, NOT THE ICON STATE. + var/fulltile = FALSE + /// i'm so sorry we have to do this - set to dir for allowthrough purposes + var/moving_right_now + var/maxhealth = 14.0 var/maximal_heat = T0C + 100 // Maximal heat before this window begins taking damage from fire var/damage_per_fire_tick = 2.0 // Amount of damage per fire tick. Regular windows are not fireproof so they might as well break quickly. var/health var/force_threshold = 0 - var/ini_dir = null - var/state = 2 - var/reinf = 0 var/basestate var/shardtype = /obj/item/material/shard var/glasstype = null // Set this in subtypes. Null is assumed strange or otherwise impossible to dismantle, such as for shuttle glass. var/silicate = 0 // number of units of silicate - var/fulltile = FALSE // Set to true on full-tile variants. /obj/structure/window/Initialize(mapload) /// COMPATIBILITY PATCH - Replace this crap with a better solution (maybe copy /tg/'s ASAP!!) + // unfortunately no longer a compatibility patch ish due to clickcode... check_fullwindow() return ..() /obj/structure/window/proc/check_fullwindow() if(dir & (dir - 1)) //diagonal! fulltile = TRUE + if(fulltile) + // clickcode requires this :( + flags &= ~ON_BORDER /obj/structure/window/examine(mob/user) . = ..() @@ -105,11 +115,11 @@ if(display_message) visible_message("[src] shatters!") new shardtype(loc) - if(reinf) + if(considered_reinforced) new /obj/item/stack/rods(loc) if(is_fulltile()) new shardtype(loc) //todo pooling? - if(reinf) + if(considered_reinforced) new /obj/item/stack/rods(loc) qdel(src) return @@ -149,7 +159,7 @@ // OUT. return FALSE // we're both single-way - if(them.dir == dir) + if(them.moving_right_now == dir) // OUT return FALSE return TRUE @@ -168,7 +178,7 @@ return TRUE if(check_standard_flag_pass(AM)) return TRUE - if(get_dir(AM, target) == dir) + if(get_dir(src, target) & dir) return FALSE return TRUE @@ -185,8 +195,8 @@ else if(isobj(AM)) var/obj/item/I = AM tforce = I.throw_force * TT.get_damage_multiplier() - if(reinf) tforce *= 0.25 - if(health - tforce <= 7 && !reinf) + if(considered_reinforced) tforce *= 0.25 + if(health - tforce <= 7 && !considered_reinforced) anchored = 0 update_verbs() update_nearby_icons() @@ -231,7 +241,7 @@ return if(damage >= STRUCTURE_MIN_DAMAGE_THRESHOLD) visible_message("[user] smashes into [src]!") - if(reinf) + if(considered_reinforced) damage = damage / 2 take_damage(damage) else @@ -248,8 +258,8 @@ if(health < maxhealth) if(WT.remove_fuel(1 ,user)) to_chat(user, "You begin repairing [src]...") - playsound(src, WT.usesound, 50, 1) - if(do_after(user, 40 * WT.toolspeed, target = src)) + playsound(src, WT.tool_sound, 50, 1) + if(do_after(user, 40 * WT.tool_speed, target = src)) health = maxhealth // playsound(src, 'sound/items/Welder.ogg', 50, 1) update_icon() @@ -286,39 +296,7 @@ if(W.item_flags & NOBLUDGEON) return - if(W.is_screwdriver()) - if(reinf && state >= 1) - state = 3 - state - update_nearby_icons() - playsound(src, W.usesound, 75, 1) - to_chat(user, "You have [state == 1 ? "un" : ""]fastened the window [state ? "from" : "to"] the frame.") - else if(reinf && state == 0) - anchored = !anchored - update_nearby_icons() - update_verbs() - playsound(src, W.usesound, 75, 1) - update_nearby_tiles(need_rebuild = TRUE) - to_chat(user, "You have [anchored ? "" : "un"]fastened the frame [anchored ? "to" : "from"] the floor.") - else if(!reinf) - anchored = !anchored - update_nearby_icons() - update_verbs() - playsound(src, W.usesound, 75, 1) - update_nearby_tiles(need_rebuild = TRUE) - to_chat(user, "You have [anchored ? "" : "un"]fastened the window [anchored ? "to" : "from"] the floor.") - else if(W.is_crowbar() && reinf && state <= 1) - state = 1 - state - playsound(src, W.usesound, 75, 1) - to_chat(user, "You have pried the window [state ? "into" : "out of"] the frame.") - else if(W.is_wrench() && !anchored && (!state || !reinf)) - if(!glasstype) - to_chat(user, "You're not sure how to dismantle \the [src] properly.") - else - playsound(src, W.usesound, 75, 1) - visible_message("[user] dismantles \the [src].") - new glasstype(loc, is_fulltile()? 2 : 1) - qdel(src) - else if(istype(W, /obj/item/stack/cable_coil) && reinf && state == 0 && !istype(src, /obj/structure/window/reinforced/polarized)) + else if(istype(W, /obj/item/stack/cable_coil) && considered_reinforced && construction_state == WINDOW_STATE_UNSECURED && !istype(src, /obj/structure/window/reinforced/polarized)) var/obj/item/stack/cable_coil/C = W if (C.use(1)) playsound(src.loc, 'sound/effects/sparks1.ogg', 75, 1) @@ -326,7 +304,7 @@ "\The [user] begins to wire \the [src] for electrochromic tinting.", \ "You begin to wire \the [src] for electrochromic tinting.", \ "You hear sparks.") - if(do_after(user, 20 * C.toolspeed, src) && state == 0) + if(do_after(user, 20 * C.tool_speed, src) && construction_state == WINDOW_STATE_UNSECURED) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) var/obj/structure/window/reinforced/polarized/P = new(loc, dir) if(is_fulltile()) @@ -334,7 +312,7 @@ P.icon_state = "fwindow" P.maxhealth = maxhealth P.health = health - P.state = state + P.construction_state = construction_state P.anchored = anchored qdel(src) else if(istype(W,/obj/item/frame) && anchored) @@ -357,7 +335,7 @@ /obj/structure/window/proc/hit(var/damage, var/sound_effect = 1) if(damage < force_threshold || force_threshold < 0) return - if(reinf) damage *= 0.5 + if(considered_reinforced) damage *= 0.5 take_damage(damage) return @@ -415,13 +393,11 @@ //player-constructed windows if (constructed) anchored = 0 - state = 0 + construction_state = 0 update_verbs() health = maxhealth - ini_dir = dir - update_nearby_tiles(need_rebuild = TRUE) update_nearby_icons() @@ -434,9 +410,10 @@ W.update_icon() /obj/structure/window/Move() - var/ini_dir = dir + moving_right_now = dir . = ..() - setDir(ini_dir) + setDir(moving_right_now) + moving_right_now = null /obj/structure/window/Moved() . = ..() @@ -498,7 +475,100 @@ take_damage(damage_per_fire_tick) ..() +/obj/structure/window/drop_products(method) + if(method == ATOM_DECONSTRUCT_DISASSEMBLED) + if(glasstype) + new glasstype(drop_location(), is_fulltile()? 2 : 1) + return + if(shardtype) + new shardtype(drop_location()) + if(is_fulltile()) + // nah no for loop + new shardtype(drop_location()) +/obj/structure/window/screwdriver_act(obj/item/I, mob/user, flags, hint) + . = TRUE + if(construction_state == WINDOW_STATE_UNSECURED || construction_state == WINDOW_STATE_SCREWED_TO_FLOOR || !considered_reinforced) + if(!use_screwdriver(I, user, flags)) + return + var/unsecuring = construction_state != WINDOW_STATE_UNSECURED + user.action_feedback(SPAN_NOTICE("You [unsecuring? "unfasten" : "fasten"] the frame [unsecuring? "from" : "to"] the floor."), src) + construction_state = unsecuring? WINDOW_STATE_UNSECURED : WINDOW_STATE_SCREWED_TO_FLOOR + anchored = !unsecuring + air_update_turf() + update_verbs() + return + if(construction_state != WINDOW_STATE_CROWBRARED_IN && construction_state != WINDOW_STATE_SECURED_TO_FRAME) + return + if(!use_screwdriver(I, user, flags)) + return + var/unsecuring = construction_state == WINDOW_STATE_SECURED_TO_FRAME + user.action_feedback(SPAN_NOTICE("You [unsecuring? "unfasten" : "fasten"] the window [unsecuring? "from" : "to"] the frame."), src) + construction_state = unsecuring? WINDOW_STATE_CROWBRARED_IN : WINDOW_STATE_SECURED_TO_FRAME + +/obj/structure/window/crowbar_act(obj/item/I, mob/user, flags, hint) + . = TRUE + if(!considered_reinforced) + return + if(construction_state != WINDOW_STATE_CROWBRARED_IN && construction_state != WINDOW_STATE_SCREWED_TO_FLOOR) + return + if(!use_crowbar(I, user, flags)) + return + var/unsecuring = construction_state == WINDOW_STATE_CROWBRARED_IN + user.action_feedback(SPAN_NOTICE("You pry [src] [unsecuring? "out of" : "into"] the frame."), src) + construction_state = unsecuring? WINDOW_STATE_SCREWED_TO_FLOOR : WINDOW_STATE_CROWBRARED_IN + +/obj/structure/window/wrench_act(obj/item/I, mob/user, flags, hint) + . = TRUE + if(construction_state != WINDOW_STATE_UNSECURED) + user.action_feedback(SPAN_WARNING("[src] has to be entirely unfastened from the floor before you can disasemble it!")) + return + if(!use_wrench(I, user, flags)) + return + user.action_feedback(SPAN_NOTICE("You disassemble [src]."), src) + deconstruct(ATOM_DECONSTRUCT_DISASSEMBLED) + +/obj/structure/window/dynamic_tool_functions(obj/item/I, mob/user) + if(construction_state == WINDOW_STATE_UNSECURED) + return list( + TOOL_SCREWDRIVER = TOOL_HINT_SCREWING_WINDOW_FRAME, + TOOL_WRENCH + ) + if(!considered_reinforced) + return list( + TOOL_SCREWDRIVER = TOOL_HINT_UNSCREWING_WINDOW_FRAME + ) + switch(construction_state) + if(WINDOW_STATE_SCREWED_TO_FLOOR) + return list( + TOOL_SCREWDRIVER = TOOL_HINT_UNSCREWING_WINDOW_FRAME, + TOOL_CROWBAR = TOOL_HINT_CROWBAR_WINDOW_IN + ) + if(WINDOW_STATE_CROWBRARED_IN) + return list( + TOOL_SCREWDRIVER = TOOL_HINT_SCREWING_WINDOW_PANE, + TOOL_CROWBAR = TOOL_HINT_CROWBAR_WINDOW_OUT + ) + if(WINDOW_STATE_SECURED_TO_FRAME) + return list( + TOOL_SCREWDRIVER = TOOL_HINT_UNSCREWING_WINDOW_PANE + ) + +/obj/structure/window/dynamic_tool_image(function, hint) + switch(hint) + if(TOOL_HINT_CROWBAR_WINDOW_IN) + return dyntool_image_forward(TOOL_CROWBAR) + if(TOOL_HINT_CROWBAR_WINDOW_OUT) + return dyntool_image_backward(TOOL_CROWBAR) + if(TOOL_HINT_SCREWING_WINDOW_FRAME) + return dyntool_image_forward(TOOL_SCREWDRIVER) + if(TOOL_HINT_UNSCREWING_WINDOW_FRAME) + return dyntool_image_backward(TOOL_SCREWDRIVER) + if(TOOL_HINT_SCREWING_WINDOW_PANE) + return dyntool_image_forward(TOOL_SCREWDRIVER) + if(TOOL_HINT_UNSCREWING_WINDOW_PANE) + return dyntool_image_backward(TOOL_SCREWDRIVER) + return ..() /obj/structure/window/basic desc = "It looks thin and flimsy. A few knocks with... almost anything, really should shatter it." @@ -539,7 +609,7 @@ icon_state = "phoronrwindow" shardtype = /obj/item/material/shard/phoron glasstype = /obj/item/stack/material/glass/phoronrglass - reinf = 1 + considered_reinforced = 1 maximal_heat = INFINITY // Same here. The reinforcement is just structural anyways damage_per_fire_tick = 1.0 // This should last for 80 fire ticks if the window is not damaged at all. The idea is that borosilicate windows have something like ablative layer that protects them for a while. maxhealth = 80.0 @@ -556,7 +626,7 @@ icon_state = "rwindow" basestate = "rwindow" maxhealth = 40.0 - reinf = 1 + considered_reinforced = 1 maximal_heat = T0C + 1000 // Bumping this as well, as most fires quickly get over 800 C damage_per_fire_tick = 2.0 glasstype = /obj/item/stack/material/glass/reinforced @@ -589,7 +659,7 @@ icon_state = "window" basestate = "window" maxhealth = 40 - reinf = 1 + considered_reinforced = 1 basestate = "w" dir = 5 force_threshold = 7 diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm index 0fcefca7008..c953ffd61e9 100644 --- a/code/game/turfs/simulated/floor_attackby.dm +++ b/code/game/turfs/simulated/floor_attackby.dm @@ -107,7 +107,7 @@ if(broken || burnt) if(welder.remove_fuel(0,user)) to_chat(user, "You fix some dents on the broken plating.") - playsound(src, welder.usesound, 80, 1) + playsound(src, welder.tool_sound, 80, 1) icon_state = "plating" burnt = null broken = null @@ -127,19 +127,19 @@ make_plating(1) else return 0 - playsound(src, W.usesound, 80, 1) + playsound(src, W.tool_sound, 80, 1) return 1 else if(W.is_screwdriver() && (flooring.flags & TURF_REMOVE_SCREWDRIVER)) if(broken || burnt) return 0 to_chat(user, "You unscrew and remove the [flooring.descriptor].") make_plating(1) - playsound(src, W.usesound, 80, 1) + playsound(src, W.tool_sound, 80, 1) return 1 else if(W.is_wrench() && (flooring.flags & TURF_REMOVE_WRENCH)) to_chat(user, "You unwrench and remove the [flooring.descriptor].") make_plating(1) - playsound(src, W.usesound, 80, 1) + playsound(src, W.tool_sound, 80, 1) return 1 else if(istype(W, /obj/item/shovel) && (flooring.flags & TURF_REMOVE_SHOVEL)) to_chat(user, "You shovel off the [flooring.descriptor].") diff --git a/code/game/turfs/simulated/floors/outdoors_attackby.dm b/code/game/turfs/simulated/floors/outdoors_attackby.dm index a3a193423be..07f3da4f967 100644 --- a/code/game/turfs/simulated/floors/outdoors_attackby.dm +++ b/code/game/turfs/simulated/floors/outdoors_attackby.dm @@ -3,7 +3,7 @@ /turf/simulated/floor/outdoors/grass/attackby(obj/item/S as obj, mob/user as mob) if(istype(S, /obj/item/shovel)) to_chat(user, "You begin to dig in \the [src] with your [S].") - if(do_after(user, 4 SECONDS * S.toolspeed)) + if(do_after(user, 4 SECONDS * S.tool_speed)) to_chat(user, "\The [src] has been dug up, a worm pops from the ground.") new /obj/item/reagent_containers/food/snacks/worm(src) else diff --git a/code/game/turfs/simulated/floors/snow.dm b/code/game/turfs/simulated/floors/snow.dm index 14e65f38904..6b7f1e245fb 100644 --- a/code/game/turfs/simulated/floors/snow.dm +++ b/code/game/turfs/simulated/floors/snow.dm @@ -26,7 +26,7 @@ /turf/simulated/floor/outdoors/snow/attackby(var/obj/item/W, var/mob/user) if(istype(W, /obj/item/shovel)) to_chat(user, "You begin to remove \the [src] with your [W].") - if(do_after(user, 4 SECONDS * W.toolspeed)) + if(do_after(user, 4 SECONDS * W.tool_speed)) to_chat(user, "\The [src] has been dug up, and now lies in a pile nearby.") new /obj/item/stack/material/snow(src) ScrapeAway(flags = CHANGETURF_INHERIT_AIR|CHANGETURF_PRESERVE_OUTDOORS) diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 8094cc86f10..610ce1e72f6 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -207,7 +207,7 @@ var/obj/item/weldingtool/WT = W if( WT.remove_fuel(0,user) ) to_chat(user, "You burn away the fungi with \the [WT].") - playsound(src, WT.usesound, 10, 1) + playsound(src, WT.tool_sound, 10, 1) for(var/obj/effect/overlay/wallrot/WR in src) qdel(WR) return @@ -256,8 +256,8 @@ if(WT.remove_fuel(0,user)) to_chat(user, "You start repairing the damage to [src].") - playsound(src.loc, WT.usesound, 100, 1) - if(do_after(user, max(5, damage / 5) * WT.toolspeed) && WT && WT.isOn()) + playsound(src.loc, WT.tool_sound, 100, 1) + if(do_after(user, max(5, damage / 5) * WT.tool_speed) && WT && WT.isOn()) to_chat(user, "You finish repairing the damage to [src].") take_damage(-damage) else @@ -281,7 +281,7 @@ to_chat(user, "You need more welding fuel to complete this task.") return dismantle_verb = "cutting" - dismantle_sound = W.usesound + dismantle_sound = W.tool_sound // cut_delay *= 0.7 // Tools themselves now can shorten the time it takes. else if(istype(W,/obj/item/melee/energy/blade)) dismantle_sound = "sparks" @@ -315,7 +315,7 @@ if(cut_delay<0) cut_delay = 0 - if(!do_after(user,cut_delay * W.toolspeed)) + if(!do_after(user,cut_delay * W.tool_speed)) return to_chat(user, "You remove the outer plating.") @@ -328,7 +328,7 @@ switch(construction_stage) if(6) if (W.is_wirecutter()) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) construction_stage = 5 user.update_examine_panel(src) to_chat(user, "You cut through the outer grille.") @@ -337,8 +337,8 @@ if(5) if (W.is_screwdriver()) to_chat(user, "You begin removing the support lines.") - playsound(src, W.usesound, 100, 1) - if(!do_after(user,40 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 5) + playsound(src, W.tool_sound, 100, 1) + if(!do_after(user,40 * W.tool_speed) || !istype(src, /turf/simulated/wall) || construction_stage != 5) return construction_stage = 4 user.update_examine_panel(src) @@ -349,7 +349,7 @@ construction_stage = 6 user.update_examine_panel(src) to_chat(user, "You mend the outer grille.") - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) update_icon() return if(4) @@ -379,8 +379,8 @@ return if(cut_cover) to_chat(user, "You begin slicing through the metal cover.") - playsound(src, W.usesound, 100, 1) - if(!do_after(user, 60 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 4) + playsound(src, W.tool_sound, 100, 1) + if(!do_after(user, 60 * W.tool_speed) || !istype(src, /turf/simulated/wall) || construction_stage != 4) return construction_stage = 3 user.update_examine_panel(src) @@ -389,8 +389,8 @@ return else if (W.is_screwdriver()) to_chat(user, "You begin screwing down the support lines.") - playsound(src, W.usesound, 100, 1) - if(!do_after(user,40 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 4) + playsound(src, W.tool_sound, 100, 1) + if(!do_after(user,40 * W.tool_speed) || !istype(src, /turf/simulated/wall) || construction_stage != 4) return construction_stage = 5 user.update_examine_panel(src) @@ -400,8 +400,8 @@ if(3) if (W.is_crowbar()) to_chat(user, "You struggle to pry off the cover.") - playsound(src, W.usesound, 100, 1) - if(!do_after(user,100 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 3) + playsound(src, W.tool_sound, 100, 1) + if(!do_after(user,100 * W.tool_speed) || !istype(src, /turf/simulated/wall) || construction_stage != 3) return construction_stage = 2 user.update_examine_panel(src) @@ -411,8 +411,8 @@ if(2) if (W.is_wrench()) to_chat(user, "You start loosening the anchoring bolts which secure the support rods to their frame.") - playsound(src, W.usesound, 100, 1) - if(!do_after(user,40 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 2) + playsound(src, W.tool_sound, 100, 1) + if(!do_after(user,40 * W.tool_speed) || !istype(src, /turf/simulated/wall) || construction_stage != 2) return construction_stage = 1 user.update_examine_panel(src) @@ -435,8 +435,8 @@ cut_cover = 1 if(cut_cover) to_chat(user, "You begin slicing through the support rods.") - playsound(src, W.usesound, 100, 1) - if(!do_after(user,70 * W.toolspeed) || !istype(src, /turf/simulated/wall) || construction_stage != 1) + playsound(src, W.tool_sound, 100, 1) + if(!do_after(user,70 * W.tool_speed) || !istype(src, /turf/simulated/wall) || construction_stage != 1) return construction_stage = 0 user.update_examine_panel(src) @@ -446,8 +446,8 @@ if(0) if(W.is_crowbar()) to_chat(user, "You struggle to pry off the outer sheath.") - playsound(src, W.usesound, 100, 1) - if(!do_after(user,100 * W.toolspeed) || !istype(src, /turf/simulated/wall) || !user || !W || !T ) + playsound(src, W.tool_sound, 100, 1) + if(!do_after(user,100 * W.tool_speed) || !istype(src, /turf/simulated/wall) || !user || !W || !T ) return if(user.loc == T && user.get_active_held_item() == W ) to_chat(user, "You pry off the outer sheath.") diff --git a/code/global.dm b/code/global.dm index 602465e0527..a38a3643384 100644 --- a/code/global.dm +++ b/code/global.dm @@ -2,7 +2,6 @@ var/global/datum/datacore/data_core = null var/global/list/processing_machines = list() // TODO - Move into SSmachines var/global/list/processing_power_items = list() // TODO - Move into SSmachines -var/global/list/active_diseases = list() var/global/list/hud_icon_reference = list() @@ -10,8 +9,6 @@ var/global/list/global_mutations = list() // List of hidden mutation things. var/global/datum/universal_state/universe = new -var/global/list/global_map = null - // Noises made when hit while typing. var/list/hit_appends = list("-OOF", "-ACK", "-UGH", "-HRNK", "-HURGH", "-GLORF") // var/station_name = "Northern Star" @@ -66,10 +63,6 @@ var/list/adminlog = list() var/list/powernets = list() // TODO - Move into SSmachines -var/datum/debug/debugobj - -var/datum/moduletypes/mods = new() - var/gravity_is_on = 1 var/join_motd = null @@ -78,16 +71,6 @@ var/datum/metric/metric = new() // Metric datum, used to keep track of the round var/list/awaydestinations = list() // Away missions. A list of landmarks that the warpgate can take you to. -// Forum MySQL configuration. (for use with forum account/key authentication) -// These are all default values that will load should the forumdbconfig_legacy.txt file fail to read for whatever reason. -var/forumsqladdress = "localhost" -var/forumsqlport = "3306" -var/forumsqldb = "tgstation" -var/forumsqllogin = "root" -var/forumsqlpass = "" -var/forum_activated_group = "2" -var/forum_authenticated_group = "10" - // For FTP requests. (i.e. downloading runtime logs.) // However it'd be ok to use for accessing attack logs and such too, which are even laggier. var/fileaccess_timer = 0 diff --git a/code/modules/assembly/shock_kit.dm b/code/modules/assembly/shock_kit.dm index 3441d945ea0..6f69188a431 100644 --- a/code/modules/assembly/shock_kit.dm +++ b/code/modules/assembly/shock_kit.dm @@ -29,7 +29,7 @@ if(W.is_screwdriver()) status = !status to_chat(user, "[src] is now [status ? "secured" : "unsecured"]!") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) add_fingerprint(user) return diff --git a/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm b/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm index e184e54477e..0f58e5a70e1 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm @@ -95,7 +95,7 @@ /obj/machinery/atmospherics/component/binary/circulator/attackby(obj/item/W as obj, mob/user as mob) if(W.is_wrench()) - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) anchored = !anchored user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \ "You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor.", \ diff --git a/code/modules/atmospherics/machinery/components/binary_devices/heat_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/heat_pump.dm index d3116771231..d94fcf2b809 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/heat_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/heat_pump.dm @@ -106,9 +106,9 @@ to_chat(user, "You cannot unwrench this [src], turn it off first.") return 1 add_fingerprint(user) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm index 5f8c8a0bc48..a2d3b0f2cbe 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm @@ -255,9 +255,9 @@ if(unsafe_pressure()) to_chat(user, "You feel a gust of air blowing in your face as you try to unwrench [src]. Maybe you should reconsider..") add_fingerprint(user) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pipeturbine.dm b/code/modules/atmospherics/machinery/components/binary_devices/pipeturbine.dm index 202446fc401..3ea59e9d6af 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pipeturbine.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pipeturbine.dm @@ -85,7 +85,7 @@ /obj/machinery/atmospherics/pipeturbine/attackby(obj/item/W as obj, mob/user as mob) if(W.is_wrench()) anchored = !anchored - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.") if(anchored) @@ -263,7 +263,7 @@ /obj/machinery/power/turbinemotor/attackby(obj/item/W as obj, mob/user as mob) if(W.is_wrench()) anchored = !anchored - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) turbine = null to_chat(user, "You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.") updateConnection() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm index dd69e7122af..e6d24dff03f 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm @@ -282,9 +282,9 @@ Thus, the two variables affect pump operation are set in New(): if(unsafe_pressure()) to_chat(user, "You feel a gust of air blowing in your face as you try to unwrench [src]. Maybe you should reconsider..") add_fingerprint(user) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/atmospherics/machinery/components/binary_devices/valve.dm b/code/modules/atmospherics/machinery/components/binary_devices/valve.dm index 94d3d63869a..de66884354f 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/valve.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/valve.dm @@ -315,9 +315,9 @@ if(unsafe_pressure()) to_chat(user, "You feel a gust of air blowing in your face as you try to unwrench [src]. Maybe you should reconsider..") add_fingerprint(user) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/atmospherics/machinery/components/omni_devices/omni_base.dm b/code/modules/atmospherics/machinery/components/omni_devices/omni_base.dm index bf9db08994c..7c6dc50899e 100644 --- a/code/modules/atmospherics/machinery/components/omni_devices/omni_base.dm +++ b/code/modules/atmospherics/machinery/components/omni_devices/omni_base.dm @@ -87,8 +87,8 @@ to_chat(user, "You feel a gust of air blowing in your face as you try to unwrench [src]. Maybe you should reconsider..") add_fingerprint(user) to_chat(user, "You begin to unfasten \the [src]...") - playsound(src, W.usesound, 50, 1) - if(do_after(user, 40 * W.toolspeed)) + playsound(src, W.tool_sound, 50, 1) + if(do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/trinary_base.dm b/code/modules/atmospherics/machinery/components/trinary_devices/trinary_base.dm index 3a192f6040e..dd051990510 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/trinary_base.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/trinary_base.dm @@ -57,9 +57,9 @@ if(unsafe_pressure()) to_chat(user, "You feel a gust of air blowing in your face as you try to unwrench [src]. Maybe you should reconsider..") add_fingerprint(user) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/tvalve.dm b/code/modules/atmospherics/machinery/components/trinary_devices/tvalve.dm index f873ce0ad84..dfff2c2bffe 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/tvalve.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/tvalve.dm @@ -354,9 +354,9 @@ if(unsafe_pressure()) to_chat(user, "You feel a gust of air blowing in your face as you try to unwrench [src]. Maybe you should reconsider..") add_fingerprint(user) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/atmospherics/machinery/components/unary/heat_exchanger.dm b/code/modules/atmospherics/machinery/components/unary/heat_exchanger.dm index 9cf3b19ceaa..7f3798c4e58 100644 --- a/code/modules/atmospherics/machinery/components/unary/heat_exchanger.dm +++ b/code/modules/atmospherics/machinery/components/unary/heat_exchanger.dm @@ -74,9 +74,9 @@ if(unsafe_pressure()) to_chat(user, "You feel a gust of air blowing in your face as you try to unwrench [src]. Maybe you should reconsider..") add_fingerprint(user) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/atmospherics/machinery/components/unary/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary/outlet_injector.dm index c3d2d04f140..9d78d5f75f4 100644 --- a/code/modules/atmospherics/machinery/components/unary/outlet_injector.dm +++ b/code/modules/atmospherics/machinery/components/unary/outlet_injector.dm @@ -240,9 +240,9 @@ to_chat(user, "You feel a gust of air blowing in your face as you try to unwrench [src]. Maybe you should reconsider..") add_fingerprint(user) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/atmospherics/machinery/components/unary/portables_connector.dm b/code/modules/atmospherics/machinery/components/unary/portables_connector.dm index 050f47f4847..f6a44039e03 100644 --- a/code/modules/atmospherics/machinery/components/unary/portables_connector.dm +++ b/code/modules/atmospherics/machinery/components/unary/portables_connector.dm @@ -157,9 +157,9 @@ if(unsafe_pressure()) to_chat(user, "You feel a gust of air blowing in your face as you try to unwrench [src]. Maybe you should reconsider..") add_fingerprint(user) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/atmospherics/machinery/components/unary/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary/vent_pump.dm index f06675a0a6b..69643686557 100644 --- a/code/modules/atmospherics/machinery/components/unary/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary/vent_pump.dm @@ -394,9 +394,9 @@ var/obj/item/weldingtool/WT = W if (WT.remove_fuel(0,user)) to_chat(user, "Now welding the vent.") - if(do_after(user, 20 * WT.toolspeed)) + if(do_after(user, 20 * WT.tool_speed)) if(!src || !WT.isOn()) return - playsound(src.loc, WT.usesound, 50, 1) + playsound(src.loc, WT.tool_sound, 50, 1) if(!welded) user.visible_message("\The [user] welds the vent shut.", "You weld the vent shut.", "You hear welding.") welded = 1 @@ -438,9 +438,9 @@ if(unsafe_pressure()) to_chat(user, "You feel a gust of air blowing in your face as you try to unwrench [src]. Maybe you should reconsider..") add_fingerprint(user) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/atmospherics/machinery/components/unary/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary/vent_scrubber.dm index d58c8b34038..55b24e9822f 100644 --- a/code/modules/atmospherics/machinery/components/unary/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary/vent_scrubber.dm @@ -280,9 +280,9 @@ if(unsafe_pressure()) to_chat(user, "You feel a gust of air blowing in your face as you try to unwrench [src]. Maybe you should reconsider..") add_fingerprint(user) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/atmospherics/machinery/machinery.dm b/code/modules/atmospherics/machinery/machinery.dm index f8a9adc20f3..44e11c0f0c7 100644 --- a/code/modules/atmospherics/machinery/machinery.dm +++ b/code/modules/atmospherics/machinery/machinery.dm @@ -170,14 +170,11 @@ Pipelines + Other Objects -> Pipe network return FALSE // Deconstruct into a pipe item. -/obj/machinery/atmospherics/proc/deconstruct() - if(QDELETED(src)) - return +/obj/machinery/atmospherics/drop_products(method) if(construction_type) var/obj/item/pipe/I = new construction_type(loc, null, null, src) I.setPipingLayer(piping_layer) transfer_fingerprints_to(I) - qdel(src) // Return a list of nodes which we should call atmos_init() and build_network() during on_construction() /obj/machinery/atmospherics/proc/get_neighbor_nodes_for_init() diff --git a/code/modules/atmospherics/machinery/pipes/pipe_base.dm b/code/modules/atmospherics/machinery/pipes/pipe_base.dm index e4d3bf03c02..fbf1131b42a 100644 --- a/code/modules/atmospherics/machinery/pipes/pipe_base.dm +++ b/code/modules/atmospherics/machinery/pipes/pipe_base.dm @@ -95,9 +95,9 @@ if(unsafe_pressure()) to_chat(user, "You feel a gust of air blowing in your face as you try to unwrench [src]. Maybe you should reconsider..") add_fingerprint(user) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) + if (do_after(user, 40 * W.tool_speed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ diff --git a/code/modules/blob/blob.dm b/code/modules/blob/blob.dm index 35210e6676f..986e451f5cc 100644 --- a/code/modules/blob/blob.dm +++ b/code/modules/blob/blob.dm @@ -142,7 +142,7 @@ if("fire") damage = (W.force / fire_resist) if(istype(W, /obj/item/weldingtool)) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) if("brute") damage = (W.force / brute_resist) diff --git a/code/modules/catalogue/cataloguer.dm b/code/modules/catalogue/cataloguer.dm index 5442e333a40..95485e8baf7 100644 --- a/code/modules/catalogue/cataloguer.dm +++ b/code/modules/catalogue/cataloguer.dm @@ -40,7 +40,7 @@ GLOBAL_LIST_EMPTY(all_cataloguers) desc = "A hand-held device, used for compiling information about an object by scanning it. This one is an upgraded model, \ with a scanner that both can scan from farther away, and with less time." scan_range = 4 - toolspeed = 0.8 + tool_speed = 0.8 // Able to see all defined catalogue data regardless of if it was unlocked, intended for testing. /obj/item/cataloguer/debug @@ -49,7 +49,7 @@ GLOBAL_LIST_EMPTY(all_cataloguers) just seems to already know everything about narrowly defined pieces of knowledge one would find \ from nearby, perhaps due to being colored gold. Truly a epistemological mystery." icon_state = "debug_cataloguer" - toolspeed = 0.1 + tool_speed = 0.1 scan_range = 7 debug = TRUE @@ -91,7 +91,7 @@ GLOBAL_LIST_EMPTY(all_cataloguers) return // Get how long the delay will be. - var/scan_delay = target.get_catalogue_delay() * toolspeed + var/scan_delay = target.get_catalogue_delay() * tool_speed if(partial_scanned) if(partial_scanned.resolve() == target) scan_delay -= partial_scan_time diff --git a/code/modules/catalogue/cataloguer_vr.dm b/code/modules/catalogue/cataloguer_vr.dm index a9976c08534..d04cf312a30 100644 --- a/code/modules/catalogue/cataloguer_vr.dm +++ b/code/modules/catalogue/cataloguer_vr.dm @@ -5,7 +5,7 @@ action_button_name = "Toggle Cataloguer" var/deployed = TRUE scan_range = 1 - toolspeed = 1.2 + tool_speed = 1.2 /obj/item/cataloguer/compact/update_icon() if(busy) @@ -53,4 +53,4 @@ name = "pathfinder's cataloguer" icon_state = "tricorder_med" scan_range = 3 - toolspeed = 1 + tool_speed = 1 diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index 55bd0480b54..2e60f13e08c 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -35,15 +35,16 @@ */ parent_type = /datum - /////////////// - // Rendering // - /////////////// - + //! Rendering /// Click catcher var/atom/movable/screen/click_catcher/click_catcher /// Parallax holder var/datum/parallax_holder/parallax_holder + //! Perspectives + /// the perspective we're currently using + var/datum/perspective/using_perspective + //////////////// //ADMIN THINGS// //////////////// @@ -61,12 +62,6 @@ ///Internal counter for clients sending irc relay messages via ahelp to prevent spamming. Set to a number every time an admin reply is sent, decremented for every client send. var/ircreplyamount = 0 - //////////////// - //PERSPECTIVES// - //////////////// - /// the perspective we're currently using - var/datum/perspective/using_perspective - ///////// //OTHER// ///////// diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index d4bd6bd480d..9654c38839d 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -666,6 +666,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( log_game("[key_name(src)] is using the middle click aimbot exploit") message_admins("[ADMIN_LOOKUPFLW(src)] [ADMIN_KICK(usr)] is using the middle click aimbot exploit") add_system_note("aimbot", "Is using the middle click aimbot exploit") + log_click("DROPPED: [ckey] middle click aimbot on [middragatom]:[object]") log_game("[key_name(src)] Has hit the per-minute click limit of [mcl] clicks in a given game minute") message_admins("[ADMIN_LOOKUPFLW(src)] [ADMIN_KICK(usr)] Has hit the per-minute click limit of [mcl] clicks in a given game minute") @@ -694,8 +695,13 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( // so that the visual focus indicator matches reality. winset(src, null, "input.background-color=[COLOR_INPUT_DISABLED]") + if(GLOB.log_clicks) + log_click("CLICK: [ckey] [object]~[location]~[control]~[params]") + return ..() +GLOBAL_VAR_INIT(log_clicks, FALSE) + /client/proc/last_activity_seconds() return inactivity / 10 diff --git a/code/modules/clothing/gloves/_gloves.dm b/code/modules/clothing/gloves/_gloves.dm index d2e6e9db331..8b39e24aa3f 100644 --- a/code/modules/clothing/gloves/_gloves.dm +++ b/code/modules/clothing/gloves/_gloves.dm @@ -45,7 +45,7 @@ update_icon() return - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) user.visible_message("[user] cuts the fingertips off of the [src].","You cut the fingertips off of the [src].") clipped = 1 diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm index 92b19ee2c25..90a6020eb81 100644 --- a/code/modules/clothing/spacesuits/void/void.dm +++ b/code/modules/clothing/spacesuits/void/void.dm @@ -275,25 +275,25 @@ to_chat(user, "You pop \the [tank] out of \the [src]'s storage compartment.") tank.forceMove(get_turf(src)) tank.clothing_flags &= ~EQUIP_IGNORE_DELIMB - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) src.tank = null else if(choice == cooler) to_chat(user, "You pop \the [cooler] out of \the [src]'s storage compartment.") cooler.forceMove(get_turf(src)) cooler.clothing_flags &= ~EQUIP_IGNORE_DELIMB - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) src.cooler = null else if(choice == helmet) to_chat(user, "You detach \the [helmet] from \the [src]'s helmet mount.") helmet.forceMove(get_turf(src)) helmet.clothing_flags &= ~EQUIP_IGNORE_DELIMB - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) src.helmet = null else if(choice == boots) to_chat(user, "You detach \the [boots] from \the [src]'s boot mounts.") boots.forceMove(get_turf(src)) boots.clothing_flags &= ~EQUIP_IGNORE_DELIMB - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) src.boots = null else to_chat(user, "\The [src] does not have anything installed.") diff --git a/code/modules/clothing/spacesuits/void/void_vr.dm b/code/modules/clothing/spacesuits/void/void_vr.dm index 4b1069cf80a..86696bc990b 100644 --- a/code/modules/clothing/spacesuits/void/void_vr.dm +++ b/code/modules/clothing/spacesuits/void/void_vr.dm @@ -188,17 +188,17 @@ if(choice == tank) //No, a switch doesn't work here. Sorry. ~Techhead to_chat(user, "You pop \the [tank] out of \the [src]'s storage compartment.") tank.forceMove(get_turf(src)) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) src.tank = null else if(choice == cooler) to_chat(user, "You pop \the [cooler] out of \the [src]'s storage compartment.") cooler.forceMove(get_turf(src)) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) src.cooler = null else if(choice == boots) to_chat(user, "You detach \the [boots] from \the [src]'s boot mounts.") boots.forceMove(get_turf(src)) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) src.boots = null else to_chat(user, "\The [src] does not have anything installed.") diff --git a/code/modules/economy/machines/cash_register.dm b/code/modules/economy/machines/cash_register.dm index dae723339b9..a0ac60f39f7 100644 --- a/code/modules/economy/machines/cash_register.dm +++ b/code/modules/economy/machines/cash_register.dm @@ -481,8 +481,8 @@ else user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You begin unsecuring \the [src] from the floor.") - playsound(src, W.usesound, 50, 1) - if(!do_after(user, 20 * W.toolspeed)) + playsound(src, W.tool_sound, 50, 1) + if(!do_after(user, 20 * W.tool_speed)) manipulating = 0 return if(!anchored) diff --git a/code/modules/economy/machines/mint.dm b/code/modules/economy/machines/mint.dm index 90b65626232..f4d31c7fd16 100644 --- a/code/modules/economy/machines/mint.dm +++ b/code/modules/economy/machines/mint.dm @@ -401,7 +401,7 @@ if(O.is_screwdriver()) panel_open = !panel_open user.visible_message("[user] [panel_open ? "opens" : "closes"] the maintenance panel of \the [src].", "You [panel_open ? "open" : "close"] the maintenance panel of \the [src].") - playsound(src, O.usesound, 50, 1) + playsound(src, O.tool_sound, 50, 1) overlays.Cut() if(panel_open) overlays += image(icon, icon_panel) diff --git a/code/modules/fishing/fishing.dm b/code/modules/fishing/fishing.dm index cc366924423..63c321f2cfe 100644 --- a/code/modules/fishing/fishing.dm +++ b/code/modules/fishing/fishing.dm @@ -132,7 +132,7 @@ GLOBAL_LIST_INIT(generic_fishing_chance_list, list(FISHING_RARE = 10, FISHING_UN to_chat(user,"You cast \the [P.name] into \the [src].") being_fished = TRUE R.cast = TRUE - var/fishing_time = rand(min_fishing_time SECONDS,max_fishing_time SECONDS) * R.toolspeed + var/fishing_time = rand(min_fishing_time SECONDS,max_fishing_time SECONDS) * R.tool_speed if(do_after(user,fishing_time,user)) playsound(src, 'sound/effects/slosh.ogg', 5, 1, 5) to_chat(user,"You feel a tug and begin pulling!") diff --git a/code/modules/fishing/fishing_rod.dm b/code/modules/fishing/fishing_rod.dm index 4a24fda7078..da7d1339ca2 100644 --- a/code/modules/fishing/fishing_rod.dm +++ b/code/modules/fishing/fishing_rod.dm @@ -91,10 +91,10 @@ if(re.id == "nutriment" || re.id == "protein" || re.id == "glucose" || re.id == "fishbait") foodvolume += re.volume - toolspeed = initial(toolspeed) * min(0.75, (0.5 / max(0.5, (foodvolume / Bait.reagents.maximum_volume)))) + tool_speed = initial(tool_speed) * min(0.75, (0.5 / max(0.5, (foodvolume / Bait.reagents.maximum_volume)))) else - toolspeed = initial(toolspeed) + tool_speed = initial(tool_speed) /obj/item/material/fishing_rod/proc/consume_bait() if(Bait) @@ -119,7 +119,7 @@ attackspeed = 2 SECONDS default_material = "titanium" - toolspeed = 0.75 + tool_speed = 0.75 /obj/item/material/fishing_rod/modern/built strung = FALSE @@ -129,10 +129,10 @@ desc = "Mass produced, but somewhat reliable." default_material = "plastic" - toolspeed = 0.9 + tool_speed = 0.9 /obj/item/material/fishing_rod/modern/strong desc = "A extremely refined rod for catching fish." default_material = "durasteel" - toolspeed = 0.5 + tool_speed = 0.5 diff --git a/code/modules/food/kitchen/smartfridge.dm b/code/modules/food/kitchen/smartfridge.dm index 4335f81cb71..7c286ac8bda 100644 --- a/code/modules/food/kitchen/smartfridge.dm +++ b/code/modules/food/kitchen/smartfridge.dm @@ -242,7 +242,7 @@ if(O.is_screwdriver()) panel_open = !panel_open user.visible_message("[user] [panel_open ? "opens" : "closes"] the maintenance panel of \the [src].", "You [panel_open ? "open" : "close"] the maintenance panel of \the [src].") - playsound(src, O.usesound, 50, 1) + playsound(src, O.tool_sound, 50, 1) overlays.Cut() if(panel_open) overlays += image(icon, icon_panel) diff --git a/code/modules/ghostroles/roles/pirate.dm b/code/modules/ghostroles/roles/pirate.dm index 7a0bc1a3388..a05d18ada35 100644 --- a/code/modules/ghostroles/roles/pirate.dm +++ b/code/modules/ghostroles/roles/pirate.dm @@ -59,7 +59,7 @@ "You start to pry open [src]...", "You hear prying...") W.play_tool_sound(src) - if(do_after(user, 100*W.toolspeed, target = src)) + if(do_after(user, 100*W.tool_speed, target = src)) user.visible_message("[user] pries open [src], disrupting the sleep of the pirate within and killing them.", "You pry open [src], disrupting the sleep of the pirate within and killing them.", "You hear prying, followed by the death rattling of bones.") diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index fc1123acba5..dac24c44177 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -189,9 +189,9 @@ datum/unarmed_attack/holopugilism/unarmed_override(var/mob/living/carbon/human/u if(W.is_screwdriver()) to_chat(user, "It's a holowindow, you can't unfasten it!") - else if(W.is_crowbar() && reinf && state <= 1) + else if(W.is_crowbar() && considered_reinforced && construction_state <= 1) to_chat(user, "It's a holowindow, you can't pry it!") - else if(W.is_wrench() && !anchored && (!state || !reinf)) + else if(W.is_wrench() && !anchored && (!construction_state || !considered_reinforced)) to_chat(user, "It's a holowindow, you can't dismantle it!") else if(W.damtype == BRUTE || W.damtype == BURN) diff --git a/code/modules/hydroponics/beekeeping/beehive.dm b/code/modules/hydroponics/beekeeping/beehive.dm index e2dc7c26004..c068c5f0d72 100644 --- a/code/modules/hydroponics/beekeeping/beehive.dm +++ b/code/modules/hydroponics/beekeeping/beehive.dm @@ -43,7 +43,7 @@ return else if(I.is_wrench()) anchored = !anchored - playsound(loc, I.usesound, 50, 1) + playsound(loc, I.tool_sound, 50, 1) user.visible_message("[user] [anchored ? "wrenches" : "unwrenches"] \the [src].", "You [anchored ? "wrench" : "unwrench"] \the [src].") return else if(istype(I, /obj/item/bee_smoker)) @@ -112,7 +112,7 @@ to_chat(user, "You can't dismantle \the [src] with these bees inside.") return to_chat(user, "You start dismantling \the [src]...") - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) if(do_after(user, 30)) user.visible_message("[user] dismantles \the [src].", "You dismantle \the [src].") new /obj/item/beehive_assembly(loc) diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm index 111447071a7..f4102e1c591 100644 --- a/code/modules/hydroponics/seed_machines.dm +++ b/code/modules/hydroponics/seed_machines.dm @@ -97,7 +97,7 @@ if(default_deconstruction_screwdriver(user, W)) return if(W.is_wrench()) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "You [anchored ? "un" : ""]secure \the [src].") anchored = !anchored return diff --git a/code/modules/hydroponics/seed_storage.dm b/code/modules/hydroponics/seed_storage.dm index 2bddbd77dbf..408c1f70cb2 100644 --- a/code/modules/hydroponics/seed_storage.dm +++ b/code/modules/hydroponics/seed_storage.dm @@ -401,13 +401,13 @@ to_chat(user, "There are no seeds in \the [O.name].") return else if(O.is_wrench()) - playsound(loc, O.usesound, 50, 1) + playsound(loc, O.tool_sound, 50, 1) anchored = !anchored to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") else if(O.is_screwdriver()) panel_open = !panel_open to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.") - playsound(src, O.usesound, 50, 1) + playsound(src, O.tool_sound, 50, 1) overlays.Cut() if(panel_open) overlays += image(icon, "[initial(icon_state)]-panel") diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm index 9df73328591..f91885154f6 100644 --- a/code/modules/hydroponics/trays/tray.dm +++ b/code/modules/hydroponics/trays/tray.dm @@ -549,7 +549,7 @@ if(locate(/obj/machinery/atmospherics/portables_connector/) in loc) return ..() - playsound(loc, O.usesound, 50, 1) + playsound(loc, O.tool_sound, 50, 1) anchored = !anchored to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") diff --git a/code/modules/instruments/instruments/stationary.dm b/code/modules/instruments/instruments/stationary.dm index 88b456d053c..c41a4983cc3 100644 --- a/code/modules/instruments/instruments/stationary.dm +++ b/code/modules/instruments/instruments/stationary.dm @@ -37,9 +37,9 @@ /obj/structure/musician/attackby(obj/item/I, mob/living/user) if(I.is_wrench()) - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) to_chat(user, "You begin to [anchored? "loosen" : "tighten"] [src]'s casters...") - if(do_after(user, 40 * I.toolspeed)) + if(do_after(user, 40 * I.tool_speed)) user.visible_message("[user] [anchored? "loosens" : "tightens"] [src]'s casters.") anchored = !anchored else diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index 0d183010d92..8072870bb57 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -428,7 +428,7 @@ on_anchored() else on_unanchored() - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) return TRUE else if(istype(I, /obj/item/integrated_circuit)) diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 5ca11ba2697..9648e936859 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -38,13 +38,13 @@ else name = ("bookcase ([newname])") else if(O.is_wrench()) - playsound(loc, O.usesound, 100, 1) + playsound(loc, O.tool_sound, 100, 1) to_chat(user, (anchored ? "You unfasten \the [src] from the floor." : "You secure \the [src] to the floor.")) anchored = !anchored else if(O.is_screwdriver()) - playsound(loc, O.usesound, 75, 1) + playsound(loc, O.tool_sound, 75, 1) to_chat(user, "You begin dismantling \the [src].") - if(do_after(user,25 * O.toolspeed)) + if(do_after(user,25 * O.tool_speed)) to_chat(user, "You dismantle \the [src].") new /obj/item/stack/material/wood(get_turf(src), 3) for(var/obj/item/book/b in contents) diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 78f30f7f428..bc2256ab6f8 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -471,7 +471,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f density = 1 var/obj/item/book/cache // Last scanned book -/obj/machinery/libraryscanner/attackby(obj/item/I, mob/living/user, params, attackchain_flags, damage_multiplier) +/obj/machinery/libraryscanner/attackby(obj/item/I, mob/living/user, params, clickchain_flags, damage_multiplier) if(istype(I, /obj/item/book)) if(!user.attempt_insert_item_for_installation(I, src)) return @@ -535,7 +535,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f if(panel_open) add_overlay("[base_icon_state]-panel") -/obj/machinery/bookbinder/attackby(obj/item/I, mob/living/user, params, attackchain_flags, damage_multiplier) +/obj/machinery/bookbinder/attackby(obj/item/I, mob/living/user, params, clickchain_flags, damage_multiplier) if(istype(I, /obj/item/paper)) if(!user.attempt_insert_item_for_installation(I, src)) return diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index 7d09ff10899..130ffcc316f 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -370,7 +370,7 @@ if(!istype(W) || W.force <= 0) return ..() if(W.sharp && W.edge) - var/time = (3 SECONDS / max(W.force / 10, 1)) * W.toolspeed + var/time = (3 SECONDS / max(W.force / 10, 1)) * W.tool_speed user.setClickCooldown(time) if(do_after(user, time, src) && use(1)) to_chat(user, "You cut up a log into planks.") diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index 87fade9130b..d4a1ee93051 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -344,7 +344,7 @@ to_chat(user, "You can't anchor something to empty space. Idiot.") return - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "You [anchored ? "un" : ""]anchor the brace.") anchored = !anchored diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index e343e87e6da..7d495aeef77 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -282,7 +282,7 @@ obj/item/pickaxe/tyrmalin/proc/turnOn(mob/user as mob) icon_state = "shovel_bone" force = 15 throw_force = 12 - toolspeed = 0.7 + tool_speed = 0.7 attack_verb = list("slashed", "impaled", "stabbed", "sliced") sharp = 1 diff --git a/code/modules/mining/shelter_atoms.dm b/code/modules/mining/shelter_atoms.dm index e1927d2d1fe..b47bc835dc3 100644 --- a/code/modules/mining/shelter_atoms.dm +++ b/code/modules/mining/shelter_atoms.dm @@ -260,9 +260,9 @@ var/buildstacktype = /obj/item/stack/material/steel var/buildstackamount = 5 -/obj/structure/fans/proc/deconstruct() - new buildstacktype(loc,buildstackamount) - qdel(src) +/obj/structure/fans/drop_products(method) + . = ..() + new buildstacktype(drop_location(), buildstackamount) /obj/structure/fans/attackby(obj/item/I, mob/living/user) if(I.is_wrench()) diff --git a/code/modules/mob/action_feedback.dm b/code/modules/mob/action_feedback.dm new file mode 100644 index 00000000000..180f232f69b --- /dev/null +++ b/code/modules/mob/action_feedback.dm @@ -0,0 +1,53 @@ +/** + * gives feedback for doing an action, e.g. using a tool on something + * + * use this instead of direct to_chats so mob remote control can be done better. + * + * @params + * - msg - what we see/know + * - target - what we're messing with + */ +/mob/proc/action_feedback(msg, atom/target) + to_chat(src, msg) + +/** + * gives feedback for doing an action, e.g. using a tool on something + * + * use this instead of direct bubble alerts so mob remote control can be done better. + * + * @params + * - msg - what we see/know + * - target - what we're messing with + */ +/mob/proc/bubble_action_feedback(msg, atom/target) + // for now, just wrapper for chat action feedback + action_feedback(SPAN_NOTICE(msg)) + +/** + * gives feedback to us and someone else + * + * @params + * - msg - what we see + * - target - what we're messing with + * - them - what they see + */ +/mob/proc/detectable_action_feedback(msg, atom/target, them) + ASSERT(them && target) + action_feedback(msg, target) + if(!ismob(target)) + return + to_chat(target, them) + +/** + * gives feedback for an action we're doing and makes it visible for everyone around us too. + * + * @params + * - msg - what everyone sees by default + * - target - what we're messing with + * - range - how far to display; defaults to loud range + * - self - what we see + * - them - what they see + * - blind - what blind people see (overridden by self and them if specified) + */ +/mob/proc/visible_action_feedback(others, atom/target, range = MESSAGE_RANGE_COMBAT_LOUD, self, them, blind) + visible_message(others, self, blind, range) diff --git a/code/modules/mob/floating_message.dm b/code/modules/mob/floating_message.dm index f92a2670e80..7a2e71ffdc2 100644 --- a/code/modules/mob/floating_message.dm +++ b/code/modules/mob/floating_message.dm @@ -43,8 +43,6 @@ var/list/floating_chat_colors = list() else C.images += gibberish -#define MAPTEXT(text) {"[##text]"} - /proc/generate_floating_text(atom/movable/holder, message, style, size, duration, show_to) var/image/I = image(null, holder) var/mob/living/X diff --git a/code/modules/mob/living/bot/SLed209bot.dm b/code/modules/mob/living/bot/SLed209bot.dm index 05fdd6653e5..3e555dba6c6 100644 --- a/code/modules/mob/living/bot/SLed209bot.dm +++ b/code/modules/mob/living/bot/SLed209bot.dm @@ -159,7 +159,7 @@ if(8) if(W.is_screwdriver()) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) var/turf/T = get_turf(user) to_chat(user, "Now attaching the gun to the frame...") sleep(40) diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 266096d45bc..7ddfcc5a22e 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -146,7 +146,7 @@ if(!locked) open = !open to_chat(user, "Maintenance panel is now [open ? "opened" : "closed"].") - playsound(src, O.usesound, 50, 1) + playsound(src, O.tool_sound, 50, 1) else to_chat(user, "You need to unlock the controls first.") return @@ -163,7 +163,7 @@ fireloss = fireloss - 10 updatehealth() user.visible_message("[user] repairs [src].","You repair [src].") - playsound(src, O.usesound, 50, 1) + playsound(src, O.tool_sound, 50, 1) else to_chat(user, "Unable to repair with the maintenance panel closed.") else diff --git a/code/modules/mob/living/bot/ed209bot.dm b/code/modules/mob/living/bot/ed209bot.dm index 98fcb22a0ee..f741cad16fe 100644 --- a/code/modules/mob/living/bot/ed209bot.dm +++ b/code/modules/mob/living/bot/ed209bot.dm @@ -199,7 +199,7 @@ if(8) if(W.is_screwdriver()) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) var/turf/T = get_turf(user) to_chat(user, "Now attaching the gun to the frame...") sleep(40) diff --git a/code/modules/mob/living/bot/edCLNbot.dm b/code/modules/mob/living/bot/edCLNbot.dm index 8f96b977aea..dbdf2ae2d39 100644 --- a/code/modules/mob/living/bot/edCLNbot.dm +++ b/code/modules/mob/living/bot/edCLNbot.dm @@ -207,7 +207,7 @@ if(7) if(W.is_screwdriver()) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) var/turf/T = get_turf(user) to_chat(user, "Attatching the mop to the frame...") if(do_after(user, 40) && get_turf(user) == T) diff --git a/code/modules/mob/living/living_movement.dm b/code/modules/mob/living/living_movement.dm index b6073c50efe..5967624343b 100644 --- a/code/modules/mob/living/living_movement.dm +++ b/code/modules/mob/living/living_movement.dm @@ -26,8 +26,7 @@ // end . = ..() - - if (s_active && !( s_active in contents ) && !(s_active.Adjacent(src))) //check !( s_active in contents ) first so we hopefully don't have to call get_turf() so much. + if(s_active && !CheapReachability(s_active)) s_active.close(src) ///Checks mobility move as well as parent checks diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 1cd5baa8575..f6251e26bec 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -58,7 +58,6 @@ var/list/ai_verbs_default = list( density = TRUE can_be_antagged = TRUE status_flags = CANSTUN|CANPARALYSE|CANPUSH - shouldnt_see = list(/obj/effect/rune) catalogue_data = list(/datum/category_item/catalogue/fauna/silicon/ai) /// The network we have access to. @@ -792,18 +791,18 @@ var/list/ai_verbs_default = list( to_chat(user, "The shell's subsystems resist your efforts to tamper with your bolts.") return if(anchored) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) user.visible_message("\The [user] starts to unbolt \the [src] from the plating...") - if(!do_after(user,40 * W.toolspeed)) + if(!do_after(user,40 * W.tool_speed)) user.visible_message("\The [user] decides not to unbolt \the [src].") return user.visible_message("\The [user] finishes unfastening \the [src]!") anchored = 0 return else - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) user.visible_message("\The [user] starts to bolt \the [src] to the plating...") - if(!do_after(user,40 * W.toolspeed)) + if(!do_after(user,40 * W.tool_speed)) user.visible_message("\The [user] decides not to bolt \the [src].") return user.visible_message("\The [user] finishes fastening down \the [src]!") diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index d614708b4e9..a6ef2627e2a 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -656,7 +656,7 @@ else if(W.is_screwdriver() && opened && !cell) // haxing wiresexposed = !wiresexposed to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) updateicon() else if(W.is_screwdriver() && opened && cell) // radio diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 24315c59cd2..a1f334b5b22 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -616,6 +616,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) var/msg = "[key_name_admin(src)]([ADMIN_KICK(src)]) attempted to use the .click macro!" log_admin(msg) message_admins(msg) + log_click("DROPPED: .click macro from [ckey] at [argu], [sec], [number1]. [number2]") GLOB.exploit_warn_spam_prevention = world.time + 10 /mob/verb/DisDblClick(argu = null as anything, sec = "" as text, number1 = 0 as num , number2 = 0 as num) @@ -626,6 +627,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) var/msg = "[key_name_admin(src)]([ADMIN_KICK(src)]) attempted to use the .dblclick macro!" log_admin(msg) message_admins(msg) + log_click("DROPPED: .dblclick macro from [ckey] at [argu], [sec], [number1]. [number2]") GLOB.exploit_warn_spam_prevention = world.time + 10 /** @@ -1296,3 +1298,9 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) /// Checks for slots that are currently obscured by other garments. /mob/proc/check_obscured_slots() return + +/mob/CanReachOut(atom/movable/mover, atom/target, obj/item/tool, list/cache) + return FALSE + +/mob/CanReachIn(atom/movable/mover, atom/target, obj/item/tool, list/cache) + return FALSE diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 79a7a331550..167a5b96895 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -48,6 +48,9 @@ var/cached_multiplicative_actions_slowdown //! Misc + /// What we're interacting with right now, associated to list of reasons and the number of concurrent interactions for that reason. + var/list/interacting_with + var/next_move = null // For click delay, despite the misleading name. //Not in use yet @@ -282,11 +285,6 @@ /// The current turf being examined in the stat panel. var/turf/listed_turf = null - /// List of objects that this mob shouldn't see in the stat panel. this silliness is needed because of AI alt+click and cult blood runes. - var/list/shouldnt_see = list() - - ///For storing what do_after's someone has, in case we want to restrict them to only one of a certain do_after at a time - var/list/do_afters var/list/active_genes=list() var/mob_size = MOB_MEDIUM diff --git a/code/modules/organs/internal/augment/armmounted.dm b/code/modules/organs/internal/augment/armmounted.dm index b7b18167364..6f47e3af4f4 100644 --- a/code/modules/organs/internal/augment/armmounted.dm +++ b/code/modules/organs/internal/augment/armmounted.dm @@ -133,7 +133,7 @@ integrated_object_type = null - toolspeed = 0.8 + tool_speed = 0.8 var/list/integrated_tools = list( /obj/item/tool/screwdriver = null, @@ -178,7 +178,7 @@ integrated_tools[path] = new path(src) var/obj/item/I = integrated_tools[path] ADD_TRAIT(I, TRAIT_NODROP, AUGMENT_TRAIT) - I.toolspeed = toolspeed + I.tool_speed = tool_speed I.name = "integrated [I.name]" for(var/tool in integrated_tools) diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index e928d5fb982..0f32ab4110a 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -43,15 +43,15 @@ SStgui.update_uis(src) else if(P.is_wrench()) - playsound(loc, P.usesound, 50, 1) + playsound(loc, P.tool_sound, 50, 1) anchored = !anchored to_chat(user, SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src].")) else if(P.is_screwdriver()) to_chat(user, SPAN_NOTICE("You begin taking the [name] apart.")) - playsound(src, P.usesound, 50, 1) - if(do_after(user, 10 * P.toolspeed)) - playsound(loc, P.usesound, 50, 1) + playsound(src, P.tool_sound, 50, 1) + if(do_after(user, 10 * P.tool_speed)) + playsound(loc, P.tool_sound, 50, 1) to_chat(user, SPAN_NOTICE("You take the [name] apart.")) new /obj/item/stack/material/steel( src.loc, 4 ) for(var/obj/item/I in contents) diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index c164e8df1d3..674e7428699 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -83,7 +83,7 @@ return -/obj/item/paper_bin/attackby(obj/item/I, mob/living/user, params, attackchain_flags, damage_multiplier) +/obj/item/paper_bin/attackby(obj/item/I, mob/living/user, params, clickchain_flags, damage_multiplier) if(!istype(I, /obj/item/paper)) return ..() diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm index ababc0003cd..7806d5db529 100644 --- a/code/modules/paperwork/papershredder.dm +++ b/code/modules/paperwork/papershredder.dm @@ -41,7 +41,7 @@ empty_bin(user, W) return else if(W.is_wrench()) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) anchored = !anchored to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") return diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 5e7b55e9452..db623271328 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -173,7 +173,7 @@ else to_chat(user, "This cartridge is not yet ready for replacement! Use up the rest of the toner.") else if(O.is_wrench()) - playsound(loc, O.usesound, 50, 1) + playsound(loc, O.tool_sound, 50, 1) anchored = !anchored to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") else if(default_deconstruction_screwdriver(user, O)) diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm index 2b907b5f6df..39bcc5cf71b 100644 --- a/code/modules/power/antimatter/control.dm +++ b/code/modules/power/antimatter/control.dm @@ -140,14 +140,14 @@ if(!istype(W) || !user) return if(W.is_wrench()) if(!anchored) - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) user.visible_message("[user.name] secures the [src.name] to the floor.", \ "You secure the anchor bolts to the floor.", \ "You hear a ratchet.") src.anchored = 1 connect_to_network() else if(!linked_shielding.len > 0) - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) user.visible_message("[user.name] unsecures the [src.name].", \ "You remove the anchor bolts.", \ "You hear a ratchet.") diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index f493ff55996..4f33983c83f 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -499,9 +499,9 @@ GLOBAL_LIST_EMPTY(apcs) if (terminal) to_chat(user,"Disconnect the wires first.") return - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user,"You begin to remove the power control board...") //lpeters - fixed grammar issues //Ner - grrrrrr - if(do_after(user, 50 * W.toolspeed)) + if(do_after(user, 50 * W.tool_speed)) if (has_electronics==1) has_electronics = 0 if ((machine_stat & BROKEN)) @@ -552,12 +552,12 @@ GLOBAL_LIST_EMPTY(apcs) if (has_electronics==1 && terminal) has_electronics = 2 machine_stat &= ~MAINT - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) to_chat(user,"You screw the circuit electronics into place.") else if (has_electronics==2) has_electronics = 1 machine_stat |= MAINT - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) to_chat(user,"You unfasten the electronics.") else /* has_electronics==0 */ to_chat(user,"There is nothing to secure.") @@ -566,7 +566,7 @@ GLOBAL_LIST_EMPTY(apcs) else wiresexposed = !wiresexposed to_chat(user,"The wires have been [wiresexposed ? "exposed" : "unexposed"].") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) update_icon() else if (istype(W, /obj/item/card/id)||istype(W, /obj/item/pda)) // trying to unlock the interface with an ID card @@ -622,7 +622,7 @@ GLOBAL_LIST_EMPTY(apcs) user.visible_message("[user.name] starts dismantling the [src]'s power terminal.", \ "You begin to cut the cables...") playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) - if(do_after(user, 50 * W.toolspeed)) + if(do_after(user, 50 * W.tool_speed)) if(terminal && opened && has_electronics!=2) if (prob(50) && electrocute_mob(usr, terminal.powernet, terminal)) var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread @@ -654,8 +654,8 @@ GLOBAL_LIST_EMPTY(apcs) user.visible_message("[user.name] begins cutting apart [src] with the [WT.name].", \ "You start welding the APC frame...", \ "You hear welding.") - playsound(src, WT.usesound, 25, 1) - if(do_after(user, 50 * WT.toolspeed)) + playsound(src, WT.tool_sound, 25, 1) + if(do_after(user, 50 * WT.tool_speed)) if(!src || !WT.remove_fuel(3, user)) return if (emagged || (machine_stat & BROKEN) || opened==2) new /obj/item/stack/material/steel(loc) diff --git a/code/modules/power/batteryrack.dm b/code/modules/power/batteryrack.dm index 5c5304bbdea..2b909bb14c1 100644 --- a/code/modules/power/batteryrack.dm +++ b/code/modules/power/batteryrack.dm @@ -55,7 +55,7 @@ if(W.is_crowbar()) if (charge < (capacity / 100)) if (!output_attempt && !input_attempt) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) var/obj/structure/frame/M = new /obj/structure/frame(drop_location()) M.frame_type = "machine" M.state = 2 diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 8f8f53b6b65..b733adfa05d 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -962,7 +962,7 @@ obj/structure/cable/proc/cableColor(var/colorC) slot_flags = SLOT_BELT attack_verb = list("whipped", "lashed", "disciplined", "flogged") stacktype = null - toolspeed = 0.25 + tool_speed = 0.25 /obj/item/stack/cable_coil/alien/Initialize(mapload, new_amount, merge, param_color) . = ..() diff --git a/code/modules/power/fission/engine.dm b/code/modules/power/fission/engine.dm index fb439e0addb..1114929144a 100644 --- a/code/modules/power/fission/engine.dm +++ b/code/modules/power/fission/engine.dm @@ -253,10 +253,10 @@ to_chat(user, "\The [WT] must be on to complete this task.") return repairing = 1 - playsound(src.loc, WT.usesound, 50, 1) + playsound(src.loc, WT.tool_sound, 50, 1) user.visible_message("\The [user.name] begins repairing \the [src].", \ "You start repairing \the [src].") - if(do_after(user, 20 * WT.toolspeed, target = src) && WT.isOn()) + if(do_after(user, 20 * WT.tool_speed, target = src) && WT.isOn()) health = clamp( health + 10, 1, max_health) repairing = 0 return @@ -268,8 +268,8 @@ to_chat(user, "You cannot unwrench \the [src], while it contains fuel rods.") return 1 - playsound(src, W.usesound, 75, 1) - if(!anchored || do_after(user, 40 * W.toolspeed)) + playsound(src, W.tool_sound, 75, 1) + if(!anchored || do_after(user, 40 * W.tool_speed)) anchor() user.visible_message("\The [user.name] [anchored ? "secures" : "unsecures"] the bolts holding \the [src.name] to the floor.", \ "You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor.", \ diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index 06b11fe72d7..53e91a35e15 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -170,7 +170,7 @@ GLOBAL_LIST_EMPTY(all_turbines) /obj/machinery/power/generator/attackby(obj/item/W as obj, mob/user as mob) if(W.is_wrench()) - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) anchored = !anchored user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \ "You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor.", \ diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index b99680e49fe..539108ee692 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -205,7 +205,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) if(GRAV_NEEDS_SCREWDRIVER) if(I.is_screwdriver()) to_chat(user, "You secure the screws of the framework.") - playsound(src, I.usesound, 75, 1) + playsound(src, I.tool_sound, 75, 1) broken_state++ update_icon() return @@ -232,7 +232,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) if(GRAV_NEEDS_WRENCH) if(I.is_wrench()) to_chat(user, "You secure the plating to the framework.") - playsound(src, I.usesound, 75, 1) + playsound(src, I.tool_sound, 75, 1) set_fix() return return ..() diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 47e8274e49a..879b58c6b78 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -106,9 +106,9 @@ var/global/list/light_type_cache = list() if (W.is_wrench()) if (src.stage == 1) - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) to_chat(usr, "You begin deconstructing [src].") - if (!do_after(usr, 30 * W.toolspeed)) + if (!do_after(usr, 30 * W.tool_speed)) return new /obj/item/stack/material/steel( get_turf(src.loc), sheets_refunded ) user.visible_message("[user.name] deconstructs [src].", \ @@ -130,7 +130,7 @@ var/global/list/light_type_cache = list() new /obj/item/stack/cable_coil(get_turf(src.loc), 1, null, "red") user.visible_message("[user.name] removes the wiring from [src].", \ "You remove the wiring from [src].", "You hear a noise.") - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) return if(istype(W, /obj/item/stack/cable_coil)) @@ -149,7 +149,7 @@ var/global/list/light_type_cache = list() src.update_icon() user.visible_message("[user.name] closes [src]'s casing.", \ "You close [src]'s casing.", "You hear a noise.") - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) var/obj/machinery/light/newlight = new fixture_type(src.loc, src) newlight.setDir(src.dir) @@ -629,7 +629,7 @@ var/global/list/light_type_cache = list() // attempt to stick weapon into light socket else if(status == LIGHT_EMPTY) if(W.is_screwdriver()) //If it's a screwdriver open it. - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) user.visible_message("[user.name] opens [src]'s casing.", \ "You open [src]'s casing.", "You hear a noise.") new construct_type(src.loc, null, null, null, src) @@ -648,7 +648,7 @@ var/global/list/light_type_cache = list() /obj/machinery/light/flamp/attackby(obj/item/W, mob/user) if(W.is_wrench()) anchored = !anchored - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].") if(!lamp_shade) @@ -660,7 +660,7 @@ var/global/list/light_type_cache = list() else if(W.is_screwdriver()) - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) user.visible_message("[user.name] removes [src]'s lamp shade.", \ "You remove [src]'s lamp shade.", "You hear a noise.") lamp_shade = 0 diff --git a/code/modules/power/lightswitch_vr.dm b/code/modules/power/lightswitch_vr.dm index 73cfc76f5ee..c2d1372639b 100644 --- a/code/modules/power/lightswitch_vr.dm +++ b/code/modules/power/lightswitch_vr.dm @@ -88,11 +88,11 @@ if(!WT.remove_fuel(0, user)) to_chat(user, "\The [src] must be on to complete this task.") return - playsound(src.loc, WT.usesound, 50, 1) + playsound(src.loc, WT.tool_sound, 50, 1) user.visible_message( \ "\The [user] begins deconstructing \the [src].", \ "You start deconstructing \the [src].") - if(do_after(user, 20 * WT.toolspeed, target = src) && WT.isOn()) + if(do_after(user, 20 * WT.tool_speed, target = src) && WT.isOn()) new /obj/item/stack/material/steel(get_turf(src), 2) user.visible_message( \ "\The [user] has deconstructed \the [src].", \ @@ -112,7 +112,7 @@ new /obj/item/stack/cable_coil(get_turf(src), 1, null, "red") user.visible_message("\The [user] removes the wiring from \the [src].", \ "You remove the wiring from \the [src].", "You hear a snip.") - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) update_icon() return @@ -134,19 +134,19 @@ user.update_examine_panel(src) user.visible_message("\The [user] screws \the [src] i nplace.", \ "You screw \the [src] in place.", "You hear a noise.") - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) update_icon() else if (stage == FRAME_FASTENED) stage = FRAME_UNFASTENED user.update_examine_panel(src) user.visible_message("\The [user] unscrews \the [src].", \ "You unscrew \the [src].", "You hear a noise.") - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) update_icon() else if (stage == FRAME_WIRED) user.visible_message("\The [user] closes \the [src]'s casing.", \ "You close \the [src]'s casing.", "You hear a click.") - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) var/obj/newmachine = new build_machine_type(get_turf(src), src.dir) newmachine.pixel_x = pixel_x newmachine.pixel_y = pixel_y diff --git a/code/modules/power/pacman2.dm b/code/modules/power/pacman2.dm index 766bf7e6598..9e4366f8c4d 100644 --- a/code/modules/power/pacman2.dm +++ b/code/modules/power/pacman2.dm @@ -88,13 +88,13 @@ SSmachines.makepowernets() else if(O.is_screwdriver()) open = !open - playsound(loc, O.usesound, 50, 1) + playsound(loc, O.tool_sound, 50, 1) if(open) to_chat(user, "You open the access panel.") else to_chat(user, "You close the access panel.") else if(O.is_crowbar() && !open) - playsound(loc, O.usesound, 50, 1) + playsound(loc, O.tool_sound, 50, 1) var/obj/machinery/constructable_frame/machine_frame/new_frame = new /obj/machinery/constructable_frame/machine_frame(src.loc) for(var/obj/item/I in component_parts) I.loc = src.loc diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index 6ae27897bcb..e38ed302706 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -74,7 +74,7 @@ var/global/list/rad_collectors = list() if(P) to_chat(user, "Remove the phoron tank first.") return 1 - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) src.anchored = !src.anchored user.visible_message("[user.name] [anchored? "secures":"unsecures"] the [src.name].", \ "You [anchored? "secure":"undo"] the external bolts.", \ diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 81ac2095c76..a6b0bd945ac 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -154,14 +154,14 @@ switch(state) if(0) state = 1 - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) user.visible_message("[user.name] secures [src] to the floor.", \ "You secure the external reinforcing bolts to the floor.", \ "You hear a ratchet.") src.anchored = 1 if(1) state = 0 - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) user.visible_message("[user.name] unsecures [src] reinforcing bolts from the floor.", \ "You undo the external reinforcing bolts.", \ "You hear a ratchet.") @@ -181,11 +181,11 @@ to_chat(user, "\The [src] needs to be wrenched to the floor.") if(1) if (WT.remove_fuel(0,user)) - playsound(loc, WT.usesound, 50, 1) + playsound(loc, WT.tool_sound, 50, 1) user.visible_message("[user.name] starts to weld [src] to the floor.", \ "You start to weld [src] to the floor.", \ "You hear welding") - if (do_after(user,20 * WT.toolspeed)) + if (do_after(user,20 * WT.tool_speed)) if(!src || !WT.isOn()) return state = 2 to_chat(user, "You weld [src] to the floor.") @@ -194,11 +194,11 @@ to_chat(user, "You need more welding fuel to complete this task.") if(2) if (WT.remove_fuel(0,user)) - playsound(loc, WT.usesound, 50, 1) + playsound(loc, WT.tool_sound, 50, 1) user.visible_message("[user.name] starts to cut [src] free from the floor.", \ "You start to cut [src] free from the floor.", \ "You hear welding") - if (do_after(user,20 * WT.toolspeed)) + if (do_after(user,20 * WT.tool_speed)) if(!src || !WT.isOn()) return state = 1 to_chat(user, "You cut [src] free from the floor.") diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index fda1bbdb004..bdf9c93e216 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -101,14 +101,14 @@ field_generator power level display switch(state) if(0) state = 1 - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) user.visible_message("[user.name] secures [src.name] to the floor.", \ "You secure the external reinforcing bolts to the floor.", \ "You hear ratchet") src.anchored = 1 if(1) state = 0 - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \ "You undo the external reinforcing bolts.", \ "You hear ratchet") @@ -124,11 +124,11 @@ field_generator power level display return if(1) if (WT.remove_fuel(0,user)) - playsound(loc, WT.usesound, 50, 1) + playsound(loc, WT.tool_sound, 50, 1) user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \ "You start to weld the [src] to the floor.", \ "You hear welding") - if (do_after(user,20 * WT.toolspeed)) + if (do_after(user,20 * WT.tool_speed)) if(!src || !WT.isOn()) return state = 2 to_chat(user, "You weld the field generator to the floor.") @@ -136,11 +136,11 @@ field_generator power level display return if(2) if (WT.remove_fuel(0,user)) - playsound(loc, WT.usesound, 50, 1) + playsound(loc, WT.tool_sound, 50, 1) user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \ "You start to cut the [src] free from the floor.", \ "You hear welding") - if (do_after(user,20 * WT.toolspeed)) + if (do_after(user,20 * WT.tool_speed)) if(!src || !WT.isOn()) return state = 1 to_chat(user, "You cut the [src] free from the floor.") diff --git a/code/modules/power/singularity/generator.dm b/code/modules/power/singularity/generator.dm index 7135d14c694..ca0c7b6b5aa 100644 --- a/code/modules/power/singularity/generator.dm +++ b/code/modules/power/singularity/generator.dm @@ -19,7 +19,7 @@ /obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user) if(W.is_wrench()) anchored = !anchored - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) if(anchored) user.visible_message("[user.name] secures [src.name] to the floor.", \ "You secure the [src.name] to the floor.", \ @@ -31,12 +31,12 @@ return if(W.is_screwdriver()) panel_open = !panel_open - playsound(loc, W.usesound, 50, 1) + playsound(loc, W.tool_sound, 50, 1) visible_message("\The [user] adjusts \the [src]'s mechanisms.") if(panel_open && do_after(user, 30)) to_chat(user, "\The [src] looks like it could be modified.") - if(panel_open && do_after(user, 80 * W.toolspeed)) // We don't have skills, so a delayed hint for engineers will have to do for now. (Panel open check for sanity) - playsound(loc, W.usesound, 50, 1) + if(panel_open && do_after(user, 80 * W.tool_speed)) // We don't have skills, so a delayed hint for engineers will have to do for now. (Panel open check for sanity) + playsound(loc, W.tool_sound, 50, 1) to_chat(user, "\The [src] looks like it could be adapted to forge advanced materials via particle acceleration, somehow..") else to_chat(user, "\The [src]'s mechanisms look secure.") diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm index b16ad263a74..1ab9fdf5fa0 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm @@ -206,14 +206,14 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin switch(src.construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps if(0) if(O.is_wrench()) - playsound(src, O.usesound, 75, 1) + playsound(src, O.tool_sound, 75, 1) src.anchored = 1 user.visible_message("[user.name] secures the [src.name] to the floor.", \ "You secure the external bolts.") temp_state++ if(1) if(O.is_wrench()) - playsound(src, O.usesound, 75, 1) + playsound(src, O.tool_sound, 75, 1) src.anchored = 0 user.visible_message("[user.name] detaches the [src.name] from the floor.", \ "You remove the external bolts.") @@ -339,14 +339,14 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin switch(src.construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps if(0) if(O.is_wrench()) - playsound(src, O.usesound, 75, 1) + playsound(src, O.tool_sound, 75, 1) src.anchored = 1 user.visible_message("[user.name] secures the [src.name] to the floor.", \ "You secure the external bolts.") temp_state++ if(1) if(O.is_wrench()) - playsound(src, O.usesound, 75, 1) + playsound(src, O.tool_sound, 75, 1) src.anchored = 0 user.visible_message("[user.name] detaches the [src.name] from the floor.", \ "You remove the external bolts.") diff --git a/code/modules/power/singularity/particle_accelerator/particle_smasher.dm b/code/modules/power/singularity/particle_accelerator/particle_smasher.dm index 322338cfe3b..488380a0536 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_smasher.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_smasher.dm @@ -68,7 +68,7 @@ return else if(W.is_wrench()) anchored = !anchored - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) if(anchored) user.visible_message("[user.name] secures [src.name] to the floor.", \ "You secure the [src.name] to the floor.", \ diff --git a/code/modules/power/smes/smes.dm b/code/modules/power/smes/smes.dm index e096ae810b3..bcd2b152433 100644 --- a/code/modules/power/smes/smes.dm +++ b/code/modules/power/smes/smes.dm @@ -244,12 +244,12 @@ GLOBAL_LIST_EMPTY(smeses) if(!open_hatch) open_hatch = 1 to_chat(user, "You open the maintenance hatch of [src].") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) return 0 else open_hatch = 0 to_chat(user, "You close the maintenance hatch of [src].") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) return 0 if (!open_hatch) @@ -283,7 +283,7 @@ GLOBAL_LIST_EMPTY(smeses) else to_chat(user, "You begin to cut the cables...") playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1) - if(do_after(user, 50 * W.toolspeed)) + if(do_after(user, 50 * W.tool_speed)) if (prob(50) && electrocute_mob(usr, terminal.powernet, terminal)) var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(5, 1, src) diff --git a/code/modules/power/smes/smes_construction.dm b/code/modules/power/smes/smes_construction.dm index 0d31e1626e0..c5042c9e9a5 100644 --- a/code/modules/power/smes/smes_construction.dm +++ b/code/modules/power/smes/smes_construction.dm @@ -310,9 +310,9 @@ to_chat(user, "You have to disassemble the terminal first!") return - playsound(get_turf(src), W.usesound, 50, 1) + playsound(get_turf(src), W.tool_sound, 50, 1) to_chat(user, "You begin to disassemble the [src]!") - if (do_after(usr, (100 * cur_coils) * W.toolspeed)) // More coils = takes longer to disassemble. It's complex so largest one with 5 coils will take 50s with a normal crowbar + if (do_after(usr, (100 * cur_coils) * W.tool_speed)) // More coils = takes longer to disassemble. It's complex so largest one with 5 coils will take 50s with a normal crowbar if (failure_probability && prob(failure_probability)) total_system_failure(failure_probability, user) diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index e71c7a9a756..8559e40b034 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -235,13 +235,13 @@ GLOBAL_LIST_EMPTY(solars_list) if(W.is_wrench()) anchored = 1 user.visible_message("[user] wrenches the solar assembly into place.") - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) return 1 else if(W.is_wrench()) anchored = 0 user.visible_message("[user] unwrenches the solar assembly from it's place.") - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) return 1 if(istype(W, /obj/item/stack/material) && (W.get_material_name() == "glass" || W.get_material_name() == "rglass")) @@ -435,7 +435,7 @@ GLOBAL_LIST_EMPTY(solars_list) /obj/machinery/power/solar_control/attackby(obj/item/I, user as mob) if(I.is_screwdriver()) - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) if(do_after(user, 20)) if (src.machine_stat & BROKEN) to_chat(user, "The broken glass falls out.") diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 6a6a9cfbc9a..5746c147da6 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -278,8 +278,8 @@ if(A.is_screwdriver()) if(dna_lock && attached_lock && !attached_lock.controller_lock) to_chat(user, "You begin removing \the [attached_lock] from \the [src].") - playsound(src, A.usesound, 50, 1) - if(do_after(user, 25 * A.toolspeed)) + playsound(src, A.tool_sound, 50, 1) + if(do_after(user, 25 * A.tool_speed)) to_chat(user, "You remove \the [attached_lock] from \the [src].") user.put_in_hands(attached_lock) dna_lock = 0 @@ -293,8 +293,8 @@ if(A.is_multitool()) if(!scrambled) to_chat(user, "You begin scrambling \the [src]'s electronic pins.") - playsound(src, A.usesound, 50, 1) - if(do_after(user, 60 * A.toolspeed)) + playsound(src, A.tool_sound, 50, 1) + if(do_after(user, 60 * A.tool_speed)) switch(rand(1,100)) if(1 to 10) to_chat(user, "The electronic pin suite detects the intrusion and explodes!") @@ -313,8 +313,8 @@ if(A.is_wirecutter()) if(pin && scrambled) to_chat(user, "You attempt to remove \the firing pin from \the [src].") - playsound(src, A.usesound, 50, 1) - if(do_after(user, 60* A.toolspeed)) + playsound(src, A.tool_sound, 50, 1) + if(do_after(user, 60* A.tool_speed)) switch(rand(1,100)) if(1 to 10) to_chat(user, "You twist \the firing pin as you tug, destroying the firing pin.") diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index ef90d250240..3f821d5ef8d 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -87,7 +87,7 @@ if(istype(I, /obj/item/tool/crowbar)) if(modkits.len) to_chat(user, "You pry the modifications out.") - playsound(loc, I.usesound, 100, 1) + playsound(loc, I.tool_sound, 100, 1) for(var/obj/item/borg/upgrade/modkit/M in modkits) M.uninstall(src) else diff --git a/code/modules/projectiles/guns/energy/modular/modulargun.dm b/code/modules/projectiles/guns/energy/modular/modulargun.dm index a03d3bf9995..221bd9b4f6b 100644 --- a/code/modules/projectiles/guns/energy/modular/modulargun.dm +++ b/code/modules/projectiles/guns/energy/modular/modulargun.dm @@ -189,11 +189,11 @@ new_mode.apply_to(src) return FALSE -/obj/item/gun/energy/modular/attackby(obj/item/I, mob/living/user, params, attackchain_flags, damage_multiplier) +/obj/item/gun/energy/modular/attackby(obj/item/I, mob/living/user, params, clickchain_flags, damage_multiplier) if(I.is_screwdriver()) to_chat(user, "You [assembled ? "disassemble" : "assemble"] the gun.") assembled = !assembled - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) generatefiremodes() return if(I.is_crowbar()) diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm index 4e43dd3cdb6..fd3758befb0 100644 --- a/code/modules/projectiles/guns/launcher/crossbow.dm +++ b/code/modules/projectiles/guns/launcher/crossbow.dm @@ -174,7 +174,7 @@ var/obj/item/C = cell C.loc = get_turf(user) to_chat(user, "You jimmy [cell] out of [src] with [W].") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) cell = null else to_chat(user, "[src] doesn't have a cell installed.") @@ -245,7 +245,7 @@ var/obj/item/weldingtool/T = W if(T.remove_fuel(0,user)) if(!src || !T.isOn()) return - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You weld the rods into place.") buildstate++ update_icon() @@ -281,7 +281,7 @@ else if(W.is_screwdriver()) if(buildstate == 5) to_chat(user, "You secure the crossbow's various parts.") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) new /obj/item/gun/launcher/crossbow(get_turf(src)) qdel(src) return diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm index 16e1335d265..a85fd077a30 100644 --- a/code/modules/projectiles/guns/launcher/pneumatic.dm +++ b/code/modules/projectiles/guns/launcher/pneumatic.dm @@ -200,7 +200,7 @@ var/obj/item/weldingtool/T = W if(T.remove_fuel(0,user)) if(!src || !T.isOn()) return - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "You weld the pipe into place.") buildstate++ update_icon() @@ -208,7 +208,7 @@ var/obj/item/weldingtool/T = W if(T.remove_fuel(0,user)) if(!src || !T.isOn()) return - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "You weld the metal chassis together.") buildstate++ update_icon() @@ -216,7 +216,7 @@ var/obj/item/weldingtool/T = W if(T.remove_fuel(0,user)) if(!src || !T.isOn()) return - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "You weld the valve into place.") new /obj/item/gun/launcher/pneumatic(get_turf(src)) qdel(src) diff --git a/code/modules/projectiles/guns/modular_guns.dm b/code/modules/projectiles/guns/modular_guns.dm index 24b6ec834cd..d63c648e5fd 100644 --- a/code/modules/projectiles/guns/modular_guns.dm +++ b/code/modules/projectiles/guns/modular_guns.dm @@ -53,7 +53,7 @@ if(O.is_screwdriver()) to_chat(user, "You [assembled ? "disassemble" : "assemble"] the gun.") assembled = !assembled - playsound(src, O.usesound, 50, 1) + playsound(src, O.tool_sound, 50, 1) return if(O.is_crowbar()) if(assembled == 1) @@ -61,7 +61,7 @@ return for(var/obj/item/I in guncomponents) to_chat(user, "You remove the gun's components.") - playsound(src, O.usesound, 50, 1) + playsound(src, O.tool_sound, 50, 1) I.forceMove(get_turf(src)) guncomponents.Remove(I) CheckParts() diff --git a/code/modules/reagents/machinery/dispenser/dispenser2.dm b/code/modules/reagents/machinery/dispenser/dispenser2.dm index 4a8aa8abdda..4ceba8085f9 100644 --- a/code/modules/reagents/machinery/dispenser/dispenser2.dm +++ b/code/modules/reagents/machinery/dispenser/dispenser2.dm @@ -63,9 +63,9 @@ /obj/machinery/chemical_dispenser/attackby(obj/item/W, mob/user) if(W.is_wrench()) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You begin to [anchored ? "un" : ""]fasten \the [src].") - if (do_after(user, 20 * W.toolspeed)) + if (do_after(user, 20 * W.tool_speed)) user.visible_message( "\The [user] [anchored ? "un" : ""]fastens \the [src].", "You have [anchored ? "un" : ""]fastened \the [src].", @@ -84,7 +84,7 @@ if(C) to_chat(user, "You remove \the [C] from \the [src].") C.loc = loc - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) else if(istype(W, /obj/item/reagent_containers/glass) || istype(W, /obj/item/reagent_containers/food)) if(container) diff --git a/code/modules/reagents/machinery/dispenser/reagent_tank.dm b/code/modules/reagents/machinery/dispenser/reagent_tank.dm index 6875e865f3c..57c60787cef 100644 --- a/code/modules/reagents/machinery/dispenser/reagent_tank.dm +++ b/code/modules/reagents/machinery/dispenser/reagent_tank.dm @@ -166,7 +166,7 @@ user.visible_message("[user] wrenches [src]'s faucet [modded ? "closed" : "open"].", \ "You wrench [src]'s faucet [modded ? "closed" : "open"]") modded = modded ? 0 : 1 - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) if (modded) message_admins("[key_name_admin(user)] opened fueltank at [loc.loc.name] ([loc.x],[loc.y],[loc.z]), leaking fuel. (JMP)") log_game("[key_name(user)] opened fueltank at [loc.loc.name] ([loc.x],[loc.y],[loc.z]), leaking fuel.") @@ -298,7 +298,7 @@ if(I.is_wrench()) src.add_fingerprint(user) if(bottle) - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) if(do_after(user, 20) && bottle) to_chat(user, "You unfasten the jug.") var/obj/item/reagent_containers/glass/cooler_bottle/G = new /obj/item/reagent_containers/glass/cooler_bottle( src.loc ) @@ -313,16 +313,16 @@ user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") else user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.") - if(do_after(user, 20 * I.toolspeed, src)) + if(do_after(user, 20 * I.tool_speed, src)) if(!src) return to_chat(user, "You [anchored? "un" : ""]secured \the [src]!") anchored = !anchored - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) return if(I.is_screwdriver()) if(cupholder) - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) to_chat(user, "You take the cup dispenser off.") new /obj/item/stack/material/plastic( src.loc ) if(cups) @@ -333,9 +333,9 @@ update_icon() return if(!bottle && !cupholder) - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) to_chat(user, "You start taking the water-cooler apart.") - if(do_after(user, 20 * I.toolspeed) && !bottle && !cupholder) + if(do_after(user, 20 * I.tool_speed) && !bottle && !cupholder) to_chat(user, "You take the water-cooler apart.") new /obj/item/stack/material/plastic( src.loc, 4 ) qdel(src) diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index b0f7fd4a38d..3db0708062a 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -290,8 +290,8 @@ if(!WT.remove_fuel(0, user)) to_chat(user, "The welding tool must be on to complete this task.") return - playsound(src, WT.usesound, 50, 1) - if(do_after(user, 20 * WT.toolspeed)) + playsound(src, WT.tool_sound, 50, 1) + if(do_after(user, 20 * WT.tool_speed)) if(!src || !WT.isOn()) return to_chat(user, "You deconstruct the frame.") new /obj/item/stack/material/steel( src.loc, 2 ) diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm index 9bda2df45d9..56b75e8f2c3 100644 --- a/code/modules/recycling/disposal-construction.dm +++ b/code/modules/recycling/disposal-construction.dm @@ -291,16 +291,16 @@ else density = 1 // We don't want disposal bins or outlets to go density 0 to_chat(user, "You attach the [nicetype] to the underfloor.") - playsound(loc, I.usesound, 100, 1) + playsound(loc, I.tool_sound, 100, 1) update() else if(istype(I, /obj/item/weldingtool)) if(anchored) var/obj/item/weldingtool/W = I if(W.remove_fuel(0,user)) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "Welding the [nicetype] in place.") - if(do_after(user, 20 * W.toolspeed)) + if(do_after(user, 20 * W.tool_speed)) if(!src || !W.isOn()) return to_chat(user, "The [nicetype] has been welded in place!") update() // TODO: Make this neat diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index f434e5c8123..3fd874a2470 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -72,12 +72,12 @@ return if(mode==0) // It's off but still not unscrewed mode=-1 // Set it to doubleoff l0l - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) to_chat(user, "You remove the screws around the power connection.") return else if(mode==-1) mode=0 - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) to_chat(user, "You attach the screws around the power connection.") return else if(istype(I, /obj/item/weldingtool) && mode==-1) @@ -86,10 +86,10 @@ return var/obj/item/weldingtool/W = I if(W.remove_fuel(0,user)) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "You start slicing the floorweld off the disposal unit.") - if(do_after(user,20 * W.toolspeed)) + if(do_after(user,20 * W.tool_speed)) if(!src || !W.isOn()) return to_chat(user, "You sliced the floorweld off the disposal unit.") var/obj/structure/disposalconstruct/C = new (src.loc) @@ -882,7 +882,7 @@ var/obj/item/weldingtool/W = I if(W.remove_fuel(0,user)) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) // check if anything changed over 2 seconds var/turf/uloc = user.loc var/atom/wloc = W.loc @@ -1365,7 +1365,7 @@ var/obj/item/weldingtool/W = I if(W.remove_fuel(0,user)) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) // check if anything changed over 2 seconds var/turf/uloc = user.loc var/atom/wloc = W.loc @@ -1483,19 +1483,19 @@ if(mode==0) mode=1 to_chat(user, "You remove the screws around the power connection.") - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) return else if(mode==1) mode=0 to_chat(user, "You attach the screws around the power connection.") - playsound(src, I.usesound, 50, 1) + playsound(src, I.tool_sound, 50, 1) return else if(istype(I, /obj/item/weldingtool) && mode==1) var/obj/item/weldingtool/W = I if(W.remove_fuel(0,user)) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "You start slicing the floorweld off the disposal outlet.") - if(do_after(user,20 * W.toolspeed)) + if(do_after(user,20 * W.tool_speed)) if(!src || !W.isOn()) return to_chat(user, "You sliced the floorweld off the disposal outlet.") var/obj/structure/disposalconstruct/C = new (src.loc) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 9a5cd9b598d..e10dac6945d 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -432,20 +432,20 @@ if(I.is_screwdriver()) if(c_mode==0) c_mode=1 - playsound(src.loc, I.usesound, 50, 1) + playsound(src.loc, I.tool_sound, 50, 1) to_chat(user, "You remove the screws around the power connection.") return else if(c_mode==1) c_mode=0 - playsound(src.loc, I.usesound, 50, 1) + playsound(src.loc, I.tool_sound, 50, 1) to_chat(user, "You attach the screws around the power connection.") return else if(istype(I, /obj/item/weldingtool) && c_mode==1) var/obj/item/weldingtool/W = I if(W.remove_fuel(0,user)) - playsound(src.loc, W.usesound, 50, 1) + playsound(src.loc, W.tool_sound, 50, 1) to_chat(user, "You start slicing the floorweld off the delivery chute.") - if(do_after(user,20 * W.toolspeed)) + if(do_after(user,20 * W.tool_speed)) if(!src || !W.isOn()) return to_chat(user, "You sliced the floorweld off the delivery chute.") var/obj/structure/disposalconstruct/C = new (src.loc) diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm index 239a28a362c..2feea9d6a02 100644 --- a/code/modules/security levels/keycard authentication.dm +++ b/code/modules/security levels/keycard authentication.dm @@ -43,8 +43,8 @@ if(W.is_screwdriver()) to_chat(user, "You begin removing the faceplate from the [src]") - playsound(src, W.usesound, 50, 1) - if(do_after(user, 10 * W.toolspeed)) + playsound(src, W.tool_sound, 50, 1) + if(do_after(user, 10 * W.tool_speed)) to_chat(user, "You remove the faceplate from the [src]") var/obj/structure/frame/A = new /obj/structure/frame(loc) var/obj/item/circuitboard/M = new circuit(A) @@ -59,7 +59,7 @@ C.forceMove(loc) A.state = 3 A.update_icon() - M.deconstruct(src) + M.after_deconstruct(src) qdel(src) return diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm index ef572a8b1e1..083cd070d5d 100644 --- a/code/modules/shieldgen/emergency_shield.dm +++ b/code/modules/shieldgen/emergency_shield.dm @@ -281,7 +281,7 @@ /obj/machinery/shieldgen/attackby(obj/item/W as obj, mob/user as mob) if(W.is_screwdriver()) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) if(is_open) to_chat(user, "You close the panel.") is_open = 0 @@ -305,7 +305,7 @@ to_chat(user, "The bolts are covered, unlocking this would retract the covers.") return if(anchored) - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "You unsecure the [src] from the floor!") if(active) to_chat(user, "The [src] shuts off!") @@ -313,7 +313,7 @@ anchored = 0 else if(istype(get_turf(src), /turf/space)) return //No wrenching these in space! - playsound(src, W.usesound, 100, 1) + playsound(src, W.tool_sound, 100, 1) to_chat(user, "You secure the [src] to the floor!") anchored = 1 diff --git a/code/modules/shieldgen/sheldwallgen.dm b/code/modules/shieldgen/sheldwallgen.dm index 01a5add023c..e9dc964f5fb 100644 --- a/code/modules/shieldgen/sheldwallgen.dm +++ b/code/modules/shieldgen/sheldwallgen.dm @@ -164,14 +164,14 @@ else if(state == 0) state = 1 - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) to_chat(user, "You secure the external reinforcing bolts to the floor.") src.anchored = 1 return else if(state == 1) state = 0 - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) to_chat(user, "You undo the external reinforcing bolts.") src.anchored = 0 return diff --git a/code/modules/shieldgen/shield_capacitor.dm b/code/modules/shieldgen/shield_capacitor.dm index f3896c55e07..964b1058c0d 100644 --- a/code/modules/shieldgen/shield_capacitor.dm +++ b/code/modules/shieldgen/shield_capacitor.dm @@ -50,7 +50,7 @@ to_chat(user, "Access denied.") else if(W.is_wrench()) src.anchored = !src.anchored - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) src.visible_message("[icon2html(thing = src, target = world)] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].") if(anchored) diff --git a/code/modules/shieldgen/shield_gen.dm b/code/modules/shieldgen/shield_gen.dm index fa2ffd3ce71..cf823c01094 100644 --- a/code/modules/shieldgen/shield_gen.dm +++ b/code/modules/shieldgen/shield_gen.dm @@ -69,7 +69,7 @@ to_chat(user, "Access denied.") else if(W.is_wrench()) src.anchored = !src.anchored - playsound(src, W.usesound, 75, 1) + playsound(src, W.tool_sound, 75, 1) src.visible_message("[icon2html(thing = src, target = world)] [src] has been [anchored?"bolted to the floor":"unbolted from the floor"] by [user].") if(active) diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index d3a55ea4fa7..e280b217835 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -150,7 +150,7 @@ // Not staying still fails you too. if(success) var/calc_duration = rand(S.min_duration, S.max_duration) - if(!do_mob(user, M, calc_duration * toolspeed, zone)) + if(!do_mob(user, M, calc_duration * tool_speed, zone)) success = FALSE to_chat(user, "You must remain close to and keep focused on your patient to conduct surgery.") diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index f258b856878..8f867c98b8b 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -159,8 +159,8 @@ var/list/table_icon_cache = list() var/obj/item/weldingtool/F = W if(F.welding) to_chat(user, "You begin reparing damage to \the [src].") - playsound(src, F.usesound, 50, 1) - if(!do_after(user, 20 * F.toolspeed) || !F.remove_fuel(1, user)) + playsound(src, F.tool_sound, 50, 1) + if(!do_after(user, 20 * F.tool_speed) || !F.remove_fuel(1, user)) return user.visible_message("\The [user] repairs some damage to \the [src].", "You repair some damage to \the [src].") @@ -286,10 +286,10 @@ var/list/table_icon_cache = list() return null /obj/structure/table/proc/remove_reinforced(obj/item/S, mob/user) - reinforced = common_material_remove(user, reinforced, 40 * S.toolspeed, "reinforcements", "screws", S.usesound) + reinforced = common_material_remove(user, reinforced, 40 * S.tool_speed, "reinforcements", "screws", S.tool_sound) /obj/structure/table/proc/remove_material(obj/item/W, mob/user) - material = common_material_remove(user, material, 20 * W.toolspeed, "plating", "bolts", W.usesound) + material = common_material_remove(user, material, 20 * W.tool_speed, "plating", "bolts", W.tool_sound) /obj/structure/table/proc/dismantle(obj/item/W, mob/user) if(manipulating) @@ -297,8 +297,8 @@ var/list/table_icon_cache = list() manipulating = TRUE user.visible_message("\The [user] begins dismantling \the [src].", "You begin dismantling \the [src].") - playsound(src, W.usesound, 50, 1) - if(!do_after(user, 20 * W.toolspeed)) + playsound(src, W.tool_sound, 50, 1) + if(!do_after(user, 20 * W.tool_speed)) manipulating = FALSE return user.visible_message("\The [user] dismantles \the [src].", diff --git a/code/modules/vehicles/construction.dm b/code/modules/vehicles/construction.dm index 057e79557a9..af71f20d887 100644 --- a/code/modules/vehicles/construction.dm +++ b/code/modules/vehicles/construction.dm @@ -129,10 +129,10 @@ if(7) if(W.is_wrench() || W.is_screwdriver()) - playsound(loc, W.usesound, 50, 1) + playsound(loc, W.tool_sound, 50, 1) to_chat(user, "You begin your finishing touches on \the [src].") if(do_after(user, 20) && build_stage == 7) - playsound(loc, W.usesound, 30, 1) + playsound(loc, W.tool_sound, 30, 1) var/obj/vehicle/train/engine/quadbike/built/product = new(get_turf(src)) to_chat(user, "You finish \the [product]") product.cell = cell @@ -174,7 +174,7 @@ if(2) if(W.is_screwdriver()) - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) to_chat(user, "You close up \the [src].") new /obj/vehicle/train/trolley/trailer(get_turf(src)) qdel(src) @@ -252,10 +252,10 @@ if(6) if(W.is_wrench() || W.is_screwdriver()) - playsound(loc, W.usesound, 50, 1) + playsound(loc, W.tool_sound, 50, 1) to_chat(user, "You begin your finishing touches on \the [src].") if(do_after(user, 20) && build_stage == 6) - playsound(loc, W.usesound, 30, 1) + playsound(loc, W.tool_sound, 30, 1) var/obj/vehicle/bike/built/product = new(get_turf(src)) to_chat(user, "You finish \the [product]") product.cell = cell diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index c179610c61d..23411e18065 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -120,7 +120,7 @@ open = !open update_icon() to_chat(user, "Maintenance panel is now [open ? "opened" : "closed"].") - playsound(src, W.usesound, 50, 1) + playsound(src, W.tool_sound, 50, 1) else if(W.is_crowbar() && cell && open) remove_cell(user) @@ -133,7 +133,7 @@ if(open) health = min(maxhealth, health+10) user.setClickCooldown(user.get_attack_speed(W)) - playsound(src, T.usesound, 50, 1) + playsound(src, T.tool_sound, 50, 1) user.visible_message("[user] repairs [src]!"," You repair [src]!") else to_chat(user, "Unable to repair with the maintenance panel closed.") diff --git a/code/modules/virus2/diseasesplicer.dm b/code/modules/virus2/diseasesplicer.dm index d071e89fcb6..a146aa640a5 100644 --- a/code/modules/virus2/diseasesplicer.dm +++ b/code/modules/virus2/diseasesplicer.dm @@ -11,7 +11,7 @@ var/splicing = 0 var/scanning = 0 -/obj/machinery/computer/diseasesplicer/attackby(obj/item/I, mob/living/user, params, attackchain_flags, damage_multiplier) +/obj/machinery/computer/diseasesplicer/attackby(obj/item/I, mob/living/user, params, clickchain_flags, damage_multiplier) if(I.is_screwdriver()) return ..(I, user) diff --git a/code/modules/xenoarcheaology/tools/suspension_generator.dm b/code/modules/xenoarcheaology/tools/suspension_generator.dm index 64995c65cc9..2449f90b310 100644 --- a/code/modules/xenoarcheaology/tools/suspension_generator.dm +++ b/code/modules/xenoarcheaology/tools/suspension_generator.dm @@ -99,7 +99,7 @@ anchored = FALSE else anchored = TRUE - playsound(loc, W.usesound, 50, 1) + playsound(loc, W.tool_sound, 50, 1) to_chat(user, SPAN_NOTICE("You wrench the stabilising legs [anchored ? "into place" : "up against the body"].")) if(anchored) desc = "It is resting securely on four stubby legs." diff --git a/code/modules/xenobio/machinery/processor.dm b/code/modules/xenobio/machinery/processor.dm index 7457f1d870d..6eb002a53ee 100644 --- a/code/modules/xenobio/machinery/processor.dm +++ b/code/modules/xenobio/machinery/processor.dm @@ -36,7 +36,7 @@ playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 1) return -/obj/machinery/processor/attackby(obj/item/I, mob/living/user, params, attackchain_flags, damage_multiplier) +/obj/machinery/processor/attackby(obj/item/I, mob/living/user, params, clickchain_flags, damage_multiplier) if(default_unfasten_wrench(user, I, 40)) return return ..() diff --git a/config/legacy/forumdbconfig.txt b/config/legacy/forumdbconfig.txt deleted file mode 100644 index 0335ef90693..00000000000 --- a/config/legacy/forumdbconfig.txt +++ /dev/null @@ -1,19 +0,0 @@ -# This configuration file is for the forum database, if you need to set up -# population, death, etc. tracking see 'dbconfig.txt' -# The login credentials for this will likely differ from those in dbconfig.txt! - -# Server the MySQL database can be found at -# Examples: localhost, 200.135.5.43, www.mysqldb.com, etc. -ADDRESS localhost - -# MySQL server port (default is 3306) -PORT 3306 - -# Database the forum data may be found in -DATABASE tgstation13 - -# Username/Login used to access the database -LOGIN mylogin - -# Password used to access the database -PASSWORD mypassword \ No newline at end of file diff --git a/icons/screen/radial/tools/generic.dmi b/icons/screen/radial/tools/generic.dmi new file mode 100644 index 00000000000..466329507e8 Binary files /dev/null and b/icons/screen/radial/tools/generic.dmi differ