Bleeding edgy refresh (#303)
* not code stuff * other things * global vars, defines, helpers * onclick hud stuff, orphans, world.dm * controllers and datums * game folder * everything not client/mobs in modules * client folder * stage 1 mob stuff * simple animal things * silicons * carbon things * ayylmaos and monkeys * hyoomahn * icons n shit * sprite fixes * compile fixes * some fixes I cherrypicked. * qdel fixes * forgot brain refractors
This commit is contained in:
@@ -10,8 +10,10 @@
|
||||
max_integrity = 25
|
||||
obj_integrity = 25
|
||||
var/ini_dir = null
|
||||
var/state = 0
|
||||
var/state = WINDOW_OUT_OF_FRAME
|
||||
var/reinf = 0
|
||||
var/heat_resistance = 800
|
||||
var/decon_speed = 30
|
||||
var/wtype = "glass"
|
||||
var/fulltile = 0
|
||||
var/glass_type = /obj/item/stack/sheet/glass
|
||||
@@ -25,15 +27,15 @@
|
||||
|
||||
/obj/structure/window/examine(mob/user)
|
||||
..()
|
||||
user << "<span class='notice'>Alt-click to rotate it clockwise.</span>"
|
||||
to_chat(user, "<span class='notice'>Alt-click to rotate it clockwise.</span>")
|
||||
|
||||
/obj/structure/window/New(Loc,re=0)
|
||||
/obj/structure/window/Initialize(mapload, direct)
|
||||
..()
|
||||
obj_integrity = max_integrity
|
||||
if(re)
|
||||
reinf = re
|
||||
if(reinf)
|
||||
state = 2*anchored
|
||||
if(direct)
|
||||
setDir(direct)
|
||||
if(reinf && anchored)
|
||||
state = WINDOW_SCREWED_TO_FRAME
|
||||
|
||||
ini_dir = dir
|
||||
air_update_turf(1)
|
||||
@@ -55,6 +57,20 @@
|
||||
if(rods)
|
||||
debris += new /obj/item/stack/rods(src, rods)
|
||||
|
||||
/obj/structure/window/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd)
|
||||
switch(the_rcd.mode)
|
||||
if(RCD_DECONSTRUCT)
|
||||
return list("mode" = RCD_DECONSTRUCT, "delay" = 20, "cost" = 5)
|
||||
return FALSE
|
||||
|
||||
/obj/structure/window/rcd_act(mob/user, var/obj/item/weapon/rcd/the_rcd)
|
||||
switch(the_rcd.mode)
|
||||
if(RCD_DECONSTRUCT)
|
||||
to_chat(user, "<span class='notice'>You deconstruct the window.</span>")
|
||||
qdel(src)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/structure/window/narsie_act()
|
||||
add_atom_colour(NARSIE_WINDOW_COLOUR, FIXED_COLOUR_PRIORITY)
|
||||
for(var/obj/item/weapon/shard/shard in debris)
|
||||
@@ -140,74 +156,77 @@
|
||||
var/obj/item/weapon/weldingtool/WT = I
|
||||
if(obj_integrity < max_integrity)
|
||||
if(WT.remove_fuel(0,user))
|
||||
user << "<span class='notice'>You begin repairing [src]...</span>"
|
||||
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
|
||||
playsound(loc, WT.usesound, 40, 1)
|
||||
if(do_after(user, 40*I.toolspeed, target = src))
|
||||
obj_integrity = max_integrity
|
||||
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
update_nearby_icons()
|
||||
user << "<span class='notice'>You repair [src].</span>"
|
||||
to_chat(user, "<span class='notice'>You repair [src].</span>")
|
||||
else
|
||||
user << "<span class='warning'>[src] is already in good condition!</span>"
|
||||
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
|
||||
return
|
||||
|
||||
|
||||
if(!(flags&NODECONSTRUCT))
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(loc, I.usesound, 75, 1)
|
||||
if(reinf && (state == 2 || state == 1))
|
||||
user << (state == 2 ? "<span class='notice'>You begin to unscrew the window from the frame...</span>" : "<span class='notice'>You begin to screw the window to the frame...</span>")
|
||||
else if(reinf && state == 0)
|
||||
user << (anchored ? "<span class='notice'>You begin to unscrew the frame from the floor...</span>" : "<span class='notice'>You begin to screw the frame to the floor...</span>")
|
||||
else if(!reinf)
|
||||
user << (anchored ? "<span class='notice'>You begin to unscrew the window from the floor...</span>" : "<span class='notice'>You begin to screw the window to the floor...</span>")
|
||||
|
||||
if(do_after(user, 30*I.toolspeed, target = src))
|
||||
if(reinf && (state == 1 || state == 2))
|
||||
//If state was unfastened, fasten it, else do the reverse
|
||||
state = (state == 1 ? 2 : 1)
|
||||
user << (state == 1 ? "<span class='notice'>You unfasten the window from the frame.</span>" : "<span class='notice'>You fasten the window to the frame.</span>")
|
||||
else if(reinf && state == 0)
|
||||
if(reinf)
|
||||
if(state == WINDOW_SCREWED_TO_FRAME || state == WINDOW_IN_FRAME)
|
||||
to_chat(user, "<span class='notice'>You begin to [state == WINDOW_SCREWED_TO_FRAME ? "unscrew the window from":"screw the window to"] the frame...</span>")
|
||||
if(do_after(user, decon_speed*I.toolspeed, target = src, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))
|
||||
state = (state == WINDOW_IN_FRAME ? WINDOW_SCREWED_TO_FRAME : WINDOW_IN_FRAME)
|
||||
to_chat(user, "<span class='notice'>You [state == WINDOW_IN_FRAME ? "unfasten the window from":"fasten the window to"] the frame.</span>")
|
||||
else if(state == WINDOW_OUT_OF_FRAME)
|
||||
to_chat(user, "<span class='notice'>You begin to [anchored ? "unscrew the frame from":"screw the frame to"] the floor...</span>")
|
||||
if(do_after(user, decon_speed*I.toolspeed, target = src, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))
|
||||
anchored = !anchored
|
||||
update_nearby_icons()
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "fasten the frame to":"unfasten the frame from"] the floor.</span>")
|
||||
else //if we're not reinforced, we don't need to check or update state
|
||||
to_chat(user, "<span class='notice'>You begin to [anchored ? "unscrew the window from":"screw the window to"] the floor...</span>")
|
||||
if(do_after(user, decon_speed*I.toolspeed, target = src, extra_checks = CALLBACK(src, .proc/check_anchored, anchored)))
|
||||
anchored = !anchored
|
||||
update_nearby_icons()
|
||||
user << (anchored ? "<span class='notice'>You fasten the frame to the floor.</span>" : "<span class='notice'>You unfasten the frame from the floor.</span>")
|
||||
else if(!reinf)
|
||||
anchored = !anchored
|
||||
update_nearby_icons()
|
||||
user << (anchored ? "<span class='notice'>You fasten the window to the floor.</span>" : "<span class='notice'>You unfasten the window.</span>")
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "fasten the window to":"unfasten the window from"] the floor.</span>")
|
||||
return
|
||||
|
||||
else if (istype(I, /obj/item/weapon/crowbar) && reinf && (state == 0 || state == 1))
|
||||
user << (state == 0 ? "<span class='notice'>You begin to lever the window into the frame...</span>" : "<span class='notice'>You begin to lever the window out of the frame...</span>")
|
||||
|
||||
else if (istype(I, /obj/item/weapon/crowbar) && reinf && (state == WINDOW_OUT_OF_FRAME || state == WINDOW_IN_FRAME))
|
||||
to_chat(user, "<span class='notice'>You begin to lever the window [state == WINDOW_OUT_OF_FRAME ? "into":"out of"] the frame...</span>")
|
||||
playsound(loc, I.usesound, 75, 1)
|
||||
if(do_after(user, 40*I.toolspeed, target = src))
|
||||
//If state was out of frame, put into frame, else do the reverse
|
||||
state = (state == 0 ? 1 : 0)
|
||||
user << (state == 1 ? "<span class='notice'>You pry the window into the frame.</span>" : "<span class='notice'>You pry the window out of the frame.</span>")
|
||||
if(do_after(user, decon_speed*I.toolspeed, target = src, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))
|
||||
state = (state == WINDOW_OUT_OF_FRAME ? WINDOW_IN_FRAME : WINDOW_OUT_OF_FRAME)
|
||||
to_chat(user, "<span class='notice'>You pry the window [state == WINDOW_IN_FRAME ? "into":"out of"] the frame.</span>")
|
||||
return
|
||||
|
||||
else if(istype(I, /obj/item/weapon/wrench) && !anchored)
|
||||
playsound(loc, I.usesound, 75, 1)
|
||||
user << "<span class='notice'> You begin to disassemble [src]...</span>"
|
||||
if(do_after(user, 40*I.toolspeed, target = src))
|
||||
if(QDELETED(src))
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'> You begin to disassemble [src]...</span>")
|
||||
if(do_after(user, decon_speed*I.toolspeed, target = src, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))
|
||||
var/obj/item/stack/sheet/G = new glass_type(user.loc, glass_amount)
|
||||
G.add_fingerprint(user)
|
||||
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "<span class='notice'>You successfully disassemble [src].</span>"
|
||||
to_chat(user, "<span class='notice'>You successfully disassemble [src].</span>")
|
||||
qdel(src)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/structure/window/proc/check_state(checked_state)
|
||||
if(state == checked_state)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/window/proc/check_anchored(checked_anchored)
|
||||
if(anchored == checked_anchored)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/window/proc/check_state_and_anchored(checked_state, checked_anchored)
|
||||
return check_state(checked_state) && check_anchored(checked_anchored)
|
||||
|
||||
/obj/structure/window/mech_melee_attack(obj/mecha/M)
|
||||
if(!can_be_reached())
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/structure/window/proc/can_be_reached(mob/user)
|
||||
if(!fulltile)
|
||||
if(get_dir(user,src) & dir)
|
||||
@@ -238,11 +257,9 @@
|
||||
if(!disassembled)
|
||||
playsound(src, "shatter", 70, 1)
|
||||
var/turf/T = loc
|
||||
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
for(var/i in debris)
|
||||
var/obj/item/I = i
|
||||
|
||||
I.loc = T
|
||||
transfer_fingerprints_to(I)
|
||||
qdel(src)
|
||||
@@ -257,13 +274,13 @@
|
||||
return
|
||||
|
||||
if(anchored)
|
||||
usr << "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>"
|
||||
to_chat(usr, "<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))
|
||||
usr << "<span class='warning'>[src] cannot be rotated in that direction!</span>"
|
||||
to_chat(usr, "<span class='warning'>[src] cannot be rotated in that direction!</span>")
|
||||
return FALSE
|
||||
|
||||
setDir(target_dir)
|
||||
@@ -272,7 +289,6 @@
|
||||
add_fingerprint(usr)
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/structure/window/verb/revrotate()
|
||||
set name = "Rotate Window Clockwise"
|
||||
set category = "Object"
|
||||
@@ -282,13 +298,13 @@
|
||||
return
|
||||
|
||||
if(anchored)
|
||||
usr << "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>"
|
||||
to_chat(usr, "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>")
|
||||
return FALSE
|
||||
|
||||
var/target_dir = turn(dir, 270)
|
||||
|
||||
if(!valid_window_location(loc, target_dir))
|
||||
usr << "<span class='warning'>[src] cannot be rotated in that direction!</span>"
|
||||
to_chat(usr, "<span class='warning'>[src] cannot be rotated in that direction!</span>")
|
||||
return FALSE
|
||||
|
||||
setDir(target_dir)
|
||||
@@ -300,7 +316,7 @@
|
||||
/obj/structure/window/AltClick(mob/user)
|
||||
..()
|
||||
if(user.incapacitated())
|
||||
user << "<span class='warning'>You can't do that right now!</span>"
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
if(!in_range(src, user))
|
||||
return
|
||||
@@ -352,7 +368,8 @@
|
||||
add_overlay(crack_overlay)
|
||||
|
||||
/obj/structure/window/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > T0C + (reinf ? 1600 : 800))
|
||||
|
||||
if(exposed_temperature > (T0C + heat_resistance))
|
||||
take_damage(round(exposed_volume / 100), BURN, 0, 0)
|
||||
..()
|
||||
|
||||
@@ -374,6 +391,7 @@
|
||||
name = "reinforced window"
|
||||
icon_state = "rwindow"
|
||||
reinf = 1
|
||||
heat_resistance = 1600
|
||||
armor = list(melee = 50, bullet = 0, laser = 0, energy = 0, bomb = 25, bio = 100, rad = 100, fire = 80, acid = 100)
|
||||
max_integrity = 50
|
||||
explosion_block = 1
|
||||
@@ -391,6 +409,11 @@
|
||||
name = "frosted window"
|
||||
icon_state = "fwindow"
|
||||
|
||||
/obj/structure/window/reinforced/highpressure
|
||||
name = "high pressure window"
|
||||
max_integrity = 1000
|
||||
heat_resistance = 50000
|
||||
pressure_resistance = 4*ONE_ATMOSPHERE
|
||||
|
||||
/* Full Tile Windows (more obj_integrity) */
|
||||
|
||||
@@ -400,8 +423,9 @@
|
||||
dir = FULLTILE_WINDOW_DIR
|
||||
max_integrity = 50
|
||||
fulltile = 1
|
||||
flags = NONE
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile)
|
||||
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile,/obj/structure/window/reinforced/highpressure/fulltile, /obj/structure/window/reinforced/tinted/fulltile)
|
||||
glass_amount = 2
|
||||
|
||||
/obj/structure/window/fulltile/unanchored
|
||||
@@ -413,8 +437,22 @@
|
||||
dir = FULLTILE_WINDOW_DIR
|
||||
max_integrity = 100
|
||||
fulltile = 1
|
||||
flags = NONE
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile)
|
||||
|
||||
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile,/obj/structure/window/reinforced/highpressure/fulltile, /obj/structure/window/reinforced/tinted/fulltile)
|
||||
level = 3
|
||||
glass_amount = 2
|
||||
|
||||
/obj/structure/window/reinforced/highpressure/fulltile
|
||||
icon = 'icons/obj/smooth_structures/reinforced_window.dmi'
|
||||
icon_state = "r_window"
|
||||
dir = FULLTILE_WINDOW_DIR
|
||||
max_integrity = 1000
|
||||
fulltile = 1
|
||||
flags = NONE
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile,/obj/structure/window/reinforced/highpressure/fulltile, /obj/structure/window/reinforced/tinted/fulltile)
|
||||
level = 3
|
||||
glass_amount = 2
|
||||
|
||||
@@ -426,8 +464,9 @@
|
||||
icon_state = "tinted_window"
|
||||
dir = FULLTILE_WINDOW_DIR
|
||||
fulltile = 1
|
||||
flags = NONE
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile/)
|
||||
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile,/obj/structure/window/reinforced/highpressure/fulltile, /obj/structure/window/reinforced/tinted/fulltile/)
|
||||
level = 3
|
||||
glass_amount = 2
|
||||
|
||||
@@ -448,7 +487,9 @@
|
||||
max_integrity = 100
|
||||
wtype = "shuttle"
|
||||
fulltile = 1
|
||||
flags = NONE
|
||||
reinf = 1
|
||||
heat_resistance = 1600
|
||||
armor = list(melee = 50, bullet = 0, laser = 0, energy = 0, bomb = 25, bio = 100, rad = 100, fire = 80, acid = 100)
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = null
|
||||
@@ -472,27 +513,22 @@
|
||||
max_integrity = 80
|
||||
armor = list(melee = 60, bullet = 25, laser = 0, energy = 0, bomb = 25, bio = 100, rad = 100, fire = 80, acid = 100)
|
||||
explosion_block = 2 //fancy AND hard to destroy. the most useful combination.
|
||||
decon_speed = 40
|
||||
glass_type = /obj/item/stack/tile/brass
|
||||
glass_amount = 1
|
||||
reinf = FALSE
|
||||
var/made_glow = FALSE
|
||||
|
||||
/obj/structure/window/reinforced/clockwork/New(loc, direct)
|
||||
/obj/structure/window/reinforced/clockwork/Initialize(mapload, direct)
|
||||
if(fulltile)
|
||||
made_glow = TRUE
|
||||
..()
|
||||
for(var/obj/item/I in debris)
|
||||
debris -= I
|
||||
qdel(I)
|
||||
var/amount_of_gears = 2
|
||||
if(!fulltile)
|
||||
if(direct)
|
||||
var/obj/effect/E = new /obj/effect/overlay/temp/ratvar/window/single(get_turf(src))
|
||||
setDir(direct)
|
||||
ini_dir = direct
|
||||
E.setDir(direct)
|
||||
made_glow = TRUE
|
||||
else
|
||||
if(fulltile)
|
||||
new /obj/effect/overlay/temp/ratvar/window(get_turf(src))
|
||||
made_glow = TRUE
|
||||
amount_of_gears = 4
|
||||
for(var/i in 1 to amount_of_gears)
|
||||
debris += new/obj/item/clockwork/alloy_shards/medium/gear_bit()
|
||||
@@ -530,11 +566,11 @@
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = null
|
||||
fulltile = 1
|
||||
flags = NONE
|
||||
dir = FULLTILE_WINDOW_DIR
|
||||
max_integrity = 120
|
||||
level = 3
|
||||
glass_amount = 2
|
||||
made_glow = TRUE
|
||||
|
||||
/obj/structure/window/reinforced/clockwork/fulltile/unanchored
|
||||
anchored = FALSE
|
||||
|
||||
Reference in New Issue
Block a user