Skip to content

Commit

Permalink
fixes fire and adds auxmos fusion
Browse files Browse the repository at this point in the history
  • Loading branch information
covertcorvid committed Aug 12, 2024
1 parent 5348b78 commit dc3806d
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 34 deletions.
Binary file modified auxmos.dll
Binary file not shown.
Binary file modified auxtools/auxmos.dll
Binary file not shown.
49 changes: 35 additions & 14 deletions code/modules/atmospherics/environmental/LINDA_fire.dm
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@

#define IGNITE_TURF_LOW_POWER 8
#define IGNITE_TURF_HIGH_POWER 22

/atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return null


/turf/open/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
//if(prob(flammability * 100))
// ignite_turf(rand(IGNITE_TURF_LOW_POWER,IGNITE_TURF_HIGH_POWER))
return ..()

/turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
return


/turf/open/hotspot_expose(exposed_temperature, exposed_volume, soh)
if(!air)
return

if (air.get_oxidation_power(exposed_temperature) < 0.5)
if (air.get_moles(GAS_O2) < 0.5 || air.get_moles(GAS_HYPERNOB) > REACTION_OPPRESSION_THRESHOLD)
return
var/has_fuel = (air.get_moles(GAS_PLASMA) + air.get_moles(GAS_CONSTRICTED_PLASMA)) > 0.5 || air.get_moles(GAS_TRITIUM) > 0.5 || air.get_fuel_amount(exposed_temperature) > 0.5 //NSV13 - constricted plasma

var/has_fuel = (air.get_moles(GAS_PLASMA) + air.get_moles(GAS_CONSTRICTED_PLASMA)) > 0.5 || air.get_moles(GAS_TRITIUM) > 0.5

if(active_hotspot)
if(soh)
if(has_fuel)
Expand Down Expand Up @@ -42,10 +49,9 @@

var/volume = 125
var/temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST
var/just_spawned = TRUE
var/bypassing = FALSE
var/visual_update_tick = 0
var/first_cycle = TRUE


/obj/effect/hotspot/Initialize(mapload, starting_volume, starting_temperature)
. = ..()
Expand All @@ -54,7 +60,8 @@
volume = starting_volume
if(!isnull(starting_temperature))
temperature = starting_temperature
perform_exposure()
if(!perform_exposure())
return INITIALIZE_HINT_QDEL
setDir(pick(GLOB.cardinals))
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
Expand All @@ -64,13 +71,17 @@
/obj/effect/hotspot/proc/perform_exposure()
var/turf/open/location = loc
if(!istype(location) || !(location.air))
return
return FALSE

//if(SEND_SIGNAL(location, COMSIG_TURF_HOTSPOT_EXPOSE) & SUPPRESS_FIRE)
// return FALSE

if(location.active_hotspot != src)
qdel(location.active_hotspot)

location.active_hotspot = src

bypassing = !first_cycle && volume > CELL_VOLUME*0.95 || location.air.return_temperature() > FUSION_TEMPERATURE_THRESHOLD
if(first_cycle)
first_cycle = FALSE
bypassing = !just_spawned && (volume > CELL_VOLUME*0.95)

if(bypassing)
volume = location.air.reaction_results["fire"]*FIRE_GROWTH_RATE
Expand All @@ -88,7 +99,7 @@
var/atom/AT = A
if(!QDELETED(AT) && AT != src) // It's possible that the item is deleted in temperature_expose
AT.fire_act(temperature, volume)
return
return TRUE

/obj/effect/hotspot/proc/gauss_lerp(x, x1, x2)
var/b = (x1 + x2) * 0.5
Expand Down Expand Up @@ -150,6 +161,10 @@

#define INSUFFICIENT(path) (location.air.get_moles(path) < 0.5)
/obj/effect/hotspot/process()
if(just_spawned)
just_spawned = FALSE
return

var/turf/open/location = loc
if(!istype(location))
qdel(src)
Expand All @@ -160,11 +175,15 @@
if((temperature < FIRE_MINIMUM_TEMPERATURE_TO_EXIST) || (volume <= 1))
qdel(src)
return
if(!location.air || location.air.get_oxidation_power() < 0.5 || (INSUFFICIENT(GAS_PLASMA) && INSUFFICIENT(GAS_TRITIUM) && INSUFFICIENT(GAS_CONSTRICTED_PLASMA) && location.air.get_fuel_amount() < 0.5)) //NSV13 - constricted plasma

//Not enough / nothing to burn
if(!location.air || (INSUFFICIENT(GAS_PLASMA) && INSUFFICIENT(GAS_TRITIUM)) && INSUFFICIENT(GAS_CONSTRICTED_PLASMA) || INSUFFICIENT(GAS_O2))
qdel(src)
return

perform_exposure()
if(!perform_exposure())
qdel(src)
return

if(bypassing)
icon_state = "3"
Expand Down Expand Up @@ -233,3 +252,5 @@
light_range = LIGHT_RANGE_FIRE

#undef INSUFFICIENT
#undef IGNITE_TURF_LOW_POWER
#undef IGNITE_TURF_HIGH_POWER
51 changes: 32 additions & 19 deletions code/modules/atmospherics/environmental/LINDA_turf_tile.dm
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
/turf
//conductivity is divided by 10 when interacting with air for balance purposes
var/thermal_conductivity = 0.05
///Amount of heat necessary to activate some atmos processes (there is a weird usage of this var because is compared directly to the temperature instead of heat energy)
var/heat_capacity = 1

//list of open turfs adjacent to us
var/list/atmos_adjacent_turfs
//bitfield of dirs in which we thermal conductivity is blocked
///bitfield of dirs in which we thermal conductivity is blocked
var/conductivity_blocked_directions = NONE

//used for mapping and for breathing while in walls (because that's a thing that needs to be accounted for...)
//string parsed by /datum/gas/proc/copy_from_turf
/**
* used for mapping and for breathing while in walls (because that's a thing that needs to be accounted for...)
* string parsed by /datum/gas/proc/copy_from_turf
* approximation of MOLES_O2STANDARD and MOLES_N2STANDARD pending byond allowing constant expressions to be embedded in constant strings
* If someone will place 0 of some gas there, SHIT WILL BREAK. Do not do that.
**/
var/initial_gas_mix = OPENTURF_DEFAULT_ATMOS
//approximation of MOLES_O2STANDARD and MOLES_N2STANDARD pending byond allowing constant expressions to be embedded in constant strings
// If someone will place 0 of some gas there, SHIT WILL BREAK. Do not do that.

/turf/open
//used for spacewind
///Pressure difference between two turfs
var/pressure_difference = 0
///Where the difference come from (from higher pressure to lower pressure)
var/pressure_direction = 0
var/turf/pressure_specific_target

///Our gas mix
var/datum/gas_mixture/turf/air

///If there is an active hotspot on us store a reference to it here
var/obj/effect/hotspot/active_hotspot
var/planetary_atmos = FALSE //air will revert to initial_gas_mix over time

var/list/atmos_overlay_types //gas IDs of current active gas overlays
/// air will slowly revert to initial_gas_mix
var/planetary_atmos = FALSE
/// once our paired turfs are finished with all other shares, do one 100% share
/// exists so things like space can ask to take 100% of a tile's gas
var/run_later = FALSE

///gas IDs of current active gas overlays
var/list/atmos_overlay_types
/// How much fuel this open turf provides to turf fires, and how easily they can be ignited in the first place. Can be negative to make fires die out faster.
var/flammability = 0.3
var/obj/effect/abstract/turf_fire/turf_fire
var/turf/pressure_specific_target

/turf/proc/should_conduct_to_space()
return get_z_base_turf() == /turf/open/space
Expand Down Expand Up @@ -157,6 +172,7 @@
UNSETEMPTY(new_overlay_types)
src.atmos_overlay_types = new_overlay_types

//called by auxmos, do not remove
/turf/open/proc/set_visuals(list/new_overlay_types)
if (atmos_overlay_types)
for(var/overlay in atmos_overlay_types-new_overlay_types) //doesn't remove overlays that would only be added
Expand Down Expand Up @@ -189,10 +205,8 @@
FD.emergency_pressure_stop()

/turf/proc/handle_decompression_floor_rip()
return

/turf/open/floor/handle_decompression_floor_rip(sum)
if(sum > 20 && prob(CLAMP(sum / 20, 0, 15)))
if(sum > 20 && prob(clamp(sum / 20, 0, 15)))
if(floor_tile)
new floor_tile(src)
make_plating()
Expand Down Expand Up @@ -227,18 +241,17 @@
M = thing
if (!M.anchored && !M.pulledby && M.last_high_pressure_movement_air_cycle < SSair.times_fired)
M.experience_pressure_difference(pressure_difference * multiplier, pressure_direction, 0, pressure_specific_target)
//if(pressure_difference > 100)
// new /obj/effect/temp_visual/dir_setting/space_wind(src, pressure_direction, clamp(round(sqrt(pressure_difference) * 2), 10, 255))

/atom/movable/var/pressure_resistance = 10
/atom/movable/var/last_high_pressure_movement_air_cycle = 0

/atom/movable/proc/experience_pressure_difference(pressure_difference, direction, pressure_resistance_prob_delta = 0, throw_target)
set waitfor = FALSE
if(SEND_SIGNAL(src, COMSIG_MOVABLE_PRE_PRESSURE_PUSH) & COMSIG_MOVABLE_BLOCKS_PRESSURE)
return

var/const/PROBABILITY_OFFSET = 40
var/const/PROBABILITY_BASE_PRECENT = 10
var/max_force = sqrt(pressure_difference)*(MOVE_FORCE_DEFAULT / 5)
set waitfor = 0
var/move_prob = 100
//NSV13 - depressurzation does not drag things upwards - caused infinite loops with objects being sucked out, then falling through openspace.
if(direction == UP)
Expand All @@ -248,14 +261,14 @@
if(pressure_resistance > 0)
move_prob = (pressure_difference/pressure_resistance*PROBABILITY_BASE_PRECENT)-PROBABILITY_OFFSET
move_prob += pressure_resistance_prob_delta
if(move_prob > PROBABILITY_OFFSET && prob(move_prob) && (move_resist != INFINITY) && (!anchored && (max_force >= (move_resist * MOVE_FORCE_PUSH_RATIO))) || (anchored && (max_force >= (move_resist * MOVE_FORCE_FORCEPUSH_RATIO))))
var/move_force = max_force * CLAMP(move_prob, 0, 100) / 100
if (move_prob > PROBABILITY_OFFSET && prob(move_prob) && (move_resist != INFINITY) && (!anchored && (max_force >= (move_resist * MOVE_FORCE_PUSH_RATIO))) || (anchored && (max_force >= (move_resist * MOVE_FORCE_FORCEPUSH_RATIO))))
var/move_force = max_force * clamp(move_prob, 0, 100) / 100
if(move_force > 6000)
// WALLSLAM HELL TIME OH BOY
var/turf/throw_turf = get_ranged_target_turf(get_turf(src), direction, round(move_force / 2000))
if(throw_target && (get_dir(src, throw_target) & direction))
throw_turf = get_turf(throw_target)
var/throw_speed = CLAMP(round(move_force / 3000), 1, 10)
var/throw_speed = clamp(round(move_force / 3000), 1, 10)
throw_at(throw_turf, move_force / 3000, throw_speed)
else
step(src, direction)
Expand Down
2 changes: 1 addition & 1 deletion dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export NODE_VERSION_PRECISE=18.14.2
export SPACEMAN_DMM_VERSION=suite-1.8

#auxmos version
export AUXMOS_VERSION=2.5.2-a
export AUXMOS_VERSION=2.5.2-b

# Python version for mapmerge and other tools
export PYTHON_VERSION=3.11.2
Binary file modified libauxmos.so
Binary file not shown.

0 comments on commit dc3806d

Please sign in to comment.