|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
#define EMITTER_DAMAGE_POWER_TRANSFER 450 //used to transfer power to containment field generators
|
|
|
|
#define EMITTER_DAMAGE_POWER_TRANSFER 450 //used to transfer power to containment field generators
|
|
|
|
|
|
|
|
|
|
|
|
/obj/machinery/power/emitter
|
|
|
|
/obj/machinery/power/emitter
|
|
|
|
name = "Emitter"
|
|
|
|
name = "emitter"
|
|
|
|
desc = "It is a heavy duty industrial laser."
|
|
|
|
desc = "It is a heavy duty industrial laser."
|
|
|
|
icon = 'icons/obj/singularity.dmi'
|
|
|
|
icon = 'icons/obj/singularity.dmi'
|
|
|
|
icon_state = "emitter"
|
|
|
|
icon_state = "emitter"
|
|
|
|
@@ -60,18 +60,18 @@
|
|
|
|
/obj/machinery/power/emitter/proc/activate(mob/user as mob)
|
|
|
|
/obj/machinery/power/emitter/proc/activate(mob/user as mob)
|
|
|
|
if(state == 2)
|
|
|
|
if(state == 2)
|
|
|
|
if(!powernet)
|
|
|
|
if(!powernet)
|
|
|
|
user << "The emitter isn't connected to a wire."
|
|
|
|
user << "\The [src] isn't connected to a wire."
|
|
|
|
return 1
|
|
|
|
return 1
|
|
|
|
if(!src.locked)
|
|
|
|
if(!src.locked)
|
|
|
|
if(src.active==1)
|
|
|
|
if(src.active==1)
|
|
|
|
src.active = 0
|
|
|
|
src.active = 0
|
|
|
|
user << "You turn off the [src]."
|
|
|
|
user << "You turn off [src]."
|
|
|
|
message_admins("Emitter turned off by [key_name(user, user.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
|
|
|
message_admins("Emitter turned off by [key_name(user, user.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
|
|
|
log_game("Emitter turned off by [user.ckey]([user]) in ([x],[y],[z])")
|
|
|
|
log_game("Emitter turned off by [user.ckey]([user]) in ([x],[y],[z])")
|
|
|
|
investigate_log("turned <font color='red'>off</font> by [user.key]","singulo")
|
|
|
|
investigate_log("turned <font color='red'>off</font> by [user.key]","singulo")
|
|
|
|
else
|
|
|
|
else
|
|
|
|
src.active = 1
|
|
|
|
src.active = 1
|
|
|
|
user << "You turn on the [src]."
|
|
|
|
user << "You turn on [src]."
|
|
|
|
src.shot_number = 0
|
|
|
|
src.shot_number = 0
|
|
|
|
src.fire_delay = 100
|
|
|
|
src.fire_delay = 100
|
|
|
|
message_admins("Emitter turned on by [key_name(user, user.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
|
|
|
message_admins("Emitter turned on by [key_name(user, user.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
|
|
|
@@ -79,9 +79,9 @@
|
|
|
|
investigate_log("turned <font color='green'>on</font> by [user.key]","singulo")
|
|
|
|
investigate_log("turned <font color='green'>on</font> by [user.key]","singulo")
|
|
|
|
update_icon()
|
|
|
|
update_icon()
|
|
|
|
else
|
|
|
|
else
|
|
|
|
user << "\red The controls are locked!"
|
|
|
|
user << "<span class='warning'>The controls are locked!</span>"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
user << "\red The [src] needs to be firmly secured to the floor first."
|
|
|
|
user << "<span class='warning'>\The [src] needs to be firmly secured to the floor first.</span>"
|
|
|
|
return 1
|
|
|
|
return 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -138,86 +138,83 @@
|
|
|
|
s.set_up(5, 1, src)
|
|
|
|
s.set_up(5, 1, src)
|
|
|
|
s.start()
|
|
|
|
s.start()
|
|
|
|
A.set_dir(src.dir)
|
|
|
|
A.set_dir(src.dir)
|
|
|
|
|
|
|
|
A.starting = get_turf(src)
|
|
|
|
switch(dir)
|
|
|
|
switch(dir)
|
|
|
|
if(NORTH)
|
|
|
|
if(NORTH)
|
|
|
|
A.yo = 20
|
|
|
|
A.original = locate(x, y+1, z)
|
|
|
|
A.xo = 0
|
|
|
|
|
|
|
|
if(EAST)
|
|
|
|
if(EAST)
|
|
|
|
A.yo = 0
|
|
|
|
A.original = locate(x+1, y, z)
|
|
|
|
A.xo = 20
|
|
|
|
|
|
|
|
if(WEST)
|
|
|
|
if(WEST)
|
|
|
|
A.yo = 0
|
|
|
|
A.original = locate(x-1, y, z)
|
|
|
|
A.xo = -20
|
|
|
|
|
|
|
|
else // Any other
|
|
|
|
else // Any other
|
|
|
|
A.yo = -20
|
|
|
|
A.original = locate(x, y-1, z)
|
|
|
|
A.xo = 0
|
|
|
|
A.process()
|
|
|
|
A.process() //TODO: Carn: check this out
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/obj/machinery/power/emitter/attackby(obj/item/W, mob/user)
|
|
|
|
/obj/machinery/power/emitter/attackby(obj/item/W, mob/user)
|
|
|
|
|
|
|
|
|
|
|
|
if(istype(W, /obj/item/weapon/wrench))
|
|
|
|
if(istype(W, /obj/item/weapon/wrench))
|
|
|
|
if(active)
|
|
|
|
if(active)
|
|
|
|
user << "Turn off the [src] first."
|
|
|
|
user << "Turn off [src] first."
|
|
|
|
return
|
|
|
|
return
|
|
|
|
switch(state)
|
|
|
|
switch(state)
|
|
|
|
if(0)
|
|
|
|
if(0)
|
|
|
|
state = 1
|
|
|
|
state = 1
|
|
|
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
|
|
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
|
|
|
user.visible_message("[user.name] secures [src.name] to the floor.", \
|
|
|
|
user.visible_message("[user.name] secures [src] to the floor.", \
|
|
|
|
"You secure the external reinforcing bolts to the floor.", \
|
|
|
|
"You secure the external reinforcing bolts to the floor.", \
|
|
|
|
"You hear a ratchet")
|
|
|
|
"You hear a ratchet")
|
|
|
|
src.anchored = 1
|
|
|
|
src.anchored = 1
|
|
|
|
if(1)
|
|
|
|
if(1)
|
|
|
|
state = 0
|
|
|
|
state = 0
|
|
|
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
|
|
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
|
|
|
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
|
|
|
|
user.visible_message("[user.name] unsecures [src] reinforcing bolts from the floor.", \
|
|
|
|
"You undo the external reinforcing bolts.", \
|
|
|
|
"You undo the external reinforcing bolts.", \
|
|
|
|
"You hear a ratchet")
|
|
|
|
"You hear a ratchet")
|
|
|
|
src.anchored = 0
|
|
|
|
src.anchored = 0
|
|
|
|
if(2)
|
|
|
|
if(2)
|
|
|
|
user << "\red The [src.name] needs to be unwelded from the floor."
|
|
|
|
user << "<span class='warning'>\The [src] needs to be unwelded from the floor.</span>"
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
if(istype(W, /obj/item/weapon/weldingtool))
|
|
|
|
if(istype(W, /obj/item/weapon/weldingtool))
|
|
|
|
var/obj/item/weapon/weldingtool/WT = W
|
|
|
|
var/obj/item/weapon/weldingtool/WT = W
|
|
|
|
if(active)
|
|
|
|
if(active)
|
|
|
|
user << "Turn off the [src] first."
|
|
|
|
user << "Turn off [src] first."
|
|
|
|
return
|
|
|
|
return
|
|
|
|
switch(state)
|
|
|
|
switch(state)
|
|
|
|
if(0)
|
|
|
|
if(0)
|
|
|
|
user << "\red The [src.name] needs to be wrenched to the floor."
|
|
|
|
user << "<span class='warning'>\The [src] needs to be wrenched to the floor.</span>"
|
|
|
|
if(1)
|
|
|
|
if(1)
|
|
|
|
if (WT.remove_fuel(0,user))
|
|
|
|
if (WT.remove_fuel(0,user))
|
|
|
|
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
|
|
|
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
|
|
|
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
|
|
|
|
user.visible_message("[user.name] starts to weld [src] to the floor.", \
|
|
|
|
"You start to weld the [src] to the floor.", \
|
|
|
|
"You start to weld [src] to the floor.", \
|
|
|
|
"You hear welding")
|
|
|
|
"You hear welding")
|
|
|
|
if (do_after(user,20))
|
|
|
|
if (do_after(user,20))
|
|
|
|
if(!src || !WT.isOn()) return
|
|
|
|
if(!src || !WT.isOn()) return
|
|
|
|
state = 2
|
|
|
|
state = 2
|
|
|
|
user << "You weld the [src] to the floor."
|
|
|
|
user << "You weld [src] to the floor."
|
|
|
|
connect_to_network()
|
|
|
|
connect_to_network()
|
|
|
|
else
|
|
|
|
else
|
|
|
|
user << "\red You need more welding fuel to complete this task."
|
|
|
|
user << "<span class='warning'>You need more welding fuel to complete this task.</span>"
|
|
|
|
if(2)
|
|
|
|
if(2)
|
|
|
|
if (WT.remove_fuel(0,user))
|
|
|
|
if (WT.remove_fuel(0,user))
|
|
|
|
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
|
|
|
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
|
|
|
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
|
|
|
|
user.visible_message("[user.name] starts to cut [src] free from the floor.", \
|
|
|
|
"You start to cut the [src] free from the floor.", \
|
|
|
|
"You start to cut [src] free from the floor.", \
|
|
|
|
"You hear welding")
|
|
|
|
"You hear welding")
|
|
|
|
if (do_after(user,20))
|
|
|
|
if (do_after(user,20))
|
|
|
|
if(!src || !WT.isOn()) return
|
|
|
|
if(!src || !WT.isOn()) return
|
|
|
|
state = 1
|
|
|
|
state = 1
|
|
|
|
user << "You cut the [src] free from the floor."
|
|
|
|
user << "You cut [src] free from the floor."
|
|
|
|
disconnect_from_network()
|
|
|
|
disconnect_from_network()
|
|
|
|
else
|
|
|
|
else
|
|
|
|
user << "\red You need more welding fuel to complete this task."
|
|
|
|
user << "<span class='warning'>You need more welding fuel to complete this task.</span>"
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
|
|
|
|
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
|
|
|
|
if(emagged)
|
|
|
|
if(emagged)
|
|
|
|
user << "\red The lock seems to be broken"
|
|
|
|
user << "<span class='warning'>The lock seems to be broken.</span>"
|
|
|
|
return
|
|
|
|
return
|
|
|
|
if(src.allowed(user))
|
|
|
|
if(src.allowed(user))
|
|
|
|
if(active)
|
|
|
|
if(active)
|
|
|
|
@@ -225,16 +222,16 @@
|
|
|
|
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
|
|
|
|
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
src.locked = 0 //just in case it somehow gets locked
|
|
|
|
src.locked = 0 //just in case it somehow gets locked
|
|
|
|
user << "\red The controls can only be locked when the [src] is online"
|
|
|
|
user << "<span class='warning'>The controls can only be locked when [src] is online.</span>"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
user << "\red Access denied."
|
|
|
|
user << "<span class='warning'>Access denied.</span>"
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
|
|
|
if(istype(W, /obj/item/weapon/card/emag) && !emagged)
|
|
|
|
locked = 0
|
|
|
|
locked = 0
|
|
|
|
emagged = 1
|
|
|
|
emagged = 1
|
|
|
|
user.visible_message("[user.name] emags the [src.name].","\red You short out the lock.")
|
|
|
|
user.visible_message("[user.name] emags [src].","<span class='warning'>You short out the lock.</span>")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
..()
|
|
|
|
..()
|
|
|
|
|