Projectile effects - Part 3

- Fixes for turrets, rogue drones, and emitters
- Removed muzzle flash from chem darts
- Converted emitters to use spanclasses and have correct capitalization
This commit is contained in:
Loganbacca
2015-03-09 20:40:10 +13:00
parent 80381a87d0
commit 11d340f898
5 changed files with 36 additions and 33 deletions

View File

@@ -1,7 +1,7 @@
#define EMITTER_DAMAGE_POWER_TRANSFER 450 //used to transfer power to containment field generators
/obj/machinery/power/emitter
name = "Emitter"
name = "emitter"
desc = "It is a heavy duty industrial laser."
icon = 'icons/obj/singularity.dmi'
icon_state = "emitter"
@@ -60,18 +60,18 @@
/obj/machinery/power/emitter/proc/activate(mob/user as mob)
if(state == 2)
if(!powernet)
user << "The emitter isn't connected to a wire."
user << "\The [src] isn't connected to a wire."
return 1
if(!src.locked)
if(src.active==1)
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)
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")
else
src.active = 1
user << "You turn on the [src]."
user << "You turn on [src]."
src.shot_number = 0
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)
@@ -79,9 +79,9 @@
investigate_log("turned <font color='green'>on</font> by [user.key]","singulo")
update_icon()
else
user << "\red The controls are locked!"
user << "<span class='warning'>The controls are locked!</span>"
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
@@ -138,86 +138,83 @@
s.set_up(5, 1, src)
s.start()
A.set_dir(src.dir)
A.starting = get_turf(src)
switch(dir)
if(NORTH)
A.yo = 20
A.xo = 0
A.original = locate(x, y+1, z)
if(EAST)
A.yo = 0
A.xo = 20
A.original = locate(x+1, y, z)
if(WEST)
A.yo = 0
A.xo = -20
A.original = locate(x-1, y, z)
else // Any other
A.yo = -20
A.xo = 0
A.process() //TODO: Carn: check this out
A.original = locate(x, y-1, z)
A.process()
/obj/machinery/power/emitter/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(active)
user << "Turn off the [src] first."
user << "Turn off [src] first."
return
switch(state)
if(0)
state = 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 hear a ratchet")
src.anchored = 1
if(1)
state = 0
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 hear a ratchet")
src.anchored = 0
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
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(active)
user << "Turn off the [src] first."
user << "Turn off [src] first."
return
switch(state)
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 (WT.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
"You start to weld the [src] to the floor.", \
user.visible_message("[user.name] starts to weld [src] to the floor.", \
"You start to weld [src] to the floor.", \
"You hear welding")
if (do_after(user,20))
if(!src || !WT.isOn()) return
state = 2
user << "You weld the [src] to the floor."
user << "You weld [src] to the floor."
connect_to_network()
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 (WT.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
"You start to cut the [src] free from the floor.", \
user.visible_message("[user.name] starts to cut [src] free from the floor.", \
"You start to cut [src] free from the floor.", \
"You hear welding")
if (do_after(user,20))
if(!src || !WT.isOn()) return
state = 1
user << "You cut the [src] free from the floor."
user << "You cut [src] free from the floor."
disconnect_from_network()
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
if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
if(emagged)
user << "\red The lock seems to be broken"
user << "<span class='warning'>The lock seems to be broken.</span>"
return
if(src.allowed(user))
if(active)
@@ -225,16 +222,16 @@
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
else
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
user << "\red Access denied."
user << "<span class='warning'>Access denied.</span>"
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.")
user.visible_message("[user.name] emags [src].","<span class='warning'>You short out the lock.</span>")
return
..()