Merge pull request #4962 from Citadel-Station-13/upstream-merge-34514

[MIRROR] You can now buckle people to target stakes
This commit is contained in:
deathride58
2018-01-19 19:44:39 +00:00
committed by GitHub
+20 -1
View File
@@ -3,8 +3,11 @@
desc = "A thin platform with negatively-magnetized wheels."
icon = 'icons/obj/objects.dmi'
icon_state = "target_stake"
density = TRUE
density = FALSE
flags_1 = CONDUCT_1
can_buckle = TRUE
max_buckled_mobs = 1
buckle_lying = FALSE
var/obj/item/target/pinned_target
/obj/structure/target_stake/Destroy()
@@ -12,6 +15,20 @@
pinned_target.nullPinnedLoc()
return ..()
/obj/structure/target_stake/proc/handle_density()
if(length(buckled_mobs) || pinned_target)
density = TRUE
else
density = FALSE
/obj/structure/target_stake/post_buckle_mob()
handle_density()
return ..()
/obj/structure/target_stake/post_unbuckle_mob()
handle_density()
return ..()
/obj/structure/target_stake/proc/nullPinnedTarget()
pinned_target = null
@@ -28,6 +45,7 @@
T.pinnedLoc = src
T.density = TRUE
T.layer = OBJ_LAYER + 0.01
handle_density()
to_chat(user, "<span class='notice'>You slide the target into the stake.</span>")
/obj/structure/target_stake/attack_hand(mob/user)
@@ -39,6 +57,7 @@
pinned_target.forceMove(user.loc)
pinned_target.nullPinnedLoc()
nullPinnedTarget()
handle_density()
if(ishuman(user))
if(!user.get_active_held_item())
user.put_in_hands(pinned_target)