Skip to content

Commit

Permalink
Fixes laser pointers hardstunning borgs (#11100)
Browse files Browse the repository at this point in the history
* Update laserpointer.dm

* changes
  • Loading branch information
XeonMations authored Jun 25, 2024
1 parent 789cdbf commit 389953b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/robots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@
#define ASSEMBLY_THIRD_STEP 2
#define ASSEMBLY_FOURTH_STEP 3
#define ASSEMBLY_FIFTH_STEP 4

#define FLASHED_COOLDOWN 30 SECONDS
12 changes: 8 additions & 4 deletions code/game/objects/items/devices/laserpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,18 @@

//robots
else if(iscyborg(target))
var/mob/living/silicon/S = target
var/mob/living/silicon/robot/S = target
log_combat(user, S, "shone in the sensors", src)
//chance to actually hit the eyes depends on internal component
if(prob(effectchance * diode.rating))
S.flash_act(affect_silicon = 1)
S.Paralyze(rand(100,200))
to_chat(S, "<span class='danger'>Your sensors were overloaded by a laser!</span>")
outmsg = "<span class='notice'>You overload [S] by shining [src] at [S.p_their()] sensors.</span>"
if(S.last_flashed + FLASHED_COOLDOWN < world.time)
S.last_flashed = world.time
S.Paralyze(5 SECONDS)
to_chat(S, "<span class='danger'>Your sensors were overloaded by a laser!</span>")
outmsg = "<span class='notice'>You overload [S] by shining [src] at [S.p_their()] sensors.</span>"
else
outmsg = "<span class='warning'>You attempt to overload [S]'s sensors with the flash, but their defense protocols mitigate the effect!</span>"
else
outmsg = "<span class='warning'>You fail to overload [S] by shining [src] at [S.p_their()] sensors!</span>"

Expand Down
2 changes: 1 addition & 1 deletion code/modules/assembly/flash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
log_combat(user, R, "flashed", src)
update_icon(1)
R.flash_act(affect_silicon = 1, type = /atom/movable/screen/fullscreen/flash/static)
if(R.last_flashed + 30 SECONDS < world.time)
if(R.last_flashed + FLASHED_COOLDOWN < world.time)
R.last_flashed = world.time
R.Paralyze(5 SECONDS)
user.visible_message("<span class='disarm'>[user] overloads [R]'s sensors with the flash!</span>", "<span class='danger'>You overload [R]'s sensors with the flash!</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/robot/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@
if(stat != DEAD && !(IsUnconscious() || low_power_mode)) //Not dead, not stunned.
if(!eye_lights)
eye_lights = new()
if(last_flashed && last_flashed + 30 SECONDS >= world.time) //We want to make sure last_flashed isn't zero because otherwise roundstart borgs blink for 30 seconds
if(last_flashed && last_flashed + FLASHED_COOLDOWN >= world.time) //We want to make sure last_flashed isn't zero because otherwise roundstart borgs blink for 30 seconds
eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_fl"
else if(lamp_enabled)
eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_l"
Expand Down

0 comments on commit 389953b

Please sign in to comment.