mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -235,8 +235,10 @@ var/list/gamemode_cache = list()
|
||||
|
||||
var/show_human_death_message = 1
|
||||
|
||||
var/radiation_resistance_calc_mode = RAD_RESIST_CALC_SUB // 0:1 subtraction:division for computing effective radiation on a turf
|
||||
var/radiation_decay_rate = 1 //How much radiation is reduced by each tick
|
||||
var/radiation_resistance_multiplier = 8.5 //VOREstation edit
|
||||
var/radiation_material_resistance_divisor = 1
|
||||
var/radiation_lower_limit = 0.35 //If the radiation level for a turf would be below this, ignore it.
|
||||
|
||||
var/random_submap_orientation = FALSE // If true, submaps loaded automatically can be rotated.
|
||||
@@ -783,6 +785,21 @@ var/list/gamemode_cache = list()
|
||||
if("radiation_lower_limit")
|
||||
radiation_lower_limit = text2num(value)
|
||||
|
||||
if("radiation_resistance_calc_divide")
|
||||
radiation_resistance_calc_mode = RAD_RESIST_CALC_DIV
|
||||
|
||||
if("radiation_resistance_calc_subtract")
|
||||
radiation_resistance_calc_mode = RAD_RESIST_CALC_SUB
|
||||
|
||||
if("radiation_resistance_multiplier")
|
||||
radiation_resistance_multiplier = text2num(value)
|
||||
|
||||
if("radiation_material_resistance_divisor")
|
||||
radiation_material_resistance_divisor = text2num(value)
|
||||
|
||||
if("radiation_decay_rate")
|
||||
radiation_decay_rate = text2num(value)
|
||||
|
||||
if ("panic_bunker")
|
||||
config.panic_bunker = 1
|
||||
|
||||
@@ -795,6 +812,8 @@ var/list/gamemode_cache = list()
|
||||
if("autostart_solars")
|
||||
config.autostart_solars = TRUE
|
||||
|
||||
|
||||
|
||||
else
|
||||
log_misc("Unknown setting in configuration: '[name]'")
|
||||
|
||||
|
||||
@@ -67,8 +67,10 @@ SUBSYSTEM_DEF(radiation)
|
||||
var/datum/radiation_source/source = value
|
||||
if(source.rad_power < .)
|
||||
continue // Already being affected by a stronger source
|
||||
|
||||
if(source.source_turf.z != T.z)
|
||||
continue // Radiation is not multi-z
|
||||
|
||||
if(source.respect_maint)
|
||||
var/area/A = T.loc
|
||||
if(A.flags & RAD_SHIELDED)
|
||||
@@ -77,9 +79,10 @@ SUBSYSTEM_DEF(radiation)
|
||||
var/dist = get_dist(source.source_turf, T)
|
||||
if(dist > source.range)
|
||||
continue // Too far to possibly affect
|
||||
|
||||
if(source.flat)
|
||||
. = max(., source.rad_power)
|
||||
continue // No need to ray trace for flat field
|
||||
. += source.rad_power
|
||||
continue // No need to ray trace for flat field
|
||||
|
||||
// Okay, now ray trace to find resistence!
|
||||
var/turf/origin = source.source_turf
|
||||
@@ -88,13 +91,23 @@ SUBSYSTEM_DEF(radiation)
|
||||
origin = get_step_towards(origin, T) //Raytracing
|
||||
if(!resistance_cache[origin]) //Only get the resistance if we don't already know it.
|
||||
origin.calc_rad_resistance()
|
||||
|
||||
if(origin.cached_rad_resistance)
|
||||
working = round((working / (origin.cached_rad_resistance * config.radiation_resistance_multiplier)), 0.1)
|
||||
if((working <= .) || (working <= RADIATION_THRESHOLD_CUTOFF))
|
||||
break // Already affected by a stronger source (or its zero...)
|
||||
. = max((working / (dist ** 2)), .) //Butchered version of the inverse square law. Works for this purpose
|
||||
if(. <= RADIATION_THRESHOLD_CUTOFF)
|
||||
. = 0
|
||||
if(config.radiation_resistance_calc_mode == RAD_RESIST_CALC_DIV)
|
||||
working = round((working / (origin.cached_rad_resistance * config.radiation_resistance_multiplier)), 0.01)
|
||||
else if(config.radiation_resistance_calc_mode == RAD_RESIST_CALC_SUB)
|
||||
working = round((working - (origin.cached_rad_resistance * config.radiation_resistance_multiplier)), 0.01)
|
||||
|
||||
if(working <= config.radiation_lower_limit) // Too far from this source
|
||||
working = 0 // May as well be 0
|
||||
break
|
||||
|
||||
// Accumulate radiation from all sources in range, not just the biggest.
|
||||
// Shouldn't really ever have practical uses, but standing in a room literally made from uranium is more dangerous than standing next to a single uranium vase
|
||||
. += working / (dist ** 2)
|
||||
|
||||
if(. <= config.radiation_lower_limit)
|
||||
. = 0
|
||||
|
||||
// Add a radiation source instance to the repository. It will override any existing source on the same turf.
|
||||
/datum/controller/subsystem/radiation/proc/add_source(var/datum/radiation_source/S)
|
||||
|
||||
Reference in New Issue
Block a user