Paper frames, but with new sprites. (#28452)

* Paper frames, take two

* With entirely new sprites

* and basemap

* no directional doors also smoothing

* changes requested

* woops

* deconstruct -> Destroy
This commit is contained in:
Expletive
2017-06-18 07:45:35 -07:00
committed by KorPhaeron
parent 38daf671b3
commit 1860e1a2ea
10 changed files with 233 additions and 60 deletions
+25 -6
View File
@@ -5,7 +5,7 @@
name = "metal door"
density = 1
anchored = 1
opacity = 1
opacity = TRUE
icon = 'icons/obj/doors/mineral_doors.dmi'
icon_state = "metal"
@@ -86,11 +86,11 @@
/obj/structure/mineral_door/proc/Open()
isSwitchingStates = 1
playsound(loc, openSound, 100, 1)
playsound(src, openSound, 100, 1)
set_opacity(FALSE)
flick("[initial_state]opening",src)
sleep(10)
density = 0
opacity = 0
state = 1
air_update_turf(1)
update_icon()
@@ -110,7 +110,7 @@
flick("[initial_state]closing",src)
sleep(10)
density = 1
opacity = 1
set_opacity(TRUE)
state = 0
air_update_turf(1)
update_icon()
@@ -175,11 +175,11 @@
max_integrity = 100
/obj/structure/mineral_door/transparent
opacity = 0
opacity = FALSE
/obj/structure/mineral_door/transparent/Close()
..()
opacity = 0
set_opacity(FALSE)
/obj/structure/mineral_door/transparent/plasma
name = "plasma door"
@@ -219,3 +219,22 @@
resistance_flags = FLAMMABLE
obj_integrity = 200
max_integrity = 200
/obj/structure/mineral_door/paperframe
name = "paper frame door"
icon_state = "paperframe"
openSound = 'sound/effects/doorcreaky.ogg'
closeSound = 'sound/effects/doorcreaky.ogg'
sheetType = /obj/item/stack/sheet/paperframes
sheetAmount = 3
resistance_flags = FLAMMABLE
obj_integrity = 20
max_integrity = 20
/obj/structure/mineral_door/paperframe/Initialize()
. = ..()
queue_smooth_neighbors(src)
/obj/structure/mineral_door/paperframe/Destroy()
queue_smooth_neighbors(src)
return ..()
+91 -15
View File
@@ -25,6 +25,8 @@
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 80, acid = 100)
CanAtmosPass = ATMOS_PASS_PROC
var/real_explosion_block //ignore this, just use explosion_block
var/breaksound = "shatter"
var/hitsound = 'sound/effects/Glasshit.ogg'
/obj/structure/window/examine(mob/user)
..()
@@ -144,7 +146,7 @@
user.changeNext_move(CLICK_CD_MELEE)
user.visible_message("<span class='notice'>Something knocks on [src].</span>")
add_fingerprint(user)
playsound(loc, 'sound/effects/glassknock.ogg', 50, 1)
playsound(src, 'sound/effects/Glassknock.ogg', 50, 1)
/obj/structure/window/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0)
if(!can_be_reached(user))
@@ -157,7 +159,7 @@
user.changeNext_move(CLICK_CD_MELEE)
user.visible_message("[user] knocks on [src].")
add_fingerprint(user)
playsound(loc, 'sound/effects/glassknock.ogg', 50, 1)
playsound(src, 'sound/effects/Glassknock.ogg', 50, 1)
/obj/structure/window/attack_paw(mob/user)
return attack_hand(user)
@@ -178,10 +180,10 @@
if(obj_integrity < max_integrity)
if(WT.remove_fuel(0,user))
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
playsound(loc, WT.usesound, 40, 1)
playsound(src, 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)
playsound(src, 'sound/items/Welder2.ogg', 50, 1)
update_nearby_icons()
to_chat(user, "<span class='notice'>You repair [src].</span>")
else
@@ -190,7 +192,7 @@
if(!(flags&NODECONSTRUCT))
if(istype(I, /obj/item/weapon/screwdriver))
playsound(loc, I.usesound, 75, 1)
playsound(src, I.usesound, 75, 1)
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>")
@@ -214,19 +216,19 @@
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)
playsound(src, I.usesound, 75, 1)
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)
playsound(src, I.usesound, 75, 1)
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)
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You successfully disassemble [src].</span>")
qdel(src)
return
@@ -265,18 +267,18 @@
switch(damage_type)
if(BRUTE)
if(damage_amount)
playsound(src.loc, 'sound/effects/glasshit.ogg', 75, 1)
playsound(src, hitsound, 75, 1)
else
playsound(src, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
playsound(src.loc, 'sound/items/welder.ogg', 100, 1)
playsound(src, 'sound/items/Welder.ogg', 100, 1)
/obj/structure/window/deconstruct(disassembled = TRUE)
if(QDELETED(src))
return
if(!disassembled)
playsound(src, "shatter", 70, 1)
playsound(src, breaksound, 70, 1)
var/turf/T = loc
if(!(flags & NODECONSTRUCT))
for(var/i in debris)
@@ -429,7 +431,6 @@
name = "tinted window"
icon_state = "twindow"
opacity = 1
/obj/structure/window/reinforced/tinted/frosted
name = "frosted window"
icon_state = "fwindow"
@@ -548,9 +549,7 @@
if(fulltile)
made_glow = TRUE
..()
for(var/obj/item/I in debris)
debris -= I
qdel(I)
QDEL_LIST(debris)
var/amount_of_gears = 2
if(fulltile)
new /obj/effect/temp_visual/ratvar/window(get_turf(src))
@@ -599,3 +598,80 @@
/obj/structure/window/reinforced/clockwork/fulltile/unanchored
anchored = FALSE
/obj/structure/window/paperframe
name = "paper frame"
desc = "A fragile separator made of thin wood and paper."
icon = 'icons/obj/smooth_structures/paperframes.dmi'
icon_state = "frame"
dir = FULLTILE_WINDOW_DIR
opacity = TRUE
max_integrity = 15
obj_integrity = 15
fulltile = TRUE
flags = PREVENT_CLICK_UNDER
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/window/paperframe, /obj/structure/mineral_door/paperframe)
glass_amount = 2
glass_type = /obj/item/stack/sheet/paperframes
heat_resistance = 233
decon_speed = 10
CanAtmosPass = ATMOS_PASS_YES
resistance_flags = FLAMMABLE
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0)
breaksound = 'sound/items/poster_ripped.ogg'
hitsound = 'sound/weapons/slashmiss.ogg'
var/static/mutable_appearance/torn = mutable_appearance('icons/obj/smooth_structures/paperframes.dmi',icon_state = "torn", layer = ABOVE_OBJ_LAYER - 0.1)
var/static/mutable_appearance/paper = mutable_appearance('icons/obj/smooth_structures/paperframes.dmi',icon_state = "paper", layer = ABOVE_OBJ_LAYER - 0.1)
/obj/structure/window/paperframe/Initialize()
. = ..()
QDEL_LIST(debris)
var/papers = rand(1,4)
debris += new /obj/item/stack/sheet/mineral/wood()
for(var/i in 1 to papers)
debris += new /obj/item/weapon/paper/natural()
update_icon()
/obj/structure/window/paperframe/attack_hand(mob/user)
add_fingerprint(user)
if(user.a_intent != INTENT_HARM)
user.changeNext_move(CLICK_CD_MELEE)
user.visible_message("[user] knocks on [src].")
playsound(src, "pageturn", 50, 1)
else
take_damage(4,BRUTE,"melee", 0)
playsound(src, hitsound, 50, 1)
if(!QDELETED(src))
user.visible_message("<span class='danger'>[user] tears a hole in [src].</span>")
update_icon()
/obj/structure/window/paperframe/update_icon()
if(obj_integrity < max_integrity)
cut_overlay(paper)
add_overlay(torn)
set_opacity(FALSE)
else
cut_overlay(torn)
add_overlay(paper)
set_opacity(TRUE)
queue_smooth(src)
/obj/structure/window/paperframe/attackby(obj/item/weapon/W, mob/user)
if(W.is_hot())
fire_act(W.is_hot())
return
if(user.a_intent == INTENT_HARM)
return ..()
if(istype(W, /obj/item/weapon/paper) && obj_integrity < max_integrity)
user.visible_message("[user] starts to patch the holes in \the [src].")
if(do_after(user, 20, target = src))
obj_integrity = min(obj_integrity+4,max_integrity)
qdel(W)
user.visible_message("[user] patches some of the holes in \the [src].")
if(obj_integrity == max_integrity)
update_icon()
return
..()
update_icon()