what a gas
This commit is contained in:
@@ -139,7 +139,7 @@
|
||||
add_overlay(lightning_overlay)
|
||||
if(temperature > 4500000) //This is where noblium happens. Some fusion-y effects.
|
||||
var/fusion_amt = temperature < LERP(4500000,12000000,0.5) ? gauss_lerp(temperature, 4500000, 12000000) : 1
|
||||
var/mutable_appearance/fusion_overlay = mutable_appearance('icons/effects/tile_effects.dmi', "chem_gas")
|
||||
var/mutable_appearance/fusion_overlay = mutable_appearance('icons/effects/atmospherics.dmi', "fusion_gas")
|
||||
fusion_overlay.blend_mode = BLEND_ADD
|
||||
fusion_overlay.alpha = fusion_amt * 255
|
||||
var/mutable_appearance/rainbow_overlay = mutable_appearance('icons/mob/screen_gen.dmi', "druggy")
|
||||
|
||||
@@ -113,17 +113,18 @@
|
||||
|
||||
/turf/open/proc/tile_graphic()
|
||||
var/static/list/nonoverlaying_gases = typecache_of_gases_with_no_overlays()
|
||||
if(air)
|
||||
. = new /list
|
||||
var/list/gases = air.gases
|
||||
for(var/id in gases)
|
||||
if (nonoverlaying_gases[id])
|
||||
continue
|
||||
var/gas = gases[id]
|
||||
var/gas_meta = gas[GAS_META]
|
||||
var/gas_overlay = gas_meta[META_GAS_OVERLAY]
|
||||
if(gas_overlay && gas[MOLES] > gas_meta[META_GAS_MOLES_VISIBLE])
|
||||
. += gas_overlay
|
||||
if(!air)
|
||||
return
|
||||
. = new /list
|
||||
var/list/gases = air.gases
|
||||
for(var/id in gases)
|
||||
if (nonoverlaying_gases[id])
|
||||
continue
|
||||
var/gas = gases[id]
|
||||
var/gas_meta = gas[GAS_META]
|
||||
var/gas_overlay = gas_meta[META_GAS_OVERLAY]
|
||||
if(gas_overlay && gas[MOLES] > gas_meta[META_GAS_MOLES_VISIBLE])
|
||||
. += gas_overlay[min(FACTOR_GAS_VISIBLE_MAX, CEILING(gas[MOLES] / MOLES_GAS_VISIBLE_STEP, 1))]
|
||||
|
||||
/proc/typecache_of_gases_with_no_overlays()
|
||||
. = list()
|
||||
|
||||
@@ -86,13 +86,6 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache())
|
||||
if(!.)
|
||||
. += HEAT_CAPACITY_VACUUM //we want vacuums in turfs to have the same heat capacity as space
|
||||
|
||||
//prefer this in performance critical areas
|
||||
#define TOTAL_MOLES(cached_gases, out_var)\
|
||||
out_var = 0;\
|
||||
for(var/total_moles_id in cached_gases){\
|
||||
out_var += cached_gases[total_moles_id][MOLES];\
|
||||
}
|
||||
|
||||
/datum/gas_mixture/proc/total_moles()
|
||||
var/cached_gases = gases
|
||||
TOTAL_MOLES(cached_gases, .)
|
||||
|
||||
@@ -11,7 +11,9 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/g
|
||||
gas_info[META_GAS_NAME] = initial(gas.name)
|
||||
gas_info[META_GAS_MOLES_VISIBLE] = initial(gas.moles_visible)
|
||||
if(initial(gas.moles_visible) != null)
|
||||
gas_info[META_GAS_OVERLAY] = new /obj/effect/overlay/gas(initial(gas.gas_overlay))
|
||||
gas_info[META_GAS_OVERLAY] = new /list(FACTOR_GAS_VISIBLE_MAX)
|
||||
for(var/i in 1 to FACTOR_GAS_VISIBLE_MAX)
|
||||
gas_info[META_GAS_OVERLAY][i] = new /obj/effect/overlay/gas(initial(gas.gas_overlay), i * 255 / FACTOR_GAS_VISIBLE_MAX)
|
||||
gas_info[META_GAS_FUSION_POWER] = initial(gas.fusion_power)
|
||||
gas_info[META_GAS_DANGER] = initial(gas.dangerous)
|
||||
gas_info[META_GAS_ID] = initial(gas.id)
|
||||
@@ -39,7 +41,7 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/g
|
||||
var/id = ""
|
||||
var/specific_heat = 0
|
||||
var/name = ""
|
||||
var/gas_overlay = "" //icon_state in icons/effects/tile_effects.dmi
|
||||
var/gas_overlay = "" //icon_state in icons/effects/atmospherics.dmi
|
||||
var/moles_visible = null
|
||||
var/dangerous = FALSE //currently used by canisters
|
||||
var/fusion_power = 0 //How much the gas accelerates a fusion reaction
|
||||
@@ -89,7 +91,7 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/g
|
||||
specific_heat = 40
|
||||
name = "Nitrous Oxide"
|
||||
gas_overlay = "nitrous_oxide"
|
||||
moles_visible = 1
|
||||
moles_visible = MOLES_GAS_VISIBLE * 2
|
||||
dangerous = TRUE
|
||||
|
||||
/datum/gas/nitryl
|
||||
@@ -137,12 +139,13 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/g
|
||||
moles_visible = MOLES_GAS_VISIBLE * 60
|
||||
|
||||
/obj/effect/overlay/gas
|
||||
icon = 'icons/effects/tile_effects.dmi'
|
||||
icon = 'icons/effects/atmospherics.dmi'
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
anchored = TRUE // should only appear in vis_contents, but to be safe
|
||||
layer = FLY_LAYER
|
||||
appearance_flags = TILE_BOUND
|
||||
|
||||
/obj/effect/overlay/gas/New(state)
|
||||
/obj/effect/overlay/gas/New(state, alph)
|
||||
. = ..()
|
||||
icon_state = state
|
||||
alpha = alph
|
||||
@@ -150,7 +150,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
var/turf/center
|
||||
var/list/flood_images = list()
|
||||
var/list/turf/flood_turfs = list()
|
||||
var/image_icon = 'icons/effects/tile_effects.dmi'
|
||||
var/image_icon = 'icons/effects/atmospherics.dmi'
|
||||
var/image_state = "plasma"
|
||||
var/radius = 0
|
||||
var/next_expand = 0
|
||||
|
||||
Reference in New Issue
Block a user