Merge remote-tracking branch 'upstream/master' into departmental-clothing-vendors

This commit is contained in:
E-MonaRhg
2021-09-11 20:26:54 +02:00
255 changed files with 1654 additions and 676 deletions
@@ -59,6 +59,12 @@
window_to_spawn_regular = /obj/structure/window/reinforced/tinted
window_to_spawn_full = /obj/structure/window/full/reinforced/tinted
/obj/effect/spawner/window/reinforced/polarized
name = "electrochromic reinforced window spawner"
icon_state = "pwindow_spawner"
window_to_spawn_regular = /obj/structure/window/reinforced/polarized
window_to_spawn_full = /obj/structure/window/full/reinforced/polarized
/obj/effect/spawner/window/shuttle
name = "shuttle window spawner"
icon_state = "swindow_spawner"
+61 -2
View File
@@ -117,6 +117,12 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/goonstation/effect
var/in_inventory = FALSE //is this item equipped into an inventory slot or hand of a mob?
var/tip_timer = 0
// item hover FX
/// Is this item inside a storage object?
var/in_storage = FALSE
/// Holder var for the item outline filter, null when no outline filter on the item.
var/outline_filter
/obj/item/New()
..()
for(var/path in actions_types)
@@ -131,6 +137,11 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/goonstation/effect
if(!move_resist)
determine_move_resist()
/obj/item/Initialize(mapload)
. = ..()
if(istype(loc, /obj/item/storage)) //marks all items in storage as being such
in_storage = TRUE
/obj/item/proc/determine_move_resist()
switch(w_class)
if(WEIGHT_CLASS_TINY)
@@ -406,6 +417,7 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/goonstation/effect
if((flags & NODROP) && !(initial(flags) & NODROP)) //Remove NODROP is dropped
flags &= ~NODROP
in_inventory = FALSE
remove_outline()
SEND_SIGNAL(src, COMSIG_ITEM_DROPPED,user)
if(!silent)
playsound(src, drop_sound, DROP_SOUND_VOLUME, ignore_walls = FALSE)
@@ -418,10 +430,12 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/goonstation/effect
// called when this item is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called.
/obj/item/proc/on_exit_storage(obj/item/storage/S as obj)
in_storage = FALSE
return
// called when this item is added into a storage item, which is passed on as S. The loc variable is already set to the storage item.
/obj/item/proc/on_enter_storage(obj/item/storage/S as obj)
in_storage = TRUE
return
/**
@@ -691,14 +705,24 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/goonstation/effect
openToolTip(user, src, params, title = name, content = "[desc]", theme = "")
/obj/item/MouseEntered(location, control, params)
if(in_inventory)
if(in_inventory || in_storage)
var/timedelay = 8
var/user = usr
var/mob/user = usr
tip_timer = addtimer(CALLBACK(src, .proc/openTip, location, control, params, user), timedelay, TIMER_STOPPABLE)
if(QDELETED(src))
return
var/mob/living/L = user
if(!(user.client.prefs.toggles2 & PREFTOGGLE_2_SEE_ITEM_OUTLINES))
return
if(istype(L) && L.incapacitated(ignore_lying = TRUE))
apply_outline(L, COLOR_RED_GRAY) //if they're dead or handcuffed, let's show the outline as red to indicate that they can't interact with that right now
else
apply_outline(L) //if the player's alive and well we send the command with no color set, so it uses the theme's color
/obj/item/MouseExited()
deltimer(tip_timer) //delete any in-progress timer if the mouse is moved off the item before it finishes
closeToolTip(usr)
remove_outline()
/obj/item/MouseDrop_T(obj/item/I, mob/user)
if(!user || user.incapacitated(ignore_lying = TRUE) || src == I)
@@ -707,6 +731,41 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/goonstation/effect
if(loc && I.loc == loc && istype(loc, /obj/item/storage) && loc.Adjacent(user)) // Are we trying to swap two items in the storage?
var/obj/item/storage/S = loc
S.swap_items(src, I, user)
remove_outline() //get rid of the hover effect in case the mouse exit isn't called if someone drags and drops an item and somthing goes wrong
/obj/item/proc/apply_outline(mob/user, outline_color = null)
if(!(in_inventory || in_storage) || QDELETED(src) || isobserver(user)) //cancel if the item isn't in an inventory, is being deleted, or if the person hovering is a ghost (so that people spectating you don't randomly make your items glow)
return
var/theme = lowertext(user.client.prefs.UI_style)
if(!outline_color) //if we weren't provided with a color, take the theme's color
switch(theme) //yeah it kinda has to be this way
if("midnight")
outline_color = COLOR_THEME_MIDNIGHT
if("plasmafire")
outline_color = COLOR_THEME_PLASMAFIRE
if("retro")
outline_color = COLOR_THEME_RETRO //just as garish as the rest of this theme
if("slimecore")
outline_color = COLOR_THEME_SLIMECORE
if("operative")
outline_color = COLOR_THEME_OPERATIVE
if("clockwork")
outline_color = COLOR_THEME_CLOCKWORK //if you want free gbp go fix the fact that clockwork's tooltip css is glass'
if("glass")
outline_color = COLOR_THEME_GLASS
else //this should never happen, hopefully
outline_color = COLOR_WHITE
if(color)
outline_color = COLOR_WHITE //if the item is recolored then the outline will be too, let's make the outline white so it becomes the same color instead of some ugly mix of the theme and the tint
if(outline_filter)
filters -= outline_filter
outline_filter = filter(type = "outline", size = 1, color = outline_color)
filters += outline_filter
/obj/item/proc/remove_outline()
if(outline_filter)
filters -= outline_filter
outline_filter = null
// Returns a numeric value for sorting items used as parts in machines, so they can be replaced by the rped
/obj/item/proc/get_part_rating()
+1 -1
View File
@@ -13,7 +13,7 @@
var/list/insultmsg = list("FUCK EVERYONE!", "I'M A TATER!", "ALL SECURITY TO SHOOT ME ON SIGHT!", "I HAVE A BOMB!", "CAPTAIN IS A COMDOM!", "FOR THE SYNDICATE!")
/obj/item/megaphone/attack_self(mob/living/user as mob)
if(user.client && (user.client.prefs.muted & MUTE_IC))
if(check_mute(user.ckey, MUTE_IC))
to_chat(src, "<span class='warning'>You cannot speak in IC (muted).</span>")
return
if(!ishuman(user))
@@ -27,8 +27,8 @@
return
var/turf/T = get_turf(P)
if(P.level < 2 && T.level == 1 && T.intact)
to_chat(user, "<span class='warning'>You must remove the plating first.</span>")
if(P.level < 2 && T.level == 1 && T.intact && !T.transparent_floor)
to_chat(user, "<span class='warning'>You must remove the flooring first.</span>")
return
P.change_color(GLOB.pipe_colors[paint_setting])
@@ -21,3 +21,11 @@
/obj/item/mounted/frame/light_switch/do_build(turf/on_wall, mob/user)
new /obj/machinery/light_switch(get_turf(user), get_dir(user, on_wall))
qdel(src)
/obj/item/mounted/frame/light_switch/windowtint
name = "window tint control button frame"
desc = "Used for repairing or building window tint control buttons"
/obj/item/mounted/frame/light_switch/windowtint/do_build(turf/on_wall, mob/user)
new /obj/machinery/button/windowtint(get_turf(user), get_dir(user, on_wall))
qdel(src)
+13 -2
View File
@@ -1,6 +1,17 @@
GLOBAL_LIST_INIT(rod_recipes, list ( \
new/datum/stack_recipe("grille", /obj/structure/grille, 2, time = 10, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("table frame", /obj/structure/table_frame, 2, time = 10, one_per_turf = 1, on_floor = 1), \
new /datum/stack_recipe("grille", /obj/structure/grille, 2, time = 10, one_per_turf = 1, on_floor = 1), \
new /datum/stack_recipe("table frame", /obj/structure/table_frame, 2, time = 10, one_per_turf = 1, on_floor = 1), \
null,
new /datum/stack_recipe("railing", /obj/structure/railing, 3, time = 10, one_per_turf = 1, on_floor = 1), \
new /datum/stack_recipe("railing corner", /obj/structure/railing/corner, 3, time = 10, one_per_turf = 1, on_floor = 1), \
null,
new /datum/stack_recipe_list("chainlink fence", list( \
new /datum/stack_recipe("chainlink fence", /obj/structure/fence, 5, time = 10, one_per_turf = 1, on_floor = 1), \
new /datum/stack_recipe("chainlink fence post", /obj/structure/fence/post, 5, time = 10, one_per_turf = 1, on_floor = 1), \
new /datum/stack_recipe("chainlink fence corner", /obj/structure/fence/corner, 5, time = 10, one_per_turf = 1, on_floor = 1), \
new /datum/stack_recipe("chainlink fence door", /obj/structure/fence/door, 10, time = 10, one_per_turf = 1, on_floor = 1), \
new /datum/stack_recipe("chainlink fence end", /obj/structure/fence/end, 3, time = 10, one_per_turf = 1, on_floor = 1), \
)), \
))
/obj/item/stack/rods
@@ -89,7 +89,10 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
new/datum/stack_recipe/window("windoor frame", /obj/structure/windoor_assembly, 5, time = 0, on_floor = TRUE, window_checks = TRUE), \
null, \
new/datum/stack_recipe/window("directional reinforced window", /obj/structure/window/reinforced, time = 0, on_floor = TRUE, window_checks = TRUE), \
new/datum/stack_recipe/window("fulltile reinforced window", /obj/structure/window/full/reinforced, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
new/datum/stack_recipe/window("fulltile reinforced window", /obj/structure/window/full/reinforced, 2, time = 0, on_floor = TRUE, window_checks = TRUE), \
null, \
new/datum/stack_recipe/window("directional electrochromic window", /obj/structure/window/reinforced/polarized, 2, time = 0, on_floor = TRUE, window_checks = TRUE), \
new/datum/stack_recipe/window("fulltile electrochromic window", /obj/structure/window/full/reinforced/polarized, 4, time = 0, on_floor = TRUE, window_checks = TRUE) \
))
/obj/item/stack/sheet/rglass
@@ -92,6 +92,7 @@ GLOBAL_LIST_INIT(metal_recipes, list(
null,
new /datum/stack_recipe("mass driver button frame", /obj/item/mounted/frame/driver_button, 1, time = 50, one_per_turf = 0, on_floor = 1),
new /datum/stack_recipe("light switch frame", /obj/item/mounted/frame/light_switch, 1, time = 50, one_per_turf = 0, on_floor = 1),
new /datum/stack_recipe("window tint control button frame", /obj/item/mounted/frame/light_switch/windowtint, 1, time = 50, one_per_turf = 0, on_floor = 1),
null,
new /datum/stack_recipe("grenade casing", /obj/item/grenade/chem_grenade),
new /datum/stack_recipe("light fixture frame", /obj/item/mounted/frame/light_fixture, 2),
+77 -32
View File
@@ -3,6 +3,7 @@
/obj/item/defibrillator
name = "defibrillator"
desc = "A device that delivers powerful shocks to detachable paddles that resuscitate incapacitated patients."
icon = 'icons/obj/defib.dmi'
icon_state = "defibunit"
item_state = "defibunit"
slot_flags = SLOT_BACK
@@ -17,27 +18,27 @@
)
var/paddles_on_defib = TRUE //if the paddles are on the defib (TRUE)
var/safety = TRUE //if you can zap people with the defibs on harm mode
var/powered = FALSE //if there's a cell in the defib with enough power for a revive, blocks paddles from reviving otherwise
var/obj/item/twohanded/shockpaddles/paddles
var/obj/item/stock_parts/cell/high/cell = null
var/safety = TRUE //if you can zap people with the defibs on harm mode
var/combat = FALSE //can we revive through space suits?
var/heart_attack = FALSE //can it give instant heart attacks when zapped on harm intent with combat?
var/base_icon_state = "defibpaddles"
var/obj/item/twohanded/shockpaddles/paddle_type = /obj/item/twohanded/shockpaddles
/obj/item/defibrillator/get_cell()
return cell
/obj/item/defibrillator/New() //starts without a cell for rnd
..()
paddles = make_paddles()
/obj/item/defibrillator/Initialize(mapload) //starts without a cell for rnd
. = ..()
paddles = new paddle_type(src)
update_icon()
return
/obj/item/defibrillator/loaded/New() //starts with hicap
..()
paddles = make_paddles()
/obj/item/defibrillator/loaded/Initialize(mapload) //starts with hicap
. = ..()
cell = new(src)
update_icon()
return
/obj/item/defibrillator/update_icon()
update_power()
@@ -158,9 +159,6 @@
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/defibrillator/proc/make_paddles()
return new /obj/item/twohanded/shockpaddles(src)
/obj/item/defibrillator/equipped(mob/user, slot)
..()
if(slot != slot_back)
@@ -214,38 +212,68 @@
/obj/item/defibrillator/compact
name = "compact defibrillator"
desc = "A belt-equipped defibrillator that can be rapidly deployed."
desc = "A belt-mounted defibrillator that can be rapidly deployed."
icon_state = "defibcompact"
item_state = "defibcompact"
sprite_sheets = null //Because Vox had the belt defibrillator sprites in back.dm
w_class = WEIGHT_CLASS_NORMAL
slot_flags = SLOT_BELT
origin_tech = "biotech=5"
/obj/item/defibrillator/compact/loaded/Initialize(mapload)
. = ..()
cell = new(src)
update_icon()
/obj/item/defibrillator/compact/item_action_slot_check(slot, mob/user)
if(slot == slot_belt)
return TRUE
/obj/item/defibrillator/compact/loaded/New()
..()
paddles = make_paddles()
cell = new(src)
update_icon()
return
/obj/item/defibrillator/compact/combat
name = "combat defibrillator"
desc = "A belt-equipped blood-red defibrillator that can be rapidly deployed. Does not have the restrictions or safeties of conventional defibrillators and can revive through space suits."
desc = "A belt-mounted blood-red defibrillator that can be rapidly deployed. Does not have the restrictions or safeties of conventional defibrillators and can revive through space suits."
icon_state = "defibcombat"
item_state = "defibcombat"
paddle_type = /obj/item/twohanded/shockpaddles/syndicate
combat = TRUE
safety = FALSE
/obj/item/defibrillator/compact/combat/loaded/New()
..()
paddles = make_paddles()
/obj/item/defibrillator/compact/combat/loaded/Initialize(mapload)
. = ..()
cell = new(src)
update_icon()
return
/obj/item/defibrillator/compact/combat/attackby(obj/item/W, mob/user, params)
/obj/item/defibrillator/compact/advanced
name = "advanced compact defibrillator"
desc = "A belt-mounted state-of-the-art defibrillator that can be rapidly deployed in all environments. Uses an experimental self-charging cell, meaning that it will (probably) never stop working. Can be used to defibrillate through space suits. It is impossible to damage."
icon_state = "defibnt"
item_state = "defibnt"
paddle_type = /obj/item/twohanded/shockpaddles/advanced
combat = TRUE
safety = TRUE
heart_attack = TRUE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF //Objective item, better not have it destroyed.
var/next_emp_message //to prevent spam from the emagging message on the advanced defibrillator
/obj/item/defibrillator/compact/advanced/attackby(obj/item/W, mob/user, params)
if(W == paddles)
paddles.unwield()
toggle_paddles()
update_icon()
/obj/item/defibrillator/compact/advanced/loaded/Initialize(mapload)
. = ..()
cell = new /obj/item/stock_parts/cell/bluespace/charging(src)
update_icon()
/obj/item/defibrillator/compact/advanced/emp_act(severity)
if(world.time > next_emp_message)
atom_say("Warning: Electromagnetic pulse detected. Integrated shielding prevented all potential hardware damage.")
playsound(src, 'sound/machines/defib_saftyon.ogg', 50)
next_emp_message = world.time + 5 SECONDS
/obj/item/defibrillator/compact/advanced/attackby(obj/item/W, mob/user, params)
if(W == paddles)
paddles.unwield()
toggle_paddles()
@@ -257,6 +285,7 @@
/obj/item/twohanded/shockpaddles
name = "defibrillator paddles"
desc = "A pair of plastic-gripped paddles with flat metal surfaces that are used to deliver powerful electric shocks."
icon = 'icons/obj/defib.dmi'
icon_state = "defibpaddles"
item_state = "defibpaddles"
force = 0
@@ -268,6 +297,7 @@
var/revivecost = 1000
var/cooldown = FALSE
var/busy = FALSE
var/base_icon_state = "defibpaddles"
var/obj/item/defibrillator/defib
/obj/item/twohanded/shockpaddles/New(mainunit)
@@ -280,10 +310,10 @@
return
/obj/item/twohanded/shockpaddles/update_icon()
icon_state = "defibpaddles[wielded]"
item_state = "defibpaddles[wielded]"
icon_state = "[base_icon_state][wielded]"
item_state = "[base_icon_state][wielded]"
if(cooldown)
icon_state = "defibpaddles[wielded]_cooldown"
icon_state = "[base_icon_state][wielded]_cooldown"
/obj/item/twohanded/shockpaddles/suicide_act(mob/user)
user.visible_message("<span class='danger'>[user] is putting the live paddles on [user.p_their()] chest! It looks like [user.p_theyre()] trying to commit suicide.</span>")
@@ -336,7 +366,7 @@
to_chat(user, "<span class='notice'>[defib] is recharging.</span>")
return
if(!ishuman(M))
to_chat(user, "<span class='notice'>The instructions on [defib] don't mention how to revive that...</span>")
to_chat(user, "<span class='notice'>The instructions on [defib] don't mention how to defibrillate that...</span>")
return
else
if(user.a_intent == INTENT_HARM && !defib.safety)
@@ -347,7 +377,7 @@
H.Weaken(5)
playsound(get_turf(src), 'sound/machines/defib_zap.ogg', 50, 1, -1)
H.emote("gasp")
if(!H.undergoing_cardiac_arrest() && (prob(10) || defib.combat)) // Your heart explodes.
if(!H.undergoing_cardiac_arrest() && (prob(10) || (defib.combat && !defib.heart_attack) || prob(10) && (defib.combat && defib.heart_attack))) // Your heart explodes.
H.set_heartattack(TRUE)
SEND_SIGNAL(H, COMSIG_LIVING_MINOR_SHOCK, 100)
add_attack_logs(user, M, "Stunned with [src]")
@@ -470,7 +500,8 @@
/obj/item/borg_defib
name = "defibrillator paddles"
desc = "A pair of mounted paddles with flat metal surfaces that are used to deliver powerful electric shocks."
desc = "A pair of paddles with flat metal surfaces that are used to deliver powerful electric shocks."
icon = 'icons/obj/defib.dmi'
icon_state = "defibpaddles0"
item_state = "defibpaddles0"
force = 0
@@ -590,3 +621,17 @@
playsound(get_turf(src), 'sound/machines/defib_failed.ogg', 50, 0)
busy = FALSE
update_icon()
/obj/item/twohanded/shockpaddles/syndicate
name = "combat defibrillator paddles"
desc = "A pair of high-tech paddles with flat plasteel surfaces to revive deceased operatives (unless they exploded). They possess both the ability to penetrate armor and to deliver powerful or disabling shocks offensively."
icon_state = "syndiepaddles0"
item_state = "syndiepaddles0"
base_icon_state = "syndiepaddles"
/obj/item/twohanded/shockpaddles/advanced
name = "advanced defibrillator paddles"
desc = "A pair of high-tech paddles with flat plasteel surfaces that are used to deliver powerful electric shocks. They possess the ability to penetrate armor to deliver shock."
icon_state = "ntpaddles0"
item_state = "ntpaddles0"
base_icon_state = "ntpaddles"
@@ -170,28 +170,6 @@
block = GLOB.hulkblock
..()
/obj/item/dnainjector/xraymut
name = "DNA-Injector (Xray)"
desc = "Finally you can see what the Captain does."
datatype = DNA2_BUF_SE
value = 0xFFF
forcedmutation = TRUE
/obj/item/dnainjector/xraymut/Initialize()
block = GLOB.xrayblock
..()
/obj/item/dnainjector/antixray
name = "DNA-Injector (Anti-Xray)"
desc = "It will make you see harder."
datatype = DNA2_BUF_SE
value = 0x001
forcedmutation = TRUE
/obj/item/dnainjector/antixray/Initialize()
block = GLOB.xrayblock
..()
/obj/item/dnainjector/firemut
name = "DNA-Injector (Fire)"
desc = "Gives you fire."
@@ -716,7 +716,6 @@
new /obj/item/stack/cable_coil(src)
new /obj/item/restraints/handcuffs(src)
new /obj/item/dnainjector/xraymut(src)
new /obj/item/dnainjector/firemut(src)
new /obj/item/dnainjector/telemut(src)
new /obj/item/dnainjector/hulkmut(src)
+2 -2
View File
@@ -90,7 +90,7 @@
/obj/blob_act(obj/structure/blob/B)
if(isturf(loc))
var/turf/T = loc
if(T.intact && level == 1) //the blob doesn't destroy thing below the floor
if((T.intact && level == 1) || T.transparent_floor) //the blob doesn't destroy thing below the floor
return
take_damage(400, BRUTE, "melee", 0, get_dir(src, B))
@@ -199,7 +199,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
/obj/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
if(isturf(loc))
var/turf/T = loc
if(T.intact && level == 1) //fire can't damage things hidden below the floor.
if((T.intact && level == 1) || T.transparent_floor) //fire can't damage things hidden below the floor.
return
..()
if(exposed_temperature && !(resistance_flags & FIRE_PROOF))
+6 -5
View File
@@ -59,30 +59,31 @@
/obj/structure/proc/do_climb(mob/living/user)
if(!can_touch(user) || !climbable)
return
return FALSE
var/blocking_object = density_check()
if(blocking_object)
to_chat(user, "<span class='warning'>You cannot climb [src], as it is blocked by \a [blocking_object]!</span>")
return
return FALSE
var/turf/T = src.loc
if(!T || !istype(T)) return
if(!T || !istype(T)) return FALSE
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
climber = user
if(!do_after(user, 50, target = src))
climber = null
return
return FALSE
if(!can_touch(user) || !climbable)
climber = null
return
return FALSE
usr.loc = get_turf(src)
if(get_turf(user) == get_turf(src))
usr.visible_message("<span class='warning'>[user] climbs onto \the [src]!</span>")
climber = null
return TRUE
/obj/structure/proc/structure_shaken()
@@ -182,7 +182,7 @@
new /obj/item/clothing/shoes/brown (src)
new /obj/item/radio/headset/heads/cmo(src)
new /obj/item/clothing/gloves/color/latex/nitrile(src)
new /obj/item/defibrillator/compact/loaded(src)
new /obj/item/defibrillator/compact/advanced/loaded(src)
new /obj/item/handheld_defibrillator(src)
new /obj/item/storage/belt/medical(src)
new /obj/item/flash(src)
+216
View File
@@ -0,0 +1,216 @@
//Chain link fences
//Sprites ported from /VG/
#define CUT_TIME 100
#define CLIMB_TIME 150
#define NO_HOLE 0 //section is intact
#define MEDIUM_HOLE 1 //medium hole in the section - can climb through
#define LARGE_HOLE 2 //large hole in the section - can walk through
#define MAX_HOLE_SIZE LARGE_HOLE
#define HOLE_REPAIR (hole_size * 2) //How many rods to fix these sections
/obj/structure/fence
name = "fence"
desc = "A chain link fence. Not as effective as a wall, but generally it keeps people out."
density = TRUE
anchored = TRUE
icon = 'icons/obj/fence.dmi'
icon_state = "straight"
var/cuttable = TRUE
var/hole_size = NO_HOLE
var/invulnerable = FALSE
var/shock_cooldown = FALSE
/obj/structure/fence/Initialize()
. = ..()
update_cut_status()
/obj/structure/fence/examine(mob/user)
. = ..()
switch(hole_size)
if(MEDIUM_HOLE)
. += "There is a large hole in \the [src]."
if(LARGE_HOLE)
. += "\The [src] has been completely cut through."
/obj/structure/fence/end
icon_state = "end"
cuttable = FALSE
/obj/structure/fence/corner
icon_state = "corner"
cuttable = FALSE
/obj/structure/fence/post
icon_state = "post"
cuttable = FALSE
/obj/structure/fence/cut/medium
icon_state = "straight_cut2"
hole_size = MEDIUM_HOLE
climbable = TRUE
/obj/structure/fence/cut/large
icon_state = "straight_cut3"
hole_size = LARGE_HOLE
/obj/structure/fence/CanPass(atom/movable/mover, turf/target)
if(istype(mover) && mover.checkpass(PASSFENCE))
return TRUE
if(istype(mover, /obj/item/projectile))
return TRUE
if(!density)
return TRUE
return FALSE
/*
Shock user with probability prb (if all connections & power are working)
Returns TRUE if shocked, FALSE otherwise
Totally not stolen from code\game\objects\structures\grille.dm
*/
/obj/structure/fence/proc/shock(mob/user, prb)
if(!prob(prb))
return FALSE
if(!in_range(src, user)) //To prevent TK and mech users from getting shocked
return FALSE
var/turf/T = get_turf(src)
var/obj/structure/cable/C = T.get_cable_node()
if(C)
if(electrocute_mob(user, C, src, 1, TRUE))
do_sparks(3, 1, src)
return TRUE
return FALSE
/obj/structure/fence/wirecutter_act(mob/living/user, obj/item/W)
. = TRUE
if(shock(user, 100))
return
if(!cuttable)
to_chat(user, "<span class='warning'>This section of the fence can't be cut!</span>")
return
if(invulnerable)
to_chat(user, "<span class='warning'>This fence is too strong to cut through!</span>")
return
var/current_stage = hole_size
user.visible_message("<span class='danger'>\The [user] starts cutting through \the [src] with \the [W].</span>",\
"<span class='danger'>You start cutting through \the [src] with \the [W].</span>")
if(W.use_tool(src, user, CUT_TIME * W.toolspeed, volume = W.tool_volume))
if(current_stage == hole_size)
switch(hole_size)
if(NO_HOLE)
visible_message("<span class='notice'>\The [user] cuts into \the [src] some more.</span>")
to_chat(user, "<span class='info'>You could probably fit yourself through that hole now. Although climbing through would be much faster if you made it even bigger.</span>")
hole_size = MEDIUM_HOLE
if(MEDIUM_HOLE)
visible_message("<span class='notice'>\The [user] completely cuts through \the [src].</span>")
to_chat(user, "<span class='info'>The hole in \the [src] is now big enough to walk through.</span>")
hole_size = LARGE_HOLE
if(LARGE_HOLE)
visible_message("<span class='notice'>\The [user] completely dismantles \the [src].</span>")
to_chat(user, "<span class='info'>You completely take apart \the [src].</span>")
qdel(src)
return
update_cut_status()
/obj/structure/fence/attackby(obj/item/C, mob/user)
if(shock(user, 90))
return
if(istype(C, /obj/item/stack/rods))
if(hole_size == NO_HOLE)
return
var/obj/item/stack/rods/R = C
if(R.get_amount() < HOLE_REPAIR)
to_chat(user, "<span class='warning'>You need [HOLE_REPAIR] rods to fix this fence!</span>")
return
to_chat(user, "<span class='notice'>You begin repairing the fence...</span>")
if(do_after(user, 3 SECONDS * C.toolspeed, target = src) && hole_size != NO_HOLE && R.use(HOLE_REPAIR))
playsound(src, C.usesound, 80, 1)
hole_size = NO_HOLE
obj_integrity = max_integrity
to_chat(user, "<span class='notice'>You repair the fence.</span>")
update_cut_status()
return
. = ..()
/obj/structure/fence/Bumped(atom/user)
if(!ismob(user))
return
if(shock_cooldown)
return
shock(user, 70)
shock_cooldown = TRUE // We do not want bump shock spam!
addtimer(CALLBACK(src, .proc/shock_cooldown), 1 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE)
/obj/structure/fence/proc/shock_cooldown()
shock_cooldown = FALSE
/obj/structure/fence/attack_animal(mob/user)
. = ..()
if(. && !QDELETED(src) && !shock(user, 70))
take_damage(rand(5,10), BRUTE, "melee", 1)
/obj/structure/fence/proc/update_cut_status()
if(!cuttable)
return
var/new_density = TRUE
switch(hole_size)
if(NO_HOLE)
icon_state = initial(icon_state)
climbable = FALSE
if(MEDIUM_HOLE)
icon_state = "straight_cut2"
climbable = TRUE
if(LARGE_HOLE)
icon_state = "straight_cut3"
new_density = FALSE
climbable = FALSE
set_density(new_density)
//FENCE DOORS
/obj/structure/fence/door
name = "fence door"
desc = "Not very useful without a real lock."
icon_state = "door_closed"
cuttable = FALSE
var/open = FALSE
/obj/structure/fence/door/Initialize()
. = ..()
update_door_status()
/obj/structure/fence/door/opened
icon_state = "door_opened"
open = TRUE
density = TRUE
/obj/structure/fence/door/attack_hand(mob/user, list/modifiers)
shock(user, 70)
if(can_open(user))
toggle(user)
return TRUE
/obj/structure/fence/door/proc/toggle(mob/user)
open = !open
visible_message("<span class='notice'>\The [user] [open ? "opens" : "closes"] \the [src].</span>")
update_door_status()
playsound(src, 'sound/machines/door_open.ogg', 100, TRUE)
/obj/structure/fence/door/proc/update_door_status()
set_density(!open)
icon_state = open ? "door_opened" : "door_closed"
/obj/structure/fence/door/proc/can_open(mob/user)
return TRUE
#undef CUT_TIME
#undef CLIMB_TIME
#undef NO_HOLE
#undef MEDIUM_HOLE
#undef LARGE_HOLE
#undef MAX_HOLE_SIZE
#undef HOLE_REPAIR
+136
View File
@@ -0,0 +1,136 @@
/obj/structure/railing
name = "railing"
desc = "Basic railing meant to protect idiots like you from falling."
icon = 'icons/obj/fence.dmi'
icon_state = "railing"
density = TRUE
anchored = TRUE
pass_flags = LETPASSTHROW
climbable = TRUE
layer = ABOVE_MOB_LAYER
var/currently_climbed = FALSE
/obj/structure/railing/corner //aesthetic corner sharp edges hurt oof ouch
icon_state = "railing_corner"
density = FALSE
climbable = FALSE
/obj/structure/railing/attackby(obj/item/I, mob/living/user, params)
..()
add_fingerprint(user)
/obj/structure/railing/welder_act(mob/living/user, obj/item/I)
if(user.intent != INTENT_HELP)
return
if(obj_integrity >= max_integrity)
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
return
if(!I.tool_start_check(user, amount = 0))
return
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
if(I.use_tool(src, user, 40, volume = 50))
obj_integrity = max_integrity
to_chat(user, "<span class='notice'>You repair [src].</span>")
/obj/structure/railing/wirecutter_act(mob/living/user, obj/item/I)
if(anchored)
return
to_chat(user, "<span class='warning'>You cut apart the railing.</span>")
I.play_tool_sound(src, 100)
deconstruct()
return TRUE
/obj/structure/railing/deconstruct(disassembled)
if(!(flags & NODECONSTRUCT))
var/obj/item/stack/rods/rod = new /obj/item/stack/rods(drop_location(), 3)
transfer_fingerprints_to(rod)
return ..()
///Implements behaviour that makes it possible to unanchor the railing.
/obj/structure/railing/wrench_act(mob/living/user, obj/item/I)
if(flags & NODECONSTRUCT)
return
to_chat(user, "<span class='notice'>You begin to [anchored ? "unfasten the railing from":"fasten the railing to"] the floor...</span>")
if(I.use_tool(src, user, volume = 75, extra_checks = CALLBACK(src, .proc/check_anchored, anchored)))
anchored = !anchored
to_chat(user, "<span class='notice'>You [anchored ? "fasten the railing to":"unfasten the railing from"] the floor.</span>")
return TRUE
/obj/structure/railing/corner/CanPass()
return TRUE
/obj/structure/railing/corner/CheckExit()
return TRUE
/obj/structure/railing/CanPass(atom/movable/mover, turf/target)
if(istype(mover) && mover.checkpass(PASSFENCE))
return TRUE
if(istype(mover, /obj/item/projectile))
return TRUE
if(ismob(mover))
var/mob/M = mover
if(M.flying)
return TRUE
if(mover.throwing)
return TRUE
if(get_dir(loc, target) != dir)
return density
return FALSE
/obj/structure/railing/CheckExit(atom/movable/O, target)
var/mob/living/M = O
if(istype(O) && O.checkpass(PASSFENCE))
return TRUE
if(istype(O, /obj/item/projectile))
return TRUE
if(ismob(O))
if(M.flying || M.floating)
return TRUE
if(O.throwing)
return TRUE
if(O.move_force >= MOVE_FORCE_EXTREMELY_STRONG)
return TRUE
if(currently_climbed)
return TRUE
if(get_dir(O.loc, target) == dir)
return FALSE
return TRUE
/obj/structure/railing/do_climb(mob/living/user)
var/initial_mob_loc = get_turf(user)
. = ..()
if(.)
currently_climbed = TRUE
if(initial_mob_loc != get_turf(src)) // If we are on the railing, we want to move in the same dir as the railing. Otherwise we get put on the railing
currently_climbed = FALSE
return
user.Move(get_step(user, dir), TRUE)
currently_climbed = FALSE
/obj/structure/railing/proc/can_be_rotated(mob/user)
if(anchored)
to_chat(user, "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>")
return FALSE
var/target_dir = turn(dir, -90)
if(!valid_window_location(loc, target_dir)) //Expanded to include rails, as well!
to_chat(user, "<span class='warning'>[src] cannot be rotated in that direction!</span>")
return FALSE
return TRUE
/obj/structure/railing/proc/check_anchored(checked_anchored)
if(anchored == checked_anchored)
return TRUE
/obj/structure/railing/proc/after_rotation(mob/user)
add_fingerprint(user)
/obj/structure/railing/AltClick(mob/user)
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!Adjacent(user))
return
if(can_be_rotated(user))
setDir(turn(dir, 90))
+2 -1
View File
@@ -368,7 +368,8 @@ GLOBAL_LIST_EMPTY(safes)
/obj/structure/safe/floor/Initialize()
. = ..()
var/turf/T = loc
hide(T.intact)
if(!T.transparent_floor)
hide(T.intact)
/obj/structure/safe/floor/hide(intact)
invisibility = intact ? INVISIBILITY_MAXIMUM : 0
+51 -16
View File
@@ -27,6 +27,8 @@
var/real_explosion_block //ignore this, just use explosion_block
var/breaksound = "shatter"
var/hitsound = 'sound/effects/Glasshit.ogg'
/// Used to restore colours from polarised glass
var/old_color
/obj/structure/window/examine(mob/user)
. = ..()
@@ -69,6 +71,17 @@
air_update_turf(TRUE)
/obj/structure/window/proc/toggle_polarization()
if(opacity)
if(!old_color)
old_color = "#FFFFFF"
animate(src, color = old_color, time = 0.5 SECONDS)
set_opacity(FALSE)
else
old_color = color
animate(src, color = "#222222", time = 0.5 SECONDS)
set_opacity(TRUE)
/obj/structure/window/narsie_act()
color = NARSIE_WINDOW_COLOUR
@@ -497,14 +510,6 @@
desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it."
var/id
/obj/structure/window/reinforced/polarized/proc/toggle()
if(opacity)
animate(src, color="#FFFFFF", time=5)
set_opacity(0)
else
animate(src, color="#222222", time=5)
set_opacity(1)
/obj/machinery/button/windowtint
name = "window tint control"
icon = 'icons/obj/power.dmi'
@@ -514,12 +519,35 @@
var/id = 0
var/active = 0
/obj/machinery/button/windowtint/Initialize(mapload, w_dir = null)
. = ..()
switch(w_dir)
if(NORTH)
pixel_y = 25
if(SOUTH)
pixel_y = -25
if(EAST)
pixel_x = 25
if(WEST)
pixel_x = -25
/obj/machinery/button/windowtint/attack_hand(mob/user)
if(..())
return 1
return TRUE
toggle_tint()
/obj/machinery/button/windowtint/wrench_act(mob/user, obj/item/I)
. = TRUE
if(!I.tool_use_check(user, 0))
return
user.visible_message("<span class='notice'>[user] starts unwrenching [src] from the wall...</span>", "<span class='notice'>You are unwrenching [src] from the wall...</span>", "<span class='warning'>You hear ratcheting.</span>")
if(!I.use_tool(src, user, 50, volume = I.tool_volume))
return
WRENCH_UNANCHOR_WALL_MESSAGE
new /obj/item/mounted/frame/light_switch/windowtint(get_turf(src))
qdel(src)
/obj/machinery/button/windowtint/proc/toggle_tint()
use_power(5)
@@ -528,9 +556,11 @@
for(var/obj/structure/window/reinforced/polarized/W in range(src,range))
if(W.id == src.id || !W.id)
spawn(0)
W.toggle()
return
W.toggle_polarization()
for(var/obj/structure/window/full/reinforced/polarized/W in range(src, range))
if(W.id == id || !W.id)
W.toggle_polarization()
/obj/machinery/button/windowtint/power_change()
..()
@@ -589,7 +619,7 @@
icon_state = "window"
max_integrity = 50
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced, /turf/simulated/wall/indestructible/fakeglass)
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/polarized, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced, /turf/simulated/wall/indestructible/fakeglass)
/obj/structure/window/full/plasmabasic
name = "plasma window"
@@ -602,7 +632,7 @@
heat_resistance = 32000
max_integrity = 300
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced, /turf/simulated/wall/indestructible/fakeglass)
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/polarized, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced, /turf/simulated/wall/indestructible/fakeglass)
explosion_block = 1
armor = list("melee" = 75, "bullet" = 5, "laser" = 0, "energy" = 0, "bomb" = 45, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
rad_insulation = RAD_NO_INSULATION
@@ -616,7 +646,7 @@
shardtype = /obj/item/shard/plasma
glass_type = /obj/item/stack/sheet/plasmarglass
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced, /turf/simulated/wall/indestructible/fakeglass)
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/polarized, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced, /turf/simulated/wall/indestructible/fakeglass)
reinf = TRUE
max_integrity = 1000
explosion_block = 2
@@ -632,7 +662,7 @@
icon = 'icons/obj/smooth_structures/reinforced_window.dmi'
icon_state = "r_window"
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced, /turf/simulated/wall/indestructible/fakeglass)
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/polarized, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced, /turf/simulated/wall/indestructible/fakeglass)
max_integrity = 100
reinf = TRUE
heat_resistance = 1600
@@ -641,6 +671,11 @@
explosion_block = 1
glass_type = /obj/item/stack/sheet/rglass
/obj/structure/window/full/reinforced/polarized
name = "electrochromic window"
desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it."
var/id
/obj/structure/window/full/reinforced/tinted
name = "tinted window"
desc = "It looks rather strong and opaque. Might take a few good hits to shatter it."