mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 22:50:26 +01:00
## About The Pull Request This PR refactors wall construction on girders, wooden barricades and metal foam to use a centralized element, which listens to item interaction signals and attempts to make any available wall recipe. This change is an atomized prerequisite to my blueprinting system, since that system requires a sane way to dynamically change the speed at which walls are built. This PR will later be expanded to refactor girder construction steps in general. I also added `proc/valid_typesof(base_type)` as a side effect of my previous attempts at refactoring this stuff. There's now what amounts to a code comment easter egg in the same file, because DM is wacko and you're going to get cursed now too. :) ## Why It's Good For The Game The old system had ~20 bespoke yet highly similar wall construction steps. Some of the wall recipes were also concatenated from a string on the used stack type. To put it bluntly, the code was fucking horrible. Same thing goes for the rest of the girder construction steps, they were all bespoke. ## Changelog 🆑 refactor: Refactored girders and wall construction. Report any bugs. tweak: Some niche wall types might have their wall delay changed by like 2 seconds. This doesn't affect normal walls, reinforced walls, falsewalls or any other important wall types. /🆑
28 lines
1.1 KiB
Plaintext
28 lines
1.1 KiB
Plaintext
/// Contains recipe data for constructing a specific type of wall on a girder.
|
|
/// Only the [/datum/element/uses_girder_wall_recipes] should be using these.
|
|
/datum/girder_wall_recipe
|
|
/// The wall type this recipe is for. Can be a turf or an object.
|
|
var/wall_type
|
|
/// The type of stack required for this recipe.
|
|
var/stack_type
|
|
/// The amount of stack items required for this recipe.
|
|
var/stack_amount
|
|
/// The [/obj/structure] type required for this recipe.
|
|
var/girder_type
|
|
/// The [/obj/structure/girder/var/state] required for this recipe.
|
|
/// Ignored if [var/girder] is not of type [/obj/structure/girder].
|
|
var/girder_state
|
|
/// The amount of time it takes to make this recipe in deciseconds.
|
|
var/make_delay
|
|
/// The starting balloon alert text for this recipe.
|
|
var/start_alert
|
|
|
|
/datum/girder_wall_recipe/New(wall_type, stack_type, stack_amount, girder_type, girder_state, make_delay, start_alert)
|
|
src.wall_type = wall_type
|
|
src.stack_type = stack_type
|
|
src.stack_amount = stack_amount
|
|
src.girder_type = girder_type
|
|
src.girder_state = girder_state
|
|
src.make_delay = make_delay
|
|
src.start_alert = start_alert
|