mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 19:44:46 +01:00
Adds the funny fences (#17840)
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
var/cuttable = TRUE
|
||||
var/hole_size= NO_HOLE
|
||||
var/invulnerable = FALSE
|
||||
var/electric = FALSE
|
||||
|
||||
/obj/structure/fence/Initialize(mapload)
|
||||
update_cut_status()
|
||||
@@ -68,8 +69,17 @@
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/structure/fence/attack_hand(mob/user)
|
||||
if(electric && isliving(user) && !user.is_incorporeal())
|
||||
if(electrocute(user))
|
||||
return
|
||||
. = ..()
|
||||
|
||||
/obj/structure/fence/attackby(obj/item/W, mob/user)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
if(electric && isliving(user) && !user.is_incorporeal() && !(W.flags & NOCONDUCT))
|
||||
if(electrocute(user))
|
||||
return
|
||||
if(W.has_tool_quality(TOOL_WIRECUTTER))
|
||||
if(!cuttable)
|
||||
to_chat(user, span_warning("This section of the fence can't be cut."))
|
||||
@@ -100,6 +110,13 @@
|
||||
update_cut_status()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/fence/Bumped(AM)
|
||||
. = ..()
|
||||
if(electric && isliving(AM))
|
||||
var/mob/living/L = AM
|
||||
if(!L.is_incorporeal())
|
||||
electrocute(L)
|
||||
|
||||
/obj/structure/fence/proc/update_cut_status()
|
||||
if(!cuttable)
|
||||
return
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
#define NAME_ELECFENCE "electric fence"
|
||||
#define DESC_ELECFENCE "A chain link fence attached to a nearby area power controller. Zap zap!"
|
||||
#define ICON_ELECFENCE 'icons/obj/fence_electric.dmi'
|
||||
|
||||
// Required to be in an area with a powered APC to electrocute! Intended for POIs.
|
||||
/obj/structure/fence/electric
|
||||
name = NAME_ELECFENCE
|
||||
desc = DESC_ELECFENCE
|
||||
icon = ICON_ELECFENCE
|
||||
electric = TRUE
|
||||
|
||||
/obj/structure/fence/electric_sign
|
||||
name = NAME_ELECFENCE
|
||||
desc = DESC_ELECFENCE
|
||||
icon = ICON_ELECFENCE
|
||||
electric = TRUE
|
||||
icon_state = "straight_sign"
|
||||
|
||||
/obj/structure/fence/door/electric
|
||||
name = NAME_ELECFENCE
|
||||
desc = DESC_ELECFENCE
|
||||
icon = ICON_ELECFENCE
|
||||
electric = TRUE
|
||||
|
||||
/obj/structure/fence/end/electric
|
||||
name = NAME_ELECFENCE
|
||||
desc = DESC_ELECFENCE
|
||||
icon = ICON_ELECFENCE
|
||||
electric = TRUE
|
||||
|
||||
/obj/structure/fence/corner/electric
|
||||
name = NAME_ELECFENCE
|
||||
desc = DESC_ELECFENCE
|
||||
icon = ICON_ELECFENCE
|
||||
electric = TRUE
|
||||
|
||||
/obj/structure/fence/post/electric
|
||||
name = NAME_ELECFENCE
|
||||
desc = DESC_ELECFENCE
|
||||
icon = ICON_ELECFENCE
|
||||
electric = TRUE
|
||||
|
||||
/obj/structure/fence/cut/medium/electric
|
||||
name = NAME_ELECFENCE
|
||||
desc = DESC_ELECFENCE
|
||||
icon = ICON_ELECFENCE
|
||||
electric = TRUE
|
||||
|
||||
/obj/structure/fence/cut/large/electric
|
||||
name = NAME_ELECFENCE
|
||||
desc = DESC_ELECFENCE
|
||||
icon = ICON_ELECFENCE
|
||||
electric = TRUE
|
||||
|
||||
/obj/structure/fence/proc/electrocute(mob/living/M)
|
||||
if(electrocute_mob(M, get_area(src), src, 0.7))
|
||||
visible_message("\The [src] zaps [M]!")
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
#undef NAME_ELECFENCE
|
||||
#undef DESC_ELECFENCE
|
||||
#undef ICON_ELECFENCE
|
||||
Reference in New Issue
Block a user