De-hardcodes spawnDebris in windows, fixes a bunch of issues with windows. (#73274)

## About The Pull Request

spawnDebris was being overridden by almost every type of window, I've
set up some new vars for it to pull shard and its debris decal from so
spawnDebris only needed to be set up once (+ once more for paper windows
which are unique).
Fixes an issue with reinforced plasma glass windows dropping regular
glass when broken.
Fixes an oversight where tram windows were dropping only 1 rod instead
of 2 and dropping glass sheets instead of shards.
Cleans up tram window code a bunch.
## Why It's Good For The Game

Fixes several issues, cleans up code and cuts down on a lot of repeat
code.
## Changelog
🆑
fix: Reinforced plasma windows will now drop plasma glass instead of
regular glass when broken.
fix: Tram windows drop the correct number of rods and a shard when
broken instead of a sheet.
code: Removed a ton of duplicate vars in tram window code and
re-organize the file slightly.
refactor: spawnDebris has been un-hardcoded and all (but one) override
of it has been removed.
/🆑
This commit is contained in:
NamelessFairy
2023-02-14 21:38:55 -07:00
committed by GitHub
parent 80d39edfbd
commit 58a9fcff82
5 changed files with 42 additions and 62 deletions
+2
View File
@@ -49,6 +49,8 @@ Simple datum which is instanced once per type and is used for every object of sa
var/cached_texture_filter_icon
///What type of shard the material will shatter to
var/obj/item/shard_type
///What type of debris the tile will leave behind when shattered.
var/obj/effect/decal/debris_type
/** Handles initializing the material.
*
+3
View File
@@ -90,6 +90,7 @@
armor_modifiers = list(MELEE = 0.8, BULLET = 0.8, LASER = 1.2, ENERGY = 1.2, BOMB = 0.3, BIO = 1.2, FIRE = 2, ACID = 2)
sheet_type = /obj/item/stack/sheet/plasmaglass
shard_type = /obj/item/shard/plasma
debris_type = /obj/effect/decal/cleanable/glass/plasma
value_per_unit = 0.075
categories = list(MAT_CATEGORY_RIGID=TRUE, MAT_CATEGORY_BASE_RECIPES=TRUE, MAT_CATEGORY_ITEM_MATERIAL=TRUE)
composition = list(/datum/material/glass=1, /datum/material/plasma=0.5)
@@ -109,6 +110,7 @@
armor_modifiers = list(MELEE = 1.2, BULLET = 1.2, LASER = 0.8, ENERGY = 0.8, BOMB = 0.5, BIO = 1.2, FIRE = 0.8, ACID = 2)
sheet_type = /obj/item/stack/sheet/titaniumglass
shard_type = /obj/item/shard/titanium
debris_type = /obj/effect/decal/cleanable/glass/titanium
value_per_unit = 0.04
categories = list(MAT_CATEGORY_RIGID=TRUE, MAT_CATEGORY_BASE_RECIPES=TRUE, MAT_CATEGORY_ITEM_MATERIAL=TRUE)
composition = list(/datum/material/glass=1, /datum/material/titanium=0.5)
@@ -129,6 +131,7 @@
armor_modifiers = list(MELEE = 1.2, BULLET = 1.2, LASER = 1.2, ENERGY = 1.2, BOMB = 0.5, BIO = 1.2, FIRE = 2, ACID = 2)
sheet_type = /obj/item/stack/sheet/plastitaniumglass
shard_type = /obj/item/shard/plastitanium
debris_type = /obj/effect/decal/cleanable/glass/plastitanium
value_per_unit = 0.125
categories = list(MAT_CATEGORY_RIGID=TRUE, MAT_CATEGORY_BASE_RECIPES=TRUE, MAT_CATEGORY_ITEM_MATERIAL=TRUE)
composition = list(/datum/material/glass=1, /datum/material/alloy/plastitanium=0.5)
+1
View File
@@ -24,6 +24,7 @@
integrity_modifier = 0.1
sheet_type = /obj/item/stack/sheet/glass
shard_type = /obj/item/shard
debris_type = /obj/effect/decal/cleanable/glass
value_per_unit = 0.0025
beauty_modifier = 0.05
armor_modifiers = list(MELEE = 0.2, BULLET = 0.2, ENERGY = 1, BIO = 0.2, FIRE = 1, ACID = 0.2)