mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 21:48:21 +01:00
Update to restraints (#25831)
* Update carbon_procs.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update items.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update handcuffs.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update humanoid.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update human_mob.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update status_effects.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update neutral.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update blood_magic.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update abduction_gear.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update items.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update abduction_gear.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update code/game/objects/items/weapons/handcuffs.dm Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update code/game/objects/items/weapons/handcuffs.dm Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update code/modules/mob/living/carbon/alien/humanoid/humanoid.dm Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com> Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update code/game/objects/items.dm Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com> Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update code/game/gamemodes/cult/blood_magic.dm Woops. Co-authored-by: chuga-git <98280110+chuga-git@users.noreply.github.com> Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update items.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update handcuffs.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update handcuffs.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update handcuffs.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update handcuffs.dm The consequences of my actions Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update humanoid.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update carbon_procs.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update clothing.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update human_mob.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update code/modules/mob/living/carbon/alien/humanoid/humanoid.dm Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update code/modules/mob/living/carbon/human/human_mob.dm Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update carbon_procs.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> * Update handcuffs.dm Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> --------- Signed-off-by: Faron <171642577+FaronCD@users.noreply.github.com> Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com> Co-authored-by: chuga-git <98280110+chuga-git@users.noreply.github.com> Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
co-authored by
1080pCat
Matt
chuga-git
Ryan
parent
82d3a22167
commit
340d8a3731
@@ -605,6 +605,8 @@
|
||||
var/list/hide_tail_by_species = null
|
||||
/// Maximum weight class of an item in the suit storage slot.
|
||||
var/max_suit_w = WEIGHT_CLASS_BULKY
|
||||
///How long to break out of the suits
|
||||
var/breakouttime
|
||||
|
||||
/obj/item/clothing/suit/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -709,6 +711,31 @@
|
||||
/obj/item/clothing/suit/proc/special_overlays() // Does it have special overlays when worn?
|
||||
return FALSE
|
||||
|
||||
/obj/item/clothing/suit/proc/resist_restraints(mob/living/carbon/user, break_restraints)
|
||||
var/effective_breakout_time = breakouttime
|
||||
if(break_restraints)
|
||||
effective_breakout_time = 5 SECONDS
|
||||
|
||||
if(user.has_status_effect(STATUS_EFFECT_REMOVE_CUFFS))
|
||||
to_chat(user, "<span class='notice'>You are already trying to [break_restraints ? "break" : "remove"] your restraints.</span>")
|
||||
return
|
||||
user.apply_status_effect(STATUS_EFFECT_REMOVE_CUFFS)
|
||||
|
||||
user.visible_message("<span class='warning'>[user] attempts to [break_restraints ? "break" : "remove"] [src]!</span>", "<span class='notice'>You attempt to [break_restraints ? "break" : "remove"] [src]...</span>")
|
||||
to_chat(user, "<span class='notice'>(This will take around [DisplayTimeText(effective_breakout_time)] and you need to stand still.)</span>")
|
||||
|
||||
if(!do_after(user, effective_breakout_time, FALSE, user))
|
||||
user.remove_status_effect(STATUS_EFFECT_REMOVE_CUFFS)
|
||||
to_chat(user, "<span class='warning'>You fail to [break_restraints ? "break" : "remove"] [src]!</span>")
|
||||
return
|
||||
|
||||
user.remove_status_effect(STATUS_EFFECT_REMOVE_CUFFS)
|
||||
if(loc != user || user.buckled)
|
||||
return
|
||||
|
||||
user.visible_message("<span class='danger'>[user] manages to [break_restraints ? "break" : "remove"] [src]!</span>", "<span class='notice'>You successfully [break_restraints ? "break" : "remove"] [src].</span>")
|
||||
user.unEquip(src)
|
||||
|
||||
//Spacesuit
|
||||
//Note: Everything in modules/clothing/spacesuits should have the entire suit grouped together.
|
||||
// Meaning the the suit is defined directly after the corrisponding helmet. Just like below!
|
||||
|
||||
@@ -76,9 +76,10 @@ GLOBAL_LIST_INIT(strippable_alien_humanoid_items, create_strippable_list(list(
|
||||
. = ..()
|
||||
. += alien_movement_delay
|
||||
|
||||
/mob/living/carbon/alien/humanoid/cuff_resist(obj/item/I)
|
||||
/mob/living/carbon/alien/humanoid/resist_restraints(attempt_breaking)
|
||||
playsound(src, 'sound/voice/hiss5.ogg', 40, 1, 1) //Alien roars when starting to break free
|
||||
..(I, cuff_break = 1)
|
||||
attempt_breaking = TRUE
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/alien/humanoid/get_standard_pixel_y_offset()
|
||||
if(leaping)
|
||||
|
||||
@@ -802,15 +802,22 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
|
||||
|
||||
/mob/living/carbon/resist_buckle()
|
||||
INVOKE_ASYNC(src, PROC_REF(resist_muzzle))
|
||||
var/obj/item/I = get_restraining_item()
|
||||
var/time = 0
|
||||
if(istype(I))
|
||||
time = I.breakouttime
|
||||
var/breakout_time = 0
|
||||
var/obj/item/restraints = get_restraining_item()
|
||||
|
||||
if(istype(restraints, /obj/item/clothing/suit/straight_jacket))
|
||||
var/obj/item/clothing/suit/straight_jacket/jacket = restraints
|
||||
jacket.breakouttime = breakout_time
|
||||
|
||||
else if(istype(restraints, /obj/item/restraints))
|
||||
var/obj/item/restraints/cuffs = restraints
|
||||
breakout_time = cuffs.breakouttime
|
||||
|
||||
else if(isstructure(buckled))
|
||||
var/obj/structure/struct = buckled
|
||||
time = struct.unbuckle_time
|
||||
breakout_time = struct.unbuckle_time
|
||||
|
||||
if(time == 0)
|
||||
if(!breakout_time)
|
||||
buckled.user_unbuckle_mob(src, src)
|
||||
return
|
||||
|
||||
@@ -820,8 +827,8 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
|
||||
apply_status_effect(STATUS_EFFECT_UNBUCKLE)
|
||||
|
||||
visible_message("<span class='warning'>[src] attempts to unbuckle [p_themselves()]!</span>",
|
||||
"<span class='notice'>You attempt to unbuckle yourself... (This will take around [time / 10] seconds and you need to stay still.)</span>")
|
||||
if(!do_after(src, time, FALSE, src, extra_checks = list(CALLBACK(src, PROC_REF(buckle_check)))))
|
||||
"<span class='notice'>You attempt to unbuckle yourself... (This will take around [breakout_time / 10] seconds and you need to stay still.)</span>")
|
||||
if(!do_after(src, breakout_time, FALSE, src, extra_checks = list(CALLBACK(src, PROC_REF(buckle_check)))))
|
||||
if(src && buckled)
|
||||
to_chat(src, "<span class='warning'>You fail to unbuckle yourself!</span>")
|
||||
else
|
||||
@@ -857,15 +864,21 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
|
||||
visible_message("<span class='danger'>[src] has successfully extinguished [p_themselves()]!</span>","<span class='notice'>You extinguish yourself.</span>")
|
||||
ExtinguishMob()
|
||||
|
||||
/mob/living/carbon/resist_restraints()
|
||||
/mob/living/carbon/resist_restraints(attempt_breaking)
|
||||
INVOKE_ASYNC(src, PROC_REF(resist_muzzle))
|
||||
var/obj/item/I = null
|
||||
if(wear_suit && wear_suit.breakouttime)
|
||||
wear_suit.resist_restraints(src, attempt_breaking)
|
||||
return
|
||||
|
||||
var/obj/item/restraints/cuffs
|
||||
if(handcuffed)
|
||||
I = handcuffed
|
||||
cuffs = handcuffed
|
||||
else if(legcuffed)
|
||||
I = legcuffed
|
||||
if(I)
|
||||
cuff_resist(I)
|
||||
cuffs = legcuffed
|
||||
|
||||
if(!cuffs)
|
||||
return
|
||||
cuff_resist(cuffs, attempt_breaking)
|
||||
|
||||
/mob/living/carbon/resist_muzzle()
|
||||
if(!istype(wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
@@ -889,89 +902,18 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
|
||||
unEquip(I)
|
||||
remove_status_effect(STATUS_EFFECT_REMOVE_MUZZLE)
|
||||
|
||||
/mob/living/carbon/proc/cuff_resist(obj/item/restraints/restraints, break_cuffs)
|
||||
var/effective_breakout_time = restraints.breakouttime
|
||||
if(break_cuffs)
|
||||
effective_breakout_time = 5 SECONDS
|
||||
|
||||
/mob/living/carbon/proc/cuff_resist(obj/item/I, breakouttime = 600, cuff_break = 0)
|
||||
breakouttime = I.breakouttime
|
||||
if(HAS_TRAIT(src, TRAIT_I_WANT_BRAINS))
|
||||
breakouttime /= 2
|
||||
if(has_status_effect(STATUS_EFFECT_REMOVE_CUFFS))
|
||||
to_chat(src, "<span class='notice'>You are already trying to [break_cuffs ? "break" : "remove"] [restraints].</span>")
|
||||
return
|
||||
|
||||
if(!cuff_break)
|
||||
if(has_status_effect(STATUS_EFFECT_REMOVE_CUFFS))
|
||||
to_chat(src, "<span class='notice'>You are already trying to remove [I].</span>")
|
||||
return
|
||||
apply_status_effect(STATUS_EFFECT_REMOVE_CUFFS)
|
||||
visible_message("<span class='warning'>[src] attempts to remove [I]!</span>")
|
||||
var/is_zombie = HAS_TRAIT(src, TRAIT_I_WANT_BRAINS)
|
||||
to_chat(src, "<span class='notice'>You attempt to remove [I]... (This will take around [breakouttime / 10] seconds[is_zombie ? "" : " and you need to stand still"].)</span>")
|
||||
if(do_after(src, breakouttime, 0, target = src, allow_moving = is_zombie, allow_moving_target = is_zombie))
|
||||
remove_status_effect(STATUS_EFFECT_REMOVE_CUFFS)
|
||||
if(I.loc != src || buckled)
|
||||
return
|
||||
if(istype(I, /obj/item/restraints/handcuffs/twimsts))
|
||||
visible_message("<span class='danger'>[src] manages to eat through [I]!</span>", "<span class='notice'>You successfully eat through [I].</span>")
|
||||
else
|
||||
visible_message("<span class='danger'>[src] manages to remove [I]!</span>", "<span class='notice'>You successfully remove [I].</span>")
|
||||
apply_status_effect(STATUS_EFFECT_REMOVE_CUFFS)
|
||||
|
||||
if(I == handcuffed)
|
||||
if(istype(I, /obj/item/restraints/handcuffs/twimsts))
|
||||
playsound(loc, 'sound/items/eatfood.ogg', 50, FALSE)
|
||||
if(I.reagents && length(I.reagents.reagent_list))
|
||||
taste(I.reagents)
|
||||
I.reagents.reaction(src, REAGENT_INGEST)
|
||||
I.reagents.trans_to(src, I.reagents.total_volume)
|
||||
qdel(handcuffed)
|
||||
else
|
||||
handcuffed.forceMove(drop_location())
|
||||
handcuffed.dropped(src)
|
||||
handcuffed = null
|
||||
if(buckled && buckled.buckle_requires_restraints)
|
||||
buckled.unbuckle_mob(src)
|
||||
update_handcuffed()
|
||||
return
|
||||
if(I == legcuffed)
|
||||
legcuffed.forceMove(drop_location())
|
||||
legcuffed.dropped()
|
||||
legcuffed = null
|
||||
toggle_move_intent()
|
||||
update_inv_legcuffed()
|
||||
return
|
||||
else
|
||||
unEquip(I)
|
||||
I.dropped(src)
|
||||
return
|
||||
else
|
||||
remove_status_effect(STATUS_EFFECT_REMOVE_CUFFS)
|
||||
to_chat(src, "<span class='warning'>You fail to remove [I]!</span>")
|
||||
|
||||
else
|
||||
breakouttime = 50
|
||||
if(has_status_effect(STATUS_EFFECT_BREAK_CUFFS))
|
||||
to_chat(src, "<span class='notice'>You are already trying to break [I].</span>")
|
||||
return
|
||||
apply_status_effect(STATUS_EFFECT_BREAK_CUFFS)
|
||||
visible_message("<span class='warning'>[src] is trying to break [I]!</span>")
|
||||
to_chat(src, "<span class='notice'>You attempt to break [I]... (This will take around 5 seconds and you need to stand still.)</span>")
|
||||
if(do_after(src, breakouttime, 0, target = src))
|
||||
remove_status_effect(STATUS_EFFECT_BREAK_CUFFS)
|
||||
if(!I.loc || buckled)
|
||||
return
|
||||
visible_message("<span class='danger'>[src] manages to break [I]!</span>")
|
||||
to_chat(src, "<span class='notice'>You successfully break [I].</span>")
|
||||
qdel(I)
|
||||
|
||||
if(I == handcuffed)
|
||||
handcuffed = null
|
||||
update_handcuffed()
|
||||
return
|
||||
else if(I == legcuffed)
|
||||
legcuffed = null
|
||||
toggle_move_intent()
|
||||
update_inv_legcuffed()
|
||||
return
|
||||
return 1
|
||||
else
|
||||
remove_status_effect(STATUS_EFFECT_BREAK_CUFFS)
|
||||
to_chat(src, "<span class='warning'>You fail to break [I]!</span>")
|
||||
restraints.attempt_resist_restraints(src, break_cuffs, effective_breakout_time)
|
||||
|
||||
//called when we get cuffed/uncuffed
|
||||
/mob/living/carbon/proc/update_handcuffed()
|
||||
|
||||
@@ -991,20 +991,11 @@
|
||||
affected.custom_pain("You feel a stabbing pain in your chest!")
|
||||
L.linked_organ.damage = L.linked_organ.min_bruised_damage
|
||||
|
||||
/mob/living/carbon/human/cuff_resist(obj/item/I)
|
||||
/mob/living/carbon/human/resist_restraints(attempt_breaking)
|
||||
if(HAS_TRAIT(src, TRAIT_HULK))
|
||||
say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
|
||||
if(..(I, cuff_break = 1))
|
||||
unEquip(I)
|
||||
else
|
||||
if(..())
|
||||
unEquip(I)
|
||||
|
||||
/mob/living/carbon/human/resist_restraints()
|
||||
if(wear_suit && wear_suit.breakouttime)
|
||||
cuff_resist(wear_suit)
|
||||
else
|
||||
..()
|
||||
attempt_breaking = TRUE
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/generate_name()
|
||||
name = dna.species.get_random_name(gender)
|
||||
|
||||
Reference in New Issue
Block a user