mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-25 05:51:56 +01:00
Tripwire Trap and Wired Rod Colors (#12090)
* Tripwire Trap and Wired Rod Colors * check for human and flying and crawling
This commit is contained in:
@@ -211,7 +211,7 @@
|
||||
if(istype(I, /obj/item/stack/rods))
|
||||
var/obj/item/stack/rods/R = I
|
||||
if (R.use(1))
|
||||
var/obj/item/material/wirerod/W = new(get_turf(user))
|
||||
var/obj/item/material/wirerod/W = new(get_turf(user), MATERIAL_STEEL, color)
|
||||
user.put_in_hands(W)
|
||||
to_chat(user, SPAN_NOTICE("You wrap \the [src] around the top of the rod."))
|
||||
qdel(src)
|
||||
|
||||
@@ -51,6 +51,18 @@
|
||||
attack_verb = list("hit", "bludgeoned", "whacked", "bonked")
|
||||
force_divisor = 0.1
|
||||
thrown_force_divisor = 0.1
|
||||
applies_material_colour = FALSE
|
||||
var/forward_cable_color = COLOR_RED
|
||||
|
||||
/obj/item/material/wirerod/Initialize(mapload, var/material_key, var/cable_color)
|
||||
. = ..()
|
||||
if(!cable_color)
|
||||
cable_color = COLOR_RED
|
||||
forward_cable_color = cable_color
|
||||
var/image/I = image(icon, null, "wiredrod_cable")
|
||||
I.appearance_flags = RESET_COLOR
|
||||
I.color = cable_color
|
||||
add_overlay(I)
|
||||
|
||||
/obj/item/material/wirerod/attackby(var/obj/item/I, mob/user as mob)
|
||||
..()
|
||||
@@ -58,10 +70,13 @@
|
||||
if(istype(I, /obj/item/material/shard) || istype(I, /obj/item/material/spearhead))
|
||||
var/obj/item/material/tmp_shard = I
|
||||
finished = new /obj/item/material/twohanded/spear(get_turf(user), tmp_shard.material.name)
|
||||
to_chat(user, "<span class='notice'>You fasten \the [I] to the top of the rod with the cable.</span>")
|
||||
to_chat(user, SPAN_NOTICE("You fasten \the [I] to the top of the rod with the cable."))
|
||||
else if(I.iswirecutter())
|
||||
finished = new /obj/item/melee/baton/cattleprod(get_turf(user))
|
||||
to_chat(user, "<span class='notice'>You fasten the wirecutters to the top of the rod with the cable, prongs outward.</span>")
|
||||
finished = new /obj/item/melee/baton/cattleprod(get_turf(user), forward_cable_color)
|
||||
to_chat(user, SPAN_NOTICE("You fasten the wirecutters to the top of the rod with the cable, prongs outward."))
|
||||
else if(istype(I, /obj/item/material/wirerod))
|
||||
finished = new /obj/item/trap/tripwire(get_turf(user), forward_cable_color)
|
||||
to_chat(user, SPAN_NOTICE("You attach the two wired rods together, spooling the cable between them."))
|
||||
if(finished)
|
||||
user.drop_from_inventory(src,finished)
|
||||
user.drop_from_inventory(I,finished)
|
||||
@@ -91,7 +106,7 @@
|
||||
if(istype(I, /obj/item/material/spearhead))
|
||||
var/obj/item/material/spearhead/tip = I
|
||||
finished = new /obj/item/material/twohanded/pike(get_turf(user), tip.material.name)
|
||||
to_chat(user, "<span class='notice'>You attach \the [I] to the top of \the [src].</span>")
|
||||
to_chat(user, SPAN_NOTICE("You attach \the [I] to the top of \the [src]."))
|
||||
if(finished)
|
||||
user.drop_from_inventory(src,finished)
|
||||
user.drop_from_inventory(I,finished)
|
||||
@@ -168,7 +183,7 @@
|
||||
complete = new /obj/item/clothing/head/lavender_crown(get_turf(user))
|
||||
|
||||
if(complete != null)
|
||||
to_chat(user, "<span class='notice'>You attach the " + S.seed.seed_name + " to the circlet and create a beautiful flower crown.</span>")
|
||||
to_chat(user, SPAN_NOTICE("You attach the " + S.seed.seed_name + " to the circlet and create a beautiful flower crown."))
|
||||
user.drop_from_inventory(W)
|
||||
user.drop_from_inventory(src)
|
||||
qdel(W)
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
var/material/material
|
||||
var/drops_debris = 1
|
||||
|
||||
/obj/item/material/New(var/newloc, var/material_key)
|
||||
..(newloc)
|
||||
/obj/item/material/Initialize(var/newloc, var/material_key)
|
||||
. = ..()
|
||||
if(!material_key)
|
||||
material_key = default_material
|
||||
set_material(material_key)
|
||||
|
||||
@@ -247,6 +247,14 @@
|
||||
baton_color = "#FFDF00"
|
||||
sheathed = 0
|
||||
|
||||
/obj/item/melee/baton/cattleprod/Initialize(mapload, var/cable_color)
|
||||
. = ..()
|
||||
var/image/I = image(icon, null, "stunprod_cable")
|
||||
if(!cable_color)
|
||||
cable_color = COLOR_RED
|
||||
I.color = cable_color
|
||||
add_overlay(I)
|
||||
|
||||
/obj/item/melee/baton/stunrod
|
||||
name = "stunrod"
|
||||
desc = "A more-than-lethal weapon used to deal with high threat situations."
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
throw_speed = 2
|
||||
throw_range = 1
|
||||
gender = PLURAL
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon = 'icons/obj/contained_items/weapons/traps.dmi'
|
||||
var/icon_base = "beartrap"
|
||||
icon_state = "beartrap0"
|
||||
randpixel = 0
|
||||
@@ -17,6 +17,10 @@
|
||||
var/time_to_escape = 60
|
||||
var/activated_armor_penetration = 0
|
||||
|
||||
/obj/item/trap/Initialize()
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/trap/proc/can_use(mob/user)
|
||||
return (user.IsAdvancedToolUser() && !issilicon(user) && !user.stat && !user.restrained())
|
||||
|
||||
@@ -62,34 +66,22 @@
|
||||
anchored = FALSE
|
||||
|
||||
/obj/item/trap/attack_hand(mob/user)
|
||||
if(buckled && can_use(user))
|
||||
user.visible_message(
|
||||
SPAN_NOTICE("\The [user] begins freeing \the [buckled] from \the [src]..."),
|
||||
SPAN_NOTICE("You carefully begin to free \the [buckled] from \the [src]...")
|
||||
)
|
||||
if(do_after(user, time_to_escape))
|
||||
user.visible_message(
|
||||
SPAN_NOTICE("\The user frees \the [buckled] from \the [src]."),
|
||||
SPAN_NOTICE("You free \the [buckled] from \the [src].")
|
||||
)
|
||||
unbuckle()
|
||||
anchored = FALSE
|
||||
else if(deployed && can_use(user))
|
||||
user.visible_message(
|
||||
SPAN_NOTICE("\The [user] starts to disarm \the [src]..."),
|
||||
SPAN_NOTICE("You begin disarming \the [src]..."),
|
||||
SPAN_WARNING("You hear a latch click followed by the slow creaking of a spring.")
|
||||
)
|
||||
if(do_after(user, 6 SECONDS))
|
||||
user.visible_message(
|
||||
SPAN_NOTICE("\The [user] disarms \the [src]!"),
|
||||
SPAN_NOTICE("You disarm \the [src]!")
|
||||
)
|
||||
deployed = FALSE
|
||||
anchored = FALSE
|
||||
update_icon()
|
||||
else
|
||||
..()
|
||||
if(can_use(user))
|
||||
if(buckled)
|
||||
user_unbuckle(user)
|
||||
return
|
||||
else if(deployed)
|
||||
disarm_trap(user)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/trap/proc/disarm_trap(var/mob/user)
|
||||
user.visible_message(SPAN_NOTICE("\The [user] starts to disarm \the [src]..."), SPAN_NOTICE("You begin disarming \the [src]..."), SPAN_WARNING("You hear a latch click followed by the slow creaking of a spring."))
|
||||
if(do_after(user, 6 SECONDS))
|
||||
user.visible_message(SPAN_NOTICE("\The [user] disarms \the [src]!"), SPAN_NOTICE("You disarm \the [src]!"))
|
||||
deployed = FALSE
|
||||
anchored = FALSE
|
||||
update_icon()
|
||||
|
||||
/obj/item/trap/proc/attack_mob(mob/living/L)
|
||||
var/target_zone
|
||||
@@ -102,6 +94,8 @@
|
||||
if(!success)
|
||||
return FALSE
|
||||
|
||||
L.visible_message(SPAN_DANGER("\The [L] steps on \the [src]!"), FONT_LARGE(SPAN_DANGER("You step on \the [src]!")), SPAN_WARNING("<b>You hear a loud metallic snap!</b>"))
|
||||
|
||||
var/did_trap = TRUE
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
@@ -124,6 +118,10 @@
|
||||
bear.anger += 15//traps make bears really angry
|
||||
bear.instant_aggro()
|
||||
|
||||
if(!buckled)
|
||||
anchored = FALSE
|
||||
deployed = FALSE
|
||||
|
||||
/obj/item/trap/Crossed(atom/movable/AM)
|
||||
if(ishuman(AM))
|
||||
var/mob/living/carbon/human/H = AM
|
||||
@@ -131,15 +129,7 @@
|
||||
return
|
||||
if(deployed && isliving(AM))
|
||||
var/mob/living/L = AM
|
||||
L.visible_message(
|
||||
SPAN_DANGER("\The [L] steps on \the [src]!"),
|
||||
FONT_LARGE(SPAN_DANGER("You step on \the [src]!")),
|
||||
SPAN_WARNING("<b>You hear a loud metallic snap!</b>")
|
||||
)
|
||||
attack_mob(L)
|
||||
if(!buckled)
|
||||
anchored = FALSE
|
||||
deployed = FALSE
|
||||
update_icon()
|
||||
shake_animation()
|
||||
|
||||
@@ -153,13 +143,9 @@
|
||||
|
||||
/obj/item/trap/animal
|
||||
name = "small trap"
|
||||
throw_speed = 2
|
||||
throw_range = 1
|
||||
gender = PLURAL
|
||||
icon = 'icons/obj/items.dmi'
|
||||
desc = "A small mechanical trap that's used to catch small animals like rats, lizards, and chicks."
|
||||
icon_base = "small"
|
||||
icon_state = "small0"
|
||||
desc = "A small mechanical trap that's used to catch small animals like rats, lizards, and chicks."
|
||||
throwforce = 2
|
||||
force = 1
|
||||
w_class = ITEMSIZE_SMALL
|
||||
@@ -190,7 +176,6 @@
|
||||
to_chat(user, "<span class='warning'>\The [src] is already full!</span>")
|
||||
|
||||
/obj/item/trap/animal/update_icon()
|
||||
icon = initial(icon)
|
||||
icon_state = "[icon_base][deployed]"
|
||||
|
||||
/obj/item/trap/animal/examine(mob/user)
|
||||
@@ -629,8 +614,8 @@
|
||||
/obj/item/large_trap_foundation
|
||||
name = "large trap foundation"
|
||||
desc = "A metal foundation for large trap, it is missing metals rods to hold the prey."
|
||||
icon = 'icons/obj/contained_items/weapons/traps.dmi'
|
||||
icon_state = "large_foundation"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
throwforce = 4
|
||||
force = 5
|
||||
w_class = ITEMSIZE_HUGE
|
||||
@@ -656,3 +641,52 @@
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/trap/tripwire
|
||||
name = "tripwire trap"
|
||||
desc = "A piece of cable coil strung between two metal rods. Low-tech, but reliable."
|
||||
icon_base = "tripwire"
|
||||
color = COLOR_RED
|
||||
layer = UNDERDOOR // so you can't cover it with items
|
||||
|
||||
/obj/item/trap/tripwire/Initialize(mapload, var/new_cable_color)
|
||||
. = ..()
|
||||
if(!new_cable_color)
|
||||
new_cable_color = COLOR_RED
|
||||
color = new_cable_color
|
||||
|
||||
/obj/item/trap/tripwire/update_icon()
|
||||
underlays = null
|
||||
icon_state = "[icon_base][deployed]"
|
||||
var/image/I = image(icon, null, "[icon_state]_base")
|
||||
I.appearance_flags = RESET_COLOR
|
||||
underlays = list(I)
|
||||
|
||||
/obj/item/trap/tripwire/deploy(mob/user)
|
||||
user.visible_message(SPAN_WARNING("\The [user] starts to deploy \the [src]."), SPAN_WARNING("You begin deploying \the [src]!"))
|
||||
if(do_after(user, 5 SECONDS))
|
||||
user.visible_message(SPAN_WARNING("\The [user] deploys \the [src]."), SPAN_WARNING("You deploy \the [src]!"))
|
||||
deployed = TRUE
|
||||
update_icon()
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/trap/tripwire/disarm_trap(var/mob/user)
|
||||
user.visible_message(SPAN_NOTICE("\The [user] starts to take \the [src] down..."), SPAN_NOTICE("You begin taking \the [src] down..."), SPAN_WARNING("You hear a latch click followed by the slow creaking of a spring."))
|
||||
if(do_after(user, 6 SECONDS))
|
||||
deployed = FALSE
|
||||
anchored = FALSE
|
||||
update_icon()
|
||||
|
||||
/obj/item/trap/tripwire/attack_mob(mob/living/L)
|
||||
if(!ishuman(L))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = L
|
||||
if(!H.organs_by_name[BP_L_LEG] && !H.organs_by_name[BP_R_LEG]) // tripwires are triggered by shin, so if you don't have legs, assume you fly or crawl
|
||||
return
|
||||
|
||||
if(!L.lying && (L.m_intent == M_RUN) || prob(5))
|
||||
L.visible_message(SPAN_DANGER("\The [L] trips over \the [src]!"), FONT_LARGE(SPAN_DANGER("You trip over \the [src]!")))
|
||||
L.Weaken(3)
|
||||
Reference in New Issue
Block a user