From 50465b2801f421e4df1176dc9f2ae78dd2ad67fa Mon Sep 17 00:00:00 2001 From: InsightfulParasite Date: Sat, 21 Oct 2023 17:11:57 -0400 Subject: [PATCH] Manager Commands Now Glow --- .../tegu_items/gadgets/unpowered.dm | 44 ++++--- .../game/machinery/computer/manager_camera.dm | 113 +++++------------- .../temporary_visuals/miscellaneous.dm | 33 +++++ 3 files changed, 82 insertions(+), 108 deletions(-) diff --git a/ModularTegustation/tegu_items/gadgets/unpowered.dm b/ModularTegustation/tegu_items/gadgets/unpowered.dm index e1beedea043a..20843a84299e 100644 --- a/ModularTegustation/tegu_items/gadgets/unpowered.dm +++ b/ModularTegustation/tegu_items/gadgets/unpowered.dm @@ -62,14 +62,18 @@ var/commandtype = 1 var/commanddelay = 1.5 SECONDS var/cooldown = 0 - var/static/list/commandtypes = typecacheof(list( - /obj/effect/temp_visual/commandMove, - /obj/effect/temp_visual/commandWarn, - /obj/effect/temp_visual/commandGaurd, - /obj/effect/temp_visual/commandHeal, - /obj/effect/temp_visual/commandFightA, - /obj/effect/temp_visual/commandFightB - )) + var/maxcommands = 3 + //List of existing commands. Used for limiting the amount of commands that can exist. + var/list/current_commands = list() + //Command Types that can be deployed. Listed in order of commandtype. + var/list/commandtypes = list( + /obj/effect/temp_visual/HoloCommand/commandMove, + /obj/effect/temp_visual/HoloCommand/commandWarn, + /obj/effect/temp_visual/HoloCommand/commandGaurd, + /obj/effect/temp_visual/HoloCommand/commandHeal, + /obj/effect/temp_visual/HoloCommand/commandFightA, + /obj/effect/temp_visual/HoloCommand/commandFightB + ) /obj/item/commandprojector/attack_self(mob/user) ..() @@ -99,24 +103,16 @@ /obj/item/commandprojector/afterattack(atom/target, mob/user, proximity_flag) . = ..() - if(cooldown <= world.time) - for(var/obj/effect/temp_visual/V in range(get_turf(target), 0)) - if(is_type_in_typecache(V, commandtypes)) + if(cooldown <= world.time + listclearnulls(current_commands) + if(current_commands.len <= maxcommands) + for(var/obj/effect/temp_visual/HoloCommand/V in range(get_turf(target), 0)) qdel(V) return - switch(commandtype) - if(1) - new /obj/effect/temp_visual/commandMove(get_turf(target)) - if(2) - new /obj/effect/temp_visual/commandWarn(get_turf(target)) - if(3) - new /obj/effect/temp_visual/commandGaurd(get_turf(target)) - if(4) - new /obj/effect/temp_visual/commandHeal(get_turf(target)) - if(5) - new /obj/effect/temp_visual/commandFightA(get_turf(target)) - if(6) - new /obj/effect/temp_visual/commandFightB(get_turf(target)) + + if(commandtype > 0 && commandtype <= 6) + var/thing_to_spawn = commandtypes[commandtype] + new thing_to_spawn(get_turf(target)) else to_chat(user, "CALIBRATION ERROR.") cooldown = world.time + commanddelay diff --git a/code/game/machinery/computer/manager_camera.dm b/code/game/machinery/computer/manager_camera.dm index de955806e188..c09a74a06cc1 100644 --- a/code/game/machinery/computer/manager_camera.dm +++ b/code/game/machinery/computer/manager_camera.dm @@ -22,16 +22,20 @@ var/commandtype = 1 var/command_delay = 0.5 SECONDS var/command_cooldown + var/maxcommands = 9 ///Variable stolen from AI. Essential for tracking feature. var/static/datum/trackable/track = new - var/static/list/commandtypes = typecacheof(list( - /obj/effect/temp_visual/commandMove, - /obj/effect/temp_visual/commandWarn, - /obj/effect/temp_visual/commandGaurd, - /obj/effect/temp_visual/commandHeal, - /obj/effect/temp_visual/commandFightA, - /obj/effect/temp_visual/commandFightB - )) + //Command Types sorted in order. + var/list/commandtypes = list( + /obj/effect/temp_visual/HoloCommand/commandMove, + /obj/effect/temp_visual/HoloCommand/commandWarn, + /obj/effect/temp_visual/HoloCommand/commandGaurd, + /obj/effect/temp_visual/HoloCommand/commandHeal, + /obj/effect/temp_visual/HoloCommand/commandFightA, + /obj/effect/temp_visual/HoloCommand/commandFightB + ) + //List of existing commands. Used for limiting the amount of commands that can exist. + var/list/current_commands = list() /// Used for radial menu; Type = list(name, desc, icon_state) var/list/bullet_types = list( HP_BULLET = list("name" = "HP-N", "desc" = "These bullets speed up the recovery of an employee.", "icon_state" = "green"), @@ -202,30 +206,23 @@ /obj/machinery/computer/camera_advanced/manager/proc/on_alt_click(mob/living/user, turf/open/T) var/mob/living/C = user - if(command_cooldown <= world.time) - playsound(get_turf(src), 'sound/machines/terminal_success.ogg', 8, 3, 3) - playsound(get_turf(T), 'sound/machines/terminal_success.ogg', 8, 3, 3) - for(var/obj/effect/temp_visual/V in range(T, 0)) - if(is_type_in_typecache(V, commandtypes)) + if(cooldown <= world.time + listclearnulls(current_commands) + if(current_commands.len <= maxcommands) + playsound(get_turf(src), 'sound/machines/terminal_success.ogg', 8, 3, 3) + playsound(get_turf(T), 'sound/machines/terminal_success.ogg', 8, 3, 3) + for(var/obj/effect/temp_visual/HoloCommand/V in range(T, 0)) qdel(V) return - switch(commandtype) - if(1) - new /obj/effect/temp_visual/commandMove(get_turf(T)) - if(2) - new /obj/effect/temp_visual/commandWarn(get_turf(T)) - if(3) - new /obj/effect/temp_visual/commandGaurd(get_turf(T)) - if(4) - new /obj/effect/temp_visual/commandHeal(get_turf(T)) - if(5) - new /obj/effect/temp_visual/commandFightA(get_turf(T)) - if(6) - new /obj/effect/temp_visual/commandFightB(get_turf(T)) + if(commandtype > 0 && commandtype <= 6) + var/thing_to_spawn = commandtypes[commandtype] + var/command_deployed = new thing_to_spawn(get_turf(T)) + current_commands += command_deployed else to_chat(C, "CALIBRATION ERROR.") - commandtimer() + commandtimer() +//Numerical Procs that alter variables /obj/machinery/computer/camera_advanced/manager/proc/commandtimer() command_cooldown = world.time + command_delay return @@ -415,6 +412,7 @@ X.altercommandtype(-5) to_chat(owner, "MOVE IMAGE INITIALIZED.") button_icon_state = button_icon1 + UpdateButtonIcon() /datum/action/innate/managercommand name = "Deploy Command" @@ -430,62 +428,7 @@ var/obj/machinery/computer/camera_advanced/manager/X = E.origin var/cooldown = X.command_cooldown if(cooldown <= world.time) - playsound(get_turf(C), 'sound/machines/terminal_success.ogg', 8, 3, 3) - playsound(get_turf(E), 'sound/machines/terminal_success.ogg', 8, 3, 3) - switch(X.commandtype) - if(1) - new /obj/effect/temp_visual/commandMove(get_turf(E)) - - if(2) - new /obj/effect/temp_visual/commandWarn(get_turf(E)) - - if(3) - new /obj/effect/temp_visual/commandGaurd(get_turf(E)) - - if(4) - new /obj/effect/temp_visual/commandHeal(get_turf(E)) - - if(5) - new /obj/effect/temp_visual/commandFightA(get_turf(E)) - - if(6) - new /obj/effect/temp_visual/commandFightB(get_turf(E)) - - else - to_chat(owner, "CALIBRATION ERROR.") - X.commandtimer() - -// Temp Effects - -/obj/effect/temp_visual/commandMove - icon = 'ModularTegustation/Teguicons/lc13icons.dmi' - icon_state = "Move_here_wagie" - duration = 150 //15 Seconds - -/obj/effect/temp_visual/commandWarn - icon = 'ModularTegustation/Teguicons/lc13icons.dmi' - icon_state = "Watch_out_wagie" - duration = 150 - -/obj/effect/temp_visual/commandGaurd - icon = 'ModularTegustation/Teguicons/lc13icons.dmi' - icon_state = "Guard_this_wagie" - duration = 150 - -/obj/effect/temp_visual/commandHeal - icon = 'ModularTegustation/Teguicons/lc13icons.dmi' - icon_state = "Heal_this_wagie" - duration = 150 - -/obj/effect/temp_visual/commandFightA - icon = 'ModularTegustation/Teguicons/lc13icons.dmi' - icon_state = "Fight_this_wagie1" - duration = 150 - -/obj/effect/temp_visual/commandFightB - icon = 'ModularTegustation/Teguicons/lc13icons.dmi' - icon_state = "Fight_this_wagie2" - duration = 150 + X.on_alt_click(C, get_turf(E)) /turf/open/AltClick(mob/user) SEND_SIGNAL(user, COMSIG_XENO_TURF_CLICK_ALT, src) @@ -499,7 +442,9 @@ #undef PALE_BULLET #undef YELLOW_BULLET -//Manager Camera Tracking Code + /*---------------------------\ + |Manager Camera Tracking Code| + \---------------------------*/ /datum/action/innate/manager_track name = "Follow Creature" desc = "Track a creature." diff --git a/code/game/objects/effects/temporary_visuals/miscellaneous.dm b/code/game/objects/effects/temporary_visuals/miscellaneous.dm index e820e66c72ba..54ae8092b0bc 100644 --- a/code/game/objects/effects/temporary_visuals/miscellaneous.dm +++ b/code/game/objects/effects/temporary_visuals/miscellaneous.dm @@ -987,3 +987,36 @@ /obj/effect/temp_visual/house/proc/FadeOut() animate(src, alpha = 0, time = 1 SECONDS) + +/obj/effect/temp_visual/HoloCommand + icon = 'ModularTegustation/Teguicons/lc13icons.dmi' + light_range = 5 + light_power = 1 + light_system = MOVABLE_LIGHT + duration = 150 //15 Seconds + +/obj/effect/temp_visual/HoloCommand/commandMove + icon_state = "Move_here_wagie" + light_range = 2 + light_power = 1 + light_color = COLOR_VERY_LIGHT_GRAY + +/obj/effect/temp_visual/HoloCommand/commandWarn + icon_state = "Watch_out_wagie" + light_color = COLOR_PALE_RED_GRAY + +/obj/effect/temp_visual/HoloCommand/commandGaurd + icon_state = "Guard_this_wagie" + light_color = COLOR_VERY_SOFT_YELLOW + +/obj/effect/temp_visual/HoloCommand/commandHeal + icon_state = "Heal_this_wagie" + light_color = COLOR_VERY_PALE_LIME_GREEN + +/obj/effect/temp_visual/HoloCommand/commandFightA + icon_state = "Fight_this_wagie1" + light_color = COLOR_PALE_BLUE_GRAY + +/obj/effect/temp_visual/HoloCommand/commandFightB + icon_state = "Fight_this_wagie2" + light_color = COLOR_PALE_BLUE_GRAY