From cf14dcfc1a8c58878b04e841db37138f02df5929 Mon Sep 17 00:00:00 2001 From: Bloop <13398309+vinylspiders@users.noreply.github.com> Date: Mon, 29 Dec 2025 19:05:50 -0500 Subject: [PATCH] Converts 3 components into elements (#94589) ## About The Pull Request `adjust_fishing_difficulty` is a good one to make into a bespoke element since a number of the same clothing item are created in the wardrobe system. climb_walkable is also good due to how prevalent it is, and it is a bit of a two for one since it also removes the need for the `/component/connect_loc_behalf` Also stops adding the on_climbable trait to literally everything in the turf, it now only applies it to atoms with density. So no more pipes and stuff getting trait lists created for no reason.
Tested + things still work as before image
## Why It's Good For The Game Lessens overhead, fixes a bug as well. ## Changelog :cl: fix: fixes a pushed crate not removing on_climbable trait properly off the mob standing atop it /:cl: --- code/__DEFINES/dcs/signals/signals_fish.dm | 2 - .../components/adjust_fishing_difficulty.dm | 110 ------------------ code/datums/components/climb_walkable.dm | 29 ----- code/datums/components/crafting/furniture.dm | 2 +- .../elements/adjust_fishing_difficulty.dm | 104 +++++++++++++++++ code/datums/elements/climb_walkable.dm | 43 +++++++ code/datums/elements/rotation.dm | 12 +- code/datums/storage/storage.dm | 5 +- code/game/objects/items/storage/belt.dm | 2 +- .../items/storage/toolboxes/fishing.dm | 2 +- code/game/objects/items/teleportation.dm | 2 +- .../objects/structures/beds_chairs/chair.dm | 2 +- .../structures/crates_lockers/crates.dm | 2 +- code/game/objects/structures/platform.dm | 2 +- code/game/objects/structures/steps.dm | 2 +- code/game/objects/structures/tables_racks.dm | 4 +- code/game/objects/structures/toiletbong.dm | 4 +- .../transit_tube_construction.dm | 2 +- code/game/objects/structures/window.dm | 4 +- code/modules/basketball/hoop.dm | 4 +- code/modules/clothing/ears/_ears.dm | 2 +- code/modules/clothing/glasses/_glasses.dm | 12 +- code/modules/clothing/gloves/bone.dm | 2 +- code/modules/clothing/gloves/botany.dm | 2 +- code/modules/clothing/gloves/boxing.dm | 2 +- code/modules/clothing/gloves/color.dm | 2 +- code/modules/clothing/gloves/combat.dm | 4 +- code/modules/clothing/gloves/insulated.dm | 12 +- code/modules/clothing/gloves/punch_mitts.dm | 2 +- code/modules/clothing/gloves/special.dm | 14 +-- code/modules/clothing/gloves/tacklers.dm | 2 +- code/modules/clothing/head/collectable.dm | 6 +- code/modules/clothing/head/fedora.dm | 2 +- code/modules/clothing/head/hardhat.dm | 2 +- code/modules/clothing/head/helmet.dm | 6 +- code/modules/clothing/head/jobs.dm | 4 +- code/modules/clothing/head/moth.dm | 2 +- code/modules/clothing/head/perceptomatrix.dm | 2 +- code/modules/clothing/head/pirate.dm | 2 +- code/modules/clothing/head/soft_caps.dm | 2 +- code/modules/clothing/head/welding.dm | 6 +- code/modules/clothing/masks/animal_masks.dm | 24 ++-- code/modules/clothing/masks/boxing.dm | 2 +- code/modules/clothing/masks/gasmask.dm | 6 +- code/modules/clothing/neck/_neck.dm | 2 +- code/modules/clothing/shoes/boots.dm | 4 +- code/modules/clothing/shoes/clown.dm | 2 +- code/modules/clothing/shoes/costume.dm | 4 +- code/modules/clothing/shoes/galoshes.dm | 2 +- code/modules/clothing/shoes/laceup.dm | 2 +- code/modules/clothing/shoes/magboots.dm | 14 +-- .../clothing/spacesuits/_spacesuits.dm | 4 +- code/modules/clothing/suits/armor.dm | 6 +- code/modules/clothing/suits/bio.dm | 4 +- code/modules/clothing/suits/costume.dm | 14 +-- code/modules/clothing/suits/ethereal.dm | 6 +- code/modules/clothing/suits/ghostsheet.dm | 2 +- code/modules/clothing/suits/jobs.dm | 4 +- code/modules/clothing/suits/labcoat.dm | 4 +- code/modules/clothing/suits/moth.dm | 2 +- code/modules/clothing/suits/utility.dm | 10 +- code/modules/clothing/suits/wintercoats.dm | 2 +- code/modules/clothing/suits/wiz_robe.dm | 4 +- .../clothing/under/jobs/civilian/curator.dm | 2 +- code/modules/clothing/under/jobs/medical.dm | 4 +- code/modules/clothing/under/miscellaneous.dm | 2 +- code/modules/clothing/under/skirt_dress.dm | 4 +- code/modules/clothing/under/suits.dm | 4 +- code/modules/clothing/under/syndicate.dm | 6 +- .../modules/fishing/aquarium/fish_analyzer.dm | 2 +- code/modules/fishing/fish_catalog.dm | 2 +- code/modules/fishing/fishing_equipment.dm | 2 +- code/modules/fishing/fishing_minigame.dm | 30 ++--- code/modules/fishing/sources/_fish_source.dm | 17 ++- code/modules/mob/living/living_defines.dm | 3 + .../mob/living/living_item_handling.dm | 1 - code/modules/mod/modules/modules_general.dm | 4 +- .../chemistry/reagents/medicine_reagents.dm | 5 +- .../recycling/disposal/construction.dm | 4 +- tgstation.dme | 4 +- 80 files changed, 337 insertions(+), 312 deletions(-) delete mode 100644 code/datums/components/adjust_fishing_difficulty.dm delete mode 100644 code/datums/components/climb_walkable.dm create mode 100644 code/datums/elements/adjust_fishing_difficulty.dm create mode 100644 code/datums/elements/climb_walkable.dm diff --git a/code/__DEFINES/dcs/signals/signals_fish.dm b/code/__DEFINES/dcs/signals/signals_fish.dm index 3dda733df1c..079db4a92cc 100644 --- a/code/__DEFINES/dcs/signals/signals_fish.dm +++ b/code/__DEFINES/dcs/signals/signals_fish.dm @@ -52,8 +52,6 @@ /// Rolling a reward path for a fishing challenge #define COMSIG_FISHING_CHALLENGE_ROLL_REWARD "fishing_roll_reward" -/// Adjusting the difficulty of a rishing challenge, often based on the reward path -#define COMSIG_FISHING_CHALLENGE_GET_DIFFICULTY "fishing_get_difficulty" /// From /datum/fishing_challenge/start_minigame_phase, called after the fish movement datum is spawned: (datum/fish_movement/mover) #define COMSIG_FISHING_CHALLENGE_MOVER_INITIALIZED "fishing_mover_initialized" /// Fishing challenge completed diff --git a/code/datums/components/adjust_fishing_difficulty.dm b/code/datums/components/adjust_fishing_difficulty.dm deleted file mode 100644 index d4b7b28492c..00000000000 --- a/code/datums/components/adjust_fishing_difficulty.dm +++ /dev/null @@ -1,110 +0,0 @@ -///Influences the difficulty of the minigame when worn or if buckled to. -/datum/component/adjust_fishing_difficulty - ///The additive numerical modifier to the difficulty of the minigame - var/modifier - ///For items, in which slot it has to be worn to influence the difficulty of the minigame - var/slots - -/datum/component/adjust_fishing_difficulty/Initialize(modifier, slots = NONE) - if(!ismovable(parent) || !modifier) - return COMPONENT_INCOMPATIBLE - - if(!isitem(parent)) - var/atom/movable/movable_parent = parent - if(!movable_parent.can_buckle) - return COMPONENT_INCOMPATIBLE - - src.modifier = modifier - src.slots = slots - -/datum/component/adjust_fishing_difficulty/RegisterWithParent() - if(isitem(parent)) - RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equipped)) - RegisterSignal(parent, COMSIG_ITEM_DROPPED, PROC_REF(on_dropped)) - RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_item_examine)) - else - RegisterSignal(parent, COMSIG_MOVABLE_BUCKLE, PROC_REF(on_buckle)) - RegisterSignal(parent, COMSIG_MOVABLE_UNBUCKLE, PROC_REF(on_unbuckle)) - RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_buckle_examine)) - - update_check() - -/datum/component/adjust_fishing_difficulty/UnregisterFromParent() - UnregisterSignal(parent, list( - COMSIG_ATOM_EXAMINE, - COMSIG_MOVABLE_BUCKLE, - COMSIG_MOVABLE_UNBUCKLE, - COMSIG_ITEM_EQUIPPED, - COMSIG_ITEM_DROPPED, - )) - - update_check(TRUE) - -/datum/component/adjust_fishing_difficulty/proc/update_check(removing = FALSE) - var/atom/movable/movable_parent = parent - for(var/mob/living/buckled_mob as anything in movable_parent.buckled_mobs) - update_user(buckled_mob, removing) - if(!isitem(movable_parent) || !isliving(movable_parent.loc)) - return - var/mob/living/holder = movable_parent.loc - var/obj/item/item = parent - if(holder.get_slot_by_item(movable_parent) & (slots || item.slot_flags)) - update_user(holder, removing) - -/datum/component/adjust_fishing_difficulty/proc/on_item_examine(obj/item/item, mob/user, list/examine_text) - SIGNAL_HANDLER - if(!HAS_MIND_TRAIT(user, TRAIT_EXAMINE_FISH)) - return - var/method = "[(slots || item.slot_flags) & ITEM_SLOT_HANDS ? "Holding" : "Wearing"] [item.p_them()]" - add_examine_line(user, examine_text, method) - -/datum/component/adjust_fishing_difficulty/proc/on_buckle_examine(atom/movable/source, mob/user, list/examine_text) - SIGNAL_HANDLER - if(!HAS_MIND_TRAIT(user, TRAIT_EXAMINE_FISH)) - return - add_examine_line(user, examine_text, "Buckling to [source.p_them()]") - -/datum/component/adjust_fishing_difficulty/proc/add_examine_line(mob/user, list/examine_text, method) - var/percent = HAS_MIND_TRAIT(user, TRAIT_EXAMINE_DEEPER_FISH) ? "[abs(modifier)]% " : "" - var/text = "[method] will make fishing [percent][modifier < 0 ? "easier" : "harder"]." - if(modifier < 0) - examine_text += span_nicegreen(text) - else - examine_text += span_danger(text) - -/datum/component/adjust_fishing_difficulty/proc/on_buckle(atom/movable/source, mob/living/buckled_mob, forced) - SIGNAL_HANDLER - update_user(buckled_mob) - -/datum/component/adjust_fishing_difficulty/proc/on_unbuckle(atom/movable/source, mob/living/buckled_mob, forced) - SIGNAL_HANDLER - update_user(buckled_mob, TRUE) - -/datum/component/adjust_fishing_difficulty/proc/on_equipped(obj/item/source, mob/living/wearer, slot) - SIGNAL_HANDLER - if(slot & (slots || source.slot_flags)) - update_user(wearer) - -/datum/component/adjust_fishing_difficulty/proc/on_dropped(obj/item/source, mob/living/dropper) - SIGNAL_HANDLER - update_user(dropper, TRUE) - -/datum/component/adjust_fishing_difficulty/proc/update_user(mob/living/user, removing = FALSE) - var/datum/fishing_challenge/challenge = GLOB.fishing_challenges_by_user[user] - if(removing) - UnregisterSignal(user, COMSIG_MOB_BEGIN_FISHING) - if(challenge) - UnregisterSignal(challenge, COMSIG_FISHING_CHALLENGE_GET_DIFFICULTY) - else - RegisterSignal(user, COMSIG_MOB_BEGIN_FISHING, PROC_REF(on_minigame_started), TRUE) - if(challenge) - RegisterSignal(challenge, COMSIG_FISHING_CHALLENGE_GET_DIFFICULTY, PROC_REF(adjust_difficulty), TRUE) - challenge?.update_difficulty() - -/datum/component/adjust_fishing_difficulty/proc/on_minigame_started(mob/living/source, datum/fishing_challenge/challenge) - SIGNAL_HANDLER - RegisterSignal(challenge, COMSIG_FISHING_CHALLENGE_GET_DIFFICULTY, PROC_REF(adjust_difficulty), TRUE) - -/datum/component/adjust_fishing_difficulty/proc/adjust_difficulty(datum/fishing_challenge/challenge, reward_path, obj/item/fishing_rod/rod, mob/living/user, list/holder) - SIGNAL_HANDLER - holder[1] += modifier diff --git a/code/datums/components/climb_walkable.dm b/code/datums/components/climb_walkable.dm deleted file mode 100644 index 0fb5a867efc..00000000000 --- a/code/datums/components/climb_walkable.dm +++ /dev/null @@ -1,29 +0,0 @@ -/// Allows objects that entered parent's tile to move freely through other objects with this component regardless of density -/datum/component/climb_walkable - -/datum/component/climb_walkable/RegisterWithParent() - var/static/list/turf_connections = list( - COMSIG_ATOM_ENTERED = PROC_REF(on_enter), - COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON = PROC_REF(on_enter), - COMSIG_ATOM_EXITED = PROC_REF(on_exit), - ) - AddComponent(/datum/component/connect_loc_behalf, parent, turf_connections) - RegisterSignal(parent, COMSIG_ATOM_TRIED_PASS, PROC_REF(can_allow_through)) - -/datum/component/climb_walkable/UnregisterFromParent() - UnregisterSignal(parent, COMSIG_ATOM_TRIED_PASS) - for (var/atom/movable/climber in get_turf(parent)) - REMOVE_TRAIT(climber, TRAIT_ON_CLIMBABLE, REF(src)) - -/datum/component/climb_walkable/proc/on_enter(datum/source, atom/movable/arrived) - SIGNAL_HANDLER - ADD_TRAIT(arrived, TRAIT_ON_CLIMBABLE, REF(src)) - -/datum/component/climb_walkable/proc/on_exit(datum/source, atom/movable/gone, direction) - SIGNAL_HANDLER - REMOVE_TRAIT(gone, TRAIT_ON_CLIMBABLE, REF(src)) - -/datum/component/climb_walkable/proc/can_allow_through(datum/source, atom/movable/mover, border_dir) - SIGNAL_HANDLER - if(HAS_TRAIT(mover, TRAIT_ON_CLIMBABLE)) - return COMSIG_COMPONENT_PERMIT_PASSAGE diff --git a/code/datums/components/crafting/furniture.dm b/code/datums/components/crafting/furniture.dm index ecbf1d7fc9a..a1d55a785ec 100644 --- a/code/datums/components/crafting/furniture.dm +++ b/code/datums/components/crafting/furniture.dm @@ -96,7 +96,7 @@ /datum/crafting_recipe/lamp/New() . = ..() - blacklist += subtypesof(/obj/item/flashlight) + LAZYADD(blacklist, subtypesof(/obj/item/flashlight)) /datum/crafting_recipe/lamp/green name = "Green Desk Lamp" diff --git a/code/datums/elements/adjust_fishing_difficulty.dm b/code/datums/elements/adjust_fishing_difficulty.dm new file mode 100644 index 00000000000..e139fb376d9 --- /dev/null +++ b/code/datums/elements/adjust_fishing_difficulty.dm @@ -0,0 +1,104 @@ +///Influences the difficulty of the minigame when worn or if buckled to. +/datum/element/adjust_fishing_difficulty + element_flags = ELEMENT_BESPOKE + argument_hash_start_idx = 2 + ///The additive numerical modifier to the difficulty of the minigame + var/modifier + ///For items, in which slot it has to be worn to influence the difficulty of the minigame + var/slots + +/datum/element/adjust_fishing_difficulty/Attach(datum/target, modifier, slots = NONE) + . = ..() + if(!ismovable(target) || !modifier) + return COMPONENT_INCOMPATIBLE + + if(!isitem(target)) + var/atom/movable/movable_target = target + if(!movable_target.can_buckle) + return COMPONENT_INCOMPATIBLE + + RegisterSignal(target, COMSIG_MOVABLE_BUCKLE, PROC_REF(on_buckle), override = TRUE) + RegisterSignal(target, COMSIG_MOVABLE_UNBUCKLE, PROC_REF(on_unbuckle), override = TRUE) + RegisterSignal(target, COMSIG_ATOM_EXAMINE, PROC_REF(on_buckle_examine), override = TRUE) + + else + RegisterSignal(target, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equipped), override = TRUE) + RegisterSignal(target, COMSIG_ITEM_DROPPED, PROC_REF(on_dropped), override = TRUE) + RegisterSignal(target, COMSIG_ATOM_EXAMINE, PROC_REF(on_item_examine), override = TRUE) + + src.modifier = modifier + src.slots = slots + + update_check(target) + +/datum/element/adjust_fishing_difficulty/Detach(datum/source, ...) + . = ..() + UnregisterSignal(source, list( + COMSIG_ATOM_EXAMINE, + COMSIG_MOVABLE_BUCKLE, + COMSIG_MOVABLE_UNBUCKLE, + COMSIG_ITEM_EQUIPPED, + COMSIG_ITEM_DROPPED, + )) + + update_check(source, TRUE) + +/datum/element/adjust_fishing_difficulty/proc/update_check(atom/movable/movable_source, removing = FALSE) + for(var/mob/living/buckled_mob as anything in movable_source.buckled_mobs) + update_user(buckled_mob, movable_source, removing) + if(!isitem(movable_source) || !isliving(movable_source.loc)) + return + var/mob/living/holder = movable_source.loc + var/obj/item/item = movable_source + if(holder.get_slot_by_item(movable_source) & (slots || item.slot_flags)) + update_user(holder, movable_source, removing) + +/datum/element/adjust_fishing_difficulty/proc/on_item_examine(obj/item/item, mob/user, list/examine_text) + SIGNAL_HANDLER + if(!HAS_MIND_TRAIT(user, TRAIT_EXAMINE_FISH)) + return + var/method = "[(slots || item.slot_flags) & ITEM_SLOT_HANDS ? "Holding" : "Wearing"] [item.p_them()]" + add_examine_line(user, examine_text, method) + +/datum/element/adjust_fishing_difficulty/proc/on_buckle_examine(atom/movable/source, mob/user, list/examine_text) + SIGNAL_HANDLER + if(!HAS_MIND_TRAIT(user, TRAIT_EXAMINE_FISH)) + return + add_examine_line(user, examine_text, "Buckling to [source.p_them()]") + +/datum/element/adjust_fishing_difficulty/proc/add_examine_line(mob/user, list/examine_text, method) + var/percent = HAS_MIND_TRAIT(user, TRAIT_EXAMINE_DEEPER_FISH) ? "[abs(modifier)]% " : "" + var/text = "[method] will make fishing [percent][modifier < 0 ? "easier" : "harder"]." + if(modifier < 0) + examine_text += span_nicegreen(text) + else + examine_text += span_danger(text) + +/datum/element/adjust_fishing_difficulty/proc/on_buckle(atom/movable/source, mob/living/buckled_mob, forced) + SIGNAL_HANDLER + update_user(buckled_mob, source) + +/datum/element/adjust_fishing_difficulty/proc/on_unbuckle(atom/movable/source, mob/living/buckled_mob, forced) + SIGNAL_HANDLER + update_user(buckled_mob, source, TRUE) + +/datum/element/adjust_fishing_difficulty/proc/on_equipped(obj/item/source, mob/living/wearer, slot) + SIGNAL_HANDLER + if(slot & (slots || source.slot_flags)) + update_user(wearer, source) + +/datum/element/adjust_fishing_difficulty/proc/on_dropped(obj/item/source, mob/living/dropper) + SIGNAL_HANDLER + update_user(dropper, source, TRUE) + +/// Updates the user's tracked current fishing modifiers +/datum/element/adjust_fishing_difficulty/proc/update_user(mob/living/user, obj/source_item, removing = FALSE) + if(removing) + LAZYREMOVE(user.fishing_difficulty_mods_by_source, source_item.type) + else + LAZYSET(user.fishing_difficulty_mods_by_source, source_item.type, modifier) + + // Are we currently in a fishing challenge? If so, update that challenge as well + var/datum/fishing_challenge/challenge = GLOB.fishing_challenges_by_user[user] + if(challenge) + challenge.update_difficulty() diff --git a/code/datums/elements/climb_walkable.dm b/code/datums/elements/climb_walkable.dm new file mode 100644 index 00000000000..111025f44ef --- /dev/null +++ b/code/datums/elements/climb_walkable.dm @@ -0,0 +1,43 @@ +/// Allows objects that entered parent's tile to move freely through other objects with this component regardless of density +/datum/element/climb_walkable + var/static/list/turf_connections = list( + COMSIG_ATOM_ENTERED = TYPE_PROC_REF(/obj/structure, on_climb_enter), + COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON = TYPE_PROC_REF(/obj/structure, on_climb_enter), + COMSIG_ATOM_EXITED = TYPE_PROC_REF(/obj/structure, on_climb_exit), + ) + +/datum/element/climb_walkable/Attach(datum/target) + . = ..() + target.AddElement(/datum/element/connect_loc, turf_connections) + RegisterSignal(target, COMSIG_ATOM_TRIED_PASS, PROC_REF(can_allow_through)) + RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(on_climbable_moved)) + +/datum/element/climb_walkable/Detach(datum/source, ...) + . = ..() + UnregisterSignal(source, list(COMSIG_ATOM_TRIED_PASS, COMSIG_MOVABLE_MOVED)) + for (var/atom/movable/climber in get_turf(source)) + if(HAS_TRAIT(climber, TRAIT_ON_CLIMBABLE)) + REMOVE_TRAIT(climber, TRAIT_ON_CLIMBABLE, ELEMENT_TRAIT(type)) + source.RemoveElement(/datum/element/connect_loc, turf_connections) + +/datum/element/climb_walkable/proc/can_allow_through(datum/source, atom/movable/mover, border_dir) + SIGNAL_HANDLER + if(HAS_TRAIT(mover, TRAIT_ON_CLIMBABLE)) + return COMSIG_COMPONENT_PERMIT_PASSAGE + +// Removes the climbable trait if the crate or whatever it is gets pushed away. +/datum/element/climb_walkable/proc/on_climbable_moved(datum/source, atom/old_loc) + SIGNAL_HANDLER + for (var/atom/movable/climber in get_turf(old_loc)) + if(HAS_TRAIT(climber, TRAIT_ON_CLIMBABLE)) + REMOVE_TRAIT(climber, TRAIT_ON_CLIMBABLE, ELEMENT_TRAIT(type)) + +/obj/structure/proc/on_climb_enter(datum/source, atom/movable/arrived) + SIGNAL_HANDLER + if(arrived.density) + ADD_TRAIT(arrived, TRAIT_ON_CLIMBABLE, ELEMENT_TRAIT(/datum/element/climb_walkable)) + +/obj/structure/proc/on_climb_exit(datum/source, atom/movable/gone, direction) + SIGNAL_HANDLER + if(HAS_TRAIT(gone, TRAIT_ON_CLIMBABLE)) + REMOVE_TRAIT(gone, TRAIT_ON_CLIMBABLE, ELEMENT_TRAIT(/datum/element/climb_walkable)) diff --git a/code/datums/elements/rotation.dm b/code/datums/elements/rotation.dm index 6d444165945..6b496b5edd0 100644 --- a/code/datums/elements/rotation.dm +++ b/code/datums/elements/rotation.dm @@ -3,6 +3,8 @@ argument_hash_start_idx = 2 /// Rotation flags for special behavior var/rotation_flags + /// Optional proc to call()() after the thing is successfully rotated + var/post_rotation_proccall /** * Adds the ability to rotate an object by Alt-click or using Right-click verbs. @@ -11,7 +13,7 @@ * * rotation_flags (optional) Bitflags that determine behavior for rotation (defined at the top of this file) * * post_rotation (optional) Callback proc that is used after the object is rotated (sound effects, balloon alerts, etc.) **/ -/datum/element/simple_rotation/Attach(datum/target, rotation_flags = NONE) +/datum/element/simple_rotation/Attach(datum/target, rotation_flags = NONE, post_rotation_proccall) . = ..() if(!ismovable(target)) return ELEMENT_INCOMPATIBLE @@ -20,6 +22,7 @@ source.flags_1 |= HAS_CONTEXTUAL_SCREENTIPS_1 src.rotation_flags = rotation_flags + src.post_rotation_proccall = post_rotation_proccall RegisterSignal(target, COMSIG_CLICK_ALT, PROC_REF(rotate_left)) RegisterSignal(target, COMSIG_CLICK_ALT_SECONDARY, PROC_REF(rotate_right)) @@ -66,7 +69,8 @@ if(rotation_flags & ROTATION_REQUIRE_WRENCH) playsound(object_to_rotate, 'sound/items/tools/ratchet.ogg', 50, TRUE) - object_to_rotate.post_rotation(user, degrees) + if(post_rotation_proccall) + call(object_to_rotate, post_rotation_proccall)(user, degrees) /datum/element/simple_rotation/proc/can_user_rotate(mob/user, obj/object_to_rotate, degrees) if(isliving(user) && user.can_perform_action(object_to_rotate, NEED_DEXTERITY)) @@ -130,7 +134,3 @@ return CONTEXTUAL_SCREENTIP_SET return NONE - -/// Calld on the atom after it has been successfully rotated -/atom/movable/proc/post_rotation(mob/user, degrees) - return diff --git a/code/datums/storage/storage.dm b/code/datums/storage/storage.dm index cbb36a9662e..7d524ecee0b 100644 --- a/code/datums/storage/storage.dm +++ b/code/datums/storage/storage.dm @@ -158,7 +158,7 @@ for(var/mob/person as anything in is_using) hide_contents(person) - LAZYNULL(is_using) + LAZYCLEARLIST(is_using) QDEL_LIST_ASSOC_VAL(storage_interfaces) parent = null @@ -1110,7 +1110,8 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches) if (!LAZYLEN(storage_interfaces) || isnull(storage_interfaces[to_hide])) return TRUE - LAZYREMOVE(is_using, to_hide) + if(LAZYLEN(is_using)) + is_using -= to_hide if(to_hide.client) to_hide.client.screen -= storage_interfaces[to_hide].list_ui_elements() diff --git a/code/game/objects/items/storage/belt.dm b/code/game/objects/items/storage/belt.dm index bc9727453e6..00b49c8913c 100644 --- a/code/game/objects/items/storage/belt.dm +++ b/code/game/objects/items/storage/belt.dm @@ -343,7 +343,7 @@ /obj/item/storage/belt/champion/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -2) + AddElement(/datum/element/adjust_fishing_difficulty, -2) /obj/item/storage/belt/military name = "chest rig" diff --git a/code/game/objects/items/storage/toolboxes/fishing.dm b/code/game/objects/items/storage/toolboxes/fishing.dm index 884649be939..445630647a4 100644 --- a/code/game/objects/items/storage/toolboxes/fishing.dm +++ b/code/game/objects/items/storage/toolboxes/fishing.dm @@ -13,7 +13,7 @@ /obj/item/storage/toolbox/fishing/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier, ITEM_SLOT_HANDS) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier, ITEM_SLOT_HANDS) /obj/item/storage/toolbox/fishing/PopulateContents() new /obj/item/bait_can/worm(src) diff --git a/code/game/objects/items/teleportation.dm b/code/game/objects/items/teleportation.dm index 18eabb3f816..cc212fe91c7 100644 --- a/code/game/objects/items/teleportation.dm +++ b/code/game/objects/items/teleportation.dm @@ -351,7 +351,7 @@ attempt_teleport(user = user, triggered_by_emp = FALSE) return TRUE -/obj/item/syndicate_teleporter/process(seconds_per_tick, times_fired) +/obj/item/syndicate_teleporter/process(seconds_per_tick) if(SPT_PROB(10, seconds_per_tick) && charges < max_charges) charges++ if(ishuman(loc)) diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index 637910ce9e4..de97a131d81 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -27,7 +27,7 @@ fishing_modifier -= 8 MakeRotate() if(can_buckle && fishing_modifier) - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier) /obj/structure/chair/buckle_feedback(mob/living/being_buckled, mob/buckler) if(HAS_TRAIT(being_buckled, TRAIT_RESTRAINED)) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index cd4cf9e9600..f293b86e8e5 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -41,7 +41,7 @@ /obj/structure/closet/crate/Initialize(mapload) AddElement(/datum/element/climbable, climb_time = crate_climb_time, climb_stun = 0) //add element in closed state before parent init opens it(if it does) if(elevation) - AddComponent(/datum/component/climb_walkable) + AddElement(/datum/element/climb_walkable) AddElement(/datum/element/elevation, pixel_shift = elevation) . = ..() diff --git a/code/game/objects/structures/platform.dm b/code/game/objects/structures/platform.dm index ab4cea5cfb6..af788a50b69 100644 --- a/code/game/objects/structures/platform.dm +++ b/code/game/objects/structures/platform.dm @@ -45,7 +45,7 @@ register_context() update_appearance(UPDATE_OVERLAYS) - AddComponent(/datum/component/climb_walkable) + AddElement(/datum/element/climb_walkable) AddElement(/datum/element/climbable) AddElement(/datum/element/elevation, pixel_shift = 12) AddElement(/datum/element/give_turf_traits, string_list(turf_traits)) diff --git a/code/game/objects/structures/steps.dm b/code/game/objects/structures/steps.dm index 70eee9cb3d7..2940392a15d 100644 --- a/code/game/objects/structures/steps.dm +++ b/code/game/objects/structures/steps.dm @@ -16,7 +16,7 @@ ) AddElement(/datum/element/connect_loc, loc_connections) - AddComponent(/datum/component/climb_walkable) + AddElement(/datum/element/climb_walkable) AddElement(/datum/element/simple_rotation) register_context() diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 635276a9aaf..6345ae1b92f 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -109,7 +109,7 @@ ///Adds the element used to make the object climbable, and also the one that shift the mob buckled to it up. /obj/structure/table/proc/make_climbable() - AddComponent(/datum/component/climb_walkable) + AddElement(/datum/element/climb_walkable) AddElement(/datum/element/climbable) AddElement(/datum/element/elevation, pixel_shift = 12) @@ -136,7 +136,7 @@ //proc that removes elements present in now-flipped tables /obj/structure/table/proc/flip_table(new_dir = SOUTH) playsound(src, flipped_table_sound, 100) - qdel(GetComponent(/datum/component/climb_walkable)) + RemoveElement(/datum/element/climb_walkable) RemoveElement(/datum/element/climbable) RemoveElement(/datum/element/footstep_override, priority = STEP_SOUND_TABLE_PRIORITY) RemoveElement(/datum/element/give_turf_traits, turf_traits) diff --git a/code/game/objects/structures/toiletbong.dm b/code/game/objects/structures/toiletbong.dm index 664cf9a0010..4ff8aabe6a7 100644 --- a/code/game/objects/structures/toiletbong.dm +++ b/code/game/objects/structures/toiletbong.dm @@ -12,7 +12,7 @@ /obj/structure/toiletbong/Initialize(mapload) . = ..() - AddElement(/datum/element/simple_rotation) + AddElement(/datum/element/simple_rotation, post_rotation_proccall = PROC_REF(post_rotation)) create_storage(storage_type = /datum/storage/toiletbong) weed_overlay = mutable_appearance('icons/obj/watercloset.dmi', "[base_icon_state]_overlay") @@ -83,7 +83,7 @@ return ITEM_INTERACT_SUCCESS ///Called in the simple rotation's post_rotation callback, playing a sound cue to players. -/obj/structure/toiletbong/post_rotation(mob/user, degrees) +/obj/structure/toiletbong/proc/post_rotation(mob/user, degrees) playsound(src, 'sound/items/deconstruct.ogg', 50) /obj/structure/toiletbong/crowbar_act(mob/living/user, obj/item/tool) diff --git a/code/game/objects/structures/transit_tubes/transit_tube_construction.dm b/code/game/objects/structures/transit_tubes/transit_tube_construction.dm index 199345a5d6c..34db3f53a45 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube_construction.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube_construction.dm @@ -27,7 +27,7 @@ return FALSE return TRUE -/obj/structure/c_transit_tube/post_rotation(mob/user, degrees) +/obj/structure/c_transit_tube/proc/post_rotation(mob/user, degrees) if(flipped_build_type && degrees == ROTATION_FLIP) setDir(turn(dir, degrees)) //Turn back we don't actually flip flipped = !flipped diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 5cff79f59c3..9caca0a8174 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -69,7 +69,7 @@ flags_1 |= ALLOW_DARK_PAINTS_1 RegisterSignal(src, COMSIG_OBJ_PAINTED, PROC_REF(on_painted)) AddElement(/datum/element/atmos_sensitive, mapload) - AddElement(/datum/element/simple_rotation, ROTATION_NEEDS_ROOM) + AddElement(/datum/element/simple_rotation, ROTATION_NEEDS_ROOM, post_rotation_proccall = PROC_REF(post_rotation)) var/static/list/loc_connections = list( COMSIG_ATOM_EXIT = PROC_REF(on_exit), @@ -360,7 +360,7 @@ dropped_debris += new /obj/item/stack/rods(location, (fulltile ? 2 : 1)) return dropped_debris -/obj/structure/window/post_rotation(mob/user, degrees) +/obj/structure/window/proc/post_rotation(mob/user, degrees) air_update_turf(TRUE, FALSE) /obj/structure/window/proc/on_painted(obj/structure/window/source, mob/user, obj/item/toy/crayon/spraycan/spraycan, is_dark_color) diff --git a/code/modules/basketball/hoop.dm b/code/modules/basketball/hoop.dm index b1963a050b2..7302a9fd416 100644 --- a/code/modules/basketball/hoop.dm +++ b/code/modules/basketball/hoop.dm @@ -26,7 +26,7 @@ /obj/structure/hoop/Initialize(mapload) . = ..() - AddElement(/datum/element/simple_rotation, ROTATION_REQUIRE_WRENCH|ROTATION_IGNORE_ANCHORED) + AddElement(/datum/element/simple_rotation, ROTATION_REQUIRE_WRENCH|ROTATION_IGNORE_ANCHORED, post_rotation_proccall = PROC_REF(post_rotation)) update_appearance() register_context() @@ -34,7 +34,7 @@ context[SCREENTIP_CONTEXT_CTRL_LMB] = "Reset score" return CONTEXTUAL_SCREENTIP_SET -/obj/structure/hoop/post_rotation(mob/user, degrees) +/obj/structure/hoop/proc/post_rotation(mob/user, degrees) update_appearance() /obj/structure/hoop/proc/score(obj/item/toy/basketball/ball, mob/living/baller, points) diff --git a/code/modules/clothing/ears/_ears.dm b/code/modules/clothing/ears/_ears.dm index a5a654687c5..63fa58c0c15 100644 --- a/code/modules/clothing/ears/_ears.dm +++ b/code/modules/clothing/ears/_ears.dm @@ -27,7 +27,7 @@ . = ..() AddElement(/datum/element/earhealing) AddComponent(/datum/component/wearertargeting/earprotection) - AddComponent(/datum/component/adjust_fishing_difficulty, -2) + AddElement(/datum/element/adjust_fishing_difficulty, -2) /obj/item/clothing/ears/earmuffs/debug name = "debug earmuffs" diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index d4815c69faf..f37cd9838f9 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -503,7 +503,7 @@ /obj/item/clothing/glasses/welding/Initialize(mapload) . = ..() if(!up) - AddComponent(/datum/component/adjust_fishing_difficulty, 8) + AddElement(/datum/element/adjust_fishing_difficulty, 8) /obj/item/clothing/glasses/welding/attack_self(mob/living/user) adjust_visor(user) @@ -511,9 +511,9 @@ /obj/item/clothing/glasses/welding/adjust_visor(mob/user) . = ..() if(up) - qdel(GetComponent(/datum/component/adjust_fishing_difficulty)) + RemoveElement(/datum/element/adjust_fishing_difficulty) else - AddComponent(/datum/component/adjust_fishing_difficulty, 8) + AddElement(/datum/element/adjust_fishing_difficulty, 8) /obj/item/clothing/glasses/welding/update_icon_state() . = ..() @@ -536,7 +536,7 @@ /obj/item/clothing/glasses/blindfold/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 8) + AddElement(/datum/element/adjust_fishing_difficulty, 8) /obj/item/clothing/glasses/trickblindfold name = "blindfold" @@ -711,7 +711,7 @@ /obj/item/clothing/glasses/debug/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -15) + AddElement(/datum/element/adjust_fishing_difficulty, -15) /obj/item/clothing/glasses/debug/click_alt(mob/user) if(!ishuman(user)) @@ -784,7 +784,7 @@ /obj/item/clothing/glasses/nightmare_vision/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 13) + AddElement(/datum/element/adjust_fishing_difficulty, 13) /obj/item/clothing/glasses/nightmare_vision/Destroy() QDEL_NULL(stored_hallucination) diff --git a/code/modules/clothing/gloves/bone.dm b/code/modules/clothing/gloves/bone.dm index f429d938241..5b333276f15 100644 --- a/code/modules/clothing/gloves/bone.dm +++ b/code/modules/clothing/gloves/bone.dm @@ -15,7 +15,7 @@ /obj/item/clothing/gloves/bracer/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 2) + AddElement(/datum/element/adjust_fishing_difficulty, 2) /datum/armor/gloves_bracer melee = 15 diff --git a/code/modules/clothing/gloves/botany.dm b/code/modules/clothing/gloves/botany.dm index ba3d777fb0d..29780edaf42 100644 --- a/code/modules/clothing/gloves/botany.dm +++ b/code/modules/clothing/gloves/botany.dm @@ -14,7 +14,7 @@ /obj/item/clothing/gloves/botanic_leather/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -4) + AddElement(/datum/element/adjust_fishing_difficulty, -4) /datum/armor/gloves_botanic_leather bio = 50 diff --git a/code/modules/clothing/gloves/boxing.dm b/code/modules/clothing/gloves/boxing.dm index cfad83432e7..9b3c54b901d 100644 --- a/code/modules/clothing/gloves/boxing.dm +++ b/code/modules/clothing/gloves/boxing.dm @@ -20,7 +20,7 @@ ) AddComponent(/datum/component/martial_art_giver, style_to_give) - AddComponent(/datum/component/adjust_fishing_difficulty, 19) + AddElement(/datum/element/adjust_fishing_difficulty, 19) /obj/item/clothing/gloves/boxing/evil name = "evil boxing gloves" diff --git a/code/modules/clothing/gloves/color.dm b/code/modules/clothing/gloves/color.dm index bcaa124e487..178ce23c826 100644 --- a/code/modules/clothing/gloves/color.dm +++ b/code/modules/clothing/gloves/color.dm @@ -44,7 +44,7 @@ /obj/item/clothing/gloves/fingerless/Initialize(mapload) . = ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/gripperoffbrand) - AddComponent(/datum/component/adjust_fishing_difficulty, -4) + AddElement(/datum/element/adjust_fishing_difficulty, -4) AddElement( /datum/element/slapcrafting,\ diff --git a/code/modules/clothing/gloves/combat.dm b/code/modules/clothing/gloves/combat.dm index 5ae715e1320..de5316a255d 100644 --- a/code/modules/clothing/gloves/combat.dm +++ b/code/modules/clothing/gloves/combat.dm @@ -27,7 +27,7 @@ /obj/item/clothing/gloves/combat/wizard/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) //something something wizard casting + AddElement(/datum/element/adjust_fishing_difficulty, -5) //something something wizard casting /obj/item/clothing/gloves/combat/floortile name = "floortile camouflage gloves" @@ -37,4 +37,4 @@ /obj/item/clothing/gloves/combat/floortile/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) //tacticool + AddElement(/datum/element/adjust_fishing_difficulty, -5) //tacticool diff --git a/code/modules/clothing/gloves/insulated.dm b/code/modules/clothing/gloves/insulated.dm index c3d44c9c760..334541df35a 100644 --- a/code/modules/clothing/gloves/insulated.dm +++ b/code/modules/clothing/gloves/insulated.dm @@ -18,15 +18,17 @@ /obj/item/clothing/gloves/color/yellow/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 10) + AddElement(/datum/element/adjust_fishing_difficulty, 10) /obj/item/clothing/gloves/color/yellow/apply_fantasy_bonuses(bonus) . = ..() if(bonus >= 10) - qdel(GetComponent(/datum/component/adjust_fishing_difficulty)) + RemoveElement(/datum/element/adjust_fishing_difficulty) /obj/item/clothing/gloves/color/yellow/remove_fantasy_bonuses(bonus) - AddComponent(/datum/component/adjust_fishing_difficulty, 10) + if(bonus >= 10) + RemoveElement(/datum/element/adjust_fishing_difficulty) + AddElement(/datum/element/adjust_fishing_difficulty, 10) return ..() /datum/armor/color_yellow @@ -135,7 +137,7 @@ /obj/item/clothing/gloves/cut/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) + AddElement(/datum/element/adjust_fishing_difficulty, -5) /obj/item/clothing/gloves/cut/heirloom desc = "The old gloves your great grandfather stole from Engineering, many moons ago. They've seen some tough times recently." @@ -155,4 +157,4 @@ /obj/item/clothing/gloves/chief_engineer/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -6) + AddElement(/datum/element/adjust_fishing_difficulty, -6) diff --git a/code/modules/clothing/gloves/punch_mitts.dm b/code/modules/clothing/gloves/punch_mitts.dm index 2d1a345dd70..5bfb6560a75 100644 --- a/code/modules/clothing/gloves/punch_mitts.dm +++ b/code/modules/clothing/gloves/punch_mitts.dm @@ -9,7 +9,7 @@ /obj/item/clothing/gloves/fingerless/punch_mitts/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -6) + AddElement(/datum/element/adjust_fishing_difficulty, -6) AddComponent(/datum/component/martial_art_giver, /datum/martial_art/boxing/hunter) /datum/armor/gloves_mitts diff --git a/code/modules/clothing/gloves/special.dm b/code/modules/clothing/gloves/special.dm index 875fdcfda52..4619ebcf485 100644 --- a/code/modules/clothing/gloves/special.dm +++ b/code/modules/clothing/gloves/special.dm @@ -14,7 +14,7 @@ . = ..() RegisterSignal(src, COMSIG_ITEM_EQUIPPED, PROC_REF(on_glove_equip)) RegisterSignal(src, COMSIG_ITEM_POST_UNEQUIP, PROC_REF(on_glove_unequip)) - AddComponent(/datum/component/adjust_fishing_difficulty, 19) + AddElement(/datum/element/adjust_fishing_difficulty, 19) /// Called when the glove is equipped. Adds a component to the equipper and stores a weak reference to it. /obj/item/clothing/gloves/cargo_gauntlet/proc/on_glove_equip(datum/source, mob/equipper, slot) @@ -60,7 +60,7 @@ /obj/item/clothing/gloves/rapid/Initialize(mapload) . = ..() AddComponent(/datum/component/wearertargeting/punchcooldown) - AddComponent(/datum/component/adjust_fishing_difficulty, -9) + AddElement(/datum/element/adjust_fishing_difficulty, -9) /obj/item/clothing/gloves/radio name = "translation gloves" @@ -79,7 +79,7 @@ /obj/item/clothing/gloves/race/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -9) + AddElement(/datum/element/adjust_fishing_difficulty, -9) /obj/item/clothing/gloves/captain desc = "Regal blue gloves, with a nice gold trim, a diamond anti-shock coating, and an integrated thermal barrier. Swanky." @@ -99,7 +99,7 @@ /obj/item/clothing/gloves/captain/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -6) + AddElement(/datum/element/adjust_fishing_difficulty, -6) /datum/armor/captain_gloves bio = 90 @@ -131,7 +131,7 @@ /obj/item/clothing/gloves/latex/nitrile/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -6) + AddElement(/datum/element/adjust_fishing_difficulty, -6) /obj/item/clothing/gloves/latex/coroner name = "coroner's gloves" @@ -174,7 +174,7 @@ /obj/item/clothing/gloves/atmos/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 6) + AddElement(/datum/element/adjust_fishing_difficulty, 6) ///A pair of gloves that both allow the user to fish without the need of a held fishing rod and provides athletics experience. /obj/item/clothing/gloves/fishing @@ -187,7 +187,7 @@ /obj/item/clothing/gloves/fishing/Initialize(mapload) . = ..() AddComponent(/datum/component/profound_fisher, new /obj/item/fishing_rod/mob_fisher/athletic(src)) - AddComponent(/datum/component/adjust_fishing_difficulty, -4) //on top of the extra that you get from the athletics skill. + AddElement(/datum/element/adjust_fishing_difficulty, -4) //on top of the extra that you get from the athletics skill. /obj/item/clothing/gloves/fishing/equipped(mob/user, slot) . = ..() diff --git a/code/modules/clothing/gloves/tacklers.dm b/code/modules/clothing/gloves/tacklers.dm index 9564c20bfde..cc4ec1337c3 100644 --- a/code/modules/clothing/gloves/tacklers.dm +++ b/code/modules/clothing/gloves/tacklers.dm @@ -28,7 +28,7 @@ /obj/item/clothing/gloves/tackler/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) //fishing tackle equipment (ba dum tsh) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier) //fishing tackle equipment (ba dum tsh) /obj/item/clothing/gloves/tackler/Destroy() tackler = null diff --git a/code/modules/clothing/head/collectable.dm b/code/modules/clothing/head/collectable.dm index 8c10a3126d5..90f85d352f0 100644 --- a/code/modules/clothing/head/collectable.dm +++ b/code/modules/clothing/head/collectable.dm @@ -117,7 +117,7 @@ /obj/item/clothing/head/collectable/pirate/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -4) + AddElement(/datum/element/adjust_fishing_difficulty, -4) /obj/item/clothing/head/collectable/kitty name = "collectable kitty ears" @@ -143,7 +143,7 @@ /obj/item/clothing/head/collectable/wizard/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -2) + AddElement(/datum/element/adjust_fishing_difficulty, -2) /obj/item/clothing/head/collectable/hardhat name = "collectable hard hat" @@ -192,4 +192,4 @@ /obj/item/clothing/head/collectable/swat/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 2) + AddElement(/datum/element/adjust_fishing_difficulty, 2) diff --git a/code/modules/clothing/head/fedora.dm b/code/modules/clothing/head/fedora.dm index 468464a4678..a05d5fdb031 100644 --- a/code/modules/clothing/head/fedora.dm +++ b/code/modules/clothing/head/fedora.dm @@ -38,7 +38,7 @@ /obj/item/clothing/head/fedora/carpskin/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -6) + AddElement(/datum/element/adjust_fishing_difficulty, -6) /obj/item/clothing/head/fedora/beige/press name = "press fedora" diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm index 7d0eebf9663..052947d94c4 100644 --- a/code/modules/clothing/head/hardhat.dm +++ b/code/modules/clothing/head/hardhat.dm @@ -253,7 +253,7 @@ /obj/item/clothing/head/utility/hardhat/pumpkinhead/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 3) + AddElement(/datum/element/adjust_fishing_difficulty, 3) /obj/item/clothing/head/utility/hardhat/pumpkinhead/set_light_on(new_value) . = ..() diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index ddf8b5f019e..66b5703c492 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -263,7 +263,7 @@ /obj/item/clothing/head/helmet/toggleable/riot/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 2) + AddElement(/datum/element/adjust_fishing_difficulty, 2) /datum/armor/toggleable_riot melee = 50 @@ -358,7 +358,7 @@ /obj/item/clothing/head/helmet/swat/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 3) + AddElement(/datum/element/adjust_fishing_difficulty, 3) /datum/armor/helmet_swat melee = 40 @@ -509,7 +509,7 @@ /obj/item/clothing/head/helmet/knight/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 3) + AddElement(/datum/element/adjust_fishing_difficulty, 3) /datum/armor/helmet_knight melee = 50 diff --git a/code/modules/clothing/head/jobs.dm b/code/modules/clothing/head/jobs.dm index ff8c725218f..b7dc17cce85 100644 --- a/code/modules/clothing/head/jobs.dm +++ b/code/modules/clothing/head/jobs.dm @@ -647,7 +647,7 @@ /obj/item/clothing/head/utility/surgerycap/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -3) //FISH DOCTOR?! + AddElement(/datum/element/adjust_fishing_difficulty, -3) //FISH DOCTOR?! /obj/item/clothing/head/utility/surgerycap/attack_self(mob/user) . = ..() @@ -696,7 +696,7 @@ /obj/item/clothing/head/utility/head_mirror/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -3) //FISH DOCTOR?! + AddElement(/datum/element/adjust_fishing_difficulty, -3) //FISH DOCTOR?! /obj/item/clothing/head/utility/head_mirror/examine(mob/user) . = ..() diff --git a/code/modules/clothing/head/moth.dm b/code/modules/clothing/head/moth.dm index 9cfdd8470b0..bc191179618 100644 --- a/code/modules/clothing/head/moth.dm +++ b/code/modules/clothing/head/moth.dm @@ -15,4 +15,4 @@ /obj/item/clothing/head/mothcap/original/Initialize(mapload) . = ..() AddComponent(/datum/component/scope, range_modifier = 1.2, zoom_method = ZOOM_METHOD_ITEM_ACTION, item_action_type = /datum/action/item_action/hands_free/moth_googles) - AddComponent(/datum/component/adjust_fishing_difficulty, -4) + AddElement(/datum/element/adjust_fishing_difficulty, -4) diff --git a/code/modules/clothing/head/perceptomatrix.dm b/code/modules/clothing/head/perceptomatrix.dm index ad8036d7b17..b2cdb061bdf 100644 --- a/code/modules/clothing/head/perceptomatrix.dm +++ b/code/modules/clothing/head/perceptomatrix.dm @@ -66,7 +66,7 @@ . = ..() update_appearance(UPDATE_ICON_STATE) update_anomaly_state() - AddComponent(/datum/component/adjust_fishing_difficulty, -7) // PSYCHIC FISHING + AddElement(/datum/element/adjust_fishing_difficulty, -7) // PSYCHIC FISHING AddComponent(/datum/component/hat_stabilizer, loose_hat = TRUE) /obj/item/clothing/head/helmet/perceptomatrix/equipped(mob/living/user, slot) diff --git a/code/modules/clothing/head/pirate.dm b/code/modules/clothing/head/pirate.dm index 9aec619d8a3..e4ce10dd9a1 100644 --- a/code/modules/clothing/head/pirate.dm +++ b/code/modules/clothing/head/pirate.dm @@ -7,7 +7,7 @@ /obj/item/clothing/head/costume/pirate/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) + AddElement(/datum/element/adjust_fishing_difficulty, -5) /obj/item/clothing/head/costume/pirate/equipped(mob/user, slot) . = ..() diff --git a/code/modules/clothing/head/soft_caps.dm b/code/modules/clothing/head/soft_caps.dm index a074358e379..4fd6e439b35 100644 --- a/code/modules/clothing/head/soft_caps.dm +++ b/code/modules/clothing/head/soft_caps.dm @@ -166,7 +166,7 @@ . = ..() AddComponent(/datum/component/speechmod, replacements = strings("crustacean_replacement.json", "crustacean")) //you asked for this. AddElement(/datum/element/skill_reward, /datum/skill/fishing) - AddComponent(/datum/component/adjust_fishing_difficulty, -5) + AddElement(/datum/element/adjust_fishing_difficulty, -5) #define PROPHAT_MOOD "prophat" diff --git a/code/modules/clothing/head/welding.dm b/code/modules/clothing/head/welding.dm index 000448fd725..05532aa1a22 100644 --- a/code/modules/clothing/head/welding.dm +++ b/code/modules/clothing/head/welding.dm @@ -21,7 +21,7 @@ /obj/item/clothing/head/utility/welding/Initialize(mapload) . = ..() if(!up) - AddComponent(/datum/component/adjust_fishing_difficulty, 8) + AddElement(/datum/element/adjust_fishing_difficulty, 8) /datum/armor/utility_welding melee = 10 @@ -34,9 +34,9 @@ /obj/item/clothing/head/utility/welding/adjust_visor(mob/user) . = ..() if(up) - qdel(GetComponent(/datum/component/adjust_fishing_difficulty)) + RemoveElement(/datum/element/adjust_fishing_difficulty) else - AddComponent(/datum/component/adjust_fishing_difficulty, 8) + AddElement(/datum/element/adjust_fishing_difficulty, 8) /obj/item/clothing/head/utility/welding/update_icon_state() . = ..() diff --git a/code/modules/clothing/masks/animal_masks.dm b/code/modules/clothing/masks/animal_masks.dm index 2913ae101ff..6c29d85e86b 100644 --- a/code/modules/clothing/masks/animal_masks.dm +++ b/code/modules/clothing/masks/animal_masks.dm @@ -154,15 +154,17 @@ GLOBAL_LIST_INIT(cursed_animal_masks, list( /obj/item/clothing/mask/animal/frog/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, cursed ? 4 : -4) + AddElement(/datum/element/adjust_fishing_difficulty, cursed ? 4 : -4) /obj/item/clothing/mask/animal/frog/make_cursed() . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 4) + RemoveElement(/datum/element/adjust_fishing_difficulty, -4) + AddElement(/datum/element/adjust_fishing_difficulty, 4) /obj/item/clothing/mask/animal/frog/clear_curse() . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -4) + RemoveElement(/datum/element/adjust_fishing_difficulty, 4) + AddElement(/datum/element/adjust_fishing_difficulty, -4) /obj/item/clothing/mask/animal/frog/cursed cursed = TRUE @@ -244,15 +246,17 @@ GLOBAL_LIST_INIT(cursed_animal_masks, list( /obj/item/clothing/mask/animal/small/bear/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, cursed ? 4 : -4) + AddElement(/datum/element/adjust_fishing_difficulty, cursed ? 4 : -4) /obj/item/clothing/mask/animal/small/bear/make_cursed() . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 4) + RemoveElement(/datum/element/adjust_fishing_difficulty, -4) + AddElement(/datum/element/adjust_fishing_difficulty, 4) /obj/item/clothing/mask/animal/small/bear/clear_curse() . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -4) + RemoveElement(/datum/element/adjust_fishing_difficulty, 4) + AddElement(/datum/element/adjust_fishing_difficulty, -4) /obj/item/clothing/mask/animal/small/bear/cursed cursed = TRUE @@ -304,15 +308,17 @@ GLOBAL_LIST_INIT(cursed_animal_masks, list( /obj/item/clothing/mask/animal/small/tribal/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, cursed ? 5 : -5) + AddElement(/datum/element/adjust_fishing_difficulty, cursed ? 5 : -5) /obj/item/clothing/mask/animal/small/tribal/make_cursed() . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 5) + RemoveElement(/datum/element/adjust_fishing_difficulty, -5) + AddElement(/datum/element/adjust_fishing_difficulty, 5) /obj/item/clothing/mask/animal/small/tribal/clear_curse() . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) + RemoveElement(/datum/element/adjust_fishing_difficulty, 5) + AddElement(/datum/element/adjust_fishing_difficulty, -5) /obj/item/clothing/mask/animal/small/tribal/cursed //adminspawn only. cursed = TRUE diff --git a/code/modules/clothing/masks/boxing.dm b/code/modules/clothing/masks/boxing.dm index b28645da3a5..ffdc90aed37 100644 --- a/code/modules/clothing/masks/boxing.dm +++ b/code/modules/clothing/masks/boxing.dm @@ -26,7 +26,7 @@ /obj/item/clothing/mask/floortilebalaclava/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) //tacticool + AddElement(/datum/element/adjust_fishing_difficulty, -5) //tacticool /obj/item/clothing/mask/floortilebalaclava/attack_self(mob/user) adjust_visor(user) diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index 33aabab75ed..9c1ba74d210 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -48,7 +48,7 @@ GLOBAL_LIST_INIT(clown_mask_options, list( AddComponent(/datum/component/clothing_dirt, dirt_state) if(fishing_modifier) - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier) if(!max_filters || !starting_filter_type) return @@ -249,9 +249,9 @@ GLOBAL_LIST_INIT(clown_mask_options, list( if(!fishing_modifier) return if(up) - qdel(GetComponent(/datum/component/adjust_fishing_difficulty)) + RemoveElement(/datum/element/adjust_fishing_difficulty) else - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier) /obj/item/clothing/mask/gas/welding/update_icon_state() . = ..() diff --git a/code/modules/clothing/neck/_neck.dm b/code/modules/clothing/neck/_neck.dm index f1262789608..49f5a7412b7 100644 --- a/code/modules/clothing/neck/_neck.dm +++ b/code/modules/clothing/neck/_neck.dm @@ -238,7 +238,7 @@ /obj/item/clothing/neck/stethoscope/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -3) //FISH DOCTOR?! + AddElement(/datum/element/adjust_fishing_difficulty, -3) //FISH DOCTOR?! /obj/item/clothing/neck/stethoscope/suicide_act(mob/living/carbon/user) user.visible_message(span_suicide("[user] puts \the [src] to [user.p_their()] chest! It looks like [user.p_they()] won't hear much!")) diff --git a/code/modules/clothing/shoes/boots.dm b/code/modules/clothing/shoes/boots.dm index 19ecbb55e94..17957869608 100644 --- a/code/modules/clothing/shoes/boots.dm +++ b/code/modules/clothing/shoes/boots.dm @@ -77,7 +77,7 @@ /obj/item/clothing/shoes/jackboots/floortile/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) //tacticool + AddElement(/datum/element/adjust_fishing_difficulty, -5) //tacticool /obj/item/clothing/shoes/winterboots name = "winter boots" @@ -192,7 +192,7 @@ /obj/item/clothing/shoes/pirate/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -4) + AddElement(/datum/element/adjust_fishing_difficulty, -4) /obj/item/clothing/shoes/pirate/armored armor_type = /datum/armor/shoes_pirate diff --git a/code/modules/clothing/shoes/clown.dm b/code/modules/clothing/shoes/clown.dm index 04c35a90941..29e635f695b 100644 --- a/code/modules/clothing/shoes/clown.dm +++ b/code/modules/clothing/shoes/clown.dm @@ -15,7 +15,7 @@ create_storage(storage_type = /datum/storage/pockets/shoes/clown) LoadComponent(/datum/component/squeak, squeak_sound, 50, falloff_exponent = 20) //die off quick please AddElement(/datum/element/swabable, CELL_LINE_TABLE_CLOWN, CELL_VIRUS_TABLE_GENERIC, rand(2,3), 0) - AddComponent(/datum/component/adjust_fishing_difficulty, 3) //Goofy + AddElement(/datum/element/adjust_fishing_difficulty, 3) //Goofy AddElement(/datum/element/ignites_matches) /obj/item/clothing/shoes/clown_shoes/equipped(mob/living/user, slot) diff --git a/code/modules/clothing/shoes/costume.dm b/code/modules/clothing/shoes/costume.dm index bc361e3685b..9e490239b4f 100644 --- a/code/modules/clothing/shoes/costume.dm +++ b/code/modules/clothing/shoes/costume.dm @@ -47,7 +47,7 @@ /obj/item/clothing/shoes/bronze/Initialize(mapload) . = ..() AddComponent(/datum/component/squeak, list('sound/machines/clockcult/integration_cog_install.ogg' = 1, 'sound/effects/magic/clockwork/fellowship_armory.ogg' = 1), 50, extrarange = SHORT_RANGE_SOUND_EXTRARANGE) - AddComponent(/datum/component/adjust_fishing_difficulty, 4) + AddElement(/datum/element/adjust_fishing_difficulty, 4) /obj/item/clothing/shoes/cookflops desc = "All this talk of antags, greytiding, and griefing... I just wanna grill for god's sake!" @@ -130,7 +130,7 @@ create_storage(storage_type = /datum/storage/pockets/shoes) LoadComponent(/datum/component/squeak, list('sound/effects/quack.ogg' = 1), 50, falloff_exponent = 20) - AddComponent(/datum/component/adjust_fishing_difficulty, -7) //deploy tactical duckling lure + AddElement(/datum/element/adjust_fishing_difficulty, -7) //deploy tactical duckling lure /obj/item/clothing/shoes/ducky_shoes/equipped(mob/living/user, slot) . = ..() diff --git a/code/modules/clothing/shoes/galoshes.dm b/code/modules/clothing/shoes/galoshes.dm index 7b866d3ef41..16a0c873387 100644 --- a/code/modules/clothing/shoes/galoshes.dm +++ b/code/modules/clothing/shoes/galoshes.dm @@ -17,7 +17,7 @@ /obj/item/clothing/shoes/galoshes/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier) /obj/item/clothing/shoes/galoshes/dry name = "absorbent galoshes" diff --git a/code/modules/clothing/shoes/laceup.dm b/code/modules/clothing/shoes/laceup.dm index 706071de102..94c79f3e76e 100644 --- a/code/modules/clothing/shoes/laceup.dm +++ b/code/modules/clothing/shoes/laceup.dm @@ -7,4 +7,4 @@ /obj/item/clothing/shoes/laceup/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 3) //You aren't going to fish with these are you? + AddElement(/datum/element/adjust_fishing_difficulty, 3) //You aren't going to fish with these are you? diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index b6227c6266f..ad31dff4ed2 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -30,7 +30,7 @@ AddElement(/datum/element/update_icon_updates_onmob) RegisterSignal(src, COMSIG_SPEED_POTION_APPLIED, PROC_REF(on_speed_potioned)) if(fishing_modifier) - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier) /// Signal handler for [COMSIG_SPEED_POTION_APPLIED]. Speed potion removes the active slowdown /obj/item/clothing/shoes/magboots/proc/on_speed_potioned(datum/source) @@ -40,9 +40,9 @@ slowdown_active = 0 if(magpulse && magpulse_fishing_modifier) - qdel(GetComponent(/datum/component/adjust_fishing_difficulty)) + RemoveElement(/datum/element/adjust_fishing_difficulty) if(fishing_modifier) - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier) magpulse_fishing_modifier = fishing_modifier /obj/item/clothing/shoes/magboots/verb/toggle() @@ -60,14 +60,14 @@ attach_clothing_traits(active_traits) slowdown += slowdown_active if(magpulse_fishing_modifier) - AddComponent(/datum/component/adjust_fishing_difficulty, magpulse_fishing_modifier) + AddElement(/datum/element/adjust_fishing_difficulty, magpulse_fishing_modifier) else if(magpulse_fishing_modifier != fishing_modifier) - qdel(GetComponent(/datum/component/adjust_fishing_difficulty)) + RemoveElement(/datum/element/adjust_fishing_difficulty) else if(fishing_modifier) - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier) else if(magpulse_fishing_modifier != fishing_modifier) - qdel(GetComponent(/datum/component/adjust_fishing_difficulty)) + RemoveElement(/datum/element/adjust_fishing_difficulty) detach_clothing_traits(active_traits) slowdown -= slowdown_active diff --git a/code/modules/clothing/spacesuits/_spacesuits.dm b/code/modules/clothing/spacesuits/_spacesuits.dm index a68b57456e0..d269dfae05e 100644 --- a/code/modules/clothing/spacesuits/_spacesuits.dm +++ b/code/modules/clothing/spacesuits/_spacesuits.dm @@ -38,7 +38,7 @@ if(visor_dirt) AddComponent(/datum/component/clothing_dirt, visor_dirt) if(fishing_modifier) - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier) add_stabilizer() /obj/item/clothing/head/helmet/space/proc/add_stabilizer(loose_hat = TRUE) @@ -102,7 +102,7 @@ cell = new cell(src) if(fishing_modifier) - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier) /obj/item/clothing/suit/space/on_outfit_equip(mob/living/carbon/human/outfit_wearer, visuals_only, item_slot) . = ..() diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index 3fc343810cb..acd57c27990 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -301,7 +301,7 @@ /obj/item/clothing/suit/armor/riot/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 5) + AddElement(/datum/element/adjust_fishing_difficulty, 5) init_rustle_component() /obj/item/clothing/suit/armor/riot/proc/init_rustle_component() @@ -428,7 +428,7 @@ /obj/item/clothing/suit/armor/swat/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 5) + AddElement(/datum/element/adjust_fishing_difficulty, 5) init_rustle_component() /obj/item/clothing/suit/armor/swat/proc/init_rustle_component() @@ -724,7 +724,7 @@ /obj/item/clothing/suit/armor/vest/military/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 5) + AddElement(/datum/element/adjust_fishing_difficulty, 5) /datum/armor/military melee = 45 diff --git a/code/modules/clothing/suits/bio.dm b/code/modules/clothing/suits/bio.dm index a6f0e7807bd..07a56424834 100644 --- a/code/modules/clothing/suits/bio.dm +++ b/code/modules/clothing/suits/bio.dm @@ -18,7 +18,7 @@ . = ..() if (dirt_state) AddComponent(/datum/component/clothing_dirt, dirt_state) - AddComponent(/datum/component/adjust_fishing_difficulty, 6) + AddElement(/datum/element/adjust_fishing_difficulty, 6) AddComponent(/datum/component/hat_stabilizer, loose_hat = TRUE) /datum/armor/head_bio_hood @@ -46,7 +46,7 @@ /obj/item/clothing/suit/bio_suit/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 6) + AddElement(/datum/element/adjust_fishing_difficulty, 6) //Standard biosuit, orange stripe /datum/armor/suit_bio_suit diff --git a/code/modules/clothing/suits/costume.dm b/code/modules/clothing/suits/costume.dm index 42ddf3fa285..f63e2ffecd6 100644 --- a/code/modules/clothing/suits/costume.dm +++ b/code/modules/clothing/suits/costume.dm @@ -280,7 +280,7 @@ /obj/item/clothing/suit/hooded/carp_costume/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -4) + AddElement(/datum/element/adjust_fishing_difficulty, -4) /obj/item/clothing/head/hooded/carp_hood name = "carp hood" @@ -296,7 +296,7 @@ /obj/item/clothing/head/hooded/carp_hood/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) + AddElement(/datum/element/adjust_fishing_difficulty, -5) /obj/item/clothing/head/hooded/carp_hood/equipped(mob/living/carbon/human/user, slot) ..() @@ -416,7 +416,7 @@ /obj/item/clothing/suit/hooded/shark_costume/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -4) + AddElement(/datum/element/adjust_fishing_difficulty, -4) /obj/item/clothing/head/hooded/shark_hood name = "shark hood" @@ -430,7 +430,7 @@ /obj/item/clothing/head/hooded/shark_hood/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) + AddElement(/datum/element/adjust_fishing_difficulty, -5) /obj/item/clothing/suit/hooded/shork_costume // Oh God Why name = "shork costume" @@ -445,7 +445,7 @@ /obj/item/clothing/suit/hooded/shork_costume/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 4) + AddElement(/datum/element/adjust_fishing_difficulty, 4) /obj/item/clothing/head/hooded/shork_hood name = "shork hood" @@ -459,7 +459,7 @@ /obj/item/clothing/head/hooded/shork_hood/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 5) + AddElement(/datum/element/adjust_fishing_difficulty, 5) /obj/item/clothing/suit/hooded/bloated_human //OH MY GOD WHAT HAVE YOU DONE!?!?!? name = "bloated human suit" @@ -630,7 +630,7 @@ /obj/item/clothing/suit/costume/hawaiian/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) + AddElement(/datum/element/adjust_fishing_difficulty, -5) allowed += GLOB.personal_carry_allowed /obj/item/clothing/suit/costume/football_armor diff --git a/code/modules/clothing/suits/ethereal.dm b/code/modules/clothing/suits/ethereal.dm index 680bc001c08..bd5e7d84cfe 100644 --- a/code/modules/clothing/suits/ethereal.dm +++ b/code/modules/clothing/suits/ethereal.dm @@ -15,7 +15,7 @@ /obj/item/clothing/suit/hooded/ethereal_raincoat/Initialize(mapload) . = ..() update_icon(UPDATE_OVERLAYS) - AddComponent(/datum/component/adjust_fishing_difficulty, -5) + AddElement(/datum/element/adjust_fishing_difficulty, -5) /obj/item/clothing/suit/hooded/ethereal_raincoat/worn_overlays(mutable_appearance/standing, isinhands, icon_file) . = ..() @@ -35,7 +35,7 @@ /obj/item/clothing/suit/hooded/ethereal_raincoat/trailwarden/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -7) + AddElement(/datum/element/adjust_fishing_difficulty, -7) /obj/item/clothing/suit/hooded/ethereal_raincoat/trailwarden/equipped(mob/living/user, slot) . = ..() @@ -58,4 +58,4 @@ /obj/item/clothing/head/hooded/ethereal_rainhood/trailwarden/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -6) + AddElement(/datum/element/adjust_fishing_difficulty, -6) diff --git a/code/modules/clothing/suits/ghostsheet.dm b/code/modules/clothing/suits/ghostsheet.dm index d5d9c370ae9..85c3cfed3f8 100644 --- a/code/modules/clothing/suits/ghostsheet.dm +++ b/code/modules/clothing/suits/ghostsheet.dm @@ -16,7 +16,7 @@ . = ..() if(check_holidays(HALLOWEEN)) update_icon(UPDATE_OVERLAYS) - AddComponent(/datum/component/adjust_fishing_difficulty, 8) + AddElement(/datum/element/adjust_fishing_difficulty, 8) /obj/item/clothing/suit/costume/ghost_sheet/worn_overlays(mutable_appearance/standing, isinhands, icon_file) . = ..() diff --git a/code/modules/clothing/suits/jobs.dm b/code/modules/clothing/suits/jobs.dm index 2a1b30d0017..663ac5db102 100644 --- a/code/modules/clothing/suits/jobs.dm +++ b/code/modules/clothing/suits/jobs.dm @@ -58,7 +58,7 @@ /obj/item/clothing/suit/apron/overalls/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -4) + AddElement(/datum/element/adjust_fishing_difficulty, -4) //Captain /obj/item/clothing/suit/jacket/capjacket @@ -364,7 +364,7 @@ /obj/item/clothing/suit/apron/surgical/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -3) // FISH DOCTOR?! + AddElement(/datum/element/adjust_fishing_difficulty, -3) // FISH DOCTOR?! //Curator /obj/item/clothing/suit/jacket/curator diff --git a/code/modules/clothing/suits/labcoat.dm b/code/modules/clothing/suits/labcoat.dm index f7f15d69a22..4478a429a40 100644 --- a/code/modules/clothing/suits/labcoat.dm +++ b/code/modules/clothing/suits/labcoat.dm @@ -41,7 +41,7 @@ /obj/item/clothing/suit/toggle/labcoat/cmo/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -3) //FISH DOCTOR?! + AddElement(/datum/element/adjust_fishing_difficulty, -3) //FISH DOCTOR?! /datum/armor/toggle_labcoat bio = 50 @@ -62,7 +62,7 @@ /obj/item/clothing/suit/toggle/labcoat/paramedic/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -3) //FISH DOCTOR?! + AddElement(/datum/element/adjust_fishing_difficulty, -3) //FISH DOCTOR?! allowed += /obj/item/crowbar/power/paramedic /obj/item/clothing/suit/toggle/labcoat/mad diff --git a/code/modules/clothing/suits/moth.dm b/code/modules/clothing/suits/moth.dm index 5a95a3945e0..58c73c88597 100644 --- a/code/modules/clothing/suits/moth.dm +++ b/code/modules/clothing/suits/moth.dm @@ -19,7 +19,7 @@ /obj/item/clothing/suit/mothcoat/original/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) + AddElement(/datum/element/adjust_fishing_difficulty, -5) create_storage(storage_type = /datum/storage/pockets) /obj/item/clothing/suit/mothcoat/winter diff --git a/code/modules/clothing/suits/utility.dm b/code/modules/clothing/suits/utility.dm index b16526d29be..3910d121246 100644 --- a/code/modules/clothing/suits/utility.dm +++ b/code/modules/clothing/suits/utility.dm @@ -41,7 +41,7 @@ /obj/item/clothing/suit/utility/fire/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 7) + AddElement(/datum/element/adjust_fishing_difficulty, 7) /datum/armor/utility_fire melee = 15 @@ -107,7 +107,7 @@ /obj/item/clothing/head/utility/bomb_hood/Initialize(mapload) . = ..() AddComponent(/datum/component/clothing_dirt, "bomb_dirt") - AddComponent(/datum/component/adjust_fishing_difficulty, 8) + AddElement(/datum/element/adjust_fishing_difficulty, 8) AddComponent(/datum/component/hat_stabilizer, loose_hat = TRUE) /datum/armor/utility_bomb_hood @@ -140,7 +140,7 @@ /obj/item/clothing/suit/utility/bomb_suit/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 8) + AddElement(/datum/element/adjust_fishing_difficulty, 8) /datum/armor/utility_bomb_suit melee = 20 @@ -186,7 +186,7 @@ /obj/item/clothing/head/utility/radiation/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 7) + AddElement(/datum/element/adjust_fishing_difficulty, 7) AddComponent(/datum/component/hat_stabilizer, loose_hat = TRUE) AddElement(/datum/element/radiation_protected_clothing) AddComponent(/datum/component/clothing_dirt, "rad_dirt") @@ -219,4 +219,4 @@ /obj/item/clothing/suit/utility/radiation/Initialize(mapload) . = ..() AddElement(/datum/element/radiation_protected_clothing) - AddComponent(/datum/component/adjust_fishing_difficulty, 7) + AddElement(/datum/element/adjust_fishing_difficulty, 7) diff --git a/code/modules/clothing/suits/wintercoats.dm b/code/modules/clothing/suits/wintercoats.dm index 751597c54e0..7a9640f5900 100644 --- a/code/modules/clothing/suits/wintercoats.dm +++ b/code/modules/clothing/suits/wintercoats.dm @@ -419,7 +419,7 @@ /obj/item/clothing/suit/hooded/wintercoat/medical/paramedic/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -3) //mirrored from jacket + AddElement(/datum/element/adjust_fishing_difficulty, -3) //mirrored from jacket allowed += /obj/item/crowbar/power/paramedic /obj/item/clothing/head/hooded/winterhood/medical/paramedic diff --git a/code/modules/clothing/suits/wiz_robe.dm b/code/modules/clothing/suits/wiz_robe.dm index fedcbc28b02..49c10d2eb9a 100644 --- a/code/modules/clothing/suits/wiz_robe.dm +++ b/code/modules/clothing/suits/wiz_robe.dm @@ -16,7 +16,7 @@ /obj/item/clothing/head/wizard/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) //A wizard always practices his casting (ba dum tsh) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier) //A wizard always practices his casting (ba dum tsh) /datum/armor/head_wizard melee = 30 @@ -128,7 +128,7 @@ /obj/item/clothing/suit/wizrobe/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) //A wizard always practices his casting (ba dum tsh) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier) //A wizard always practices his casting (ba dum tsh) /datum/armor/suit_wizrobe melee = 30 diff --git a/code/modules/clothing/under/jobs/civilian/curator.dm b/code/modules/clothing/under/jobs/civilian/curator.dm index a4cc66f2d2e..f2af7ace09f 100644 --- a/code/modules/clothing/under/jobs/civilian/curator.dm +++ b/code/modules/clothing/under/jobs/civilian/curator.dm @@ -30,7 +30,7 @@ /obj/item/clothing/under/rank/civilian/curator/treasure_hunter/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) + AddElement(/datum/element/adjust_fishing_difficulty, -5) /obj/item/clothing/under/rank/civilian/curator/nasa name = "\improper NASA jumpsuit" diff --git a/code/modules/clothing/under/jobs/medical.dm b/code/modules/clothing/under/jobs/medical.dm index 6cf86c8770e..42d3c7aa8cf 100644 --- a/code/modules/clothing/under/jobs/medical.dm +++ b/code/modules/clothing/under/jobs/medical.dm @@ -47,7 +47,7 @@ /obj/item/clothing/under/rank/medical/chief_medical_officer/scrubs/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -3) //FISH DOCTOR?! + AddElement(/datum/element/adjust_fishing_difficulty, -3) //FISH DOCTOR?! /obj/item/clothing/under/rank/medical/chief_medical_officer/turtleneck name = "chief medical officer's turtleneck" @@ -89,7 +89,7 @@ /obj/item/clothing/under/rank/medical/scrubs/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -3) //FISH DOCTOR?! + AddElement(/datum/element/adjust_fishing_difficulty, -3) //FISH DOCTOR?! /obj/item/clothing/under/rank/medical/scrubs/blue desc = "It's made of a special fiber that provides minor protection against biohazards. This one is in baby blue." diff --git a/code/modules/clothing/under/miscellaneous.dm b/code/modules/clothing/under/miscellaneous.dm index 91ca031837f..e403716603f 100644 --- a/code/modules/clothing/under/miscellaneous.dm +++ b/code/modules/clothing/under/miscellaneous.dm @@ -64,7 +64,7 @@ /obj/item/clothing/under/misc/adminsuit/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -25) + AddElement(/datum/element/adjust_fishing_difficulty, -25) /datum/armor/clothing_under/adminsuit melee = 100 diff --git a/code/modules/clothing/under/skirt_dress.dm b/code/modules/clothing/under/skirt_dress.dm index 68503be3255..34a492e2b56 100644 --- a/code/modules/clothing/under/skirt_dress.dm +++ b/code/modules/clothing/under/skirt_dress.dm @@ -48,7 +48,7 @@ /obj/item/clothing/under/dress/wedding_dress/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 4) //You aren't going to fish with this are you? + AddElement(/datum/element/adjust_fishing_difficulty, 4) //You aren't going to fish with this are you? /obj/item/clothing/under/dress/eveninggown name = "evening gown" @@ -65,7 +65,7 @@ /obj/item/clothing/under/dress/eveninggown/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 4) //You aren't going to fish with this are you? + AddElement(/datum/element/adjust_fishing_difficulty, 4) //You aren't going to fish with this are you? /obj/item/clothing/under/dress/skirt name = "cardigan skirt" diff --git a/code/modules/clothing/under/suits.dm b/code/modules/clothing/under/suits.dm index 5f388987a4b..f77114d4aab 100644 --- a/code/modules/clothing/under/suits.dm +++ b/code/modules/clothing/under/suits.dm @@ -101,7 +101,7 @@ /obj/item/clothing/under/suit/tuxedo/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, 4) //You aren't going to fish with this are you? + AddElement(/datum/element/adjust_fishing_difficulty, 4) //You aren't going to fish with this are you? /obj/item/clothing/under/suit/carpskin name = "carpskin suit" @@ -112,4 +112,4 @@ /obj/item/clothing/under/suit/carpskin/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -4) + AddElement(/datum/element/adjust_fishing_difficulty, -4) diff --git a/code/modules/clothing/under/syndicate.dm b/code/modules/clothing/under/syndicate.dm index 65a0400ed45..5d2f301484a 100644 --- a/code/modules/clothing/under/syndicate.dm +++ b/code/modules/clothing/under/syndicate.dm @@ -36,7 +36,7 @@ /obj/item/clothing/under/syndicate/bloodred/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -4) //extra-tactical + AddElement(/datum/element/adjust_fishing_difficulty, -4) //extra-tactical /datum/armor/clothing_under/syndicate_bloodred melee = 10 @@ -125,7 +125,7 @@ /obj/item/clothing/under/syndicate/floortilecamo/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -5) //tacticool + AddElement(/datum/element/adjust_fishing_difficulty, -5) //tacticool /obj/item/clothing/under/syndicate/soviet name = "Ratnik 5 tracksuit" @@ -170,7 +170,7 @@ /obj/item/clothing/under/syndicate/scrubs/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -3) //FISH DOCTOR?! + AddElement(/datum/element/adjust_fishing_difficulty, -3) //FISH DOCTOR?! /datum/armor/clothing_under/syndicate_scrubs melee = 10 diff --git a/code/modules/fishing/aquarium/fish_analyzer.dm b/code/modules/fishing/aquarium/fish_analyzer.dm index 64b4798e911..401b1c67ef9 100644 --- a/code/modules/fishing/aquarium/fish_analyzer.dm +++ b/code/modules/fishing/aquarium/fish_analyzer.dm @@ -41,7 +41,7 @@ register_item_context() update_appearance() - AddComponent(/datum/component/adjust_fishing_difficulty, -3, ITEM_SLOT_HANDS) + AddElement(/datum/element/adjust_fishing_difficulty, -3, ITEM_SLOT_HANDS) /obj/item/fish_analyzer/Destroy() scanned_object = null diff --git a/code/modules/fishing/fish_catalog.dm b/code/modules/fishing/fish_catalog.dm index dd7a03cc53b..511d7bb8e65 100644 --- a/code/modules/fishing/fish_catalog.dm +++ b/code/modules/fishing/fish_catalog.dm @@ -8,7 +8,7 @@ /obj/item/book/manual/fish_catalog/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, -7, ITEM_SLOT_HANDS) + AddElement(/datum/element/adjust_fishing_difficulty, -7, ITEM_SLOT_HANDS) /obj/item/book/manual/fish_catalog/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) diff --git a/code/modules/fishing/fishing_equipment.dm b/code/modules/fishing/fishing_equipment.dm index 421f4c66f67..ba8b590b5e4 100644 --- a/code/modules/fishing/fishing_equipment.dm +++ b/code/modules/fishing/fishing_equipment.dm @@ -482,7 +482,7 @@ /obj/item/storage/bag/fishing/Initialize(mapload) . = ..() - AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier, ITEM_SLOT_HANDS) + AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier, ITEM_SLOT_HANDS) /obj/item/storage/bag/fishing/carpskin name = "carpskin fishing bag" diff --git a/code/modules/fishing/fishing_minigame.dm b/code/modules/fishing/fishing_minigame.dm index 74aad213448..f45918e3309 100644 --- a/code/modules/fishing/fishing_minigame.dm +++ b/code/modules/fishing/fishing_minigame.dm @@ -60,7 +60,7 @@ GLOBAL_LIST_EMPTY(fishing_challenges_by_user) /// The last time we clicked during the baiting phase var/last_baiting_click /// Fishing mob - var/mob/user + var/mob/living/user /// Rod that is used for the challenge var/obj/item/fishing_rod/used_rod /// float visual @@ -120,7 +120,7 @@ GLOBAL_LIST_EMPTY(fishing_challenges_by_user) ///Keep track of the fish source from which we're pulling the reward var/datum/fish_source/fish_source -/datum/fishing_challenge/New(datum/component/fishing_spot/comp, obj/item/fishing_rod/rod, mob/user) +/datum/fishing_challenge/New(datum/component/fishing_spot/comp, obj/item/fishing_rod/rod, mob/living/user) src.user = user used_rod = rod location = comp.parent @@ -200,12 +200,10 @@ GLOBAL_LIST_EMPTY(fishing_challenges_by_user) if(fish_source) fish_source.UnregisterSignal(src, list( COMSIG_FISHING_CHALLENGE_ROLL_REWARD, - COMSIG_FISHING_CHALLENGE_GET_DIFFICULTY, )) fish_source.UnregisterSignal(user, COMSIG_MOB_COMPLETE_FISHING) fish_source = new_fish_source fish_source.RegisterSignal(src, COMSIG_FISHING_CHALLENGE_ROLL_REWARD, TYPE_PROC_REF(/datum/fish_source, roll_reward_minigame)) - fish_source.RegisterSignal(src, COMSIG_FISHING_CHALLENGE_GET_DIFFICULTY, TYPE_PROC_REF(/datum/fish_source, calculate_difficulty_minigame)) fish_source.RegisterSignal(user, COMSIG_MOB_COMPLETE_FISHING, TYPE_PROC_REF(/datum/fish_source, on_challenge_completed)) /datum/fishing_challenge/proc/send_alert(message) @@ -302,7 +300,7 @@ GLOBAL_LIST_EMPTY(fishing_challenges_by_user) user.balloon_alert(user, "interrupted!") interrupt() -/datum/fishing_challenge/proc/handle_click(mob/source, atom/target, modifiers) +/datum/fishing_challenge/proc/handle_click(mob/living/source, atom/target, modifiers) SIGNAL_HANDLER if(HAS_TRAIT(source, TRAIT_HANDS_BLOCKED)) //blocked, can't do stuff return @@ -337,11 +335,11 @@ GLOBAL_LIST_EMPTY(fishing_challenges_by_user) experience_multiplier *= 0.5 complete(FALSE) -/datum/fishing_challenge/proc/on_attack_self(obj/item/source, mob/user) +/datum/fishing_challenge/proc/on_attack_self(obj/item/source, mob/living/user) SIGNAL_HANDLER INVOKE_ASYNC(src, PROC_REF(stop_fishing), source, user) -/datum/fishing_challenge/proc/stop_fishing(obj/item/rod, mob/user) +/datum/fishing_challenge/proc/stop_fishing(obj/item/rod, mob/living/user) if((phase != MINIGAME_PHASE || do_after(user, 3 SECONDS, rod)) && !QDELETED(src) && !completed) experience_multiplier *= 0.5 send_alert("stopped fishing") @@ -378,11 +376,11 @@ GLOBAL_LIST_EMPTY(fishing_challenges_by_user) playsound(location, 'sound/effects/bigsplash.ogg', 100) var/valid_achievement_catch = FALSE - if (ispath(reward_path, /obj/item/fish)) + if(ispath(reward_path, /obj/item/fish)) valid_achievement_catch = TRUE - else if (isfish(reward_path)) + else if(isfish(reward_path)) var/obj/item/fish/fishy_individual = reward_path - if (!HAS_TRAIT(fishy_individual, TRAIT_NO_FISHING_ACHIEVEMENT) && fishy_individual.status == FISH_ALIVE) + if(!HAS_TRAIT(fishy_individual, TRAIT_NO_FISHING_ACHIEVEMENT) && fishy_individual.status == FISH_ALIVE) valid_achievement_catch = TRUE if(valid_achievement_catch) @@ -515,14 +513,16 @@ GLOBAL_LIST_EMPTY(fishing_challenges_by_user) reward.damage_fish(damage) /datum/fishing_challenge/proc/get_difficulty() - var/list/difficulty_holder = list(0) - SEND_SIGNAL(src, COMSIG_FISHING_CHALLENGE_GET_DIFFICULTY, reward_path, used_rod, user, difficulty_holder) - difficulty = difficulty_holder[1] + var/new_difficulty = fish_source?.calculate_difficulty_minigame(src, reward_path, used_rod, user) || initial(difficulty) + for(var/source, modifier in user?.fishing_difficulty_mods_by_source) + new_difficulty += modifier + //If you manage to be so well-equipped and skilled to completely crush the difficulty, just skip to the reward. - if(difficulty <= 0) + if(new_difficulty <= 0) complete(TRUE) return FALSE - difficulty = clamp(round(difficulty), FISHING_MINIMUM_DIFFICULTY, 100) + + difficulty = clamp(round(new_difficulty), FISHING_MINIMUM_DIFFICULTY, 100) return TRUE /datum/fishing_challenge/proc/update_difficulty() diff --git a/code/modules/fishing/sources/_fish_source.dm b/code/modules/fishing/sources/_fish_source.dm index 5c7db3668c1..adf82d77aae 100644 --- a/code/modules/fishing/sources/_fish_source.dm +++ b/code/modules/fishing/sources/_fish_source.dm @@ -159,15 +159,22 @@ GLOBAL_LIST_INIT(specific_fish_icons, generate_specific_fish_icons()) /datum/fish_source/proc/on_start_fishing(obj/item/fishing_rod/rod, mob/fisherman, atom/parent) return -///Comsig proc from the fishing minigame for 'calculate_difficulty' -/datum/fish_source/proc/calculate_difficulty_minigame(datum/fishing_challenge/challenge, reward_path, obj/item/fishing_rod/rod, mob/fisherman, list/difficulty_holder) - SIGNAL_HANDLER +/** + * Calculates the difficulty of the minigame: + * + * This includes the source's fishing difficulty, that of the fish, the rod, + * favorite and disliked baits, fish traits and the fisherman skill. + * + * This is the version to call while we are in the fishing minigame phase. + */ +/datum/fish_source/proc/calculate_difficulty_minigame(datum/fishing_challenge/challenge, reward_path, obj/item/fishing_rod/rod, mob/fisherman) SHOULD_NOT_OVERRIDE(TRUE) - difficulty_holder[1] += calculate_difficulty(reward_path, rod, fisherman) + . = 0 // begin with a fresh calculation each time + . += calculate_difficulty(reward_path, rod, fisherman) // Difficulty modifier added by the fisher's skill level if(!(challenge.special_effects & FISHING_MINIGAME_RULE_NO_EXP)) - difficulty_holder[1] += fisherman.mind?.get_skill_modifier(/datum/skill/fishing, SKILL_VALUE_MODIFIER) + . += fisherman.mind?.get_skill_modifier(/datum/skill/fishing, SKILL_VALUE_MODIFIER) if(challenge.special_effects & FISHING_MINIGAME_RULE_KILL) challenge.RegisterSignal(src, COMSIG_FISH_SOURCE_REWARD_DISPENSED, TYPE_PROC_REF(/datum/fishing_challenge, hurt_fish)) diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 4aa9fe381e7..f8ac8fa8d01 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -256,3 +256,6 @@ /// how many tiles can this mob reach with their hands? 1 tile is adjacent. var/reach_length = 1 + + /// Lazy assoc list of currently applied fishing difficulty modifiers keyed to their source + var/list/fishing_difficulty_mods_by_source diff --git a/code/modules/mob/living/living_item_handling.dm b/code/modules/mob/living/living_item_handling.dm index 6363fa53bed..482e0099491 100644 --- a/code/modules/mob/living/living_item_handling.dm +++ b/code/modules/mob/living/living_item_handling.dm @@ -214,7 +214,6 @@ offered_item.do_pickup_animation(src, offerer) put_in_hands(offered_item) - /mob/living/click_ctrl_shift(mob/user) if(HAS_TRAIT(src, TRAIT_CAN_HOLD_ITEMS)) var/mob/living/living_user = user diff --git a/code/modules/mod/modules/modules_general.dm b/code/modules/mod/modules/modules_general.dm index e9f6d1543a7..cc1f4dc03df 100644 --- a/code/modules/mod/modules/modules_general.dm +++ b/code/modules/mod/modules/modules_general.dm @@ -1008,14 +1008,14 @@ var/obj/item/gloves = mod.get_part_from_slot(ITEM_SLOT_GLOVES) if(!gloves) return - gloves.AddComponent(/datum/component/adjust_fishing_difficulty, -5) + gloves.AddElement(/datum/element/adjust_fishing_difficulty, -5) if(equipped) gloves.AddComponent(/datum/component/profound_fisher, equipped, delete_rod_when_deleted = FALSE) /obj/item/mod/module/fishing_glove/on_part_deactivation(deleting = FALSE) var/obj/item/gloves = mod.get_part_from_slot(ITEM_SLOT_GLOVES) if(gloves && !deleting) - qdel(gloves.GetComponent(/datum/component/adjust_fishing_difficulty)) + gloves.RemoveElement(/datum/element/adjust_fishing_difficulty) qdel(gloves.GetComponent(/datum/component/profound_fisher)) /obj/item/mod/module/shock_absorber diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index eddeafe8371..f03559062ff 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -1274,8 +1274,9 @@ . = ..() affected_mob.remove_status_effect(/datum/status_effect/jitter) if(affected_mob.has_dna()) - var/list/mutations = affected_mob.dna.mutations || list() - affected_mob.dna.remove_mutation_group(mutations - affected_mob.dna.get_mutation(/datum/mutation/race), GLOB.standard_mutation_sources) + var/list/mutations = affected_mob.dna.mutations + if(LAZYLEN(mutations)) // Don't need to be doing this at all if there are no mutations + affected_mob.dna.remove_mutation_group(mutations - affected_mob.dna.get_mutation(/datum/mutation/race), GLOB.standard_mutation_sources) affected_mob.dna.scrambled = FALSE /datum/reagent/medicine/antihol diff --git a/code/modules/recycling/disposal/construction.dm b/code/modules/recycling/disposal/construction.dm index a36d785cf09..a56b07ca8a0 100644 --- a/code/modules/recycling/disposal/construction.dm +++ b/code/modules/recycling/disposal/construction.dm @@ -33,7 +33,7 @@ pipename = initial(pipe_type.name) - AddElement(/datum/element/simple_rotation) + AddElement(/datum/element/simple_rotation, post_rotation_proccall = PROC_REF(post_rotation)) AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) // this only gets used by pipes created by RPDs or pipe dispensers @@ -88,7 +88,7 @@ dpdir |= REVERSE_DIR(dir) return dpdir -/obj/structure/disposalconstruct/post_rotation(mob/user, degrees) +/obj/structure/disposalconstruct/proc/post_rotation(mob/user, degrees) if(degrees == ROTATION_FLIP) var/obj/structure/disposalpipe/temp = pipe_type if(initial(temp.flip_type)) diff --git a/tgstation.dme b/tgstation.dme index 12d3c7e0b2a..239e7c82735 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1082,7 +1082,6 @@ #include "code\datums\components\_component.dm" #include "code\datums\components\acid.dm" #include "code\datums\components\action_item_overlay.dm" -#include "code\datums\components\adjust_fishing_difficulty.dm" #include "code\datums\components\admin_popup.dm" #include "code\datums\components\aggro_emote.dm" #include "code\datums\components\ai_has_target_timer.dm" @@ -1127,7 +1126,6 @@ #include "code\datums\components\chuunibyou.dm" #include "code\datums\components\cleaner.dm" #include "code\datums\components\clickbox.dm" -#include "code\datums\components\climb_walkable.dm" #include "code\datums\components\clothing_dirt.dm" #include "code\datums\components\clothing_fov_visor.dm" #include "code\datums\components\codeword_hearing.dm" @@ -1483,6 +1481,7 @@ #include "code\datums\dna\blocks\dna_identity_block.dm" #include "code\datums\elements\_element.dm" #include "code\datums\elements\above_mob_drop.dm" +#include "code\datums\elements\adjust_fishing_difficulty.dm" #include "code\datums\elements\ai_control_examine.dm" #include "code\datums\elements\ai_flee_while_injured.dm" #include "code\datums\elements\ai_held_item.dm" @@ -1522,6 +1521,7 @@ #include "code\datums\elements\chewable.dm" #include "code\datums\elements\cleaning.dm" #include "code\datums\elements\cliff_walker.dm" +#include "code\datums\elements\climb_walkable.dm" #include "code\datums\elements\climbable.dm" #include "code\datums\elements\connect_loc.dm" #include "code\datums\elements\consumable_mob.dm"