mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
Tweak kitchen spikes (#21152)
* Tweak kitchen spike * fix deconstruction * fix mistake lmao * revert wrench_act and fix metal drop * fix accidental removal * and the damn end of line * AAAA * add mob check to victim, deconstructing tweak * fix bug preventing attack on spikes
This commit is contained in:
@@ -74,7 +74,7 @@ GLOBAL_LIST_INIT(metal_recipes, list(
|
||||
new /datum/stack_recipe("machine frame", /obj/machinery/constructable_frame/machine_frame, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_floor = TRUE),
|
||||
new /datum/stack_recipe("turret frame", /obj/machinery/porta_turret_construct, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_floor = TRUE),
|
||||
new /datum/stack_recipe("firelock frame", /obj/structure/firelock_frame, 3, time = 5 SECONDS, one_per_turf = TRUE, on_floor = TRUE),
|
||||
new /datum/stack_recipe("meatspike frame", /obj/structure/kitchenspike_frame, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_floor = TRUE),
|
||||
new /datum/stack_recipe("meatspike frame", /obj/structure/kitchenspike_frame, 5, time = 5 SECONDS, one_per_turf = TRUE, on_floor = TRUE),
|
||||
new /datum/stack_recipe("reflector frame", /obj/structure/reflector, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_floor = TRUE),
|
||||
null,
|
||||
new /datum/stack_recipe_list("airlock assemblies", list(
|
||||
|
||||
@@ -7,18 +7,19 @@
|
||||
icon_state = "spikeframe"
|
||||
desc = "The frame of a meat spike."
|
||||
density = TRUE
|
||||
anchored = FALSE
|
||||
anchored = TRUE
|
||||
max_integrity = 200
|
||||
|
||||
/obj/structure/kitchenspike_frame/attackby(obj/item/I, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
if(istype(I, /obj/item/wrench))
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='notice'>You unwrench [src] from the floor.</span>")
|
||||
anchored = FALSE
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You wrench [src] into place.</span>")
|
||||
anchored = TRUE
|
||||
if(!I.tool_use_check(user, 0))
|
||||
return
|
||||
TOOL_ATTEMPT_DISMANTLE_MESSAGE
|
||||
if(!I.use_tool(src, user, 40, volume = I.tool_volume))
|
||||
return
|
||||
TOOL_DISMANTLE_SUCCESS_MESSAGE
|
||||
deconstruct(TRUE)
|
||||
else if(istype(I, /obj/item/stack/rods))
|
||||
var/obj/item/stack/rods/R = I
|
||||
if(R.get_amount() >= 4)
|
||||
@@ -31,6 +32,17 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/kitchenspike_frame/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Add metal rods to complete construction, or use a wrench to deconstruct it.</span>"
|
||||
|
||||
/obj/structure/kitchenspike_frame/deconstruct(disassembled = TRUE)
|
||||
if(disassembled)
|
||||
new /obj/item/stack/sheet/metal(loc, 5)
|
||||
else
|
||||
new /obj/item/stack/sheet/metal(loc, 4)
|
||||
..()
|
||||
|
||||
|
||||
/obj/structure/kitchenspike
|
||||
name = "meat spike"
|
||||
@@ -43,6 +55,10 @@
|
||||
can_buckle = TRUE
|
||||
max_integrity = 250
|
||||
|
||||
/obj/structure/kitchenspike/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>To deconstruct, pry out the spikes with a crowbar, then deconstruct the frame with a wrench.</span>"
|
||||
|
||||
//ATTACK HAND IGNORING PARENT RETURN VALUE
|
||||
/obj/structure/kitchenspike/attack_hand(mob/user)
|
||||
if(has_buckled_mobs())
|
||||
@@ -51,24 +67,24 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/structure/kitchenspike/attackby(obj/item/grab/G, mob/user)
|
||||
if(istype(G, /obj/item/crowbar))
|
||||
/obj/structure/kitchenspike/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/crowbar))
|
||||
if(!has_buckled_mobs())
|
||||
playsound(loc, G.usesound, 100, 1)
|
||||
if(do_after(user, 20 * G.toolspeed, target = src))
|
||||
playsound(loc, I.usesound, 100, 1)
|
||||
if(do_after(user, 20 * I.toolspeed, target = src))
|
||||
to_chat(user, "<span class='notice'>You pry the spikes out of the frame.</span>")
|
||||
deconstruct(TRUE)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You can't do that while something's on the spike!</span>")
|
||||
return
|
||||
if(!istype(G, /obj/item/grab) || !G.affecting)
|
||||
return
|
||||
if(isliving(G.affecting))
|
||||
start_spike(G.affecting, user)
|
||||
else if(istype(I, /obj/item/grab))
|
||||
var/obj/item/grab/G = I
|
||||
if(G.affecting && isliving(G.affecting))
|
||||
start_spike(G.affecting, user)
|
||||
return ..()
|
||||
|
||||
/obj/structure/kitchenspike/MouseDrop_T(mob/living/victim, mob/living/user)
|
||||
if (!user.Adjacent(src) || !user.Adjacent(victim) || isAI(user))
|
||||
if (!user.Adjacent(src) || !user.Adjacent(victim) || isAI(user) || !ismob(victim))
|
||||
return
|
||||
if(isanimal(user) && victim != user)
|
||||
return // animals cannot put mobs other than themselves onto spikes
|
||||
@@ -83,7 +99,7 @@
|
||||
"<span class='danger'>[user] tries to slam [victim] onto the meat spike!</span>",
|
||||
"<span class='userdanger'>[user] tries to slam you onto the meat spike!</span>"
|
||||
)
|
||||
if(do_mob(user, src, 12 SECONDS))
|
||||
if(do_mob(user, src, 6 SECONDS))
|
||||
end_spike(victim, user)
|
||||
|
||||
/obj/structure/kitchenspike/proc/end_spike(mob/living/victim, mob/user)
|
||||
@@ -121,7 +137,7 @@
|
||||
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(!do_after(user, 15 SECONDS, target = src))
|
||||
if(M && M.buckled)
|
||||
M.visible_message("<span class='notice'>[user] fails to free [M]!</span>",\
|
||||
"<span class='notice'>[user] fails to pull you off of [src].</span>")
|
||||
@@ -132,7 +148,7 @@
|
||||
"<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))
|
||||
if(!do_after(M, 2 MINUTES, target = src))
|
||||
if(M && M.buckled)
|
||||
to_chat(M, "<span class='warning'>You fail to free yourself!</span>")
|
||||
return
|
||||
@@ -142,12 +158,11 @@
|
||||
|
||||
/obj/structure/kitchenspike/proc/release_mob(mob/living/M)
|
||||
M.adjustBruteLoss(30)
|
||||
src.visible_message(text("<span class='danger'>[M] falls free of [src]!</span>"))
|
||||
visible_message(text("<span class='danger'>[M] falls free of [src]!</span>"))
|
||||
unbuckle_mob(M, force = TRUE)
|
||||
M.emote("scream")
|
||||
M.AdjustWeakened(20 SECONDS)
|
||||
|
||||
|
||||
/obj/structure/kitchenspike/post_unbuckle_mob(mob/living/M)
|
||||
M.pixel_y = M.get_standard_pixel_y_offset(0)
|
||||
M.set_lying_angle(0)
|
||||
@@ -166,4 +181,4 @@
|
||||
else
|
||||
new /obj/item/stack/sheet/metal(loc, 4)
|
||||
new /obj/item/stack/rods(loc, 4)
|
||||
qdel(src)
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user