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

@@ -605,6 +605,7 @@
//Shooting Code: //Shooting Code:
A.current = T A.current = T
A.starting = T
A.yo = U.y - T.y A.yo = U.y - T.y
A.xo = U.x - T.x A.xo = U.x - T.x
spawn(1) spawn(1)

View File

@@ -265,6 +265,7 @@
A = new /obj/item/projectile/energy/electrode( loc ) A = new /obj/item/projectile/energy/electrode( loc )
use_power(200) use_power(200)
A.current = T A.current = T
A.starting = T
A.yo = U.y - T.y A.yo = U.y - T.y
A.xo = U.x - T.x A.xo = U.x - T.x
spawn( 0 ) spawn( 0 )

View File

@@ -188,6 +188,8 @@
del(A) del(A)
return return
A.current = target A.current = target
A.starting = get_turf(src)
A.original = get_turf(target)
A.yo = target:y - start:y A.yo = target:y - start:y
A.xo = target:x - start:x A.xo = target:x - start:x
spawn( 0 ) spawn( 0 )

View File

@@ -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
..() ..()

View File

@@ -6,6 +6,8 @@
embed = 1 //the dart is shot fast enough to pierce space suits, so I guess splintering inside the target can be a thing. Should be rare due to low damage. embed = 1 //the dart is shot fast enough to pierce space suits, so I guess splintering inside the target can be a thing. Should be rare due to low damage.
var/reagent_amount = 15 var/reagent_amount = 15
kill_count = 15 //shorter range kill_count = 15 //shorter range
muzzle_type = null
/obj/item/projectile/bullet/chemdart/New() /obj/item/projectile/bullet/chemdart/New()
reagents = new/datum/reagents(reagent_amount) reagents = new/datum/reagents(reagent_amount)