mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-20 03:19:58 +01:00
Fully fixes #21686, as well as other assorted issues caused by #21458.  
107 lines
3.0 KiB
Plaintext
107 lines
3.0 KiB
Plaintext
var/global/datum/xgm_gas_data/gas_data
|
|
|
|
/datum/xgm_gas_data
|
|
/// Simple list of all the gas IDs.
|
|
var/list/gases = list()
|
|
/// The friendly, human-readable name for the gas.
|
|
var/list/name = list()
|
|
/// Specific heat of the gas. Used for calculating heat capacity.
|
|
var/list/specific_heat = list()
|
|
/// Molar mass of the gas. Used for calculating specific entropy.
|
|
var/list/molar_mass = list()
|
|
/// Tile overlays. /obj/gas_overlay, created from references to 'icons/effects/tile_effects.dmi'
|
|
var/list/tile_overlay = list()
|
|
/// Optional color for tile overlay
|
|
var/list/tile_overlay_color = list()
|
|
/// Overlay limits. There must be at least this many moles for the overlay to appear.
|
|
var/list/overlay_limit = list()
|
|
/// Flags.
|
|
var/list/flags = list()
|
|
|
|
/singleton/xgm_gas
|
|
var/id = ""
|
|
var/name = "Unnamed Gas"
|
|
var/desc
|
|
var/specific_heat = 20 // J/(mol*K)
|
|
var/molar_mass = 0.032 // kg/mol
|
|
|
|
var/tile_overlay = "generic"
|
|
var/tile_color = null
|
|
var/overlay_limit = null
|
|
|
|
var/flags = 0
|
|
|
|
/hook/startup/proc/generateGasData()
|
|
gas_data = new
|
|
for(var/p in (typesof(/singleton/xgm_gas) - /singleton/xgm_gas))
|
|
var/singleton/xgm_gas/gas = new p //avoid initial() because of potential New() actions
|
|
|
|
if(gas.id in gas_data.gases)
|
|
stack_trace("ERROR: Duplicate gas id `[gas.id]` in `[p]`")
|
|
|
|
gas_data.gases += gas.id
|
|
gas_data.name[gas.id] = gas.name
|
|
gas_data.specific_heat[gas.id] = gas.specific_heat
|
|
gas_data.molar_mass[gas.id] = gas.molar_mass
|
|
if(gas.overlay_limit)
|
|
gas_data.overlay_limit[gas.id] = gas.overlay_limit
|
|
gas_data.tile_overlay[gas.id] = gas.tile_overlay
|
|
gas_data.tile_overlay_color[gas.id] = gas.tile_color
|
|
gas_data.flags[gas.id] = gas.flags
|
|
|
|
return 1
|
|
|
|
/obj/gas_overlay
|
|
name = "gas"
|
|
desc = "You shouldn't be clicking this."
|
|
icon = 'icons/effects/tile_effects.dmi'
|
|
icon_state = "generic"
|
|
layer = FIRE_LAYER
|
|
appearance_flags = DEFAULT_APPEARANCE_FLAGS | RESET_COLOR
|
|
mouse_opacity = 0
|
|
var/gas_id
|
|
|
|
/obj/gas_overlay/proc/update_alpha_animation(new_alpha)
|
|
animate(src, alpha = new_alpha)
|
|
alpha = new_alpha
|
|
animate(src, alpha = 0.8 * new_alpha, time = 10, easing = SINE_EASING | EASE_OUT, loop = -1)
|
|
animate(alpha = new_alpha, time = 10, easing = SINE_EASING | EASE_IN, loop = -1)
|
|
|
|
/obj/gas_overlay/Initialize(mapload, gas)
|
|
. = ..()
|
|
gas_id = gas
|
|
if(gas_data.tile_overlay[gas_id])
|
|
icon_state = gas_data.tile_overlay[gas_id]
|
|
color = gas_data.tile_overlay_color[gas_id]
|
|
|
|
/obj/gas_overlay/heat
|
|
name = "gas"
|
|
desc = "You shouldn't be clicking this."
|
|
plane = HEAT_EFFECT_PLANE
|
|
gas_id = GAS_HEAT
|
|
render_source = HEAT_EFFECT_PLATE_RENDER_TARGET
|
|
|
|
/obj/gas_overlay/heat/Initialize(mapload, gas)
|
|
. = ..()
|
|
icon = null
|
|
icon_state = null
|
|
|
|
/obj/effect/gas_cold_back
|
|
plane = GAME_PLANE
|
|
layer = BELOW_OBJ_LAYER
|
|
render_source = COLD_EFFECT_BACK_PLATE_RENDER_TARGET
|
|
|
|
/obj/gas_overlay/cold
|
|
name = "gas"
|
|
desc = "You shouldn't be clicking this."
|
|
gas_id = GAS_COLD
|
|
var/obj/effect/gas_cold_back/b = null
|
|
render_source = COLD_EFFECT_PLATE_RENDER_TARGET
|
|
|
|
/obj/gas_overlay/cold/Initialize(mapload, gas)
|
|
. = ..()
|
|
icon = null
|
|
icon_state = null
|
|
b = new()
|
|
add_vis_contents(b)
|