mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 21:19:00 +01:00
TG Buckle Update (#12375)
This commit is contained in:
committed by
variableundefined
parent
7846268dae
commit
c87389a595
@@ -35,14 +35,20 @@
|
||||
desc = "A spike for collecting meat from animals."
|
||||
density = 1
|
||||
anchored = 1
|
||||
buckle_lying = 0
|
||||
can_buckle = 1
|
||||
buckle_lying = FALSE
|
||||
can_buckle = TRUE
|
||||
|
||||
//ATTACK HAND IGNORING PARENT RETURN VALUE
|
||||
/obj/structure/kitchenspike/attack_hand(mob/user)
|
||||
if(has_buckled_mobs())
|
||||
for(var/mob/living/L in buckled_mobs)
|
||||
user_unbuckle_mob(L, user)
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
/obj/structure/kitchenspike/attackby(obj/item/grab/G as obj, mob/user as mob)
|
||||
/obj/structure/kitchenspike/attackby(obj/item/grab/G, mob/user)
|
||||
if(istype(G, /obj/item/crowbar))
|
||||
if(!buckled_mob)
|
||||
if(!has_buckled_mobs())
|
||||
playsound(loc, G.usesound, 100, 1)
|
||||
if(do_after(user, 20 * G.toolspeed, target = src))
|
||||
to_chat(user, "<span class='notice'>You pry the spikes out of the frame.</span>")
|
||||
@@ -55,11 +61,11 @@
|
||||
return
|
||||
if(!istype(G, /obj/item/grab) || !G.affecting)
|
||||
return
|
||||
if(buckled_mob)
|
||||
if(has_buckled_mobs())
|
||||
to_chat(user, "<span class = 'danger'>The spike already has something on it, finish collecting its meat first!</span>")
|
||||
else
|
||||
if(isliving(G.affecting))
|
||||
if(!buckled_mob)
|
||||
if(!has_buckled_mobs())
|
||||
if(do_mob(user, src, 120))
|
||||
if(spike(G.affecting))
|
||||
G.affecting.visible_message("<span class='danger'>[user] slams [G.affecting] onto the meat spike!</span>", "<span class='userdanger'>[user] slams you onto the meat spike!</span>", "<span class='italics'>You hear a squishy wet noise.</span>")
|
||||
@@ -68,56 +74,50 @@
|
||||
to_chat(user, "<span class='danger'>You can't use that on the spike!</span>")
|
||||
return
|
||||
|
||||
/obj/structure/kitchenspike/proc/spike(var/mob/living/victim)
|
||||
/obj/structure/kitchenspike/proc/spike(mob/living/victim)
|
||||
|
||||
if(!istype(victim))
|
||||
return
|
||||
return FALSE
|
||||
|
||||
|
||||
if(buckled_mob) //to prevent spam/queing up attacks
|
||||
return 0
|
||||
if(has_buckled_mobs()) //to prevent spam/queing up attacks
|
||||
return FALSE
|
||||
if(victim.buckled)
|
||||
return 0
|
||||
var/mob/living/H = victim
|
||||
return FALSE
|
||||
playsound(loc, 'sound/effects/splat.ogg', 25, 1)
|
||||
H.forceMove(loc)
|
||||
H.emote("scream")
|
||||
if(ishuman(H))
|
||||
victim.forceMove(drop_location())
|
||||
victim.emote("scream")
|
||||
if(ishuman(victim))
|
||||
var/mob/living/carbon/human/H = victim
|
||||
H.add_splatter_floor()
|
||||
H.adjustBruteLoss(30)
|
||||
H.buckled = src
|
||||
H.dir = 2
|
||||
buckled_mob = H
|
||||
var/matrix/m180 = matrix()
|
||||
victim.adjustBruteLoss(30)
|
||||
victim.setDir(2)
|
||||
buckle_mob(victim, force = TRUE)
|
||||
var/matrix/m180 = matrix(victim.transform)
|
||||
m180.Turn(180)
|
||||
animate(H, transform = m180, time = 3)
|
||||
H.pixel_y = H.get_standard_pixel_y_offset(180)
|
||||
return 1
|
||||
|
||||
animate(victim, transform = m180, time = 3)
|
||||
victim.pixel_y = victim.get_standard_pixel_y_offset(180)
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/structure/kitchenspike/user_buckle_mob(mob/living/M, mob/living/user) //Don't want them getting put on the rack other than by spiking
|
||||
return
|
||||
|
||||
/obj/structure/kitchenspike/user_unbuckle_mob(mob/living/carbon/human/user)
|
||||
if(buckled_mob && buckled_mob.buckled == src)
|
||||
/obj/structure/kitchenspike/user_unbuckle_mob(mob/living/buckled_mob, mob/living/carbon/human/user)
|
||||
if(buckled_mob)
|
||||
var/mob/living/M = buckled_mob
|
||||
if(M != user)
|
||||
M.visible_message(\
|
||||
"[user.name] tries to pull [M.name] free of the [src]!",\
|
||||
"<span class='notice'>[user.name] is trying to pull you off of [src], opening up fresh wounds!</span>",\
|
||||
M.visible_message("<span class='notice'>[user] tries to pull [M] free of [src]!</span>",\
|
||||
"<span class='notice'>[user] is trying to pull you off [src], opening up fresh wounds!</span>",\
|
||||
"<span class='italics'>You hear a squishy wet noise.</span>")
|
||||
if(!do_after(user, 300, target = src))
|
||||
if(M && M.buckled)
|
||||
M.visible_message(\
|
||||
"[user.name] fails to free [M.name]!",\
|
||||
"<span class='notice'>[user.name] fails to pull you off of [src].</span>")
|
||||
M.visible_message("<span class='notice'>[user] fails to free [M]!</span>",\
|
||||
"<span class='notice'>[user] fails to pull you off of [src].</span>")
|
||||
return
|
||||
|
||||
else
|
||||
M.visible_message(\
|
||||
"<span class='warning'>[M.name] struggles to break free from the [src]!</span>",\
|
||||
"<span class='notice'>You struggle to break free from the [src], exacerbating your wounds! (Stay still for two minutes.)</span>",\
|
||||
M.visible_message("<span class='warning'>[M] struggles to break free from [src]!</span>",\
|
||||
"<span class='notice'>You struggle to break free from [src], exacerbating your wounds! (Stay still for two minutes.)</span>",\
|
||||
"<span class='italics'>You hear a wet squishing noise..</span>")
|
||||
M.adjustBruteLoss(30)
|
||||
if(!do_after(M, 1200, target = src))
|
||||
@@ -126,13 +126,21 @@
|
||||
return
|
||||
if(!M.buckled)
|
||||
return
|
||||
var/matrix/m180 = matrix(M.transform)
|
||||
m180.Turn(180)
|
||||
animate(M, transform = m180, time = 3)
|
||||
M.pixel_y = M.get_standard_pixel_y_offset(180)
|
||||
M.adjustBruteLoss(30)
|
||||
visible_message("<span class='danger'>[M] falls free of the [src]!</span>")
|
||||
unbuckle_mob()
|
||||
M.emote("scream")
|
||||
M.AdjustWeakened(10)
|
||||
release_mob(M)
|
||||
|
||||
/obj/structure/kitchenspike/proc/release_mob(mob/living/M)
|
||||
var/matrix/m180 = matrix(M.transform)
|
||||
m180.Turn(180)
|
||||
animate(M, transform = m180, time = 3)
|
||||
M.pixel_y = M.get_standard_pixel_y_offset(180)
|
||||
M.adjustBruteLoss(30)
|
||||
src.visible_message(text("<span class='danger'>[M] falls free of [src]!</span>"))
|
||||
unbuckle_mob(M, force = TRUE)
|
||||
M.emote("scream")
|
||||
M.AdjustWeakened(10)
|
||||
|
||||
/obj/structure/kitchenspike/Destroy()
|
||||
if(has_buckled_mobs())
|
||||
for(var/mob/living/L in buckled_mobs)
|
||||
release_mob(L)
|
||||
return ..()
|
||||
Reference in New Issue
Block a user