diff --git a/ModularTegustation/tegu_items/gadgets/unpowered.dm b/ModularTegustation/tegu_items/gadgets/unpowered.dm index e1beedea043a..827b5f0fe03e 100644 --- a/ModularTegustation/tegu_items/gadgets/unpowered.dm +++ b/ModularTegustation/tegu_items/gadgets/unpowered.dm @@ -62,14 +62,15 @@ 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 - )) + //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) ..() @@ -100,25 +101,15 @@ /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)) - 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)) - else - to_chat(user, "CALIBRATION ERROR.") + for(var/obj/effect/temp_visual/HoloCommand/V in range(get_turf(target), 0)) + qdel(V) + return + + 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 playsound(src, 'sound/machines/pda_button1.ogg', 20, TRUE) diff --git a/code/game/machinery/computer/manager_camera.dm b/code/game/machinery/computer/manager_camera.dm index de955806e188..87e3174e09ce 100644 --- a/code/game/machinery/computer/manager_camera.dm +++ b/code/game/machinery/computer/manager_camera.dm @@ -24,14 +24,17 @@ var/command_cooldown ///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"), @@ -203,29 +206,19 @@ /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) + for(var/obj/effect/temp_visual/HoloCommand/V in range(T, 0)) + qdel(V) + return 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)) - 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)) - else - to_chat(C, "CALIBRATION ERROR.") + if(commandtype > 0 && commandtype <= 6) + var/thing_to_spawn = commandtypes[commandtype] + new thing_to_spawn(get_turf(T)) + else + to_chat(C, "CALIBRATION ERROR.") commandtimer() +//Numerical Procs that alter variables /obj/machinery/computer/camera_advanced/manager/proc/commandtimer() command_cooldown = world.time + command_delay return @@ -415,6 +408,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 +424,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 +438,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..94cca2f78a25 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 = 2 + light_power = 1 + light_system = MOVABLE_LIGHT + duration = 150 //15 Seconds + +/obj/effect/temp_visual/HoloCommand/commandMove + icon_state = "Move_here_wagie" + light_range = 1 + 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