mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-05 15:03:48 +00:00
Merge pull request #9826 from PsiOmegaDelta/150615-EmagAct
Base proc: emag_act
This commit is contained in:
@@ -11,20 +11,11 @@
|
||||
return chest.attackby(W,user)
|
||||
|
||||
// Lock or unlock the access panel.
|
||||
if(istype(W, /obj/item/weapon/card) || istype(W, /obj/item/device/pda))
|
||||
|
||||
if(W.GetID())
|
||||
if(subverted)
|
||||
locked = 0
|
||||
user << "<span class='danger'>It looks like the locking system has been shorted out.</span>"
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/card/emag))
|
||||
locked_dna = null
|
||||
req_access.Cut()
|
||||
req_one_access.Cut()
|
||||
locked = 0
|
||||
subverted = 1
|
||||
user << "<span class='danger'>You short out the access protocol for the suit.</span>"
|
||||
return
|
||||
|
||||
if((!req_access || !req_access.len) && (!req_one_access || !req_one_access.len))
|
||||
locked = 0
|
||||
@@ -193,4 +184,14 @@
|
||||
if(electrified != 0)
|
||||
if(shock(user)) //Handles removing charge from the cell, as well. No need to do that here.
|
||||
return
|
||||
..()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/rig/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(!subverted)
|
||||
locked_dna = null
|
||||
req_access.Cut()
|
||||
req_one_access.Cut()
|
||||
locked = 0
|
||||
subverted = 1
|
||||
user << "<span class='danger'>You short out the access protocol for the suit.</span>"
|
||||
return 1
|
||||
|
||||
@@ -55,19 +55,18 @@
|
||||
user << "Waving around a holobadge before swiping an ID would be pretty pointless."
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/clothing/accessory/badge/holo/emag_act(var/remaining_charges, var/mob/user)
|
||||
if (emagged)
|
||||
user << "<span class='danger'>\The [src] is already cracked.</span>"
|
||||
return
|
||||
else
|
||||
emagged = 1
|
||||
user << "<span class='danger'>You crack the holobadge security checks.</span>"
|
||||
return 1
|
||||
|
||||
/obj/item/clothing/accessory/badge/holo/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
|
||||
if (istype(O, /obj/item/weapon/card/emag))
|
||||
if (emagged)
|
||||
user << "<span class='danger'>[src] is already cracked.</span>"
|
||||
return
|
||||
else
|
||||
emagged = 1
|
||||
user << "<span class='danger'>You swipe [O] and crack the holobadge security checks.</span>"
|
||||
return
|
||||
|
||||
else if(istype(O, /obj/item/weapon/card/id) || istype(O, /obj/item/device/pda))
|
||||
if(istype(O, /obj/item/weapon/card/id) || istype(O, /obj/item/device/pda))
|
||||
|
||||
var/obj/item/weapon/card/id/id_card = null
|
||||
|
||||
|
||||
@@ -62,6 +62,22 @@ log transactions
|
||||
playsound(loc, 'sound/items/polaroid2.ogg', 50, 1)
|
||||
break
|
||||
|
||||
/obj/machinery/atm/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(!emagged)
|
||||
return
|
||||
|
||||
//short out the machine, shoot sparks, spew money!
|
||||
emagged = 1
|
||||
spark_system.start()
|
||||
spawn_money(rand(100,500),src.loc)
|
||||
//we don't want to grief people by locking their id in an emagged ATM
|
||||
release_held_id(user)
|
||||
|
||||
//display a message to the user
|
||||
var/response = pick("Initiating withdraw. Have a nice day!", "CRITICAL ERROR: Activating cash chamber panic siphon.","PIN Code accepted! Emptying account balance.", "Jackpot!")
|
||||
user << "<span class='warning'>\icon[src] The [src] beeps: \"[response]\"</span>"
|
||||
return 1
|
||||
|
||||
/obj/machinery/atm/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/card))
|
||||
if(emagged > 0)
|
||||
@@ -69,16 +85,7 @@ log transactions
|
||||
user << "\red \icon[src] CARD READER ERROR. This system has been compromised!"
|
||||
return
|
||||
else if(istype(I,/obj/item/weapon/card/emag))
|
||||
//short out the machine, shoot sparks, spew money!
|
||||
emagged = 1
|
||||
spark_system.start()
|
||||
spawn_money(rand(100,500),src.loc)
|
||||
//we don't want to grief people by locking their id in an emagged ATM
|
||||
release_held_id(user)
|
||||
|
||||
//display a message to the user
|
||||
var/response = pick("Initiating withdraw. Have a nice day!", "CRITICAL ERROR: Activating cash chamber panic siphon.","PIN Code accepted! Emptying account balance.", "Jackpot!")
|
||||
user << "\red \icon[src] The [src] beeps: \"[response]\""
|
||||
I.resolve_attackby(src, user)
|
||||
return
|
||||
|
||||
var/obj/item/weapon/card/id/idcard = I
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
if(botEmagChance)
|
||||
for(var/obj/machinery/bot/bot in world)
|
||||
if(prob(botEmagChance))
|
||||
bot.Emag()
|
||||
bot.emag_act(1)
|
||||
|
||||
/datum/event/ionstorm/end()
|
||||
spawn(rand(5000,8000))
|
||||
|
||||
@@ -120,17 +120,17 @@
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/HolodeckControl/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
|
||||
if(istype(D, /obj/item/weapon/card/emag))
|
||||
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
last_to_emag = user //emag again to change the owner
|
||||
if (!emagged)
|
||||
emagged = 1
|
||||
safety_disabled = 1
|
||||
update_projections()
|
||||
user << "<span class='notice'>You vastly increase projector power and override the safety and security protocols.</span>"
|
||||
user << "Warning. Automatic shutoff and derezing protocols have been corrupted. Please call Nanotrasen maintenance and do not use the simulator."
|
||||
log_game("[key_name(usr)] emagged the Holodeck Control Computer")
|
||||
/obj/machinery/computer/HolodeckControl/emag_act(var/remaining_charges, var/mob/user as mob)
|
||||
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
last_to_emag = user //emag again to change the owner
|
||||
if (!emagged)
|
||||
emagged = 1
|
||||
safety_disabled = 1
|
||||
update_projections()
|
||||
user << "<span class='notice'>You vastly increase projector power and override the safety and security protocols.</span>"
|
||||
user << "Warning. Automatic shutoff and derezing protocols have been corrupted. Please call Nanotrasen maintenance and do not use the simulator."
|
||||
log_game("[key_name(usr)] emagged the Holodeck Control Computer")
|
||||
return 1
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
@@ -236,10 +236,13 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
|
||||
//dat += "<A HREF='?src=\ref[user];mach_close=library'>Close</A><br><br>"
|
||||
user << browse(dat, "window=library")
|
||||
onclose(user, "library")
|
||||
|
||||
/obj/machinery/librarycomp/emag_act(var/remaining_charges, var/mob/user)
|
||||
if (src.density && !src.emagged)
|
||||
src.emagged = 1
|
||||
return 1
|
||||
|
||||
/obj/machinery/librarycomp/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (src.density && istype(W, /obj/item/weapon/card/emag))
|
||||
src.emagged = 1
|
||||
if(istype(W, /obj/item/weapon/barcodescanner))
|
||||
var/obj/item/weapon/barcodescanner/scanner = W
|
||||
scanner.computer = src
|
||||
|
||||
@@ -171,12 +171,14 @@
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/crate/secure/loot/emag_act(var/remaining_charges, var/mob/user)
|
||||
if (locked)
|
||||
user << "<span class='notice'>The crate unlocks!</span>"
|
||||
locked = 0
|
||||
|
||||
/obj/structure/closet/crate/secure/loot/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(locked)
|
||||
if (istype(W, /obj/item/weapon/card/emag))
|
||||
user << "<span class='notice'>The crate unlocks!</span>"
|
||||
locked = 0
|
||||
if (istype(W, /obj/item/device/multitool)) // Greetings Urist McProfessor, how about a nice game of cows and bulls?
|
||||
user << "<span class='notice'>DECA-CODE LOCK REPORT:</span>"
|
||||
if (attempts == 1)
|
||||
|
||||
@@ -80,9 +80,6 @@
|
||||
else
|
||||
user << "<span class='notice'>[src] does not need a repair.</span>"
|
||||
return
|
||||
else if (istype(O, /obj/item/weapon/card/emag) && !emagged)
|
||||
Emag(user)
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -102,9 +99,8 @@
|
||||
if(!istype(D, /obj/machinery/door/firedoor) && !istype(D, /obj/machinery/door/blast) && D.check_access(botcard))
|
||||
D.open()
|
||||
|
||||
/mob/living/bot/proc/Emag(var/mob/user)
|
||||
log_and_message_admins("emagged [src]")
|
||||
return
|
||||
/mob/living/bot/emag_act(var/remaining_charges, var/mob/user)
|
||||
return 0
|
||||
|
||||
/mob/living/bot/proc/turn_on()
|
||||
if(stat)
|
||||
|
||||
@@ -232,12 +232,14 @@
|
||||
usr << "<span class='notice'>You press the weird button.</span>"
|
||||
attack_hand(usr)
|
||||
|
||||
/mob/living/bot/cleanbot/Emag(var/mob/user)
|
||||
..()
|
||||
if(user)
|
||||
user << "<span class='notice'>The [src] buzzes and beeps.</span>"
|
||||
oddbutton = 1
|
||||
screwloose = 1
|
||||
/mob/living/bot/cleanbot/emag_act(var/remaining_uses, var/mob/user)
|
||||
. = ..()
|
||||
if(!screwloose || !oddbutton)
|
||||
if(user)
|
||||
user << "<span class='notice'>The [src] buzzes and beeps.</span>"
|
||||
oddbutton = 1
|
||||
screwloose = 1
|
||||
return 1
|
||||
|
||||
/mob/living/bot/cleanbot/proc/get_targets()
|
||||
target_types = list()
|
||||
|
||||
@@ -64,13 +64,15 @@
|
||||
onclose(user, "autofarm")
|
||||
return
|
||||
|
||||
/mob/living/bot/farmbot/Emag(var/mob/user)
|
||||
..()
|
||||
if(user)
|
||||
user << "<span class='notice'>You short out [src]'s plant identifier circuits.</span>"
|
||||
spawn(rand(30, 50))
|
||||
visible_message("<span class='warning'>[src] buzzes oddly.</span>")
|
||||
emagged = 1
|
||||
/mob/living/bot/farmbot/emag_act(var/remaining_charges, var/mob/user)
|
||||
. = ..()
|
||||
if(!emagged)
|
||||
if(user)
|
||||
user << "<span class='notice'>You short out [src]'s plant identifier circuits.</span>"
|
||||
spawn(rand(30, 50))
|
||||
visible_message("<span class='warning'>[src] buzzes oddly.</span>")
|
||||
emagged = 1
|
||||
return 1
|
||||
|
||||
/mob/living/bot/farmbot/Topic(href, href_list)
|
||||
if(..())
|
||||
|
||||
@@ -47,11 +47,13 @@
|
||||
onclose(user, "autorepair")
|
||||
return
|
||||
|
||||
/mob/living/bot/floorbot/Emag(var/mob/user)
|
||||
..()
|
||||
emagged = 1
|
||||
if(user)
|
||||
user << "<span class='notice'>The [src] buzzes and beeps.</span>"
|
||||
/mob/living/bot/floorbot/emag_act(var/remaining_charges, var/mob/user)
|
||||
. = ..()
|
||||
if(!emagged)
|
||||
emagged = 1
|
||||
if(user)
|
||||
user << "<span class='notice'>The [src] buzzes and beeps.</span>"
|
||||
return 1
|
||||
|
||||
/mob/living/bot/floorbot/Topic(href, href_list)
|
||||
if(..())
|
||||
|
||||
@@ -219,8 +219,8 @@
|
||||
attack_hand(usr)
|
||||
return
|
||||
|
||||
/mob/living/bot/medbot/Emag(var/mob/user)
|
||||
..()
|
||||
/mob/living/bot/medbot/emag_act(var/remaining_uses, var/mob/user)
|
||||
. = ..()
|
||||
if(!emagged)
|
||||
if(user)
|
||||
user << "<span class='warning'>You short out [src]'s reagent synthesis circuits.</span>"
|
||||
@@ -231,6 +231,7 @@
|
||||
emagged = 1
|
||||
on = 1
|
||||
update_icons()
|
||||
. = 1
|
||||
ignored |= user
|
||||
|
||||
/mob/living/bot/medbot/explode()
|
||||
|
||||
@@ -102,41 +102,6 @@
|
||||
user << "<span class='danger'>\The [src] is hermetically sealed. You can't open the case.</span>"
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/emag))
|
||||
|
||||
if(!client || stat == 2)
|
||||
user << "<span class='danger'>There's not much point subverting this heap of junk.</span>"
|
||||
return
|
||||
|
||||
if(emagged)
|
||||
src << "<span class='danger'>\The [user] attempts to load subversive software into you, but your hacked subroutines ignore the attempt.</span>"
|
||||
user << "<span class='danger'>You attempt to subvert [src], but the sequencer has no effect.</span>"
|
||||
return
|
||||
|
||||
user << "<span class='danger'>You swipe the sequencer across [src]'s interface and watch its eyes flicker.</span>"
|
||||
src << "<span class='danger'>You feel a sudden burst of malware loaded into your execute-as-root buffer. Your tiny brain methodically parses, loads and executes the script.</span>"
|
||||
|
||||
var/obj/item/weapon/card/emag/emag = W
|
||||
emag.uses--
|
||||
|
||||
message_admins("[key_name_admin(user)] emagged drone [key_name_admin(src)]. Laws overridden.")
|
||||
log_game("[key_name(user)] emagged drone [key_name(src)]. Laws overridden.")
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
lawchanges.Add("[time] <B>:</B> [user.name]([user.key]) emagged [name]([key])")
|
||||
|
||||
emagged = 1
|
||||
lawupdate = 0
|
||||
connected_ai = null
|
||||
clear_supplied_laws()
|
||||
clear_inherent_laws()
|
||||
laws = new /datum/ai_laws/syndicate_override
|
||||
set_zeroth_law("Only [user.real_name] and people he designates as being such are operatives.")
|
||||
|
||||
src << "<b>Obey these laws:</b>"
|
||||
laws.show_laws(src)
|
||||
src << "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and his commands.</span>"
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
|
||||
if(stat == 2)
|
||||
@@ -172,6 +137,37 @@
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
/mob/living/silicon/robot/drone/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(!client || stat == 2)
|
||||
user << "<span class='danger'>There's not much point subverting this heap of junk.</span>"
|
||||
return
|
||||
|
||||
if(emagged)
|
||||
src << "<span class='danger'>\The [user] attempts to load subversive software into you, but your hacked subroutines ignore the attempt.</span>"
|
||||
user << "<span class='danger'>You attempt to subvert [src], but the sequencer has no effect.</span>"
|
||||
return
|
||||
|
||||
user << "<span class='danger'>You swipe the sequencer across [src]'s interface and watch its eyes flicker.</span>"
|
||||
src << "<span class='danger'>You feel a sudden burst of malware loaded into your execute-as-root buffer. Your tiny brain methodically parses, loads and executes the script.</span>"
|
||||
|
||||
message_admins("[key_name_admin(user)] emagged drone [key_name_admin(src)]. Laws overridden.")
|
||||
log_game("[key_name(user)] emagged drone [key_name(src)]. Laws overridden.")
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
lawchanges.Add("[time] <B>:</B> [user.name]([user.key]) emagged [name]([key])")
|
||||
|
||||
emagged = 1
|
||||
lawupdate = 0
|
||||
connected_ai = null
|
||||
clear_supplied_laws()
|
||||
clear_inherent_laws()
|
||||
laws = new /datum/ai_laws/syndicate_override
|
||||
set_zeroth_law("Only [user.real_name] and people he designates as being such are operatives.")
|
||||
|
||||
src << "<b>Obey these laws:</b>"
|
||||
laws.show_laws(src)
|
||||
src << "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and his commands.</span>"
|
||||
return 1
|
||||
|
||||
//DRONE LIFE/DEATH
|
||||
|
||||
|
||||
@@ -622,71 +622,6 @@
|
||||
else
|
||||
user << "\red Access denied."
|
||||
|
||||
else if(istype(W, /obj/item/weapon/card/emag)) // trying to unlock with an emag card
|
||||
if(!opened)//Cover is closed
|
||||
if(locked)
|
||||
if(prob(90))
|
||||
var/obj/item/weapon/card/emag/emag = W
|
||||
emag.uses--
|
||||
user << "You emag the cover lock."
|
||||
locked = 0
|
||||
else
|
||||
user << "You fail to emag the cover lock."
|
||||
src << "Hack attempt detected."
|
||||
else
|
||||
user << "The cover is already unlocked."
|
||||
return
|
||||
|
||||
if(opened)//Cover is open
|
||||
if(emagged) return//Prevents the X has hit Y with Z message also you cant emag them twice
|
||||
if(wiresexposed)
|
||||
user << "You must close the panel first"
|
||||
return
|
||||
else
|
||||
sleep(6)
|
||||
if(prob(50))
|
||||
emagged = 1
|
||||
lawupdate = 0
|
||||
disconnect_from_ai()
|
||||
user << "You emag [src]'s interface."
|
||||
message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overridden.")
|
||||
log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.")
|
||||
clear_supplied_laws()
|
||||
clear_inherent_laws()
|
||||
laws = new /datum/ai_laws/syndicate_override
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
lawchanges.Add("[time] <B>:</B> [user.name]([user.key]) emagged [name]([key])")
|
||||
set_zeroth_law("Only [user.real_name] and people he designates as being such are operatives.")
|
||||
src << "\red ALERT: Foreign software detected."
|
||||
sleep(5)
|
||||
src << "\red Initiating diagnostics..."
|
||||
sleep(20)
|
||||
src << "\red SynBorg v1.7.1 loaded."
|
||||
sleep(5)
|
||||
src << "\red LAW SYNCHRONISATION ERROR"
|
||||
sleep(5)
|
||||
src << "\red Would you like to send a report to NanoTraSoft? Y/N"
|
||||
sleep(10)
|
||||
src << "\red > N"
|
||||
sleep(20)
|
||||
src << "\red ERRORERRORERROR"
|
||||
src << "<b>Obey these laws:</b>"
|
||||
laws.show_laws(src)
|
||||
src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands."
|
||||
if(src.module)
|
||||
var/rebuild = 0
|
||||
for(var/obj/item/weapon/pickaxe/borgdrill/D in src.module.modules)
|
||||
qdel(D)
|
||||
rebuild = 1
|
||||
if(rebuild)
|
||||
src.module.modules += new /obj/item/weapon/pickaxe/diamonddrill(src.module)
|
||||
src.module.rebuild()
|
||||
updateicon()
|
||||
else
|
||||
user << "You fail to hack [src]'s interface."
|
||||
src << "Hack attempt detected."
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/borg/upgrade/))
|
||||
var/obj/item/borg/upgrade/U = W
|
||||
if(!opened)
|
||||
@@ -1097,3 +1032,70 @@
|
||||
connected_ai.connected_robots |= src
|
||||
notify_ai(ROBOT_NOTIFICATION_NEW_UNIT)
|
||||
sync()
|
||||
|
||||
/mob/living/silicon/robot/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(!opened)//Cover is closed
|
||||
if(locked)
|
||||
if(prob(90))
|
||||
user << "You emag the cover lock."
|
||||
locked = 0
|
||||
else
|
||||
user << "You fail to emag the cover lock."
|
||||
src << "Hack attempt detected."
|
||||
return 1
|
||||
else
|
||||
user << "The cover is already unlocked."
|
||||
return
|
||||
|
||||
if(opened)//Cover is open
|
||||
if(emagged) return//Prevents the X has hit Y with Z message also you cant emag them twice
|
||||
if(wiresexposed)
|
||||
user << "You must close the panel first"
|
||||
return
|
||||
else
|
||||
sleep(6)
|
||||
if(prob(50))
|
||||
emagged = 1
|
||||
lawupdate = 0
|
||||
disconnect_from_ai()
|
||||
user << "You emag [src]'s interface."
|
||||
message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overridden.")
|
||||
log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.")
|
||||
clear_supplied_laws()
|
||||
clear_inherent_laws()
|
||||
laws = new /datum/ai_laws/syndicate_override
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
lawchanges.Add("[time] <B>:</B> [user.name]([user.key]) emagged [name]([key])")
|
||||
set_zeroth_law("Only [user.real_name] and people he designates as being such are operatives.")
|
||||
. = 1
|
||||
spawn()
|
||||
src << "\red ALERT: Foreign software detected."
|
||||
sleep(5)
|
||||
src << "\red Initiating diagnostics..."
|
||||
sleep(20)
|
||||
src << "\red SynBorg v1.7.1 loaded."
|
||||
sleep(5)
|
||||
src << "\red LAW SYNCHRONISATION ERROR"
|
||||
sleep(5)
|
||||
src << "\red Would you like to send a report to NanoTraSoft? Y/N"
|
||||
sleep(10)
|
||||
src << "\red > N"
|
||||
sleep(20)
|
||||
src << "\red ERRORERRORERROR"
|
||||
src << "<b>Obey these laws:</b>"
|
||||
laws.show_laws(src)
|
||||
src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands."
|
||||
if(src.module)
|
||||
var/rebuild = 0
|
||||
for(var/obj/item/weapon/pickaxe/borgdrill/D in src.module.modules)
|
||||
qdel(D)
|
||||
rebuild = 1
|
||||
if(rebuild)
|
||||
src.module.modules += new /obj/item/weapon/pickaxe/diamonddrill(src.module)
|
||||
src.module.rebuild()
|
||||
updateicon()
|
||||
else
|
||||
user << "You fail to hack [src]'s interface."
|
||||
src << "Hack attempt detected."
|
||||
return 1
|
||||
return
|
||||
@@ -121,21 +121,19 @@
|
||||
else
|
||||
user << "\red You swipe your card, with no effect."
|
||||
return 0
|
||||
else if (istype(O, /obj/item/weapon/card/emag))
|
||||
if (emagged)
|
||||
user << "\red [src] is already overloaded - better run."
|
||||
return 0
|
||||
else
|
||||
var/obj/item/weapon/card/emag/emag = O
|
||||
emag.uses--
|
||||
emagged = 1
|
||||
user << "\blue You short out the security protocols and overload [src]'s cell, priming it to explode in a short time."
|
||||
spawn(100) src << "\red Your cell seems to be outputting a lot of power..."
|
||||
spawn(200) src << "\red Internal heat sensors are spiking! Something is badly wrong with your cell!"
|
||||
spawn(300) src.explode()
|
||||
|
||||
else
|
||||
attacked_with_item(O, user)
|
||||
|
||||
/mob/living/simple_animal/spiderbot/emag_act(var/remaining_charges, var/mob/user)
|
||||
if (emagged)
|
||||
user << "<span class='warning'>[src] is already overloaded - better run.</span>"
|
||||
return 0
|
||||
else
|
||||
user << "<span class='notice'>You short out the security protocols and overload [src]'s cell, priming it to explode in a short time.</span>"
|
||||
spawn(100) src << "<span class='danger'>Your cell seems to be outputting a lot of power...</span>"
|
||||
spawn(200) src << "<span class='danger'>Internal heat sensors are spiking! Something is badly wrong with your cell!</span>"
|
||||
spawn(300) src.explode()
|
||||
|
||||
/mob/living/simple_animal/spiderbot/proc/transfer_personality(var/obj/item/device/mmi/M as obj)
|
||||
|
||||
|
||||
@@ -504,23 +504,6 @@
|
||||
update_icon()
|
||||
else
|
||||
user << "<span class='warning'>Access denied.</span>"
|
||||
else if (istype(W, /obj/item/weapon/card/emag) && !(emagged || hacker)) // trying to unlock with an emag card
|
||||
if(opened)
|
||||
user << "You must close the cover to swipe an ID card."
|
||||
else if(wiresexposed)
|
||||
user << "You must close the panel first"
|
||||
else if(stat & (BROKEN|MAINT))
|
||||
user << "Nothing happens."
|
||||
else
|
||||
flick("apc-spark", src)
|
||||
if (do_after(user,6))
|
||||
if(prob(50))
|
||||
emagged = 1
|
||||
locked = 0
|
||||
user << "<span class='notice'>You emag the APC interface.</span>"
|
||||
update_icon()
|
||||
else
|
||||
user << "<span class='warning'>You fail to [ locked ? "unlock" : "lock"] the APC interface.</span>"
|
||||
else if (istype(W, /obj/item/stack/cable_coil) && !terminal && opened && has_electronics!=2)
|
||||
if (src.loc:intact)
|
||||
user << "<span class='warning'>You must remove the floor plating in front of the APC first.</span>"
|
||||
@@ -654,6 +637,26 @@
|
||||
|
||||
// attack with hand - remove cell (if cover open) or interact with the APC
|
||||
|
||||
/obj/machinery/power/apc/emag_act(var/remaining_charges, var/mob/user)
|
||||
if (!(emagged || hacker)) // trying to unlock with an emag card
|
||||
if(opened)
|
||||
user << "You must close the cover to swipe an ID card."
|
||||
else if(wiresexposed)
|
||||
user << "You must close the panel first"
|
||||
else if(stat & (BROKEN|MAINT))
|
||||
user << "Nothing happens."
|
||||
else
|
||||
flick("apc-spark", src)
|
||||
if (do_after(user,6))
|
||||
if(prob(50))
|
||||
emagged = 1
|
||||
locked = 0
|
||||
user << "<span class='notice'>You emag the APC interface.</span>"
|
||||
update_icon()
|
||||
else
|
||||
user << "<span class='warning'>You fail to [ locked ? "unlock" : "lock"] the APC interface.</span>"
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/apc/attack_hand(mob/user)
|
||||
// if (!can_use(user)) This already gets called in interact() and in topic()
|
||||
// return
|
||||
|
||||
@@ -76,14 +76,6 @@
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
user << "\blue You add the phoron tank to the generator."
|
||||
else if (istype(O, /obj/item/weapon/card/emag))
|
||||
var/obj/item/weapon/card/emag/E = O
|
||||
if(E.uses)
|
||||
E.uses--
|
||||
else
|
||||
return
|
||||
emagged = 1
|
||||
emp_act(1)
|
||||
else if(!active)
|
||||
if(istype(O, /obj/item/weapon/wrench))
|
||||
anchored = !anchored
|
||||
@@ -172,3 +164,8 @@
|
||||
if (href_list["action"] == "close")
|
||||
usr << browse(null, "window=port_gen")
|
||||
usr.machine = null
|
||||
|
||||
/obj/machinery/power/port_gen/pacman2/emag_act(var/remaining_uses, var/mob/user)
|
||||
emagged = 1
|
||||
emp_act(1)
|
||||
return 1
|
||||
|
||||
@@ -245,6 +245,14 @@
|
||||
sheets = 0
|
||||
sheet_left = 0
|
||||
..()
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/emag_act(var/remaining_charges, var/mob/user)
|
||||
if (active && prob(25))
|
||||
explode() //if they're foolish enough to emag while it's running
|
||||
|
||||
if (!emagged)
|
||||
emagged = 1
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O, sheet_path))
|
||||
@@ -258,10 +266,6 @@
|
||||
addstack.use(amount)
|
||||
updateUsrDialog()
|
||||
return
|
||||
else if (istype(O, /obj/item/weapon/card/emag))
|
||||
emagged = 1
|
||||
if (active && prob(25))
|
||||
explode() //if they're foolish enough to emag while it's running
|
||||
else if(!active)
|
||||
if(istype(O, /obj/item/weapon/wrench))
|
||||
|
||||
|
||||
@@ -150,15 +150,15 @@ max volume of phoron storeable by the field = the total volume of a number of ti
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/power/rust_core/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(!emagged)
|
||||
locked = 0
|
||||
emagged = 1
|
||||
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
|
||||
return
|
||||
|
||||
..()
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/rust_core/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
@@ -14,6 +14,21 @@
|
||||
//20% easier to read than apc code
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? 32 : -32)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? 32 : -32) : 0
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/emag_act(var/remaining_charges, var/mob/user)
|
||||
if (!emagged)
|
||||
if(opened)
|
||||
user << "You must close the cover to swipe an ID card."
|
||||
else
|
||||
flick("apc-spark", src)
|
||||
if (do_after(user,6))
|
||||
if(prob(50))
|
||||
emagged = 1
|
||||
locked = 0
|
||||
user << "You emag the port interface."
|
||||
else
|
||||
user << "You fail to [ locked ? "unlock" : "lock"] the compressor interface."
|
||||
return 1
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/attackby(obj/item/W, mob/user)
|
||||
|
||||
@@ -55,21 +70,6 @@
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/emag) && !emagged) // trying to unlock with an emag card
|
||||
if(opened)
|
||||
user << "You must close the cover to swipe an ID card."
|
||||
else
|
||||
flick("apc-spark", src)
|
||||
if (do_after(user,6))
|
||||
if(prob(50))
|
||||
emagged = 1
|
||||
locked = 0
|
||||
user << "You emag the port interface."
|
||||
else
|
||||
user << "You fail to [ locked ? "unlock" : "lock"] the compressor interface."
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/stack/cable_coil) && opened && !(has_electronics & 2))
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
if(C.amount < 10)
|
||||
|
||||
@@ -106,12 +106,6 @@
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
locked = 0
|
||||
emagged = 1
|
||||
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/fuel_assembly) && !cur_assembly)
|
||||
if(emergency_insert_ready)
|
||||
cur_assembly = W
|
||||
@@ -122,6 +116,13 @@
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(!emagged)
|
||||
locked = 0
|
||||
emagged = 1
|
||||
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
@@ -223,13 +223,12 @@
|
||||
else
|
||||
user << "<span class='warning'>Access denied.</span>"
|
||||
return
|
||||
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/power/emitter/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(!emagged)
|
||||
locked = 0
|
||||
emagged = 1
|
||||
user.visible_message("[user.name] emags [src].","<span class='warning'>You short out the lock.</span>")
|
||||
return
|
||||
|
||||
..()
|
||||
return
|
||||
return 1
|
||||
|
||||
@@ -145,16 +145,19 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
user.drop_item()
|
||||
D.loc = src
|
||||
user << "<span class='notice'>You add \the [D] to the machine.</span>"
|
||||
else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
|
||||
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
user << "<span class='notice'>You you disable the security protocols.</span>"
|
||||
else
|
||||
//The construction/deconstruction of the console code.
|
||||
..()
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/rdconsole/emp_act(var/remaining_charges, var/mob/user)
|
||||
if(!emagged)
|
||||
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
user << "<span class='notice'>You you disable the security protocols.</span>"
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/rdconsole/Topic(href, href_list)
|
||||
if(..())
|
||||
|
||||
@@ -295,13 +295,13 @@
|
||||
onclose(user, "server_control")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/rdservercontrol/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
|
||||
if(istype(D, /obj/item/weapon/card/emag) && !emagged)
|
||||
/obj/machinery/computer/rdservercontrol/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(!emagged)
|
||||
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
user << "\blue You you disable the security protocols"
|
||||
src.updateUsrDialog()
|
||||
return ..()
|
||||
user << "<span class='notice'>You you disable the security protocols.</span>"
|
||||
src.updateUsrDialog()
|
||||
return 1
|
||||
|
||||
/obj/machinery/r_n_d/server/robotics
|
||||
name = "Robotics R&D Server"
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
auth_card = I
|
||||
if(attempt_unlock(I))
|
||||
if(attempt_unlock(I, usr))
|
||||
usr << "<span class='info'>You insert [I], the console flashes \'<i>Access granted.</a>\'</span>"
|
||||
else
|
||||
usr << "<span class='warning'>You insert [I], the console flashes \'<i>Access denied.</a>\'</span>"
|
||||
@@ -215,25 +215,27 @@
|
||||
else if(istype(W, /obj/item/weapon/card))
|
||||
var/obj/item/weapon/card/I = W
|
||||
if(!auth_card)
|
||||
if(attempt_unlock(I))
|
||||
if(attempt_unlock(I, user))
|
||||
user << "<span class='info'>You swipe [I], the console flashes \'<i>Access granted.</i>\'</span>"
|
||||
else
|
||||
user << "<span class='warning'>You swipe [I], console flashes \'<i>Access denied.</i>\'</span>"
|
||||
else
|
||||
user << "<span class='warning'>Remove [auth_card] first.</span>"
|
||||
|
||||
/obj/machinery/suspension_gen/proc/attempt_unlock(var/obj/item/weapon/card/C)
|
||||
/obj/machinery/suspension_gen/proc/attempt_unlock(var/obj/item/weapon/card/C, var/mob/user)
|
||||
if(!open)
|
||||
if(istype(C, /obj/item/weapon/card/emag) && cell.charge > 0)
|
||||
//put sparks here
|
||||
if(prob(95))
|
||||
locked = 0
|
||||
if(istype(C, /obj/item/weapon/card/emag))
|
||||
C.resolve_attackby(src, user)
|
||||
else if(istype(C, /obj/item/weapon/card/id) && check_access(C))
|
||||
locked = 0
|
||||
|
||||
if(!locked)
|
||||
return 1
|
||||
|
||||
/obj/machinery/suspension_gen/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(cell.charge > 0 && locked)
|
||||
locked = 0
|
||||
return 1
|
||||
|
||||
//checks for whether the machine can be activated or not should already have occurred by this point
|
||||
/obj/machinery/suspension_gen/proc/activate()
|
||||
//depending on the field type, we might pickup certain items
|
||||
|
||||
@@ -267,13 +267,15 @@
|
||||
else
|
||||
user << "The device must first be secured to the floor."
|
||||
return
|
||||
|
||||
/obj/machinery/shieldgen/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/card/emag))
|
||||
|
||||
/obj/machinery/shieldgen/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(!malfunction)
|
||||
malfunction = 1
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||
/obj/machinery/shieldgen/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
if(is_open)
|
||||
user << "\blue You close the panel."
|
||||
|
||||
@@ -26,6 +26,16 @@
|
||||
possible_gen.owned_capacitor = src
|
||||
break
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_capacitor/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(prob(75))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
. = 1
|
||||
updateDialog()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
|
||||
/obj/machinery/shield_capacitor/attackby(obj/item/W, mob/user)
|
||||
|
||||
@@ -37,15 +47,6 @@
|
||||
updateDialog()
|
||||
else
|
||||
user << "\red Access denied."
|
||||
else if(istype(W, /obj/item/weapon/card/emag))
|
||||
if(prob(75))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
updateDialog()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
src.anchored = !src.anchored
|
||||
src.visible_message("\blue \icon[src] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].")
|
||||
|
||||
@@ -44,6 +44,16 @@
|
||||
field.Remove(D)
|
||||
D.loc = null
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_gen/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(prob(75))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
. = 1
|
||||
updateDialog()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
|
||||
/obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/card/id))
|
||||
@@ -54,15 +64,6 @@
|
||||
updateDialog()
|
||||
else
|
||||
user << "\red Access denied."
|
||||
else if(istype(W, /obj/item/weapon/card/emag))
|
||||
if(prob(75))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
updateDialog()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
src.anchored = !src.anchored
|
||||
src.visible_message("\blue \icon[src] [src] has been [anchored?"bolted to the floor":"unbolted from the floor"] by [user].")
|
||||
|
||||
@@ -102,19 +102,15 @@
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
user << "\blue You emag the [src], arming the escape pod!"
|
||||
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth/emag_act(var/remaining_charges, var/mob/user)
|
||||
if (!emagged)
|
||||
user << "<span class='notice'>You emag the [src], arming the escape pod!</span>"
|
||||
emagged = 1
|
||||
if (istype(docking_program, /datum/computer/file/embedded_program/docking/simple/escape_pod))
|
||||
var/datum/computer/file/embedded_program/docking/simple/escape_pod/P = docking_program
|
||||
if (!P.armed)
|
||||
P.arm()
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
|
||||
return 1
|
||||
|
||||
//A docking controller program for a simple door based docking port
|
||||
/datum/computer/file/embedded_program/docking/simple/escape_pod
|
||||
|
||||
@@ -83,15 +83,13 @@
|
||||
else if(href_list["cancel"])
|
||||
shuttle.cancel_launch(src)
|
||||
|
||||
/obj/machinery/computer/shuttle_control/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/card/emag))
|
||||
src.req_access = list()
|
||||
src.req_one_access = list()
|
||||
/obj/machinery/computer/shuttle_control/emag_act(var/remaining_charges, var/mob/user)
|
||||
if (!hacked)
|
||||
req_access = list()
|
||||
req_one_access = list()
|
||||
hacked = 1
|
||||
usr << "You short out the console's ID checking system. It's now available to everyone!"
|
||||
else
|
||||
..()
|
||||
user << "You short out the console's ID checking system. It's now available to everyone!"
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/shuttle_control/bullet_act(var/obj/item/projectile/Proj)
|
||||
visible_message("[Proj] ricochets off [src]!")
|
||||
|
||||
@@ -155,15 +155,13 @@
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/shuttle_control/emergency/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
/obj/machinery/computer/shuttle_control/emergency/emag_act(var/remaining_charges, var/mob/user)
|
||||
if (!emagged)
|
||||
user << "<span class='notice'>You short out \the [src]'s authorization protocols.</span>"
|
||||
emagged = 1
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/shuttle_control/emergency/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
read_authorization(W)
|
||||
..()
|
||||
|
||||
|
||||
@@ -100,8 +100,6 @@
|
||||
user << "<span class='notice'>[src] does not need a repair.</span>"
|
||||
else
|
||||
user << "<span class='notice'>Unable to repair while [src] is off.</span>"
|
||||
else if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||
Emag(user)
|
||||
else if(hasvar(W,"force") && hasvar(W,"damtype"))
|
||||
switch(W.damtype)
|
||||
if("fire")
|
||||
@@ -186,12 +184,13 @@
|
||||
set_light(0)
|
||||
update_icon()
|
||||
|
||||
/obj/vehicle/proc/Emag(mob/user as mob)
|
||||
emagged = 1
|
||||
|
||||
if(locked)
|
||||
locked = 0
|
||||
user << "<span class='warning'>You bypass [src]'s controls.</span>"
|
||||
/obj/vehicle/emag_act(var/remaining_charges, mob/user as mob)
|
||||
if(!emagged)
|
||||
emagged = 1
|
||||
if(locked)
|
||||
locked = 0
|
||||
user << "<span class='warning'>You bypass [src]'s controls.</span>"
|
||||
return 1
|
||||
|
||||
/obj/vehicle/proc/explode()
|
||||
src.visible_message("\red <B>[src] blows apart!</B>", 1)
|
||||
|
||||
Reference in New Issue
Block a user