mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Merge pull request #9165 from Yoshax/trapping
Makes bear traps do damage when stepped on
This commit is contained in:
@@ -175,47 +175,91 @@
|
||||
origin_tech = "materials=1"
|
||||
var/breakouttime = 300 //Deciseconds = 30s = 0.5 minute
|
||||
|
||||
/obj/item/weapon/legcuffs/beartrap
|
||||
/obj/item/weapon/beartrap
|
||||
name = "bear trap"
|
||||
throw_speed = 2
|
||||
throw_range = 1
|
||||
gender = PLURAL
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "beartrap0"
|
||||
desc = "A trap used to catch bears and other legged creatures."
|
||||
var/armed = 0
|
||||
throwforce = 0
|
||||
w_class = 3.0
|
||||
origin_tech = "materials=1"
|
||||
var/deployed = 0
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is putting the [src.name] on \his head! It looks like \he's trying to commit suicide.</b>"
|
||||
viewers(user) << "<span class='danger'>[user] is putting the [src.name] on \his head! It looks like \he's trying to commit suicide.</span>"
|
||||
return (BRUTELOSS)
|
||||
|
||||
/obj/item/weapon/legcuffs/beartrap/attack_self(mob/user as mob)
|
||||
/obj/item/weapon/beartrap/attack_self(mob/user as mob)
|
||||
..()
|
||||
if(ishuman(user) && !user.stat && !user.restrained())
|
||||
armed = !armed
|
||||
icon_state = "beartrap[armed]"
|
||||
user << "<span class='notice'>[src] is now [armed ? "armed" : "disarmed"]</span>"
|
||||
if(deployed==0)
|
||||
user.visible_message("<span class='danger'>[user] is deploying \the [src]</span>", "<span class='danger'>You are deploying \the [src]!</span>")
|
||||
if (do_after(user, 60))
|
||||
user.visible_message("<span class='danger'>[user] has deployed \the [src]</span>", "<span class='danger'>You have deployed \the [src]!</span>")
|
||||
deployed = 1
|
||||
user.drop_from_inventory(src, user.loc)
|
||||
update_icon()
|
||||
anchored = 1
|
||||
|
||||
/obj/item/weapon/legcuffs/beartrap/Crossed(AM as mob|obj)
|
||||
if(armed)
|
||||
/obj/item/weapon/beartrap/attack_hand(mob/user as mob)
|
||||
if(ishuman(user) && !user.stat && !user.restrained())
|
||||
if(deployed==1)
|
||||
user.visible_message("<span class='danger'>[user] is disarming \the [src]</span>", "<span class='danger'>You are disarming \the [src]!</span>")
|
||||
if (do_after(user, 60))
|
||||
user.visible_message("<span class='danger'>[user] has disarmed \the [src]</span>", "<span class='danger'>You have disarmed \the [src]!</span>")
|
||||
deployed = 0
|
||||
anchored = 0
|
||||
update_icon()
|
||||
|
||||
if(deployed==0)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/beartrap/Crossed(AM as mob|obj)
|
||||
if(deployed)
|
||||
if(ishuman(AM))
|
||||
if(isturf(src.loc))
|
||||
var/mob/living/carbon/H = AM
|
||||
var/mob/living/carbon/human/H = AM
|
||||
if(H.m_intent == "run")
|
||||
armed = 0
|
||||
H.legcuffed = src
|
||||
src.loc = H
|
||||
H.update_inv_legcuffed()
|
||||
H << "\red <B>You step on \the [src]!</B>"
|
||||
feedback_add_details("handcuffs","B") //Yes, I know they're legcuffs. Don't change this, no need for an extra variable. The "B" is used to tell them apart.
|
||||
deployed = 0
|
||||
update_icon()
|
||||
H << "<span class='danger'>You step on \the [src]!</span>"
|
||||
for(var/mob/O in viewers(H, null))
|
||||
if(O == H)
|
||||
continue
|
||||
O.show_message("\red <B>[H] steps on \the [src].</B>", 1)
|
||||
O.show_message("<span class='danger'>[H] steps on \the [src].</span>", 1)
|
||||
if(H.lying)
|
||||
var/obj/item/organ/external/affecting = pick(H.organs)
|
||||
if(affecting.take_damage(30, 0))
|
||||
H.UpdateDamageIcon()
|
||||
affecting.embed(src)
|
||||
else
|
||||
var/list/potentialorgans = list()
|
||||
for(var/organ in list("l_leg", "r_leg", "l_foot", "r_foot"))
|
||||
var/obj/item/organ/external/R = H.get_organ(organ)
|
||||
if(R && !(R.status & ORGAN_DESTROYED))
|
||||
potentialorgans += R
|
||||
var/obj/item/organ/external/affecting = pick(potentialorgans)
|
||||
if(affecting.take_damage(30, 0))
|
||||
H.UpdateDamageIcon()
|
||||
affecting.embed(src)
|
||||
|
||||
|
||||
if(isanimal(AM) && !istype(AM, /mob/living/simple_animal/parrot) && !istype(AM, /mob/living/simple_animal/construct) && !istype(AM, /mob/living/simple_animal/shade) && !istype(AM, /mob/living/simple_animal/hostile/viscerator))
|
||||
armed = 0
|
||||
deployed = 0
|
||||
var/mob/living/simple_animal/SA = AM
|
||||
SA.health -= 20
|
||||
..()
|
||||
|
||||
/obj/item/weapon/beartrap/update_icon()
|
||||
..()
|
||||
|
||||
if(deployed == 0)
|
||||
icon_state = "beartrap0"
|
||||
else
|
||||
icon_state = "beartrap1"
|
||||
|
||||
|
||||
/obj/item/weapon/caution
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
if(9)
|
||||
item_type = "[pick("wicked","evil","byzantine","dangerous")] looking [pick("device","contraption","thing","trap")]"
|
||||
apply_prefix = 0
|
||||
new_item = new /obj/item/weapon/legcuffs/beartrap(src.loc)
|
||||
new_item = new /obj/item/weapon/beartrap(src.loc)
|
||||
additional_desc = "[pick("It looks like it could take a limb off",\
|
||||
"Could be some kind of animal trap",\
|
||||
"There appear to be [pick("dark red","dark purple","dark green","dark blue")] stains along part of it")]."
|
||||
|
||||
37
html/changelogs/Yoshax - trapping.YML
Normal file
37
html/changelogs/Yoshax - trapping.YML
Normal file
@@ -0,0 +1,37 @@
|
||||
################################
|
||||
# Example Changelog File
|
||||
#
|
||||
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||
#
|
||||
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||
# When it is, any changes listed below will disappear.
|
||||
#
|
||||
# Valid Prefixes:
|
||||
# bugfix
|
||||
# wip (For works in progress)
|
||||
# tweak
|
||||
# soundadd
|
||||
# sounddel
|
||||
# rscadd (general adding of nice things)
|
||||
# rscdel (general deleting of nice things)
|
||||
# imageadd
|
||||
# imagedel
|
||||
# maptweak
|
||||
# spellcheck (typo fixes)
|
||||
# experiment
|
||||
#################################
|
||||
|
||||
# Your name.
|
||||
author: Yoshax
|
||||
|
||||
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||
delete-after: True
|
||||
|
||||
# Any changes you've made. See valid prefix list above.
|
||||
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||
# SCREW THIS UP AND IT WON'T WORK.
|
||||
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
|
||||
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
|
||||
changes:
|
||||
- tweak: "Bear traps now do damage when stood on, enough to break bones! Bear traps can now affect any limb of a person who is on the ground, including head! Bear traps are no longer legcuffs and instead embed in the limb they attack."
|
||||
- tweak: "Bear traps now take several seconds to deploy and cannot be picked up when armed, they must be disarmed by clicking on them. They also cannot be moved then they are deployed."
|
||||
@@ -4927,7 +4927,7 @@
|
||||
"bQM" = (/obj/structure/table/standard,/obj/machinery/newscaster/security_unit{pixel_x = 0; pixel_y = 32},/obj/machinery/recharger{pixel_y = 0},/obj/item/weapon/packageWrap,/obj/item/weapon/hand_labeler,/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{dir = 4},/obj/structure/cable/green{d1 = 4; d2 = 8; icon_state = "4-8"},/turf/simulated/floor,/area/crew_quarters/heads/hop)
|
||||
"bQN" = (/obj/machinery/disposal,/obj/structure/disposalpipe/trunk{dir = 1},/obj/machinery/light,/turf/simulated/floor,/area/janitor)
|
||||
"bQO" = (/obj/structure/janitorialcart,/obj/machinery/atmospherics/unary/vent_scrubber/on{dir = 4},/turf/simulated/floor,/area/janitor)
|
||||
"bQP" = (/obj/item/weapon/legcuffs/beartrap,/obj/item/weapon/legcuffs/beartrap,/obj/item/weapon/storage/box/mousetraps,/obj/item/weapon/storage/box/mousetraps,/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{dir = 4},/turf/simulated/floor,/area/janitor)
|
||||
"bQP" = (/obj/item/weapon/beartrap,/obj/item/weapon/storage/box/mousetraps,/obj/item/weapon/storage/box/mousetraps,/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{dir = 4},/obj/item/weapon/beartrap,/turf/simulated/floor,/area/janitor)
|
||||
"bQQ" = (/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{dir = 10},/obj/machinery/atmospherics/pipe/simple/hidden/supply,/obj/structure/cable/green{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor,/area/janitor)
|
||||
"bQR" = (/obj/structure/reagent_dispensers/watertank,/turf/simulated/floor,/area/janitor)
|
||||
"bQS" = (/obj/effect/decal/cleanable/cobweb,/obj/effect/decal/cleanable/generic,/turf/simulated/floor/plating,/area/maintenance/engineering)
|
||||
|
||||
Reference in New Issue
Block a user