Skip to content

Commit

Permalink
TGS Test Merge (#22169)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yogbot-13 committed Jun 4, 2024
2 parents b385182 + 6954ffb commit 74e71d1
Show file tree
Hide file tree
Showing 54 changed files with 2,861 additions and 26 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ GLOBAL_LIST_INIT(atmos_adjacent_savings, list(0,0))
#define LAVALAND_DEFAULT_ATMOS "o2=14;n2=23;TEMP=300"
#define ICEMOON_DEFAULT_ATMOS "o2=14;n2=23;TEMP=180"
#define JUNGLELAND_DEFAULT_ATMOS "o2=44;n2=164;TEMP=300" //yogs edit
#define OCEAN_DEFAULT_ATMOS "o2=10;co2=10;TEMP=293.15"

//ATMOSIA GAS MONITOR TAGS
#define ATMOS_GAS_MONITOR_INPUT_O2 "o2_in"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@
#define COMSIG_ATOM_SECONDARY_TOOL_ACT(tooltype) "tool_secondary_act_[tooltype]"
// We have the same returns here as COMSIG_ATOM_TOOL_ACT
// #define COMPONENT_BLOCK_TOOL_ATTACK (1<<0)
#define COMSIG_ATOM_DOOR_OPEN "atom_door_open"
10 changes: 10 additions & 0 deletions code/__DEFINES/dcs/signals/signals_turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,13 @@
#define COMSIG_TURF_IGNITED "turf_ignited"
///Prevents hotspots and turf fires
#define SUPPRESS_FIRE (1<<0)

///called on liquid creation
#define COMSIG_TURF_LIQUIDS_CREATION "turf_liquids_creation"

#define COMSIG_TURF_MOB_FALL "turf_mob_fall"

///this is called whenever a turf is destroyed
#define COMSIG_TURF_DESTROY "turf_destroy"
///this is called whenever a turfs air is updated
#define COMSIG_TURF_UPDATE_AIR "turf_air_change"
4 changes: 4 additions & 0 deletions code/__DEFINES/icon_smoothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ DEFINE_BITFIELD(smoothing_junction, list(
#define SMOOTH_GROUP_BAMBOO_WALLS S_TURF(17) //![/turf/closed/wall/mineral/bamboo, /obj/structure/falsewall/bamboo]
#define SMOOTH_GROUP_PLASTINUM_WALLS S_TURF(18) //![turf/closed/indestructible/riveted/plastinum]
#define SMOOTH_GROUP_CLOCKWORK_WALLS S_TURF(19) //![/turf/closed/wall/clockwork, /obj/structure/falsewall/brass]
#define SMOOTH_GROUP_ELEVATED_PLASTEEL S_TURF(20)
#define SMOOTH_GROUP_LOWERED_PLASTEEL S_TURF(21)

#define SMOOTH_GROUP_PAPERFRAME S_OBJ(21) ///obj/structure/window/paperframe, /obj/structure/mineral_door/paperframe

Expand Down Expand Up @@ -203,6 +205,8 @@ DEFINE_BITFIELD(smoothing_junction, list(

#define SMOOTH_GROUP_GAS_TANK S_OBJ(72)

#define SMOOTH_GROUP_WATER S_OBJ(73) ///obj/effect/abstract/liquid_turf


/// Performs the work to set smoothing_groups and canSmoothWith.
/// An inlined function used in both turf/Initialize and atom/Initialize.
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/movespeed_modification.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@
#define MOVESPEED_ID_RESIN_FOAM "RESIN_FOAM"

#define MOVESPEED_ID_SYNTH_SUSPICION "SYNTH_SUSPICION"

#define MOVESPEED_ID_LIQUID "LIQUID"
10 changes: 10 additions & 0 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,13 @@
//Wardrobe callback master list indexes
#define WARDROBE_CALLBACK_INSERT 1
#define WARDROBE_CALLBACK_REMOVE 2

///liquid defines
#define SSLIQUIDS_RUN_TYPE_TURFS 1
#define SSLIQUIDS_RUN_TYPE_GROUPS 2
#define SSLIQUIDS_RUN_TYPE_IMMUTABLES 3
#define SSLIQUIDS_RUN_TYPE_EVAPORATION 4
#define SSLIQUIDS_RUN_TYPE_FIRE 5
#define SSLIQUIDS_RUN_TYPE_OCEAN 6
#define SSLIQUIDS_RUN_TYPE_TEMPERATURE 7
#define SSLIQUIDS_RUN_TYPE_CACHED_EDGES 8
2 changes: 1 addition & 1 deletion code/__DEFINES/turfs.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define CHANGETURF_DEFER_CHANGE (1<<0)
#define CHANGETURF_IGNORE_AIR (1<<1) // This flag prevents changeturf from gathering air from nearby turfs to fill the new turf with an approximation of local air
#define CHANGETURF_FORCEOP (1<<2)
#define CHANGETURF_SKIP (1<<3) // A flag for PlaceOnTop to just instance the new turf instead of calling ChangeTurf. Used for uninitialized turfs NOTHING ELSE
#define CHANGETURF_SKIP (1<<3) // A flag for place_on_top to just instance the new turf instead of calling ChangeTurf. Used for uninitialized turfs NOTHING ELSE
#define CHANGETURF_INHERIT_AIR (1<<4) // Inherit air from previous turf. Implies CHANGETURF_IGNORE_AIR
#define CHANGETURF_RECALC_ADJACENT (1<<5) //Immediately recalc adjacent atmos turfs instead of queuing.
#define CHANGETURF_TRAPDOOR_INDUCED (1<<6) // Caused by a trapdoor, for trapdoor to know that this changeturf was caused by itself
Expand Down
86 changes: 86 additions & 0 deletions code/__DEFINES/{yogs_defines}/liquids.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#define WATER_HEIGH_DIFFERENCE_SOUND_CHANCE 50
#define WATER_HEIGH_DIFFERENCE_DELTA_SPLASH 7 //Delta needed for the splash effect to be made in 1 go

#define REQUIRED_MEMBER_PROCESSES 10

#define REQUIRED_EVAPORATION_PROCESSES 20
#define EVAPORATION_CHANCE 50

#define REQUIRED_FIRE_PROCESSES 10
#define REQUIRED_FIRE_POWER_PER_UNIT 5
#define FIRE_BURN_PERCENT 10

#define REQUIRED_OCEAN_PROCESSES 5

#define PARTIAL_TRANSFER_AMOUNT 0.3

#define LIQUID_MUTUAL_SHARE 1
#define LIQUID_NOT_MUTUAL_SHARE 2

#define LIQUID_GIVER 1
#define LIQUID_TAKER 2

//Required amount of a reagent to be simulated on turf exposures from liquids (to prevent gaming the system with cheap dillutions)
#define LIQUID_REAGENT_THRESHOLD_TURF_EXPOSURE 5

//Threshold at which the difference of height makes us need to climb/blocks movement/allows to fall down
#define TURF_HEIGHT_BLOCK_THRESHOLD 20

#define LIQUID_HEIGHT_DIVISOR 10

#define ONE_LIQUIDS_HEIGHT LIQUID_HEIGHT_DIVISOR

#define LIQUID_ATTRITION_TO_STOP_ACTIVITY 2

//Percieved heat capacity for calculations with atmos sharing
#define REAGENT_HEAT_CAPACITY 5

#define LIQUID_STATE_PUDDLE 1
#define LIQUID_STATE_ANKLES 2
#define LIQUID_STATE_WAIST 3
#define LIQUID_STATE_SHOULDERS 4
#define LIQUID_STATE_FULLTILE 5
#define TOTAL_LIQUID_STATES 5
#define LYING_DOWN_SUBMERGEMENT_STATE_BONUS 2

#define LIQUID_STATE_FOR_HEAT_EXCHANGERS LIQUID_STATE_WAIST

#define LIQUID_ANKLES_LEVEL_HEIGHT 8
#define LIQUID_WAIST_LEVEL_HEIGHT 19
#define LIQUID_SHOULDERS_LEVEL_HEIGHT 29
#define LIQUID_FULLTILE_LEVEL_HEIGHT 39

#define LIQUID_FIRE_STATE_NONE 0
#define LIQUID_FIRE_STATE_SMALL 1
#define LIQUID_FIRE_STATE_MILD 2
#define LIQUID_FIRE_STATE_MEDIUM 3
#define LIQUID_FIRE_STATE_HUGE 4
#define LIQUID_FIRE_STATE_INFERNO 5

//Threshold at which we "choke" on the water, instead of holding our breath
#define OXYGEN_DAMAGE_CHOKING_THRESHOLD 15

#define IMMUTABLE_LIQUID_SHARE 1

#define LIQUID_RECURSIVE_LOOP_SAFETY 255

//Height at which we consider the tile "full" and dont drop liquids on it from the upper Z level
#define LIQUID_HEIGHT_CONSIDER_FULL_TILE 50

#define LIQUID_GROUP_DECAY_TIME 3

//Scaled with how much a person is submerged
#define SUBMERGEMENT_REAGENTS_TOUCH_AMOUNT 60

#define CHOKE_REAGENTS_INGEST_ON_FALL_AMOUNT 4

#define CHOKE_REAGENTS_INGEST_ON_BREATH_AMOUNT 2

#define SUBMERGEMENT_PERCENT(carbon, liquids) min(1,(!MOBILITY_STAND ? liquids.liquid_group.group_overlay_state+LYING_DOWN_SUBMERGEMENT_STATE_BONUS : liquids.liquid_group.group_overlay_state)/TOTAL_LIQUID_STATES)

#define LIQUID_PROTECTION "liquid_protection"

GLOBAL_LIST_INIT(liquid_blacklist, list(
/datum/reagent/sorium,
/datum/reagent/liquid_dark_matter
))
2 changes: 1 addition & 1 deletion code/game/area/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
CRASH("Bad op: area/drop_location() called")

/// A hook so areas can modify the incoming args (of what??)
/area/proc/PlaceOnTopReact(list/new_baseturfs, turf/fake_turf_type, flags)
/area/proc/place_on_topReact(list/new_baseturfs, turf/fake_turf_type, flags)
return flags

/// Called when a living mob that spawned here, joining the round, receives the player client.
Expand Down
2 changes: 1 addition & 1 deletion code/game/area/areas/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
///list of miners & their mining points from gems to be given once all exports are processed, used by supply shuttles
var/list/gem_payout = list()

/area/shuttle/PlaceOnTopReact(list/new_baseturfs, turf/fake_turf_type, flags)
/area/shuttle/place_on_topReact(list/new_baseturfs, turf/fake_turf_type, flags)
. = ..()
if(length(new_baseturfs) > 1 || fake_turf_type)
return // More complicated larger changes indicate this isn't a player
Expand Down
2 changes: 2 additions & 0 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,7 @@
locked = !locked
if(welded)
welded = !welded
SEND_SIGNAL(src, COMSIG_AIRLOCK_OPEN, forced)
operating = TRUE
update_icon(state = AIRLOCK_OPENING, override = TRUE)
sleep(0.1 SECONDS)
Expand All @@ -1389,6 +1390,7 @@
if(delayed_close_requested)
delayed_close_requested = FALSE
addtimer(CALLBACK(src, PROC_REF(close)), 1)
SEND_SIGNAL(src, COMSIG_ATOM_DOOR_OPEN) /// this is different because we need one that covers all doors
return TRUE


Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@
operating = FALSE
air_update_turf()
update_freelook_sight()
SEND_SIGNAL(src, COMSIG_ATOM_DOOR_OPEN)
if(autoclose)
spawn(autoclose)
close()
Expand Down
4 changes: 2 additions & 2 deletions code/game/turfs/baseturfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
/// Places a turf on top - for map loading
/turf/proc/load_on_top(turf/added_layer, flags)
var/area/our_area = get_area(src)
flags = our_area.PlaceOnTopReact(list(baseturfs), added_layer, flags)
flags = our_area.place_on_topReact(list(baseturfs), added_layer, flags)

if(flags & CHANGETURF_SKIP) // We haven't been initialized
if(flags_1 & INITIALIZED_1)
stack_trace("CHANGETURF_SKIP was used in a PlaceOnTop call for a turf that's initialized. This is a mistake. [src]([type])")
stack_trace("CHANGETURF_SKIP was used in a place_on_top call for a turf that's initialized. This is a mistake. [src]([type])")
assemble_baseturfs()

var/turf/new_turf
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/open/_open.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
* This replaces the current turf if it is plating and is passed plating, is tile and is passed tile.
* It places the new turf on top of itself if it is plating and is passed a tile.
* It also replaces the turf if it is tile and is passed plating, essentially destroying the over turf.
* Flags argument is passed directly to ChangeTurf or PlaceOnTop
* Flags argument is passed directly to ChangeTurf or place_on_top
*/
/turf/open/proc/replace_floor(turf/open/new_floor_path, flags)
if (!overfloor_placed && initial(new_floor_path.overfloor_placed))
Expand Down
1 change: 1 addition & 0 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ GLOBAL_LIST_EMPTY(station_turfs)

if(length(vis_contents))
vis_contents.Cut()
SEND_SIGNAL(src, COMSIG_TURF_DESTROY)

/// WARNING WARNING
/// Turfs DO NOT lose their signals when they get replaced, REMEMBER THIS
Expand Down
4 changes: 3 additions & 1 deletion code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ GLOBAL_LIST_INIT(admin_verbs_fun, list(
/client/proc/admin_away,
/client/proc/centcom_podlauncher,/*Open a window to launch a Supplypod and configure it or it's contents*/
/client/proc/load_json_admin_event,
/client/proc/event_role_manager
/client/proc/event_role_manager,
/client/proc/spawn_liquid,
/client/proc/remove_liquid
))
GLOBAL_PROTECT(admin_verbs_fun)
GLOBAL_LIST_INIT(admin_verbs_spawn, list(/datum/admins/proc/spawn_atom, /datum/admins/proc/podspawn_atom, /datum/admins/proc/spawn_cargo, /datum/admins/proc/spawn_objasmob, /client/proc/respawn_character, /datum/admins/proc/beaker_panel))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mapping/reader.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
* - y_upper: The maximum y coordinate to load
* - z_lower: The minimum z coordinate to load
* - z_upper: The maximum z coordinate to load
* - place_on_top: Whether to use /turf/proc/PlaceOnTop rather than /turf/proc/ChangeTurf
* - place_on_top: Whether to use /turf/proc/place_on_top rather than /turf/proc/ChangeTurf
* - new_z: If true, a new z level will be created for the map
*/
/proc/load_map(
Expand Down
16 changes: 16 additions & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
return ..()

/mob/living/proc/ZImpactDamage(turf/T, levels)
SEND_SIGNAL(T, COMSIG_TURF_MOB_FALL, src)
visible_message(span_danger("[src] crashes into [T] with a sickening noise!"))
adjustBruteLoss((levels * 5) ** 1.5)
Knockdown(levels * 50)
Expand Down Expand Up @@ -633,6 +634,21 @@
cure_fakedeath()
SEND_SIGNAL(src, COMSIG_LIVING_POST_FULLY_HEAL)

/mob/living/proc/do_strange_reagent_revival()
if(iscarbon(src))
var/mob/living/carbon/C = src
for(var/organ in C.internal_organs)
var/obj/item/organ/O = organ
O.setOrganDamage(0)
adjustBruteLoss(-100)
adjustFireLoss(-100)
adjustOxyLoss(-200, 0)
adjustToxLoss(-200, 0, TRUE)
updatehealth()
if(revive())
emote("gasp")
log_combat(src, src, "revived", src)

//proc called by revive(), to check if we can actually ressuscitate the mob (we don't want to revive him and have him instantly die again)
/mob/living/proc/can_be_revived()
. = 1
Expand Down
4 changes: 2 additions & 2 deletions code/modules/reagents/chemistry/holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -742,10 +742,10 @@
return TRUE

/// Like add_reagent but you can enter a list. Format it like this: list(/datum/reagent/toxin = 10, "beer" = 15)
/datum/reagents/proc/add_reagent_list(list/list_reagents, list/data=null)
/datum/reagents/proc/add_reagent_list(list/list_reagents, list/data=null, _no_react = FALSE)
for(var/r_id in list_reagents)
var/amt = list_reagents[r_id]
add_reagent(r_id, amt, data)
add_reagent(r_id, amt, data, no_react = _no_react)

/// Remove a specific reagent
/datum/reagents/proc/remove_reagent(reagent, amount, safety)//Added a safety check for the trans_id_to
Expand Down
22 changes: 20 additions & 2 deletions code/modules/reagents/chemistry/reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,23 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
var/harmful = FALSE
/// The default reagent container for the reagent. Currently only used for crafting icon/displays.
var/obj/item/reagent_containers/default_container = /obj/item/reagent_containers/glass/bottle

/// Are we from a material? We might wanna know that for special stuff. Like metalgen. Is replaced with a ref of the material on New()

///Whether it will evaporate if left untouched on a liquids simulated puddle
var/evaporates = TRUE
///How much fire power does the liquid have, for burning on simulated liquids. Not enough fire power/unit of entire mixture may result in no fire
var/liquid_fire_power = 0
///How fast does the liquid burn on simulated turfs, if it does
var/liquid_fire_burnrate = 0
///Whether a fire from this requires oxygen in the atmosphere
var/fire_needs_oxygen = TRUE
///The opacity of the chems used to determine the alpha of liquid turfs
var/opacity = 175
///The rate of evaporation in units per call
var/evaporation_rate = 1
/// do we have a turf exposure (used to prevent liquids doing un-needed processes)
var/turf_exposure = FALSE
/// are we slippery?
var/slippery = TRUE

/datum/reagent/Destroy() // This should only be called by the holder, so it's already handled clearing its references
. = ..()
Expand Down Expand Up @@ -149,6 +164,9 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
/datum/reagent/proc/on_ex_act(severity)
return

/datum/reagent/proc/evaporate(turf/exposed_turf, reac_volume)
return

/// Called if the reagent has passed the overdose threshold and is set to be triggering overdose effects
/datum/reagent/proc/overdose_process(mob/living/M)
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
metabolization_rate = 0.5 * REAGENTS_METABOLISM
var/boozepwr = 65 //Higher numbers equal higher hardness, higher hardness equals more intense alcohol poisoning
accelerant_quality = 5
liquid_fire_power = 10
/*
Boozepwr Chart
Note that all higher effects of alcohol poisoning will inherit effects for smaller amounts (i.e. light poisoning inherts from slight poisoning)
Expand Down
15 changes: 1 addition & 14 deletions code/modules/reagents/chemistry/reagents/medicine_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -934,20 +934,7 @@
M.do_jitter_animation(10)
addtimer(CALLBACK(M, TYPE_PROC_REF(/mob/living/carbon, do_jitter_animation), 10), 40) //jitter immediately, then again after 4 and 8 seconds
addtimer(CALLBACK(M, TYPE_PROC_REF(/mob/living/carbon, do_jitter_animation), 10), 80)
sleep(10 SECONDS) //so the ghost has time to re-enter
if(iscarbon(M))
var/mob/living/carbon/C = M
for(var/organ in C.internal_organs)
var/obj/item/organ/O = organ
O.setOrganDamage(0)
M.adjustBruteLoss(-100)
M.adjustFireLoss(-100)
M.adjustOxyLoss(-200, 0)
M.adjustToxLoss(-200, 0, TRUE)
M.updatehealth()
if(M.revive())
M.emote("gasp")
log_combat(M, M, "revived", src)
addtimer(CALLBACK(M, TYPE_PROC_REF(/mob/living, do_strange_reagent_revival)), 10 SECONDS)
..()

/datum/reagent/medicine/strange_reagent/on_mob_life(mob/living/carbon/M)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/reagents/chemistry/reagents/other_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,7 @@
glass_desc = "Dr. Gibb. Not as dangerous as the glass_name might imply."
accelerant_quality = 10
compatible_biotypes = ALL_BIOTYPES
liquid_fire_power = 25

/datum/reagent/fuel/reaction_mob(mob/living/M, methods=TOUCH, reac_volume)//Splashing people with welding fuel to make them easy to ignite!
if(methods & (TOUCH|VAPOR))
Expand Down Expand Up @@ -1747,6 +1748,7 @@
color = "#C8A5DC"
taste_description = "oil"
compatible_biotypes = ALL_BIOTYPES
liquid_fire_power = 15

/datum/reagent/oil/on_mob_life(mob/living/carbon/M)
M.adjustFireLoss(-2*REM, FALSE, FALSE, BODYPART_ROBOTIC)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
self_consuming = TRUE
accelerant_quality = 20
compatible_biotypes = ALL_BIOTYPES
liquid_fire_power = 1

/datum/reagent/napalm/on_mob_life(mob/living/carbon/M)
M.adjust_fire_stacks(1)
Expand Down
Binary file added goon/icons/turfs/outdoors.dmi
Binary file not shown.
Loading

0 comments on commit 74e71d1

Please sign in to comment.