Plasma pistol no longer requires the user stand still while overloading it (#20146)

* Plasma pistol no longer requires the user stand still while charging it

* eh keep it 2.5 quite low dps

* Update code/modules/projectiles/guns/energy/special.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
Qwertytoforty
2023-01-19 15:08:01 -05:00
committed by GitHub
co-authored by Ryan
parent 64d74ed0f7
commit c4bab6ff13
@@ -324,6 +324,7 @@
var/overloaded = FALSE
var/warned = FALSE
var/charging = FALSE
var/charge_failure = FALSE
var/mob/living/carbon/holder = null
/obj/item/gun/energy/plasma_pistol/Initialize(mapload)
@@ -354,19 +355,29 @@
to_chat(user, "<span class='warning'>[src] does not have enough charge to be overloaded.</span>")
return
if(charging)
to_chat(user, "<span class='warning'>[src] is already charging!</span>")
return
to_chat(user, "<span class='notice'>You begin to overload [src].</span>")
charging = TRUE
if(do_after(user, 2.5 SECONDS, target = src))
select_fire(user)
charge_failure = FALSE
addtimer(CALLBACK(src, PROC_REF(overload)), 2.5 SECONDS)
/obj/item/gun/energy/plasma_pistol/proc/overload()
if(ishuman(loc) && !charge_failure)
var/mob/living/carbon/C = loc
select_fire(C)
overloaded = TRUE
cell.charge -= 125
playsound(loc, 'sound/machines/terminal_prompt_confirm.ogg', 75, 1)
cell.use(125)
playsound(C.loc, 'sound/machines/terminal_prompt_confirm.ogg', 75, 1)
atom_say("Overloading successful.")
set_light(3) //extra visual effect to make it more noticable to user and victims alike
holder = user
holder = C
RegisterSignal(holder, COMSIG_CARBON_SWAP_HANDS, PROC_REF(discharge))
else
atom_say("Overloading failure.")
playsound(loc, 'sound/machines/buzz-sigh.ogg', 75, 1)
charging = FALSE
charge_failure = FALSE
/obj/item/gun/energy/plasma_pistol/proc/reset_overloaded()
select_fire()
@@ -390,16 +401,19 @@
/obj/item/gun/energy/plasma_pistol/emp_act(severity)
..()
charge_failure = TRUE
if(prob(100 / severity) && overloaded)
discharge()
/obj/item/gun/energy/plasma_pistol/dropped(mob/user)
. = ..()
charge_failure = TRUE
if(overloaded)
discharge()
/obj/item/gun/energy/plasma_pistol/equipped(mob/user, slot, initial)
. = ..()
charge_failure = TRUE
if(overloaded)
discharge()