Merge pull request #8537 from Ghommie/Ghommie-cit28
Fixes emags wasting charges on un-emaggable stuff.
This commit is contained in:
@@ -134,12 +134,14 @@ RSF
|
||||
return
|
||||
|
||||
/obj/item/cookiesynth/emag_act(mob/user)
|
||||
. = ..()
|
||||
obj_flags ^= EMAGGED
|
||||
if(obj_flags & EMAGGED)
|
||||
to_chat(user, "<span class='warning'>You short out [src]'s reagent safety checker!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You reset [src]'s reagent safety checker!</span>")
|
||||
toxin = 0
|
||||
toxin = FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/cookiesynth/attack_self(mob/user)
|
||||
var/mob/living/silicon/robot/P = null
|
||||
|
||||
@@ -93,34 +93,22 @@
|
||||
/obj/item/card/emag/afterattack(atom/target, mob/user, proximity)
|
||||
. = ..()
|
||||
var/atom/A = target
|
||||
if(!proximity && prox_check)
|
||||
if(!proximity && prox_check || !(isobj(A) || issilicon(A) || isbot(A) || isdrone(A)))
|
||||
return
|
||||
if(istype(A, /obj/item/storage) && !(istype(A, /obj/item/storage/lockbox) || istype(A, /obj/item/storage/pod)))
|
||||
return
|
||||
//Citadel changes: modular code misfiring, so we're bypassing into main code.
|
||||
if(!uses)
|
||||
user.visible_message("<span class='warning'>[src] emits a weak spark. It's burnt out!</span>")
|
||||
playsound(src, 'sound/effects/light_flicker.ogg', 100, 1)
|
||||
return
|
||||
else if(uses <= 3)
|
||||
playsound(src, 'sound/effects/light_flicker.ogg', 30, 1) //Tiiiiiiny warning sound to let ya know your emag's almost dead
|
||||
|
||||
if(isturf(A))
|
||||
if(!A.emag_act(user))
|
||||
return
|
||||
if(istype(A,/obj/item/storage/lockbox) || istype(A, /obj/item/storage/pod))
|
||||
A.emag_act(user)
|
||||
uses = max(uses - 1, 0)
|
||||
if(!uses)
|
||||
user.visible_message("<span class='warning'>[src] fizzles and sparks. It seems like it's out of charges.</span>")
|
||||
playsound(src, 'sound/effects/light_flicker.ogg', 100, 1)
|
||||
if(istype(A,/obj/item/storage))
|
||||
return
|
||||
if(!(isobj(A) || issilicon(A) || isbot(A) || isdrone(A)))
|
||||
return
|
||||
else
|
||||
A.emag_act(user)
|
||||
uses = max(uses - 1, 0)
|
||||
if(!uses)
|
||||
user.visible_message("<span class='warning'>[src] fizzles and sparks. It seems like it's out of charges.</span>")
|
||||
playsound(src, 'sound/effects/light_flicker.ogg', 100, 1)
|
||||
uses = max(uses - 1, 0)
|
||||
if(!uses)
|
||||
user.visible_message("<span class='warning'>[src] fizzles and sparks. It seems like it's out of charges.</span>")
|
||||
playsound(src, 'sound/effects/light_flicker.ogg', 100, 1)
|
||||
|
||||
|
||||
/obj/item/card/emagfake
|
||||
|
||||
@@ -764,20 +764,22 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
..()
|
||||
|
||||
/obj/item/clothing/mask/vape/emag_act(mob/user)// I WON'T REGRET WRITTING THIS, SURLY.
|
||||
if(screw)
|
||||
if(!(obj_flags & EMAGGED))
|
||||
cut_overlays()
|
||||
obj_flags |= EMAGGED
|
||||
super = FALSE
|
||||
to_chat(user, "<span class='warning'>You maximize the voltage of [src].</span>")
|
||||
add_overlay("vapeopen_high")
|
||||
var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread //for effect
|
||||
sp.set_up(5, 1, src)
|
||||
sp.start()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is already emagged!</span>")
|
||||
else
|
||||
. = ..()
|
||||
if(!screw)
|
||||
to_chat(user, "<span class='notice'>You need to open the cap to do that.</span>")
|
||||
return
|
||||
if(obj_flags & EMAGGED)
|
||||
to_chat(user, "<span class='warning'>[src] is already emagged!</span>")
|
||||
return
|
||||
cut_overlays()
|
||||
obj_flags |= EMAGGED
|
||||
super = FALSE
|
||||
to_chat(user, "<span class='warning'>You maximize the voltage of [src].</span>")
|
||||
add_overlay("vapeopen_high")
|
||||
var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread //for effect
|
||||
sp.set_up(5, 1, src)
|
||||
sp.start()
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/mask/vape/attack_self(mob/user)
|
||||
if(reagents.total_volume > 0)
|
||||
|
||||
@@ -217,10 +217,13 @@
|
||||
to_chat(user, "<span class='notice'>The spectrum chip is unresponsive.</span>")
|
||||
|
||||
/obj/item/circuitboard/computer/cargo/emag_act(mob/living/user)
|
||||
if(!(obj_flags & EMAGGED))
|
||||
contraband = TRUE
|
||||
obj_flags |= EMAGGED
|
||||
to_chat(user, "<span class='notice'>You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.</span>")
|
||||
. = ..()
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
contraband = TRUE
|
||||
obj_flags |= EMAGGED
|
||||
to_chat(user, "<span class='notice'>You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/circuitboard/computer/cargo/express
|
||||
name = "Express Supply Console (Computer Board)"
|
||||
@@ -234,8 +237,12 @@
|
||||
obj_flags &= ~EMAGGED
|
||||
|
||||
/obj/item/circuitboard/computer/cargo/express/emag_act(mob/living/user)
|
||||
to_chat(user, "<span class='notice'>You change the routing protocols, allowing the Drop Pod to land anywhere on the station.</span>")
|
||||
obj_flags |= EMAGGED
|
||||
. = SEND_SIGNAL(src, COMSIG_ATOM_EMAG_ACT)
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You change the routing protocols, allowing the Drop Pod to land anywhere on the station.</span>")
|
||||
obj_flags |= EMAGGED
|
||||
return TRUE
|
||||
|
||||
/obj/item/circuitboard/computer/cargo/request
|
||||
name = "Supply Request Console (Computer Board)"
|
||||
|
||||
@@ -140,12 +140,10 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/defibrillator/emag_act(mob/user)
|
||||
if(safety)
|
||||
safety = FALSE
|
||||
to_chat(user, "<span class='warning'>You silently disable [src]'s safety protocols with the cryptographic sequencer.</span>")
|
||||
else
|
||||
safety = TRUE
|
||||
to_chat(user, "<span class='notice'>You silently enable [src]'s safety protocols with the cryptographic sequencer.</span>")
|
||||
. = ..()
|
||||
safety = !safety
|
||||
to_chat(user, "<span class='warning'>You silently [safety ? "enable" : "disable"] [src]'s safety protocols with the cryptographic sequencer.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/defibrillator/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
@@ -192,13 +192,15 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/geiger_counter/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
if(scanning)
|
||||
to_chat(user, "<span class='warning'>Turn off [src] before you perform this action!</span>")
|
||||
return 0
|
||||
return
|
||||
to_chat(user, "<span class='warning'>You override [src]'s radiation storing protocols. It will now generate small doses of radiation, and stored rads are now projected into creatures you scan.</span>")
|
||||
obj_flags |= EMAGGED
|
||||
return TRUE
|
||||
|
||||
/obj/item/geiger_counter/cyborg
|
||||
var/datum/component/mobhook
|
||||
|
||||
@@ -149,9 +149,11 @@
|
||||
to_chat(user, "<span class='notice'>You fill \the [src] with lights from \the [S]. " + status_string() + "</span>")
|
||||
|
||||
/obj/item/lightreplacer/emag_act()
|
||||
. = ..()
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
Emag()
|
||||
return TRUE
|
||||
|
||||
/obj/item/lightreplacer/attack_self(mob/user)
|
||||
to_chat(user, status_string())
|
||||
|
||||
@@ -38,11 +38,13 @@
|
||||
speech_args[SPEECH_SPANS] |= voicespan
|
||||
|
||||
/obj/item/megaphone/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
to_chat(user, "<span class='warning'>You overload \the [src]'s voice synthesizer.</span>")
|
||||
obj_flags |= EMAGGED
|
||||
voicespan = list(SPAN_REALLYBIG, "userdanger")
|
||||
return TRUE
|
||||
|
||||
/obj/item/megaphone/sec
|
||||
name = "security megaphone"
|
||||
|
||||
@@ -282,11 +282,13 @@
|
||||
var/cooldown = 0
|
||||
|
||||
/obj/item/harmalarm/emag_act(mob/user)
|
||||
. = ..()
|
||||
obj_flags ^= EMAGGED
|
||||
if(obj_flags & EMAGGED)
|
||||
to_chat(user, "<font color='red'>You short out the safeties on [src]!</font>")
|
||||
else
|
||||
to_chat(user, "<font color='red'>You reset the safeties on [src]!</font>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/harmalarm/attack_self(mob/user)
|
||||
var/safety = !(obj_flags & EMAGGED)
|
||||
|
||||
@@ -48,14 +48,16 @@
|
||||
to_chat(user, "<span class='danger'>It's locked!</span>")
|
||||
|
||||
/obj/item/storage/lockbox/emag_act(mob/user)
|
||||
if(!broken)
|
||||
broken = TRUE
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, FALSE)
|
||||
desc += "It appears to be broken."
|
||||
icon_state = src.icon_broken
|
||||
if(user)
|
||||
visible_message("<span class='warning'>\The [src] has been broken by [user] with an electromagnetic card!</span>")
|
||||
return
|
||||
. = ..()
|
||||
if(broken)
|
||||
return
|
||||
broken = TRUE
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, FALSE)
|
||||
desc += "It appears to be broken."
|
||||
icon_state = src.icon_broken
|
||||
if(user)
|
||||
visible_message("<span class='warning'>\The [src] has been broken by [user] with an electromagnetic card!</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/storage/lockbox/Entered()
|
||||
. = ..()
|
||||
|
||||
@@ -112,12 +112,16 @@
|
||||
|
||||
|
||||
/obj/structure/sign/barsign/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(broken || (obj_flags & EMAGGED))
|
||||
to_chat(user, "<span class='warning'>Nothing interesting happens!</span>")
|
||||
return
|
||||
obj_flags |= EMAGGED
|
||||
to_chat(user, "<span class='notice'>You emag the barsign. Takeover in progress...</span>")
|
||||
sleep(10 SECONDS)
|
||||
addtimer(CALLBACK(src, .proc/syndie_bar_good), 10 SECONDS)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/sign/barsign/proc/syndie_bar_good()
|
||||
set_sign(new /datum/barsign/hiddensigns/syndibarsign)
|
||||
req_access = list(ACCESS_SYNDICATE)
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user