mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Standardize windows.
Conflicts: code/WorkInProgress/buildmode.dm code/game/machinery/doors/airlock.dm code/game/objects/items/stacks/sheets/glass.dm code/game/objects/items/weapons/twohanded.dm code/game/objects/structures/window.dm code/modules/mining/mine_items.dm code/modules/mob/living/carbon/metroid/metroid.dm code/modules/mob/living/simple_animal/constructs.dm code/modules/mob/living/simple_animal/friendly/corgi.dm
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
/obj/structure/window/full
|
||||
sheets = 2
|
||||
dir=SOUTHWEST
|
||||
|
||||
/obj/structure/window/full/CheckExit(atom/movable/O as mob|obj, target as turf)
|
||||
return 1
|
||||
|
||||
/obj/structure/window/full/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/structure/window/full/update_nearby_tiles(need_rebuild)
|
||||
if(!air_master) return 0
|
||||
if(!loc) return 0
|
||||
|
||||
var/turf/simulated/source = get_turf(src)
|
||||
if(istype(source))
|
||||
air_master.tiles_to_update |= source
|
||||
for(var/dir in cardinal)
|
||||
var/turf/simulated/target = get_step(source,dir)
|
||||
if(istype(target)) air_master.tiles_to_update |= target
|
||||
return 1
|
||||
|
||||
/obj/structure/window/full/is_fulltile()
|
||||
return 1
|
||||
|
||||
//merges adjacent full-tile windows into one (blatant ripoff from game/smoothwall.dm)
|
||||
/obj/structure/window/full/update_icon()
|
||||
//A little cludge here, since I don't know how it will work with slim windows. Most likely VERY wrong.
|
||||
//this way it will only update full-tile ones
|
||||
//This spawn is here so windows get properly updated when one gets deleted.
|
||||
spawn(2)
|
||||
if(!src) return
|
||||
if(!is_fulltile())
|
||||
return
|
||||
var/junction = 0 //will be used to determine from which side the window is connected to other windows
|
||||
if(anchored)
|
||||
for(var/obj/structure/window/full/W in orange(src,1))
|
||||
if(W.anchored && W.density) //Only counts anchored, not-destroyed full-tile windows.
|
||||
if(abs(x-W.x)-abs(y-W.y) ) //doesn't count windows, placed diagonally to src
|
||||
junction |= get_dir(src,W)
|
||||
icon_state = "[basestate][junction]"
|
||||
return
|
||||
|
||||
/obj/structure/window/full/basic
|
||||
desc = "It looks thin and flimsy. A few knocks with... anything, really should shatter it."
|
||||
icon_state = "window"
|
||||
basestate = "window"
|
||||
|
||||
/obj/structure/window/full/plasmabasic
|
||||
name = "plasma window"
|
||||
desc = "A plasma-glass alloy window. It looks insanely tough to break. It appears it's also insanely tough to burn through."
|
||||
basestate = "plasmawindow"
|
||||
icon_state = "plasmawindow"
|
||||
shardtype = /obj/item/weapon/shard/plasma
|
||||
health = 120
|
||||
|
||||
/obj/structure/window/full/plasmabasic/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > T0C + 32000)
|
||||
hit(round(exposed_volume / 1000), 0)
|
||||
..()
|
||||
|
||||
/obj/structure/window/full/plasmareinforced
|
||||
name = "reinforced plasma window"
|
||||
desc = "A plasma-glass alloy window, with rods supporting it. It looks hopelessly tough to break. It also looks completely fireproof, considering how basic plasma windows are insanely fireproof."
|
||||
basestate = "plasmarwindow"
|
||||
icon_state = "plasmarwindow"
|
||||
shardtype = /obj/item/weapon/shard/plasma
|
||||
reinf = 1
|
||||
health = 160
|
||||
|
||||
/obj/structure/window/full/plasmareinforced/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
return
|
||||
|
||||
/obj/structure/window/full/reinforced
|
||||
name = "reinforced window"
|
||||
desc = "It looks rather strong. Might take a few good hits to shatter it."
|
||||
icon_state = "rwindow"
|
||||
basestate = "rwindow"
|
||||
health = 40
|
||||
reinf = 1
|
||||
|
||||
/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."
|
||||
icon_state = "twindow"
|
||||
basestate = "twindow"
|
||||
opacity = 1
|
||||
|
||||
/obj/structure/window/full/reinforced/tinted/frosted
|
||||
name = "frosted window"
|
||||
desc = "It looks rather strong and frosted over. Looks like it might take a few less hits then a normal reinforced window."
|
||||
icon_state = "fwindow"
|
||||
basestate = "fwindow"
|
||||
health = 30
|
||||
@@ -13,10 +13,10 @@
|
||||
var/reinf = 0
|
||||
var/basestate
|
||||
var/shardtype = /obj/item/weapon/shard
|
||||
var/sheets = 1 // Number of sheets needed to build this window (determines how much shit is spawned by destroy())
|
||||
// var/silicate = 0 // number of units of silicate
|
||||
// var/icon/silicateIcon = null // the silicated icon
|
||||
|
||||
|
||||
/obj/structure/window/bullet_act(var/obj/item/projectile/Proj)
|
||||
health -= Proj.damage
|
||||
..()
|
||||
@@ -25,62 +25,52 @@
|
||||
if(pdiff>0)
|
||||
message_admins("Window destroyed by [Proj.firer.real_name] ([formatPlayerPanel(Proj.firer,Proj.firer.ckey)]) via \an [Proj]! pdiff = [pdiff] at [formatJumpTo(loc)]!")
|
||||
log_admin("Window destroyed by ([Proj.firer.ckey]) via \an [Proj]! pdiff = [pdiff] at [loc]!")
|
||||
new /obj/item/weapon/shard(loc)
|
||||
new /obj/item/stack/rods(loc)
|
||||
del(src)
|
||||
destroy()
|
||||
return
|
||||
|
||||
// This should result in the same materials used to make the window.
|
||||
/obj/structure/window/proc/destroy()
|
||||
for(var/i=0;i<sheets;i++)
|
||||
new shardtype(loc)
|
||||
if(reinf)
|
||||
new /obj/item/stack/rods(loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/window/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
new /obj/item/weapon/shard(loc)
|
||||
if(reinf) new /obj/item/stack/rods(loc)
|
||||
del(src)
|
||||
destroy()
|
||||
return
|
||||
if(3.0)
|
||||
if(prob(50))
|
||||
new /obj/item/weapon/shard(loc)
|
||||
if(reinf) new /obj/item/stack/rods(loc)
|
||||
del(src)
|
||||
destroy()
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/window/blob_act()
|
||||
new /obj/item/weapon/shard(loc)
|
||||
if(reinf) new /obj/item/stack/rods(loc)
|
||||
del(src)
|
||||
|
||||
destroy()
|
||||
|
||||
/obj/structure/window/meteorhit()
|
||||
//world << "glass at [x],[y],[z] Mhit"
|
||||
new /obj/item/weapon/shard( loc )
|
||||
if(reinf) new /obj/item/stack/rods( loc)
|
||||
del(src)
|
||||
destroy()
|
||||
|
||||
/obj/structure/window/CheckExit(var/atom/movable/O, var/turf/target)
|
||||
if(istype(O) && O.checkpass(PASSGLASS))
|
||||
return 1
|
||||
if(get_dir(O.loc, target) == dir)
|
||||
return !density
|
||||
return 1
|
||||
|
||||
/obj/structure/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
return 1
|
||||
if(dir == SOUTHWEST || dir == SOUTHEAST || dir == NORTHWEST || dir == NORTHEAST)
|
||||
return 0 //full tile window, you can't move into it!
|
||||
if(get_dir(loc, target) == dir)
|
||||
return !density
|
||||
else
|
||||
return 1
|
||||
|
||||
|
||||
/obj/structure/window/CheckExit(atom/movable/O as mob|obj, target as turf)
|
||||
if(istype(O) && O.checkpass(PASSGLASS))
|
||||
return 1
|
||||
if(get_dir(O.loc, target) == dir)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/obj/structure/window/hitby(AM as mob|obj)
|
||||
..()
|
||||
visible_message("<span class='danger'>[src] was hit by [AM].</span>")
|
||||
@@ -108,9 +98,6 @@
|
||||
message_admins("Window with pdiff [pdiff] at [formatJumpTo(loc)] deanchored by [AM]!")
|
||||
log_admin("Window with pdiff [pdiff] at [loc] deanchored by [AM]!")
|
||||
if(health <= 0)
|
||||
new /obj/item/weapon/shard(loc)
|
||||
if(reinf) new /obj/item/stack/rods(loc)
|
||||
del(src)
|
||||
var/pdiff=performWallPressureCheck(src.loc)
|
||||
if(pdiff>0)
|
||||
if(M)
|
||||
@@ -119,21 +106,20 @@
|
||||
else
|
||||
message_admins("Window with pdiff [pdiff] at [formatJumpTo(loc)] destroyed by [AM]!")
|
||||
log_admin("Window with pdiff [pdiff] at [loc] destroyed by [AM]!")
|
||||
destroy()
|
||||
|
||||
|
||||
/obj/structure/window/attack_hand(mob/user as mob)
|
||||
if(M_HULK in user.mutations)
|
||||
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
|
||||
user.visible_message("<span class='danger'>[user] smashes through [src]!</span>")
|
||||
new /obj/item/weapon/shard(loc)
|
||||
if(reinf) new /obj/item/stack/rods(loc)
|
||||
del(src)
|
||||
var/pdiff=performWallPressureCheck(src.loc)
|
||||
if(pdiff>0)
|
||||
message_admins("Window destroyed by hulk [user.real_name] ([formatPlayerPanel(user,user.ckey)]) with pdiff [pdiff] at [formatJumpTo(loc)]!")
|
||||
log_admin("Window destroyed by hulk [user.real_name] ([user.ckey]) with pdiff [pdiff] at [loc]!")
|
||||
else if (usr.a_intent == "harm")
|
||||
playsound(src.loc, 'sound/effects/glassknock.ogg', 80, 1)
|
||||
destroy()
|
||||
else if (usr.a_intent == "hurt")
|
||||
playsound(get_turf(src), 'sound/effects/glassknock.ogg', 80, 1)
|
||||
usr.visible_message("\red [usr.name] bangs against the [src.name]!", \
|
||||
"\red You bang against the [src.name]!", \
|
||||
"You hear a banging sound.")
|
||||
@@ -148,17 +134,14 @@
|
||||
/obj/structure/window/attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
/obj/structure/window/proc/attack_generic(mob/user as mob, damage = 0) //used by attack_alien, attack_animal, and attack_slime
|
||||
health -= damage
|
||||
if(health <= 0)
|
||||
user.visible_message("<span class='danger'>[user] smashes through [src]!</span>")
|
||||
new /obj/item/weapon/shard(loc)
|
||||
if(reinf) new /obj/item/stack/rods(loc)
|
||||
del(src)
|
||||
var/pdiff=performWallPressureCheck(src.loc)
|
||||
if(pdiff>0)
|
||||
message_admins("Window destroyed by [user.real_name] ([formatPlayerPanel(user,user.ckey)]) with pdiff [pdiff] at [formatJumpTo(loc)]!")
|
||||
destroy()
|
||||
else //for nicer text~
|
||||
user.visible_message("<span class='danger'>[user] smashes into [src]!</span>")
|
||||
playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
|
||||
@@ -257,20 +240,10 @@
|
||||
if(sound_effect)
|
||||
playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
if(health <= 0)
|
||||
if(dir == SOUTHWEST)
|
||||
var/index = null
|
||||
index = 0
|
||||
while(index < 2)
|
||||
new shardtype(loc)
|
||||
if(reinf) new /obj/item/stack/rods(loc)
|
||||
index++
|
||||
else
|
||||
new shardtype(loc)
|
||||
if(reinf) new /obj/item/stack/rods(loc)
|
||||
var/pdiff=performWallPressureCheck(src.loc)
|
||||
if(pdiff>0)
|
||||
message_admins("Window with pdiff [pdiff] broken at [formatJumpTo(loc)]!")
|
||||
del(src)
|
||||
destroy()
|
||||
return
|
||||
|
||||
|
||||
@@ -351,7 +324,8 @@
|
||||
/obj/structure/window/Destroy()
|
||||
density = 0
|
||||
update_nearby_tiles()
|
||||
playsound(src, "shatter", 70, 1)
|
||||
if(loc)
|
||||
playsound(get_turf(src), "shatter", 70, 1)
|
||||
update_nearby_icons()
|
||||
..()
|
||||
|
||||
@@ -372,50 +346,24 @@
|
||||
|
||||
//checks if this window is full-tile one
|
||||
/obj/structure/window/proc/is_fulltile()
|
||||
if(dir in list(5,6,9,10))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//This proc is used to update the icons of nearby windows. It should not be confused with update_nearby_tiles(), which is an atmos proc!
|
||||
/obj/structure/window/proc/update_nearby_icons()
|
||||
if(!loc) return 0
|
||||
update_icon()
|
||||
for(var/direction in cardinal)
|
||||
for(var/obj/structure/window/W in get_step(src,direction) )
|
||||
W.update_icon()
|
||||
|
||||
//merges adjacent full-tile windows into one (blatant ripoff from game/smoothwall.dm)
|
||||
/obj/structure/window/update_icon()
|
||||
//A little cludge here, since I don't know how it will work with slim windows. Most likely VERY wrong.
|
||||
//this way it will only update full-tile ones
|
||||
//This spawn is here so windows get properly updated when one gets deleted.
|
||||
spawn(2)
|
||||
if(!src) return
|
||||
if(!is_fulltile())
|
||||
icon_state = "[basestate]"
|
||||
return
|
||||
var/junction = 0 //will be used to determine from which side the window is connected to other windows
|
||||
if(anchored)
|
||||
for(var/obj/structure/window/W in orange(src,1))
|
||||
if(W.anchored && W.density && W.is_fulltile()) //Only counts anchored, not-destroyed fill-tile windows.
|
||||
if(abs(x-W.x)-abs(y-W.y) ) //doesn't count windows, placed diagonally to src
|
||||
junction |= get_dir(src,W)
|
||||
if(opacity)
|
||||
icon_state = "[basestate][junction]"
|
||||
else
|
||||
if(reinf)
|
||||
icon_state = "[basestate][junction]"
|
||||
else
|
||||
icon_state = "[basestate][junction]"
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
/obj/structure/window/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > T0C + 800)
|
||||
hit(round(exposed_volume / 100), 0)
|
||||
..()
|
||||
|
||||
|
||||
|
||||
/obj/structure/window/basic
|
||||
icon_state = "window"
|
||||
desc = "It looks thin and flimsy. A few knocks with... anything, really should shatter it."
|
||||
|
||||
Reference in New Issue
Block a user