Skip to content

Commit

Permalink
Manager Commands Now Glow
Browse files Browse the repository at this point in the history
Update manager_camera.dm

Egors Suggestion

Manager Commands Now Glow

Update manager_camera.dm
  • Loading branch information
InsightfulParasite committed Nov 18, 2023
1 parent 7d818c0 commit aa31b01
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 133 deletions.
57 changes: 28 additions & 29 deletions ModularTegustation/tegu_items/gadgets/unpowered.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
))
//Used for limiting the amount of commands that can exist.
var/current_commands = 0
var/max_commands = 5
//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)
..()
Expand Down Expand Up @@ -100,30 +104,25 @@
/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, "<span class='warning'>CALIBRATION ERROR.</span>")
for(var/obj/effect/temp_visual/HoloCommand/V in get_turf(target))
qdel(V)
return
if(current_commands >= max_commands)
to_chat(user, "<span class='warning'>COMMAND CAPACITY REACHED.</span>")
return
if(commandtype > 0 && commandtype <= 6)
var/thing_to_spawn = commandtypes[commandtype]
var/thing_spawned = new thing_to_spawn(get_turf(target))
current_commands++
RegisterSignal(thing_spawned, COMSIG_PARENT_QDELETING, .proc/ReduceCommandAmount)
else
to_chat(user, "<span class='warning'>CALIBRATION ERROR.</span>")
cooldown = world.time + commanddelay
playsound(src, 'sound/machines/pda_button1.ogg', 20, TRUE)



/obj/item/commandprojector/proc/ReduceCommandAmount()
SIGNAL_HANDLER
current_commands--

//Deepscanner
/obj/item/deepscanner //intended for ordeals
Expand Down
160 changes: 56 additions & 104 deletions code/game/machinery/computer/manager_camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,25 @@
var/datum/action/innate/managercommand/command
var/datum/action/innate/manager_track/follow
var/ammo = 6
var/maxAmmo = 5
var/max_ammo = 5
var/bullettype = 1
var/commandtype = 1
var/command_delay = 0.5 SECONDS
var/command_cooldown
//Used for limiting the amount of commands that can exist.
var/current_commands = 0
var/max_commands = 10
///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
)
/// 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"),
Expand All @@ -52,7 +56,7 @@
follow = new

command_cooldown = world.time
RegisterSignal(SSdcs, COMSIG_GLOB_MELTDOWN_START, .proc/recharge_meltdown)
RegisterSignal(SSdcs, COMSIG_GLOB_MELTDOWN_START, .proc/RechargeMeltdown)

/obj/machinery/computer/camera_advanced/manager/examine(mob/user)
. = ..()
Expand Down Expand Up @@ -88,12 +92,12 @@
follow.Grant(user)
actions += follow

RegisterSignal(user, COMSIG_MOB_CTRL_CLICKED, .proc/on_hotkey_click) //wanted to use shift click but shift click only allowed applying the effects to my player.
RegisterSignal(user, COMSIG_XENO_TURF_CLICK_ALT, .proc/on_alt_click)
RegisterSignal(user, COMSIG_MOB_CTRL_CLICKED, .proc/HotkeyClick) //wanted to use shift click but shift click only allowed applying the effects to my player.
RegisterSignal(user, COMSIG_XENO_TURF_CLICK_ALT, .proc/altClick)
RegisterSignal(user, COMSIG_MOB_SHIFTCLICKON, .proc/ManagerExaminate)

/obj/machinery/computer/camera_advanced/manager/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/managerbullet) && ammo <= maxAmmo)
if(istype(O, /obj/item/managerbullet) && ammo <= max_ammo)
ammo++
to_chat(user, "<span class='notice'>You load [O] in to the [src]. It now has [ammo] bullets stored.</span>")
playsound(get_turf(src), 'sound/weapons/kenetic_reload.ogg', 10, 0, 3)
Expand All @@ -107,18 +111,18 @@
UnregisterSignal(user, COMSIG_MOB_SHIFTCLICKON)
..()

/obj/machinery/computer/camera_advanced/manager/proc/on_hotkey_click(datum/source, atom/clicked_atom) //system control for hotkeys
/obj/machinery/computer/camera_advanced/manager/proc/HotkeyClick(datum/source, atom/clicked_atom) //system control for hotkeys
SIGNAL_HANDLER
if(!isliving(clicked_atom))
return
if(ishuman(clicked_atom))
clickedemployee(source, clicked_atom)
clickedEmployee(source, clicked_atom)
return
if(ishostile(clicked_atom))
clickedabno(source, clicked_atom)
clickedAbno(source, clicked_atom)
return

/obj/machinery/computer/camera_advanced/manager/proc/clickedemployee(mob/living/owner, mob/living/carbon/employee) //contains carbon copy code of fire action
/obj/machinery/computer/camera_advanced/manager/proc/clickedEmployee(mob/living/owner, mob/living/carbon/employee) //contains carbon copy code of fire action
if(ammo >= 1)
var/mob/living/carbon/human/H = employee
switch(bullettype)
Expand Down Expand Up @@ -155,7 +159,7 @@
to_chat(owner, "<span class='warning'>NO TARGET.</span>")
return

/obj/machinery/computer/camera_advanced/manager/proc/clickedabno(mob/living/owner, mob/living/simple_animal/hostile/critter)
/obj/machinery/computer/camera_advanced/manager/proc/clickedAbno(mob/living/owner, mob/living/simple_animal/hostile/critter)
if(ammo >= 1)
var/mob/living/simple_animal/hostile/abnormality/ABNO = critter
if(bullettype == 7)
Expand Down Expand Up @@ -201,32 +205,31 @@

to_chat(user, message)

/obj/machinery/computer/camera_advanced/manager/proc/on_alt_click(mob/living/user, turf/open/T)
/obj/machinery/computer/camera_advanced/manager/proc/altClick(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 T)
qdel(V)
return
if(current_commands >= max_commands)
to_chat(C, "<span class='warning'>COMMAND CAPACITY REACHED.</span>")
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, "<span class='warning'>CALIBRATION ERROR.</span>")
if(commandtype > 0 && commandtype <= 6)
var/thing_to_spawn = commandtypes[commandtype]
var/thing_spawned = new thing_to_spawn(get_turf(T))
current_commands++
RegisterSignal(thing_spawned, COMSIG_PARENT_QDELETING, .proc/ReduceCommandAmount)
else
to_chat(C, "<span class='warning'>ERROR: Calibration Faliure.</span>")
commandtimer()

//Used in the tracking of existing commands.
/obj/machinery/computer/camera_advanced/manager/proc/ReduceCommandAmount()
current_commands--

//Numerical Procs that alter variables
/obj/machinery/computer/camera_advanced/manager/proc/commandtimer()
command_cooldown = world.time + command_delay
return
Expand All @@ -239,13 +242,14 @@
commandtype = commandtype + amount
return

/obj/machinery/computer/camera_advanced/manager/proc/recharge_meltdown()
/obj/machinery/computer/camera_advanced/manager/proc/RechargeMeltdown()
playsound(get_turf(src), 'sound/weapons/kenetic_reload.ogg', 10, 0, 3)
maxAmmo += 0.25
ammo = maxAmmo

//Employee Tracking Code: Butchered AI Tracking
max_ammo += 0.25
ammo = max_ammo

/*--------------------------------------------\
|Employee Tracking Code: Butchered AI Tracking|
\--------------------------------------------*/
//Shows a list of creatures that can be tracked.
/obj/machinery/computer/camera_advanced/manager/proc/TrackableCreatures()
track.initialized = TRUE
Expand Down Expand Up @@ -416,6 +420,7 @@
X.altercommandtype(-5)
to_chat(owner, "<span class='notice'>MOVE IMAGE INITIALIZED.</span>")
button_icon_state = button_icon1
UpdateButtonIcon()

/datum/action/innate/managercommand
name = "Deploy Command"
Expand All @@ -431,62 +436,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, "<span class='warning'>CALIBRATION ERROR.</span>")
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.altClick(C, get_turf(E))

/turf/open/AltClick(mob/user)
SEND_SIGNAL(user, COMSIG_XENO_TURF_CLICK_ALT, src)
Expand All @@ -500,7 +450,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."
Expand Down Expand Up @@ -537,7 +489,7 @@
/obj/machinery/computer/camera_advanced/manager/sephirah //crude and lazy but i think it may work.
name = "sephirah camera console"
ammo = 0
maxAmmo = 0
max_ammo = 0

/obj/machinery/computer/camera_advanced/manager/sephirah/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -570,11 +522,11 @@
follow.Grant(user)
actions += follow

RegisterSignal(user, COMSIG_XENO_TURF_CLICK_ALT, .proc/on_alt_click)
RegisterSignal(user, COMSIG_XENO_TURF_CLICK_ALT, .proc/altClick)
RegisterSignal(user, COMSIG_MOB_SHIFTCLICKON, .proc/ManagerExaminate)

/obj/machinery/computer/camera_advanced/manager/sephirah/clickedemployee()
/obj/machinery/computer/camera_advanced/manager/sephirah/clickedEmployee()
return

/obj/machinery/computer/camera_advanced/manager/sephirah/recharge_meltdown()
/obj/machinery/computer/camera_advanced/manager/sephirah/RechargeMeltdown()
return
33 changes: 33 additions & 0 deletions code/game/objects/effects/temporary_visuals/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1038,3 +1038,36 @@
name = "goodbye"
icon_state = "nobody_slash"
duration = 5

/obj/effect/temp_visual/HoloCommand
icon = 'ModularTegustation/Teguicons/lc13icons.dmi'
light_range = 1.5
light_power = 0.2
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

0 comments on commit aa31b01

Please sign in to comment.