Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BOUNTY] Liquids try #3: Return of the pee #22169

Merged
merged 30 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5138fa3
pee
ToasterBiome Jun 3, 2024
6954ffb
strange reagent fix
ToasterBiome Jun 4, 2024
616c5e5
Merge remote-tracking branch 'upstream/master' into p3trotp
ToasterBiome Jun 4, 2024
282bef0
smell mop
ToasterBiome Jun 4, 2024
0cde5bb
throwing?
ToasterBiome Jun 4, 2024
b0ea29d
evaporation + more effects
ToasterBiome Jun 4, 2024
e230518
Update pyrotechnic_reagents.dm
ToasterBiome Jun 4, 2024
6fb6126
doors/airlocks
ToasterBiome Jun 4, 2024
3705cbc
smell mop
ToasterBiome Jun 6, 2024
77b6920
Update liquid_groups.dm
ToasterBiome Jun 6, 2024
6174a40
borbop changes
ToasterBiome Jul 12, 2024
5247dc2
breathing in liquids
ToasterBiome Jul 12, 2024
aa4ba9c
Merge remote-tracking branch 'upstream/master' into p3trotp
ToasterBiome Jul 12, 2024
cdb7ad2
fixes liquids going into dense tiles
ToasterBiome Jul 22, 2024
65dd352
increases mopcap to 45
ToasterBiome Jul 22, 2024
79d5f97
Merge remote-tracking branch 'upstream/master' into p3trotp
ToasterBiome Jul 22, 2024
6f5198a
liquids fixes
ToasterBiome Jul 22, 2024
9323f52
lol
ToasterBiome Jul 22, 2024
afec315
more liquid stuff
ToasterBiome Jul 22, 2024
d5eef1c
fixes this
ToasterBiome Aug 1, 2024
64a0261
more changes
ToasterBiome Aug 1, 2024
f70fb3b
fix all this stupid stuff
ToasterBiome Aug 1, 2024
14276cd
fix phantom pixel
ToasterBiome Aug 1, 2024
257d21d
liquid pump fix
ToasterBiome Aug 2, 2024
80c339e
gives you better ability to scoop things up
ToasterBiome Aug 2, 2024
9751936
fix liquid pump
ToasterBiome Aug 6, 2024
3416d8d
BUUURN BABY BURN + blud
ToasterBiome Aug 6, 2024
f948639
slipping reaction checking
ToasterBiome Aug 7, 2024
d46adfd
change liquid push reaction
ToasterBiome Aug 7, 2024
13fb446
removes liquid_fire_power
ToasterBiome Aug 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 3 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,6 @@

///reduces the cooldown of all used /datum/action/cooldown by 25%
#define TRAIT_FAST_COOLDOWNS "short_spell_cooldowns"

/// One can breath under water, you get me?
#define TRAIT_WATER_BREATHING "water_breathing"
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
16 changes: 16 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 Expand Up @@ -1418,6 +1420,20 @@
if(killthis)
SSexplosions.med_mov_atom += killthis

SEND_SIGNAL(src, COMSIG_AIRLOCK_CLOSE, forced)

var/turf/open/open_turf = get_turf(src)
if(open_turf.liquids)
var/datum/liquid_group/turfs_group = open_turf.liquids.liquid_group
turfs_group.remove_from_group(open_turf)
qdel(open_turf.liquids)
turfs_group.try_split(open_turf)
for(var/dir in GLOB.cardinals)
var/turf/open/direction_turf = get_step(open_turf, dir)
if(!isopenturf(direction_turf) || !direction_turf.liquids)
continue
turfs_group.check_edges(direction_turf)

operating = TRUE
update_icon(state = AIRLOCK_CLOSING, override = TRUE)
layer = CLOSED_DOOR_LAYER
Expand Down
14 changes: 14 additions & 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 All @@ -399,6 +400,19 @@
operating = TRUE

do_animate("closing")

var/turf/open/open_turf = get_turf(src)
if(open_turf.liquids)
var/datum/liquid_group/turfs_group = open_turf.liquids.liquid_group
turfs_group.remove_from_group(open_turf)
qdel(open_turf.liquids)
turfs_group.try_split(open_turf)
for(var/dir in GLOB.cardinals)
var/turf/open/direction_turf = get_step(open_turf, dir)
if(!isopenturf(direction_turf) || !direction_turf.liquids)
continue
turfs_group.check_edges(direction_turf)

layer = closingLayer
if(air_tight)
density = TRUE
Expand Down
11 changes: 11 additions & 0 deletions code/game/objects/items/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,14 @@
user.gib()
playsound(src, 'sound/items/eatfood.ogg', 50, 1, -1)
return MANUAL_SUICIDE

/obj/item/choice_beacon/liquids
name = "Free Liquid Pump Kit"
desc = "Kit containing a free liquid pump from SPAAAACE."
icon = 'icons/obj/device.dmi'
icon_state = "gangtool-blue"
item_state = "radio"

// LIQUIDS TM REMOVE THIS
/obj/item/choice_beacon/liquids/generate_display_names()
return list("Liquid Pump" = /obj/structure/liquid_pump)
35 changes: 34 additions & 1 deletion code/game/objects/items/mop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
resistance_flags = FLAMMABLE
var/mopping = 0
var/mopcount = 0
var/mopcap = 15
var/mopcap = 45
var/mopspeed = 15
force_string = "robust... against germs"
var/insertable = TRUE

/obj/item/mop/Initialize(mapload)
. = ..()
create_reagents(mopcap, REFILLABLE)
AddComponent(/datum/component/liquids_interaction, TYPE_PROC_REF(/obj/item/mop, attack_on_liquids_turf))


/obj/item/mop/proc/clean(turf/A)
Expand All @@ -46,6 +47,11 @@
return

if(T)
// Disable normal cleaning if there are liquids.
if(T.liquids)
to_chat(user, span_warning("It would be quite difficult to clean this with a pool of liquids on top!"))
return

user.visible_message("[user] begins to clean \the [T] with [src].", span_notice("You begin to clean \the [T] with [src]..."))

var/realspeed = mopspeed
Expand Down Expand Up @@ -73,6 +79,33 @@
to_chat(user, span_warning("You are unable to fit your [name] into the [J.name]."))
return

/obj/item/mop/proc/attack_on_liquids_turf(obj/item/mop/the_mop, turf/target, mob/user, obj/effect/abstract/liquid_turf/liquids)
if(!user.Adjacent(target))
return FALSE
var/free_space = mopcap - reagents.total_volume
var/speed_mult = 1
var/datum/liquid_group/targeted_group = target?.liquids?.liquid_group
while(!QDELETED(targeted_group))
if(speed_mult >= 0.2)
speed_mult -= 0.05
if(free_space <= 0)
to_chat(user, span_warning("You cant absorb any more liquid with \the [src]!"))
return TRUE
if(!do_after(user, src.mopspeed * speed_mult, target = target))
break
if(the_mop.reagents.total_volume == the_mop.mopcap)
to_chat(user, span_warning("You cant absorb any more liquid with \the [src]!"))
break
if(targeted_group?.reagents_per_turf)
targeted_group?.trans_to_seperate_group(the_mop.reagents, min(targeted_group?.reagents_per_turf, 5))
to_chat(user, span_notice("You soak up some liquids with \the [src]."))
else if(!QDELETED(target?.liquids?.liquid_group))
targeted_group = target.liquids.liquid_group
else
break
user.changeNext_move(CLICK_CD_MELEE)
return TRUE

/obj/item/mop/cyborg
insertable = FALSE

Expand Down
24 changes: 24 additions & 0 deletions code/game/objects/structures/mop_bucket.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,30 @@
return
return ..()

/obj/structure/mop_bucket/attackby_secondary(obj/item/weapon, mob/user, params)
if(istype(weapon, /obj/item/mop))
if(!weapon.reagents.total_volume)
if(weapon.reagents.total_volume >= weapon.reagents.maximum_volume)
balloon_alert(user, "mop is already soaked!")
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
if(!reagents.total_volume < 1)
balloon_alert(user, "mop bucket is empty!")
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
reagents.trans_to(weapon, weapon.reagents.maximum_volume, transfered_by = user)
balloon_alert(user, "wet mop")
playsound(src, 'sound/effects/slosh.ogg', 25, vary = TRUE)
else
var/obj/item/mop/attacked_mop = weapon
to_chat(user, "You completly wring out the [attacked_mop.name] into the waste bucket of the cart.")
attacked_mop.reagents.remove_all(attacked_mop.mopcap)

if(istype(weapon, /obj/item/reagent_containers) || istype(weapon, /obj/item/mop))
update_appearance(UPDATE_OVERLAYS)
return SECONDARY_ATTACK_CONTINUE_CHAIN // skip attack animations when refilling cart

return SECONDARY_ATTACK_CONTINUE_CHAIN


/obj/structure/mopbucket/update_overlays()
. = ..()
if(reagents.total_volume > 0)
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
Loading
Loading