From 0e5c7041e25eab130b6f917bece6f9b09556c5b2 Mon Sep 17 00:00:00 2001 From: Arkatos1 <43862960+Arkatos1@users.noreply.github.com> Date: Sat, 20 Feb 2021 22:39:17 +0100 Subject: [PATCH] Auxiliary Base construction fixes (#56969) * Base construction fixes --- code/game/objects/items/RCD.dm | 34 ++++++++++++------- .../construction_actions.dm | 14 ++++---- .../construction_console.dm | 16 ++++----- .../construction_console_aux.dm | 0 .../construction_console_centcom.dm | 0 tgstation.dme | 8 ++--- 6 files changed, 41 insertions(+), 31 deletions(-) rename code/game/objects/structures/{construction_consolse => construction_console}/construction_actions.dm (89%) rename code/game/objects/structures/{construction_consolse => construction_console}/construction_console.dm (96%) rename code/game/objects/structures/{construction_consolse => construction_console}/construction_console_aux.dm (100%) rename code/game/objects/structures/{construction_consolse => construction_console}/construction_console_centcom.dm (100%) diff --git a/code/game/objects/items/RCD.dm b/code/game/objects/items/RCD.dm index b23d8531a5a..922b9ffc01d 100644 --- a/code/game/objects/items/RCD.dm +++ b/code/game/objects/items/RCD.dm @@ -194,10 +194,19 @@ RLD else return FALSE -/obj/item/construction/proc/check_menu(mob/living/user) +/** + * Checks if we are allowed to interact with a radial menu + * + * Arguments: + * * user The living mob interacting with the menu + * * remote_anchor The remote anchor for the menu + */ +/obj/item/construction/proc/check_menu(mob/living/user, remote_anchor) if(!istype(user)) return FALSE - if(user.incapacitated() || !user.Adjacent(src)) + if(user.incapacitated()) + return FALSE + if(remote_anchor && user.remote_control != remote_anchor) return FALSE return TRUE @@ -348,7 +357,14 @@ RLD if("WEST") computer_dir = 8 -/obj/item/construction/rcd/proc/change_airlock_setting(mob/user) +/** + * Customizes RCD's airlock settings based on user's choices + * + * Arguments: + * * user The mob that is choosing airlock settings + * * remote_anchor The remote anchor for radial menus. If set, it will also remove proximity restrictions from the menus + */ +/obj/item/construction/rcd/proc/change_airlock_setting(mob/user, remote_anchor) if(!user) return @@ -394,15 +410,11 @@ RLD "External Maintenance" = get_airlock_image(/obj/machinery/door/airlock/maintenance/external/glass) ) - var/airlockcat = show_radial_menu(user, src, solid_or_glass_choices, custom_check = CALLBACK(src, .proc/check_menu, user), require_near = TRUE, tooltips = TRUE) - if(!check_menu(user)) - return + var/airlockcat = show_radial_menu(user, remote_anchor || src, solid_or_glass_choices, custom_check = CALLBACK(src, .proc/check_menu, user, remote_anchor), require_near = remote_anchor ? FALSE : TRUE, tooltips = TRUE) switch(airlockcat) if("Solid") if(advanced_airlock_setting == 1) - var/airlockpaint = show_radial_menu(user, src, solid_choices, radius = 42, custom_check = CALLBACK(src, .proc/check_menu, user), require_near = TRUE, tooltips = TRUE) - if(!check_menu(user)) - return + var/airlockpaint = show_radial_menu(user, remote_anchor || src, solid_choices, radius = 42, custom_check = CALLBACK(src, .proc/check_menu, user, remote_anchor), require_near = remote_anchor ? FALSE : TRUE, tooltips = TRUE) switch(airlockpaint) if("Standard") airlock_type = /obj/machinery/door/airlock @@ -443,9 +455,7 @@ RLD if("Glass") if(advanced_airlock_setting == 1) - var/airlockpaint = show_radial_menu(user, src , glass_choices, radius = 42, custom_check = CALLBACK(src, .proc/check_menu, user), require_near = TRUE, tooltips = TRUE) - if(!check_menu(user)) - return + var/airlockpaint = show_radial_menu(user, remote_anchor || src, glass_choices, radius = 42, custom_check = CALLBACK(src, .proc/check_menu, user, remote_anchor), require_near = remote_anchor ? FALSE : TRUE, tooltips = TRUE) switch(airlockpaint) if("Standard") airlock_type = /obj/machinery/door/airlock/glass diff --git a/code/game/objects/structures/construction_consolse/construction_actions.dm b/code/game/objects/structures/construction_console/construction_actions.dm similarity index 89% rename from code/game/objects/structures/construction_consolse/construction_actions.dm rename to code/game/objects/structures/construction_console/construction_actions.dm index 48d5a75d2ec..16d795b40b8 100644 --- a/code/game/objects/structures/construction_consolse/construction_actions.dm +++ b/code/game/objects/structures/construction_console/construction_actions.dm @@ -1,7 +1,7 @@ /datum/action/innate/camera_off/base_construction name = "Log out" -///Generic construction action for base [construction consoles][/obj/machinery/computer/camera_advanced/base_construction]. +///Generic construction action for base [construction consoles][/obj/machinery/computer/camera_advanced/base_construction]. /datum/action/innate/construction icon_icon = 'icons/mob/actions/actions_construction.dmi' ///Console's eye mob @@ -56,7 +56,7 @@ rcd_target = S //If we don't break out of this loop we'll get the last placed thing owner.changeNext_move(CLICK_CD_RANGE) check_rcd() - base_console.internal_rcd.afterattack(rcd_target, owner, TRUE) //Activate the RCD and force it to work remotely! + base_console.internal_rcd.pre_attack(rcd_target, owner, TRUE) //Activate the RCD and force it to work remotely! playsound(target_turf, 'sound/items/deconstruct.ogg', 60, TRUE) /datum/action/innate/construction/switch_mode @@ -66,10 +66,10 @@ /datum/action/innate/construction/switch_mode/Activate() if(..()) return - var/list/buildlist = list("Walls and Floors" = 1,"Airlocks" = 2,"Deconstruction" = 3,"Windows and Grilles" = 4) - var/buildmode = input("Set construction mode.", "Base Console", null) in buildlist + var/list/buildlist = list("Walls and Floors" = RCD_FLOORWALL, "Airlocks" = RCD_AIRLOCK, "Deconstruction" = RCD_DECONSTRUCT, "Windows and Grilles" = RCD_WINDOWGRILLE) + var/buildmode = input(owner, "Set construction mode.", "Base Console", null) in buildlist check_rcd() - base_console.internal_rcd.mode = buildlist[buildmode] + base_console.internal_rcd.construction_mode = buildlist[buildmode] to_chat(owner, "Build mode is now [buildmode].") /datum/action/innate/construction/airlock_type @@ -80,7 +80,7 @@ if(..()) return check_rcd() - base_console.internal_rcd.change_airlock_setting() + base_console.internal_rcd.change_airlock_setting(owner, remote_eye) /datum/action/innate/construction/window_type name = "Select Window Glass" @@ -90,7 +90,7 @@ if(..()) return check_rcd() - base_console.internal_rcd.toggle_window_glass() + base_console.internal_rcd.toggle_window_glass(owner) ///Generic action used with base construction consoles to build anything that can't be built with an RCD /datum/action/innate/construction/place_structure diff --git a/code/game/objects/structures/construction_consolse/construction_console.dm b/code/game/objects/structures/construction_console/construction_console.dm similarity index 96% rename from code/game/objects/structures/construction_consolse/construction_console.dm rename to code/game/objects/structures/construction_console/construction_console.dm index 056419946da..10c3cd3f43e 100644 --- a/code/game/objects/structures/construction_consolse/construction_console.dm +++ b/code/game/objects/structures/construction_console/construction_console.dm @@ -22,7 +22,7 @@ ///Assoc. list ("structure_name" : count) that keeps track of the number of special structures that can't be built with an RCD, for example, tiny fans or turrets. var/list/structures = list() ///Internal RCD. Some construction actions rely on having this. - var/obj/item/construction/rcd/internal/internal_rcd + var/obj/item/construction/rcd/internal/internal_rcd ///Actions given to the console user to help with base building. Actions are generally carried out at the location of the eyeobj var/list/datum/action/innate/construction_actions @@ -37,7 +37,7 @@ /** * Fill the construction_actios list with actions * - * Instantiate each action object that we'll be giving to users of + * Instantiate each action object that we'll be giving to users of * this console, and put it in the construction actions list. */ /obj/machinery/computer/camera_advanced/base_construction/proc/populate_actions_list() @@ -46,8 +46,8 @@ /** * Reload materials used by the console * - * Restocks any materials used by the base construction console. - * This might mean refilling the internal RCD (should it be initialized), or + * Restocks any materials used by the base construction console. + * This might mean refilling the internal RCD (should it be initialized), or * giving the structures list default values. */ /obj/machinery/computer/camera_advanced/base_construction/proc/restock_materials() @@ -70,7 +70,7 @@ /obj/machinery/computer/camera_advanced/base_construction/attackby(obj/item/W, mob/user, params) //If we have an internal RCD, we can refill it by slapping the console with some materials if(internal_rcd && (istype(W, /obj/item/rcd_ammo) || istype(W, /obj/item/stack/sheet))) - internal_rcd.attackby(W, user, params) + internal_rcd.attackby(W, user, params) else return ..() @@ -98,14 +98,14 @@ * A mob used by [/obj/machinery/computer/camera_advanced/base_construction] for building in specific areas. * * Controlled by a user who is using a base construction console. - * The user will be granted a set of building actions by the console, and the actions will be carried out by this mob. + * The user will be granted a set of building actions by the console, and the actions will be carried out by this mob. * The mob is constrained to a given area defined by the base construction console. * */ /mob/camera/ai_eye/remote/base_construction name = "construction holo-drone" //Allows any curious crew to watch the base after it leaves. (This is safe as the base cannot be modified once it leaves) - move_on_shuttle = TRUE + move_on_shuttle = TRUE icon = 'icons/obj/mining.dmi' icon_state = "construction_drone" ///Reference to the camera console controlling this drone @@ -127,7 +127,7 @@ return ..() ///[Base console's][/obj/machinery/computer/camera_advanced/base_construction] internal RCD. Has a large material capacity and a fast buildspeed. -/obj/item/construction/rcd/internal +/obj/item/construction/rcd/internal name = "internal RCD" max_matter = 600 no_ammo_message = "Internal matter exhausted. Please add additional materials." diff --git a/code/game/objects/structures/construction_consolse/construction_console_aux.dm b/code/game/objects/structures/construction_console/construction_console_aux.dm similarity index 100% rename from code/game/objects/structures/construction_consolse/construction_console_aux.dm rename to code/game/objects/structures/construction_console/construction_console_aux.dm diff --git a/code/game/objects/structures/construction_consolse/construction_console_centcom.dm b/code/game/objects/structures/construction_console/construction_console_centcom.dm similarity index 100% rename from code/game/objects/structures/construction_consolse/construction_console_centcom.dm rename to code/game/objects/structures/construction_console/construction_console_centcom.dm diff --git a/tgstation.dme b/tgstation.dme index 22b5658469b..3dcf9a4819a 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1339,10 +1339,10 @@ #include "code\game\objects\structures\beds_chairs\chair.dm" #include "code\game\objects\structures\beds_chairs\pew.dm" #include "code\game\objects\structures\beds_chairs\sofa.dm" -#include "code\game\objects\structures\construction_consolse\construction_actions.dm" -#include "code\game\objects\structures\construction_consolse\construction_console.dm" -#include "code\game\objects\structures\construction_consolse\construction_console_aux.dm" -#include "code\game\objects\structures\construction_consolse\construction_console_centcom.dm" +#include "code\game\objects\structures\construction_console\construction_actions.dm" +#include "code\game\objects\structures\construction_console\construction_console.dm" +#include "code\game\objects\structures\construction_console\construction_console_aux.dm" +#include "code\game\objects\structures\construction_console\construction_console_centcom.dm" #include "code\game\objects\structures\crates_lockers\closets.dm" #include "code\game\objects\structures\crates_lockers\crates.dm" #include "code\game\objects\structures\crates_lockers\closets\bodybag.dm"