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

Updating from Neb dev #15

Closed
wants to merge 36 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
baa528c
Make ammo magazines lazy-initialize
out-of-phaze Feb 23, 2024
9ed8c48
Merge pull request #3730 from out-of-phaze/optimization/lazy-ammo
MistakeNot4892 Jun 18, 2024
702df7e
Automatic changelog generation for PR #3730 [ci skip]
NebulaSS13Bot Jun 18, 2024
84c4ca4
Move Heist gamemode into its own modpack
out-of-phaze Jun 16, 2024
88c4123
Genericize heist objectives
out-of-phaze Jun 16, 2024
20e8906
Move crossfire gamemode into modpack
out-of-phaze Jun 16, 2024
9c28f6f
Include Heist and mixed gamemode modpacks
out-of-phaze Jun 16, 2024
fdbd77b
Merge pull request #4114 from out-of-phaze/codequality/heist-modpack
MistakeNot4892 Jun 18, 2024
1185d44
Move Ninja antagonist and gamemode into a modpack
out-of-phaze Jun 15, 2024
c7e4dce
Merge pull request #4107 from out-of-phaze/codequality/ninja-modpack
MistakeNot4892 Jun 19, 2024
20d95a7
Fixes and expansions for skeletal limbs.
MistakeNot4892 Jun 18, 2024
be37949
Automatic changelog generation [ci skip]
NebulaSS13Bot Jun 19, 2024
112441a
Merge pull request #4122 from MistakeNot4892/feature/skellymans
out-of-phaze Jun 19, 2024
6297725
Make diagonal movement on by default
out-of-phaze Jun 19, 2024
febc7d6
Remove unnecessary uses of unsafe var access operator
out-of-phaze Jun 19, 2024
8d420a1
Added beggar knights to Shaded Hills.
MistakeNot4892 Jun 17, 2024
ae9a484
Expand DME validation to include modpacks
out-of-phaze Jun 16, 2024
0e5c2c1
Fix issues found in modpacks
out-of-phaze Jun 16, 2024
230d9ed
You can now dip items into turf liquids, wells and barrels.
MistakeNot4892 Jun 17, 2024
15deea6
Added debounce to on_reagent_change().
MistakeNot4892 Jun 17, 2024
45e8f30
Automatic changelog generation for PR #4120 [ci skip]
NebulaSS13Bot Jun 19, 2024
a959e3c
Automatic changelog generation [ci skip]
NebulaSS13Bot Jun 20, 2024
5590a2a
Added shrine and associated jobs to Shaded Hills.
MistakeNot4892 Jun 19, 2024
67f3291
Travel* back to travell*.
MistakeNot4892 Jun 20, 2024
4490e0d
Removed DNA and replaced it with mob_snapshot.
MistakeNot4892 Jun 20, 2024
94984e0
Merge pull request #3882 from MistakeNot4892/removal/dna
out-of-phaze Jun 20, 2024
b04da0c
Updating comment and adding migration for human repath.
MistakeNot4892 Jun 16, 2024
14c99d4
Repaths /mob/living/carbon/human to /mob/living/human.
MistakeNot4892 Jun 20, 2024
811438c
Add log wall frames/low walls
out-of-phaze Jun 20, 2024
3895efb
Add low log walls to fantasy map
out-of-phaze Jun 20, 2024
1e9a927
Merge pull request #4113 from MistakeNot4892/rework/carbon_final_removal
out-of-phaze Jun 20, 2024
2728152
Move Revolution gamemode into a modpack
out-of-phaze Jun 20, 2024
a5a4834
Merge pull request #4132 from out-of-phaze/codequality/rev-modpack
MistakeNot4892 Jun 20, 2024
b9133ff
Merge pull request #4130 from out-of-phaze/feature/low-log
MistakeNot4892 Jun 20, 2024
e64a30b
Merge pull request #4127 from out-of-phaze/tweak/default-diagonal
MistakeNot4892 Jun 21, 2024
17c8eef
Merge pull request #4126 from MistakeNot4892/feature/shrine
out-of-phaze Jun 21, 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
Prev Previous commit
Next Next commit
Added debounce to on_reagent_change().
  • Loading branch information
MistakeNot4892 authored and comma committed Jun 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 15deea639cfd81a63e2cedf3ffd7252b17e26e6d
17 changes: 15 additions & 2 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
@@ -52,12 +52,15 @@
var/tmp/default_pixel_z
var/tmp/default_pixel_w

// Health vars largely used by obj and mob.
/// (FLOAT) Current remaining health value.
var/current_health
/// (FLOAT) Theoretical maximum health value.
var/max_health

// /datum/storage instance to use for this obj. Set to a type for instantiation on init.
/// (DATUM) /datum/storage instance to use for this obj. Set to a type for instantiation on init.
var/datum/storage/storage
/// (FLOAT) world.time of last on_reagent_update call, used to prevent recursion due to reagents updating reagents
VAR_PRIVATE/_reagent_update_started = 0

/atom/proc/get_max_health()
return max_health
@@ -130,11 +133,21 @@
return 0

/// Handle reagents being modified
/atom/proc/try_on_reagent_change()
SHOULD_NOT_OVERRIDE(TRUE)
set waitfor = FALSE
if(_reagent_update_started >= world.time)
return FALSE
_reagent_update_started = world.time
sleep(0) // Defer to end of tick so we don't drop subsequent reagent updates.
return on_reagent_change()

/atom/proc/on_reagent_change()
SHOULD_CALL_PARENT(TRUE)
if(storage && reagents?.total_volume)
for(var/obj/item/thing in get_stored_inventory())
thing.fluid_act(reagents)
return TRUE

/**
Handle an atom bumping this atom
4 changes: 2 additions & 2 deletions code/game/machinery/biogenerator.dm
Original file line number Diff line number Diff line change
@@ -59,8 +59,8 @@
. = ..()

/obj/machinery/biogenerator/on_reagent_change() //When the reagents change, change the icon as well.
..()
update_icon()
if((. = ..()))
update_icon()

/obj/machinery/biogenerator/on_update_icon()
if(state == BG_NO_BEAKER)
3 changes: 1 addition & 2 deletions code/game/machinery/kitchen/microwave.dm
Original file line number Diff line number Diff line change
@@ -342,8 +342,7 @@
SSnano.update_uis(src)

/obj/machinery/microwave/on_reagent_change()
..()
if(!operating)
if((. = ..()) && !operating)
SSnano.update_uis(src)

/obj/machinery/microwave/proc/dispose(var/mob/user, var/message = TRUE)
4 changes: 2 additions & 2 deletions code/game/objects/effects/chem/water.dm
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@
QDEL_IN(src, 15 SECONDS) // In case whatever made it forgets to delete it

/obj/effect/effect/water/on_reagent_change()
..()
set_color(reagents?.get_color())
if((. = ..()))
set_color(reagents?.get_color())

/obj/effect/effect/water/proc/set_up(var/turf/target, var/step_count = 5, var/delay = 5)
if(!target)
4 changes: 2 additions & 2 deletions code/game/objects/items/devices/scanners/mass_spectrometer.dm
Original file line number Diff line number Diff line change
@@ -14,8 +14,8 @@
create_reagents(5)

/obj/item/scanner/spectrometer/on_reagent_change()
..()
update_icon()
if((. = ..()))
update_icon()

/obj/item/scanner/spectrometer/on_update_icon()
. = ..()
3 changes: 2 additions & 1 deletion code/game/objects/items/toys.dm
Original file line number Diff line number Diff line change
@@ -64,7 +64,8 @@
to_chat(user, "It's [reagents?.total_volume > 0? "filled with liquid sloshing around" : "empty"].")

/obj/item/chems/water_balloon/on_reagent_change()
..()
if(!(. = ..()))
return
w_class = (reagents?.total_volume > 0)? ITEM_SIZE_SMALL : ITEM_SIZE_TINY
//#TODO: Maybe acids should handle eating their own containers themselves?
for(var/reagent in reagents?.reagent_volumes)
3 changes: 2 additions & 1 deletion code/game/objects/items/weapons/towels.dm
Original file line number Diff line number Diff line change
@@ -32,7 +32,8 @@
. = ..()

/obj/item/towel/on_reagent_change()
. = ..()
if(!(. = ..()))
return
if(reagents?.total_volume)
SetName("damp [initial(name)]")
if(!is_processing)
3 changes: 2 additions & 1 deletion code/game/objects/structures/barrel.dm
Original file line number Diff line number Diff line change
@@ -36,7 +36,8 @@
storage.handle_item_insertion(null, thing)

/obj/structure/reagent_dispensers/barrel/on_reagent_change()
. = ..()
if(!(. = ..()))
return
var/primary_mat = reagents?.get_primary_reagent_name()
if(primary_mat)
SetName("[material.solid_name] [initial(name)] of [primary_mat]")
3 changes: 2 additions & 1 deletion code/game/objects/structures/fires.dm
Original file line number Diff line number Diff line change
@@ -314,7 +314,8 @@
return (fuel > 0)

/obj/structure/fire_source/on_reagent_change()
..()
if(!(. = ..()))
return
if(reagents?.total_volume)
var/do_steam = FALSE
var/list/waste = list()
3 changes: 2 additions & 1 deletion code/game/objects/structures/well.dm
Original file line number Diff line number Diff line change
@@ -21,7 +21,8 @@
add_overlay(overlay_image(icon, "[icon_state]-fluid", reagents.get_color(), (RESET_COLOR | RESET_ALPHA)))

/obj/structure/reagent_dispensers/well/on_reagent_change()
. = ..()
if(!(. = ..()))
return
update_icon()
if(!is_processing)
START_PROCESSING(SSobj, src)
5 changes: 4 additions & 1 deletion code/game/turfs/floors/natural/_natural.dm
Original file line number Diff line number Diff line change
@@ -113,7 +113,10 @@
return ..()

/turf/floor/natural/on_reagent_change()
. = ..()

if(!(. = ..()))
return

if(!QDELETED(src) && reagent_type && height < 0 && !QDELETED(reagents) && reagents.total_volume < abs(height))
add_to_reagents(reagent_type, abs(height) - reagents.total_volume)

3 changes: 2 additions & 1 deletion code/game/turfs/turf_fluids.dm
Original file line number Diff line number Diff line change
@@ -163,7 +163,8 @@

/turf/on_reagent_change()

..()
if(!(. = ..()))
return

if(reagents?.total_volume > FLUID_QDEL_POINT)
ADD_ACTIVE_FLUID(src)
4 changes: 2 additions & 2 deletions code/modules/crafting/metalwork/metalwork_items.dm
Original file line number Diff line number Diff line change
@@ -55,8 +55,8 @@
return ..()

/obj/item/chems/crucible/on_reagent_change()
. = ..()
queue_icon_update()
if((. = ..()))
queue_icon_update()

/obj/item/chems/crucible/on_update_icon()
. = ..()
4 changes: 2 additions & 2 deletions code/modules/crafting/pottery/pottery_items.dm
Original file line number Diff line number Diff line change
@@ -65,8 +65,8 @@
volume = 60

/obj/item/chems/glass/pottery/bowl/on_reagent_change()
. = ..()
update_icon()
if((. = ..()))
update_icon()

/obj/item/chems/glass/pottery/bowl/on_update_icon()
. = ..()
3 changes: 2 additions & 1 deletion code/modules/food/cooking/cooking_vessels/_cooking_vessel.dm
Original file line number Diff line number Diff line change
@@ -89,7 +89,8 @@
update_icon()

/obj/item/chems/cooking_vessel/on_reagent_change()
. = ..()
if(!(. = ..()))
return
started_cooking = null
if(!is_processing)
START_PROCESSING(SSobj, src)
3 changes: 2 additions & 1 deletion code/modules/integrated_electronics/passive/power.dm
Original file line number Diff line number Diff line change
@@ -120,7 +120,8 @@
..()

/obj/item/integrated_circuit/passive/power/chemical_cell/on_reagent_change(changetype)
..()
if(!(. = ..()))
return
set_pin_data(IC_OUTPUT, 1, reagents?.total_volume || 0)
push_data()

4 changes: 2 additions & 2 deletions code/modules/integrated_electronics/subtypes/reagents.dm
Original file line number Diff line number Diff line change
@@ -50,8 +50,8 @@
var/notified = FALSE

/obj/item/integrated_circuit/reagent/on_reagent_change()
..()
push_vol()
if((. = ..()))
push_vol()

/obj/item/integrated_circuit/reagent/smoke/do_work(ord)
switch(ord)
3 changes: 1 addition & 2 deletions code/modules/mining/machinery/material_extractor.dm
Original file line number Diff line number Diff line change
@@ -94,9 +94,8 @@
break

/obj/machinery/material_processing/extractor/on_reagent_change()
..()

if(!reagents)
if(!(. = ..()) || !reagents)
return

var/adjusted_reagents = FALSE
3 changes: 1 addition & 2 deletions code/modules/mining/machinery/material_smelter.dm
Original file line number Diff line number Diff line change
@@ -26,9 +26,8 @@

// Outgas anything that is in gas form. Check what you put into the smeltery, nerds.
/obj/machinery/material_processing/smeltery/on_reagent_change()
..()

if(!reagents)
if(!(. = ..()) || !reagents)
return

var/datum/gas_mixture/environment = loc?.return_air()
10 changes: 4 additions & 6 deletions code/modules/reagents/Chemistry-Holder.dm
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ var/global/obj/temp_reagents_holder = new
if(my_atom.reagents == src)
my_atom.reagents = null
if(total_volume > 0) // we can assume 0 reagents and null reagents are broadly identical for the purposes of atom logic
my_atom.on_reagent_change()
my_atom.try_on_reagent_change()
my_atom = null

/datum/reagents/GetCloneArgs()
@@ -235,16 +235,14 @@ var/global/obj/temp_reagents_holder = new
update_total()
if(!safety)
HANDLE_REACTIONS(src)
if(my_atom)
my_atom.on_reagent_change()
my_atom?.try_on_reagent_change()

///Set and call updates on the target holder.
/datum/reagents/proc/set_holder(var/obj/new_holder)
if(my_atom == new_holder)
return
my_atom = new_holder
if(my_atom)
my_atom.on_reagent_change()
my_atom?.try_on_reagent_change()
handle_update()

/datum/reagents/proc/add_reagent(var/reagent_type, var/amount, var/data = null, var/safety = 0, var/defer_update = FALSE)
@@ -333,7 +331,7 @@ var/global/obj/temp_reagents_holder = new
LAZYCLEARLIST(reagent_volumes)
LAZYCLEARLIST(reagent_data)
total_volume = 0
my_atom?.on_reagent_change()
my_atom?.try_on_reagent_change()

/datum/reagents/proc/get_overdose(var/decl/material/current)
if(current)
8 changes: 4 additions & 4 deletions code/modules/reagents/reagent_containers.dm
Original file line number Diff line number Diff line change
@@ -79,10 +79,10 @@
desc = new_desc_list.Join("\n")

/obj/item/chems/on_reagent_change()
..()
update_container_name()
update_container_desc()
update_icon()
if((. = ..()))
update_container_name()
update_container_desc()
update_icon()

/obj/item/chems/verb/set_amount_per_transfer_from_this()
set name = "Set Transfer Amount"
3 changes: 2 additions & 1 deletion code/modules/reagents/reagent_containers/blood_pack.dm
Original file line number Diff line number Diff line change
@@ -25,7 +25,8 @@
. = ..()

/obj/item/chems/ivbag/on_reagent_change()
..()
if(!(. = ..()))
return
if(reagents?.total_volume > volume/2)
w_class = ITEM_SIZE_SMALL
else
9 changes: 5 additions & 4 deletions code/modules/reagents/reagent_containers/condiment.dm
Original file line number Diff line number Diff line change
@@ -42,11 +42,12 @@
if(length(tmp_label))
to_chat(user, SPAN_NOTICE("You set the label to \"[tmp_label]\"."))
label_text = tmp_label
name = addtext(name," ([label_text])")
else
to_chat(user, SPAN_NOTICE("You remove the label."))
label_text = null
on_reagent_change()
update_container_name()
update_container_desc()
update_icon()
return

/obj/item/chems/condiment/afterattack(var/obj/target, var/mob/user, var/proximity)
@@ -77,8 +78,8 @@

/obj/item/chems/condiment/on_reagent_change()
is_special_bottle = reagents?.total_volume && special_bottles[reagents?.primary_reagent]
..()
update_center_of_mass()
if((. = ..()))
update_center_of_mass()

/obj/item/chems/condiment/update_container_name()
name = is_special_bottle ? initial(is_special_bottle.name) : initial(name)
3 changes: 1 addition & 2 deletions code/modules/reagents/reagent_containers/food/meat/cubes.dm
Original file line number Diff line number Diff line change
@@ -54,8 +54,7 @@
Expand(get_turf(target))

/obj/item/chems/food/monkeycube/on_reagent_change()
..()
if(!QDELETED(src) && reagents?.has_reagent(/decl/material/liquid/water))
if((. = ..()) && !QDELETED(src) && reagents?.has_reagent(/decl/material/liquid/water))
Expand()

/obj/item/chems/food/monkeycube/wrapped
4 changes: 2 additions & 2 deletions code/modules/reagents/reagent_containers/syringes.dm
Original file line number Diff line number Diff line change
@@ -39,8 +39,8 @@


/obj/item/chems/syringe/on_reagent_change()
. = ..()
update_icon()
if((. = ..()))
update_icon()

/obj/item/chems/syringe/on_picked_up(mob/user)
. = ..()
3 changes: 2 additions & 1 deletion code/modules/reagents/reagent_dispenser.dm
Original file line number Diff line number Diff line change
@@ -34,7 +34,8 @@
atom_flags = old_atom_flags

/obj/structure/reagent_dispensers/on_reagent_change()
..()
if(!(. = ..()))
return
if(reagents?.total_volume > 0)
tool_interaction_flags = 0
else
3 changes: 1 addition & 2 deletions mods/content/xenobiology/slime/items.dm
Original file line number Diff line number Diff line change
@@ -50,8 +50,7 @@
add_to_reagents(/decl/material/liquid/slimejelly, 30)

/obj/item/slime_extract/on_reagent_change()
..()
if(reagents?.total_volume)
if((. = ..()) && reagents?.total_volume)
var/decl/slime_colour/slime_data = GET_DECL(slime_type)
slime_data.handle_reaction(reagents)