Files
Bubberstation/code/game/objects/structures/tank_holder.dm
ArcaneMusic f2fd69a49a Minerals have been refactored so costs and minerals in items are now in terms of mineral defines. (#75052)
Ladies, Gentlemen, Gamers. You're probably wondering why I've called you
all here (through the automatic reviewer request system). So, mineral
balance! Mineral balance is less a balance and more of a nervous white
dude juggling spinning plates on a high-wire on his first day. The fact
it hasn't failed after going on this long is a miracle in and of itself.

This PR does not change mineral balance. What this does is moves over
every individual cost, both in crafting recipes attached to an object
over to a define based system. We have 3 defines:

`sheet_material_amount=2000` . Stock standard mineral sheet. This being
our central mineral unit, this is used for all costs 2000+.
`half_sheet_material_amount=1000` . Same as above, but using iron rods
as our inbetween for costs of 1000-1999.
`small_material_amount=100` . This hits 1-999. This covers... a
startlingly large amount of the codebase. It's feast or famine out here
in terms of mineral costs as a result, items are either sheets upon
sheets, or some fraction of small mats.

Shout out to riot darts for being the worst material cost in the game. I
will not elaborate.

Regardless, this has no functional change, but it sets the groundwork
for making future changes to material costs much, MUCH easier, and moves
over to a single, standardized set of units to help enforce coding
standards on new items, and will bring up lots of uncomfortable balance
questions down the line.

For now though, this serves as some rough boundaries on how items costs
are related, and will make adjusting these values easier going forward.

Except for foam darts.

I did round up foam darts.

Adjusting mineral balance on the macro scale will be as simple as
changing the aforementioned mineral defines, where the alternative is a
rats nest of magic number defines. ~~No seriously, 11.25 iron for a foam
dart are you kidding me what is the POINT WHY NOT JUST MAKE IT 11~~

Items individual numbers have not been adjusted yet, but we can
standardize how the conversation can be held and actually GET SOMEWHERE
on material balance as opposed to throwing our hands up or ignoring it
for another 10 years.
2023-05-03 14:44:51 +00:00

147 lines
4.0 KiB
Plaintext

///?
/obj/structure/tank_holder
name = "tank holder"
desc = "A metallic frame that can hold tanks and extinguishers."
icon = 'icons/obj/atmospherics/tank.dmi'
icon_state = "holder"
custom_materials = list(/datum/material/iron =SHEET_MATERIAL_AMOUNT)
density = FALSE
anchored = FALSE
pass_flags_self = LETPASSTHROW
max_integrity = 20
resistance_flags = FIRE_PROOF
/// The stored tank. If this is a path, it gets created into contents at Initialize.
var/obj/item/tank
/obj/structure/tank_holder/Initialize(mapload)
. = ..()
if(tank)
var/obj/item/tank_ = new tank(null)
tank = null
SEND_SIGNAL(tank_, COMSIG_CONTAINER_TRY_ATTACH, src, null)
/obj/structure/tank_holder/Destroy()
QDEL_NULL(tank)
return ..()
/obj/structure/tank_holder/CanAllowThrough(atom/movable/mover, border_dir)
. = ..()
if(istype(mover) && mover.throwing)
return TRUE
/obj/structure/tank_holder/examine(mob/user)
. = ..()
. += "It is [anchored ? "wrenched to the floor." : "The <i>bolts</i> on the bottom are unsecured."]<br/>"
if(tank)
. += "It is holding one [tank]."
else
. += "It is empty."
. += span_notice("It is held together by some <b>screws</b>.")
/obj/structure/tank_holder/attackby(obj/item/W, mob/living/user, params)
if(user.combat_mode)
return ..()
if(W.tool_behaviour == TOOL_WRENCH)
to_chat(user, span_notice("You begin to [anchored ? "unwrench" : "wrench"] [src]."))
if(W.use_tool(src, user, 20, volume=50))
to_chat(user, span_notice("You successfully [anchored ? "unwrench" : "wrench"] [src]."))
set_anchored(!anchored)
else if(!SEND_SIGNAL(W, COMSIG_CONTAINER_TRY_ATTACH, src, user))
to_chat(user, span_warning("[W] does not fit in [src]."))
return
/obj/structure/tank_holder/screwdriver_act(mob/living/user, obj/item/I)
if(..())
return TRUE
if(tank)
return FALSE
I.play_tool_sound(src)
deconstruct(TRUE)
return TRUE
/obj/structure/tank_holder/deconstruct(disassembled = TRUE)
var/atom/Tsec = drop_location()
new /obj/item/stack/rods(Tsec, 2)
if(tank)
tank.forceMove(Tsec)
after_detach_tank()
qdel(src)
/obj/structure/tank_holder/attack_paw(mob/user, list/modifiers)
return attack_hand(user, modifiers)
/obj/structure/tank_holder/attack_hand(mob/user, list/modifiers)
if(!tank)
return ..()
if(!Adjacent(user) || issilicon(user))
return ..()
to_chat(user, span_notice("You take [tank] from [src]."))
add_fingerprint(user)
tank.add_fingerprint(user)
user.put_in_hands(tank)
after_detach_tank()
/obj/structure/tank_holder/handle_atom_del(atom/A)
if(A == tank)
after_detach_tank()
return ..()
/obj/structure/tank_holder/contents_explosion(severity, target)
if(!tank)
return
switch(severity)
if(EXPLODE_DEVASTATE)
SSexplosions.high_mov_atom += tank
if(EXPLODE_HEAVY)
SSexplosions.med_mov_atom += tank
if(EXPLODE_LIGHT)
SSexplosions.low_mov_atom += tank
/// Call this after taking the tank from contents in order to update references, icon
/// and density.
/obj/structure/tank_holder/proc/after_detach_tank()
tank = null
set_density(FALSE)
icon_state = "holder"
/obj/structure/tank_holder/oxygen
icon_state = "holder_oxygen"
tank = /obj/item/tank/internals/oxygen
/obj/structure/tank_holder/anesthetic
icon_state = "holder_anesthetic"
tank = /obj/item/tank/internals/anesthetic
/obj/structure/tank_holder/oxygen/yellow
icon_state = "holder_oxygen_f"
tank = /obj/item/tank/internals/oxygen/yellow
/obj/structure/tank_holder/oxygen/red
icon_state = "holder_oxygen_fr"
tank = /obj/item/tank/internals/oxygen/red
/obj/structure/tank_holder/emergency_oxygen
icon_state = "holder_emergency"
tank = /obj/item/tank/internals/emergency_oxygen
/obj/structure/tank_holder/emergency_oxygen/engi
icon_state = "holder_emergency_engi"
tank = /obj/item/tank/internals/emergency_oxygen/engi
/obj/structure/tank_holder/generic
icon_state = "holder_generic"
tank = /obj/item/tank/internals/generic
/obj/structure/tank_holder/extinguisher
icon_state = "holder_extinguisher"
tank = /obj/item/extinguisher
/obj/structure/tank_holder/extinguisher/advanced
icon_state = "holder_foam_extinguisher"
tank = /obj/item/extinguisher/advanced