Path normalization requires outdenting

This commit is contained in:
Patrick Meade
2019-01-24 16:40:11 -06:00
parent b4641b7fdb
commit cbbb1e4262
2 changed files with 63 additions and 62 deletions
+51 -50
View File
@@ -10,74 +10,75 @@
var/list/bulletholes = list()
/obj/item/target/Destroy()
// if a target is deleted and associated with a stake, force stake to forget
for(var/obj/structure/target_stake/T in view(3,src))
if(T.pinned_target == src)
T.pinned_target = null
T.density = 1
break
return ..() // delete target
// if a target is deleted and associated with a stake, force stake to forget
for(var/obj/structure/target_stake/T in view(3,src))
if(T.pinned_target == src)
T.pinned_target = null
T.density = 1
break
return ..() // delete target
/obj/item/target/Move()
..()
// After target moves, check for nearby stakes. If associated, move to target
for(var/obj/structure/target_stake/M in view(3,src))
if(M.density == 0 && M.pinned_target == src)
M.loc = loc
..()
// After target moves, check for nearby stakes. If associated, move to target
for(var/obj/structure/target_stake/M in view(3,src))
if(M.density == 0 && M.pinned_target == src)
M.loc = loc
// This may seem a little counter-intuitive but I assure you that's for a purpose.
// Stakes are the ones that carry targets, yes, but in the stake code we set
// a stake's density to 0 meaning it can't be pushed anymore. Instead of pushing
// the stake now, we have to push the target.
// This may seem a little counter-intuitive but I assure you that's for a purpose.
// Stakes are the ones that carry targets, yes, but in the stake code we set
// a stake's density to 0 meaning it can't be pushed anymore. Instead of pushing
// the stake now, we have to push the target.
/obj/item/target/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0, user))
overlays.Cut()
to_chat(usr, "You slice off [src]'s uneven chunks of aluminum and scorch marks.")
return
if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0, user))
overlays.Cut()
to_chat(usr, "You slice off [src]'s uneven chunks of aluminum and scorch marks.")
return
/obj/item/target/attack_hand(mob/user as mob)
// taking pinned targets off!
var/obj/structure/target_stake/stake
for(var/obj/structure/target_stake/T in view(3,src))
if(T.pinned_target == src)
stake = T
break
// taking pinned targets off!
var/obj/structure/target_stake/stake
for(var/obj/structure/target_stake/T in view(3,src))
if(T.pinned_target == src)
stake = T
break
if(stake)
if(stake.pinned_target)
stake.density = 1
density = 0
layer = OBJ_LAYER
if(stake)
if(stake.pinned_target)
stake.density = 1
density = 0
layer = OBJ_LAYER
loc = user.loc
if(ishuman(user))
if(!user.get_active_hand())
user.put_in_hands(src)
to_chat(user, "You take the target out of the stake.")
else
src.loc = get_turf(user)
loc = user.loc
if(ishuman(user))
if(!user.get_active_hand())
user.put_in_hands(src)
to_chat(user, "You take the target out of the stake.")
else
src.loc = get_turf(user)
to_chat(user, "You take the target out of the stake.")
stake.pinned_target = null
return
stake.pinned_target = null
return
else
..()
else
..()
/obj/item/target/syndicate
icon_state = "target_s"
desc = "A shooting target that looks like a syndicate scum."
hp = 2600 // i guess syndie targets are sturdier?
icon_state = "target_s"
desc = "A shooting target that looks like a syndicate scum."
hp = 2600 // i guess syndie targets are sturdier?
/obj/item/target/alien
icon_state = "target_q"
desc = "A shooting target that looks like a xenomorphic alien."
hp = 2350 // alium onest too kinda
icon_state = "target_q"
desc = "A shooting target that looks like a xenomorphic alien."
hp = 2350 // alium onest too kinda
/obj/item/target/bullet_act(var/obj/item/projectile/Proj)
var/p_x = Proj.p_x + pick(0,0,0,0,0,-1,1) // really ugly way of coding "sometimes offset Proj.p_x!"