TG Buckle Update (#12375)

This commit is contained in:
Fox McCloud
2019-09-22 21:22:57 -04:00
committed by variableundefined
parent 7846268dae
commit c87389a595
60 changed files with 640 additions and 533 deletions
@@ -69,7 +69,7 @@
continue
if(istype(O, /obj/structure/bed)) //This is only necessary because of rollerbeds and swivel chairs.
var/obj/structure/bed/B = O
if(B.buckled_mob)
if(B.has_buckled_mobs())
continue
O.forceMove(src)
itemcount++
@@ -161,7 +161,7 @@
if(C.use(15))
to_chat(user, "<span class='notice'>You rig [src].</span>")
rigged = TRUE
else
else
to_chat(user, "<span class='warning'>You need atleast 15 wires to rig [src]!</span>")
return
else if(istype(W, /obj/item/radio/electropack))
@@ -71,11 +71,12 @@
flick("echair_shock", src)
do_sparks(12, 1, src)
visible_message("<span class='danger'>The electric chair went off!</span>", "<span class='danger'>You hear a deep sharp shock!</span>")
if(buckled_mob)
buckled_mob.electrocute_act(110, src, 1)
to_chat(buckled_mob, "<span class='danger'>You feel a deep shock course through your body!</span>")
spawn(1)
if(has_buckled_mobs())
for(var/m in buckled_mobs)
var/mob/living/buckled_mob = m
buckled_mob.electrocute_act(110, src, 1)
to_chat(buckled_mob, "<span class='danger'>You feel a deep shock course through your body!</span>")
spawn(1)
buckled_mob.electrocute_act(110, src, 1)
A.power_light = light
A.updateicon()
return
A.updateicon()
+20 -12
View File
@@ -28,6 +28,10 @@
var/force_clap = FALSE //You WILL clap if I want you to
var/current_action = 0 // What's currently happening to the guillotine
/obj/structure/guillotine/Initialize(mapload)
LAZYINITLIST(buckled_mobs)
return ..()
/obj/structure/guillotine/examine(mob/user)
..()
@@ -84,7 +88,7 @@
else
current_action = 0
else
unbuckle_mob()
unbuckle_all_mobs()
else
blade_status = GUILLOTINE_BLADE_MOVING
icon_state = "guillotine_drop"
@@ -97,7 +101,7 @@
/obj/structure/guillotine/proc/drop_blade(mob/user)
if(has_buckled_mobs() && blade_sharpness)
var/mob/living/carbon/human/H = buckled_mob
var/mob/living/carbon/human/H = buckled_mobs[1]
if(!H)
blade_status = GUILLOTINE_BLADE_DROPPED
@@ -116,7 +120,7 @@
head.droplimb()
add_attack_logs(user, H, "beheaded with [src]")
H.regenerate_icons()
unbuckle_mob()
unbuckle_all_mobs()
kill_count += 1
var/blood_overlay = "bloody"
@@ -219,7 +223,7 @@
else
return ..()
/obj/structure/guillotine/buckle_mob(mob/living/M, force = 0)
/obj/structure/guillotine/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE)
if(!anchored)
to_chat(usr, "<span class='warning'>The [src] needs to be wrenched to the floor!</span>")
return FALSE
@@ -232,15 +236,19 @@
to_chat(usr, "<span class='warning'>You need to raise the blade before buckling someone in!</span>")
return FALSE
if(..())
M.pixel_y -= GUILLOTINE_HEAD_OFFSET // Offset their body so it looks like they're in the guillotine
M.layer += GUILLOTINE_LAYER_DIFF
return ..(M, force, FALSE)
/obj/structure/guillotine/unbuckle_mob(force = 0)
if(buckled_mob)
buckled_mob.pixel_y += GUILLOTINE_HEAD_OFFSET // Move their body back
buckled_mob.layer -= GUILLOTINE_LAYER_DIFF
. = ..()
/obj/structure/guillotine/post_buckle_mob(mob/living/M)
if(!ishuman(M))
return
M.pixel_y += -GUILLOTINE_HEAD_OFFSET // Offset their body so it looks like they're in the guillotine
M.layer += GUILLOTINE_LAYER_DIFF
..()
/obj/structure/guillotine/post_unbuckle_mob(mob/living/M)
M.pixel_y -= -GUILLOTINE_HEAD_OFFSET // Move their body back
M.layer -= GUILLOTINE_LAYER_DIFF
..()
#undef GUILLOTINE_BLADE_MAX_SHARP
#undef GUILLOTINE_DECAP_MIN_SHARP
+54 -46
View File
@@ -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 ..()
+22 -31
View File
@@ -7,12 +7,6 @@
anchored = 1
layer = 4
armor = list(melee = 100, bullet = 80, laser = 80, energy = 100, bomb = 50, bio = 100, rad = 100)
var/list/mobs_can_pass = list(
/mob/living/carbon/slime,
/mob/living/simple_animal/mouse,
/mob/living/silicon/robot/drone,
/mob/living/simple_animal/bot/mulebot
)
var/state = PLASTIC_FLAPS_NORMAL
/obj/structure/plasticflaps/examine(mob/user)
@@ -66,43 +60,40 @@
return prob(60)
var/obj/structure/bed/B = A
if(istype(A, /obj/structure/bed) && B.buckled_mob)//if it's a bed/chair and someone is buckled, it will not pass
return 0
if(istype(A, /obj/structure/bed) && (B.has_buckled_mobs() || B.density))//if it's a bed/chair and is dense or someone is buckled, it will not pass
return FALSE
if(istype(A, /obj/structure/closet/cardboard))
var/obj/structure/closet/cardboard/C = A
if(C.move_delay)
return 0
return FALSE
if(istype(A, /obj/vehicle)) //no vehicles
return 0
var/mob/living/M = A
if(istype(M))
if(M.lying)
return ..()
for(var/mob_type in mobs_can_pass)
if(istype(A, mob_type))
return ..()
if(istype(A, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if(H.dna.species.is_small)
return ..()
return 0
if(ismecha(A))
return FALSE
else if(isliving(A)) // You Shall Not Pass!
var/mob/living/M = A
if(isbot(A)) //Bots understand the secrets
return TRUE
if(M.buckled && istype(M.buckled, /mob/living/simple_animal/bot/mulebot)) // mulebot passenger gets a free pass.
return TRUE
if(!M.lying && !M.ventcrawler && M.mob_size != MOB_SIZE_TINY) //If your not laying down, or a ventcrawler or a small creature, no pass.
return FALSE
return ..()
/obj/structure/plasticflaps/CanAStarPass(ID, to_dir, caller)
if(istype(caller, /mob/living))
for(var/mob_type in mobs_can_pass)
if(istype(caller, mob_type))
return 1
if(isliving(caller))
if(isbot(caller))
return TRUE
var/mob/living/M = caller
if(!M.ventcrawler && M.mob_size > MOB_SIZE_SMALL)
return 0
return 1
if(!M.ventcrawler && M.mob_size != MOB_SIZE_TINY)
return FALSE
var/atom/movable/M = caller
if(M && M.pulling)
return CanAStarPass(ID, to_dir, M.pulling)
return TRUE //diseases, stings, etc can pass
/obj/structure/plasticflaps/ex_act(severity)
switch(severity)
@@ -14,68 +14,67 @@
return ..()
/obj/structure/bed/nest/user_unbuckle_mob(mob/living/user)
if(buckled_mob && buckled_mob.buckled == src)
var/mob/living/M = buckled_mob
if(has_buckled_mobs())
for(var/buck in buckled_mobs) //breaking a nest releases all the buckled mobs, because the nest isn't holding them down anymore
var/mob/living/M = buck
if(user.get_int_organ(/obj/item/organ/internal/xenos/plasmavessel))
unbuckle_mob()
if(user.get_int_organ(/obj/item/organ/internal/xenos/plasmavessel))
unbuckle_mob(M)
add_fingerprint(user)
return
if(M != user)
M.visible_message("<span class='notice'>[user.name] pulls [M.name] free from the sticky nest!</span>",\
"<span class='notice'>[user.name] pulls you free from the gelatinous resin.</span>",\
"<span class='italics'>You hear squelching...</span>")
else
M.visible_message("<span class='warning'>[M.name] struggles to break free from the gelatinous resin!</span>",\
"<span class='notice'>You struggle to break free from the gelatinous resin... (Stay still for two minutes.)</span>",\
"<span class='italics'>You hear squelching...</span>")
if(!do_after(M, 1200, target = src))
if(M && M.buckled)
to_chat(M, "<span class='warning'>You fail to escape \the [src]!</span>")
return
if(!M.buckled)
return
M.visible_message("<span class='warning'>[M.name] breaks free from the gelatinous resin!</span>",\
"<span class='notice'>You break free from the gelatinous resin!</span>",\
"<span class='italics'>You hear squelching...</span>")
unbuckle_mob(M)
add_fingerprint(user)
return
if(M != user)
M.visible_message(\
"<span class='notice'>[user.name] pulls [M.name] free from the sticky nest!</span>",\
"<span class='notice'>[user.name] pulls you free from the gelatinous resin.</span>",\
"<span class='notice'>You hear squelching...</span>")
else
buckled_mob.visible_message(\
"<span class='warning'>[buckled_mob.name] struggles to break free of the gelatinous resin...</span>",\
"<span class='warning'>You struggle to break free from the gelatinous resin... (This will take around 2 minutes and you need to stay still)</span>",\
"<span class='notice'>You hear squelching...</span>")
if(!do_after(M, 1200, target = src))
if(M && M.buckled)
to_chat(M, "<span class='warning'>You fail to escape \the [src]!</span>")
return
if(!M.buckled)
return
M.visible_message(\
"<span class='warning'>[M.name] breaks free from the gelatinous resin!</span>",\
"<span class='notice'>You break free from the gelatinous resin!</span>",\
"<span class='italics'>You hear squelching...</span>")
unbuckle_mob()
add_fingerprint(user)
/obj/structure/bed/nest/user_buckle_mob(mob/living/M, mob/living/user)
if( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.restrained() || usr.stat || M.buckled || istype(user, /mob/living/silicon/pai) )
if (!ismob(M) || (get_dist(src, user) > 1) || (M.loc != loc) || user.incapacitated() || M.buckled)
return
if(M.get_int_organ(/obj/item/organ/internal/xenos/plasmavessel))
return
if(!user.get_int_organ(/obj/item/organ/internal/xenos/plasmavessel))
return
unbuckle_mob()
if(has_buckled_mobs())
unbuckle_all_mobs()
if(buckle_mob(M))
M.visible_message(\
"[user.name] secretes a thick vile goo, securing [M.name] into [src]!",\
M.visible_message("<span class='notice'>[user.name] secretes a thick vile goo, securing [M.name] into [src]!</span>",\
"<span class='danger'>[user.name] drenches you in a foul-smelling resin, trapping you in [src]!</span>",\
"<span class='italics'>You hear squelching...</span>")
/obj/structure/bed/nest/post_buckle_mob(mob/living/M)
if(M == buckled_mob)
M.pixel_y = 0
M.pixel_x = initial(M.pixel_x) + 2
M.layer = MOB_LAYER - 0.3
overlays += nest_overlay
else
M.pixel_x = M.get_standard_pixel_x_offset(M.lying)
M.pixel_y = M.get_standard_pixel_y_offset(M.lying)
M.layer = initial(M.layer)
overlays -= nest_overlay
M.pixel_y = 0
M.pixel_x = initial(M.pixel_x) + 2
M.layer = BELOW_MOB_LAYER
add_overlay(nest_overlay)
/obj/structure/bed/nest/post_unbuckle_mob(mob/living/M)
M.pixel_x = M.get_standard_pixel_x_offset(M.lying)
M.pixel_y = M.get_standard_pixel_y_offset(M.lying)
M.layer = initial(M.layer)
cut_overlay(nest_overlay)
/obj/structure/bed/nest/attackby(obj/item/W as obj, mob/user as mob, params)
user.changeNext_move(CLICK_CD_MELEE)
@@ -29,8 +29,6 @@
desc = "For prime comfort during psychiatric evaluations."
icon_state = "psychbed"
buildstackamount = 5
can_buckle = TRUE
buckle_lying = TRUE
/obj/structure/bed/alien
name = "resting contraption"
@@ -66,20 +64,23 @@
anchored = FALSE
comfort = 1
/obj/structure/bed/roller/attackby(obj/item/W as obj, mob/user as mob, params)
/obj/structure/bed/roller/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/roller_holder))
if(buckled_mob)
user_unbuckle_mob(user)
if(has_buckled_mobs())
if(buckled_mobs.len > 1)
unbuckle_all_mobs()
user.visible_message("<span class='notice'>[user] unbuckles all creatures from [src].</span>")
else
user_unbuckle_mob(buckled_mobs[1], user)
else
user.visible_message("<span class='notice'>[user] collapses \the [name].</span>", "<span class='notice'>You collapse \the [name].</span>")
new/obj/item/roller(get_turf(src))
qdel(src)
/obj/structure/bed/roller/post_buckle_mob(mob/living/M)
if(M == buckled_mob)
density = TRUE
icon_state = "up"
M.pixel_y = initial(M.pixel_y)
density = TRUE
icon_state = "up"
M.pixel_y = initial(M.pixel_y)
/obj/structure/bed/roller/post_unbuckle_mob(mob/living/M)
density = FALSE
@@ -112,7 +113,7 @@
if(over_object == usr && Adjacent(usr) && (in_range(src, usr) || usr.contents.Find(src)))
if(!ishuman(usr))
return
if(buckled_mob)
if(has_buckled_mobs())
return 0
usr.visible_message("<span class='notice'>[usr] collapses \the [name].</span>", "<span class='notice'>You collapse \the [name].</span>")
new/obj/item/roller(get_turf(src))
@@ -78,19 +78,20 @@
qdel(src)
/obj/structure/chair/attack_tk(mob/user as mob)
if(buckled_mob)
if(!anchored || has_buckled_mobs() || !isturf(user.loc))
..()
else
rotate()
return
/obj/structure/chair/proc/handle_rotation(direction) //making this into a seperate proc so office chairs can call it on Move()
/obj/structure/chair/proc/handle_rotation(direction)
handle_layer()
if(buckled_mob)
buckled_mob.dir = dir
if(has_buckled_mobs())
for(var/m in buckled_mobs)
var/mob/living/buckled_mob = m
buckled_mob.setDir(direction)
/obj/structure/chair/proc/handle_layer()
if(buckled_mob && dir == NORTH)
if(has_buckled_mobs() && dir == NORTH)
layer = ABOVE_MOB_LAYER
else
layer = OBJ_LAYER
@@ -229,24 +230,20 @@
/obj/structure/chair/office/Bump(atom/A)
..()
if(!buckled_mob)
if(!has_buckled_mobs())
return
if(propelled)
var/mob/living/occupant = buckled_mob
unbuckle_mob()
occupant.throw_at(A, 3, propelled)
occupant.apply_effect(6, STUN, 0)
occupant.apply_effect(6, WEAKEN, 0)
occupant.apply_effect(6, STUTTER, 0)
playsound(src.loc, 'sound/weapons/punch1.ogg', 50, 1, -1)
if(istype(A, /mob/living))
var/mob/living/victim = A
victim.apply_effect(6, STUN, 0)
victim.apply_effect(6, WEAKEN, 0)
victim.apply_effect(6, STUTTER, 0)
victim.take_organ_damage(10)
occupant.visible_message("<span class='danger'>[occupant] crashed into \the [A]!</span>")
for(var/m in buckled_mobs)
var/mob/living/buckled_mob = m
unbuckle_mob(buckled_mob)
buckled_mob.throw_at(A, 3, propelled)
buckled_mob.apply_effect(6, STUN, 0)
buckled_mob.apply_effect(6, WEAKEN, 0)
buckled_mob.apply_effect(6, STUTTER, 0)
buckled_mob.take_organ_damage(10)
playsound(loc, 'sound/weapons/punch1.ogg', 50, 1, -1)
buckled_mob.visible_message("<span class='danger'>[buckled_mob] crashed into [A]!</span>")
/obj/structure/chair/office/light
icon_state = "officechair_white"
@@ -11,8 +11,10 @@
overlays = null
var/image/O = image(icon = icon, icon_state = "[icon_state]_overlay", layer = FLY_LAYER, dir = src.dir)
overlays += O
if(buckled_mob)
buckled_mob.dir = dir
if(has_buckled_mobs())
for(var/m in buckled_mobs)
var/mob/living/buckled_mob = m
buckled_mob.setDir(dir)
/obj/structure/chair/wheelchair/relaymove(mob/user, direction)
if(propelled)
@@ -27,7 +29,8 @@
var/calculated_move_delay
calculated_move_delay += 2 //wheelchairs are not infact sport bikes
if(buckled_mob)
if(has_buckled_mobs())
var/mob/living/buckled_mob = buckled_mobs[1]
if(buckled_mob.incapacitated())
return 0
@@ -69,15 +72,15 @@
/obj/structure/chair/wheelchair/Bump(atom/A)
..()
if(!buckled_mob)
if(!has_buckled_mobs())
return
var/mob/living/buckled_mob = buckled_mobs[1]
if(istype(A, /obj/machinery/door))
A.Bumped(buckled_mob)
if(propelled)
var/mob/living/occupant = buckled_mob
unbuckle_mob()
unbuckle_mob(occupant)
occupant.throw_at(A, 3, propelled)
@@ -114,9 +117,10 @@
var/calculated_move_delay
calculated_move_delay = 0 //bikes are infact sport bikes
if(buckled_mob)
if(has_buckled_mobs())
var/mob/living/buckled_mob = buckled_mobs[1]
if(buckled_mob.incapacitated())
unbuckle_mob() //if the rider is incapacitated, unbuckle them (they can't balance so they fall off)
unbuckle_mob(buckled_mob) //if the rider is incapacitated, unbuckle them (they can't balance so they fall off)
return 0
var/mob/living/thedriver = user
@@ -151,4 +155,4 @@
. = 0
else
. = 1
. = 1