mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
Fixes e-bolas being unblockable and not ensnaring flying mobs. (#60160)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
@@ -402,7 +402,7 @@
|
||||
|
||||
/obj/item/shockpaddles/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_NO_STORAGE_INSERT, GENERIC_ITEM_TRAIT) //stops shockpaddles from being inserted in BoH
|
||||
ADD_TRAIT(src, TRAIT_NO_STORAGE_INSERT, TRAIT_GENERIC) //stops shockpaddles from being inserted in BoH
|
||||
RegisterSignal(src, COMSIG_TWOHANDED_WIELD, .proc/on_wield)
|
||||
RegisterSignal(src, COMSIG_TWOHANDED_UNWIELD, .proc/on_unwield)
|
||||
if(!req_defib)
|
||||
|
||||
@@ -338,38 +338,42 @@
|
||||
update_appearance()
|
||||
playsound(src, 'sound/effects/snap.ogg', 50, TRUE)
|
||||
|
||||
/obj/item/restraints/legcuffs/beartrap/proc/spring_trap(datum/source, AM as mob|obj)
|
||||
/obj/item/restraints/legcuffs/beartrap/proc/spring_trap(datum/source, atom/movable/AM, thrown_at = FALSE)
|
||||
SIGNAL_HANDLER
|
||||
if(armed && isturf(loc))
|
||||
if(isliving(AM))
|
||||
var/mob/living/L = AM
|
||||
var/snap = TRUE
|
||||
if(istype(L.buckled, /obj/vehicle))
|
||||
var/obj/vehicle/ridden_vehicle = L.buckled
|
||||
if(!ridden_vehicle.are_legs_exposed) //close the trap without injuring/trapping the rider if their legs are inside the vehicle at all times.
|
||||
close_trap()
|
||||
ridden_vehicle.visible_message(span_danger("[ridden_vehicle] triggers \the [src]."))
|
||||
if(!armed || !isturf(loc) || !isliving(AM))
|
||||
return
|
||||
var/mob/living/L = AM
|
||||
var/snap = TRUE
|
||||
if(istype(L.buckled, /obj/vehicle))
|
||||
var/obj/vehicle/ridden_vehicle = L.buckled
|
||||
if(!ridden_vehicle.are_legs_exposed) //close the trap without injuring/trapping the rider if their legs are inside the vehicle at all times.
|
||||
close_trap()
|
||||
ridden_vehicle.visible_message(span_danger("[ridden_vehicle] triggers \the [src]."))
|
||||
|
||||
if(L.movement_type & (FLYING|FLOATING)) //don't close the trap if they're flying/floating over it.
|
||||
snap = FALSE
|
||||
if(!thrown_at && L.movement_type & (FLYING|FLOATING)) //don't close the trap if they're flying/floating over it.
|
||||
snap = FALSE
|
||||
|
||||
var/def_zone = BODY_ZONE_CHEST
|
||||
if(snap && iscarbon(L))
|
||||
var/mob/living/carbon/C = L
|
||||
if(C.body_position == STANDING_UP)
|
||||
def_zone = pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
|
||||
if(!C.legcuffed && C.num_legs >= 2) //beartrap can't cuff your leg if there's already a beartrap or legcuffs, or you don't have two legs.
|
||||
INVOKE_ASYNC(C, /mob/living/carbon.proc/equip_to_slot, src, ITEM_SLOT_LEGCUFFED)
|
||||
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
|
||||
else if(snap && isanimal(L))
|
||||
var/mob/living/simple_animal/SA = L
|
||||
if(SA.mob_size <= MOB_SIZE_TINY) //don't close the trap if they're as small as a mouse.
|
||||
snap = FALSE
|
||||
if(snap)
|
||||
close_trap()
|
||||
L.visible_message(span_danger("[L] triggers \the [src]."), \
|
||||
span_userdanger("You trigger \the [src]!"))
|
||||
L.apply_damage(trap_damage, BRUTE, def_zone)
|
||||
var/def_zone = BODY_ZONE_CHEST
|
||||
if(snap && iscarbon(L))
|
||||
var/mob/living/carbon/C = L
|
||||
if(C.body_position == STANDING_UP)
|
||||
def_zone = pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
|
||||
if(!C.legcuffed && C.num_legs >= 2) //beartrap can't cuff your leg if there's already a beartrap or legcuffs, or you don't have two legs.
|
||||
INVOKE_ASYNC(C, /mob/living/carbon.proc/equip_to_slot, src, ITEM_SLOT_LEGCUFFED)
|
||||
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
|
||||
else if(snap && isanimal(L))
|
||||
var/mob/living/simple_animal/SA = L
|
||||
if(SA.mob_size <= MOB_SIZE_TINY) //don't close the trap if they're as small as a mouse.
|
||||
snap = FALSE
|
||||
if(snap)
|
||||
close_trap()
|
||||
if(!thrown_at)
|
||||
L.visible_message(span_danger("[L] triggers \the [src]."), \
|
||||
span_userdanger("You trigger \the [src]!"))
|
||||
else
|
||||
L.visible_message(span_danger("\The [src] ensnares [L]!"), \
|
||||
span_userdanger("\The [src] ensnares you!"))
|
||||
L.apply_damage(trap_damage, BRUTE, def_zone)
|
||||
|
||||
/**
|
||||
* # Energy snare
|
||||
@@ -439,10 +443,9 @@
|
||||
*/
|
||||
/obj/item/restraints/legcuffs/bola/proc/ensnare(mob/living/carbon/C)
|
||||
if(!C.legcuffed && C.num_legs >= 2)
|
||||
visible_message(span_danger("\The [src] ensnares [C]!"))
|
||||
visible_message(span_danger("\The [src] ensnares [C]!"), span_userdanger("\The [src] ensnares you!"))
|
||||
C.equip_to_slot(src, ITEM_SLOT_LEGCUFFED)
|
||||
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
|
||||
to_chat(C, span_userdanger("\The [src] ensnares you!"))
|
||||
C.Knockdown(knockdown)
|
||||
playsound(src, 'sound/effects/snap.ogg', 50, TRUE)
|
||||
|
||||
@@ -474,13 +477,14 @@
|
||||
breakouttime = 6 SECONDS
|
||||
custom_price = PAYCHECK_HARD * 0.35
|
||||
|
||||
/obj/item/restraints/legcuffs/bola/energy/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
|
||||
if(iscarbon(hit_atom))
|
||||
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(hit_atom))
|
||||
B.spring_trap(null, hit_atom)
|
||||
qdel(src)
|
||||
return
|
||||
/obj/item/restraints/legcuffs/bola/energy/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_UNCATCHABLE, TRAIT_GENERIC) // People said energy bolas being uncatchable is a feature.
|
||||
|
||||
/obj/item/restraints/legcuffs/bola/energy/ensnare(atom/hit_atom)
|
||||
var/obj/item/restraints/legcuffs/beartrap/energy/cyborg/B = new (get_turf(hit_atom))
|
||||
B.spring_trap(null, hit_atom, TRUE)
|
||||
qdel(src)
|
||||
|
||||
/**
|
||||
* A pacifying variant of the bola.
|
||||
|
||||
Reference in New Issue
Block a user