Skip to content
Closed
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
0bf2b9f
Attempt to fix and debug random away-site unit test failures
out-of-phaze Sep 9, 2025
0b4703c
Simplify some code via `drop_from_slot()`
out-of-phaze Sep 23, 2025
e456493
Attempting to fix issues with skillset loading.
MistakeNot4892 Sep 24, 2025
4942aba
Remove some entirely-unused defunct variables
out-of-phaze Sep 26, 2025
d27b8a8
Fix load_event not working due to unused variable
out-of-phaze Sep 26, 2025
5478df3
Remove unused, broken crew manifest spawner
out-of-phaze Sep 26, 2025
266e28a
Merge pull request #5131 from MistakeNot4892/fix/skillset
out-of-phaze Sep 26, 2025
b783665
Replace deprecated bodytype `has_eyes` variable
out-of-phaze Sep 26, 2025
aafb869
Replace defunct show_reagent_name variable
out-of-phaze Sep 26, 2025
e21d3e0
Merge pull request #5117 from out-of-phaze/fix/test-random-slime-fail
MistakeNot4892 Sep 27, 2025
3a9ea69
Merge pull request #5133 from out-of-phaze/codequality/unused-vars-only
MistakeNot4892 Sep 27, 2025
f6b2272
Merge pull request #5134 from out-of-phaze/codequality/clothing-unused
MistakeNot4892 Sep 27, 2025
a2fce3d
Merge pull request #5136 from out-of-phaze/codequality/manifest-remove
MistakeNot4892 Sep 27, 2025
82e2c2e
Merge pull request #5137 from out-of-phaze/fix/config-event-load
MistakeNot4892 Sep 27, 2025
36c4acd
Merge pull request #5140 from out-of-phaze/codequality/no-eyes
MistakeNot4892 Sep 27, 2025
3a6e500
Merge pull request #5142 from out-of-phaze/codequality/no-show-name
MistakeNot4892 Sep 27, 2025
de3e782
Replace spawns in effect trail with timers and waitfor=FALSE
out-of-phaze Sep 26, 2025
540104b
Replace spawn in nurse spider AI with timer
out-of-phaze Sep 26, 2025
91657e1
Move custom circuit system into a modpack
out-of-phaze Jun 13, 2025
ba88992
Add map migrations for circuit modpack changes
out-of-phaze Sep 9, 2025
aed3446
Implement initial network ID and key on network receivers
out-of-phaze Sep 26, 2025
99be960
Fix network key not adjusting based on map hash
out-of-phaze Sep 26, 2025
bde57a6
Expanding mob controller handler-directing logic.
MistakeNot4892 Sep 27, 2025
6dc7aa0
Allowing scooping of mobs to silence messages.
MistakeNot4892 Sep 27, 2025
69a5523
Shifted rabbits down one size category.
MistakeNot4892 Sep 30, 2025
90298d0
Tweaking hunter AI params.
MistakeNot4892 Oct 1, 2025
b8069b1
Adding fadeout effect to go with fadein.
MistakeNot4892 Oct 1, 2025
a584f6c
Holder examine will now examine contents.
MistakeNot4892 Oct 1, 2025
39d3ec7
Shirts are now named 'shirt' and not 'clothing'.
MistakeNot4892 Oct 1, 2025
8c3c923
Adding trained bird module.
MistakeNot4892 Oct 1, 2025
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
11 changes: 11 additions & 0 deletions code/__defines/machinery_public_vars.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Displayed along with the pin name to show what type of pin it is.
#define VAR_FORMAT_ANY "\<ANY\>"
#define VAR_FORMAT_STRING "\<TEXT\>"
#define VAR_FORMAT_CHAR "\<CHAR\>"
#define VAR_FORMAT_COLOR "\<COLOR\>"
#define VAR_FORMAT_NUMBER "\<NUM\>"
#define VAR_FORMAT_DIR "\<DIR\>"
#define VAR_FORMAT_BOOLEAN "\<BOOL\>"
#define VAR_FORMAT_REF "\<REF\>"
#define VAR_FORMAT_LIST "\<LIST\>"
#define VAR_FORMAT_INDEX "\<INDEX\>"
2 changes: 1 addition & 1 deletion code/controllers/subsystems/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SUBSYSTEM_DEF(configuration)

load_files()
load_sql()
load_event()
load_event(load_event_from)

for(var/client/C)
C.update_post_config_load()
Expand Down
24 changes: 22 additions & 2 deletions code/datums/ai/_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* 1. AI should not implement any bespoke mob logic within the proc it uses
* to trigger or respond to game events. It should share entrypoints with
* action performed by players and should respect the same intents, etc.
* actions performed by players and should respect the same intents, etc.
* that players have to manage, through the same procs players use. This
* should mean that players can be slotted into the pilot seat of any mob,
* suspending AI behavior, and should then be able to freely use any of the
Expand Down Expand Up @@ -79,6 +79,9 @@
/// How long minimum between scans.
var/target_scan_delay = 1 SECOND

/// Last mob to attempt to handle this mob.
var/weakref/last_handler

/datum/mob_controller/New(var/mob/living/target_body)
body = target_body
if(expected_type && !istype(body, expected_type))
Expand Down Expand Up @@ -215,4 +218,21 @@
if(!scary_grabber)
return
if(spooked_by_grab && !is_friend(scary_grabber))
retaliate(scary_grabber)
retaliate(scary_grabber)

// General stubs for when another mob has directed this mob to attack.
/datum/mob_controller/proc/check_handler_can_order(mob/handler, atom/target, intent_flags)
return is_friend(handler)

/datum/mob_controller/proc/process_handler_target(mob/handler, atom/target, intent_flags)
if(!check_handler_can_order(handler, target, intent_flags))
return process_handler_failure(handler, target)
last_handler = weakref(handler)
return TRUE

/datum/mob_controller/proc/process_handler_failure(mob/handler, atom/target)
return FALSE

/datum/mob_controller/proc/process_holder_interaction(mob/handler)
last_handler = weakref(handler)
return body?.attack_hand_with_interaction_checks(handler)
46 changes: 25 additions & 21 deletions code/datums/ai/hunter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
body.ClickOn(prey)

/datum/mob_controller/passive/hunter/proc/consume_prey(mob/living/prey)
if(prey.stat != DEAD)
return
body.visible_message(SPAN_DANGER("\The [body] consumes the body of \the [prey]!"))
var/remains_type = prey.get_remains_type()
if(remains_type)
Expand All @@ -32,55 +34,57 @@
prey.gib()
else
qdel(prey)
set_target(null)
resume_wandering()

/datum/mob_controller/passive/hunter/get_target(atom/new_target)
if(isnull(hunt_target))
return null
var/mob/living/prey = hunt_target.resolve()
var/atom/prey = hunt_target.resolve()
if(!istype(prey) || QDELETED(prey))
set_target(null)
return null
return prey

/datum/mob_controller/passive/hunter/set_target(atom/new_target)
if(isnull(new_target) || isliving(new_target))
hunt_target = new_target ? weakref(new_target) : null
return TRUE
return FALSE
hunt_target = new_target ? weakref(new_target) : null
return TRUE

/datum/mob_controller/passive/hunter/do_process(time_elapsed)

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

if(body.incapacitated() || body.current_posture?.prone || body.buckled || flee_target || !get_target())
return
process_hunting(get_target())

/datum/mob_controller/passive/hunter/proc/process_hunting(atom/target)

var/mob/living/target = get_target()
if(!istype(target) || QDELETED(target) || !(target in view(body)))
set_target(null)
resume_wandering()
return
return FALSE

// Find or pursue the target.
if(!body.Adjacent(target))
stop_wandering()
body.start_automove(target)
return
return FALSE

// Hunt/consume the target.
if(target.stat != DEAD)
try_attack_prey(target)
if(!ismob(target))
return TRUE // Indicates a valid target that this base proc does not handle.

if(QDELETED(target))
// Hunt/consume the target.
. = FALSE // we handle mobs already
var/mob/prey = target
if(prey.stat != DEAD && (!is_friend(prey) || !handle_friend_hunting(prey)))
try_attack_prey(prey)
if(QDELETED(prey))
set_target(null)
resume_wandering()
return

if(target.stat != DEAD)
return

// Eat the mob.
set_target(null)
resume_wandering()
consume_prey(target)
consume_prey(prey)

// Stub for hawks to return to their handler and dock with the mothership.
/datum/mob_controller/passive/hunter/proc/handle_friend_hunting(mob/user)
return FALSE
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
return MCS_CHANGE
if(istext(fail))
to_chat(user, fail)
// This logging exists so that random CI fails due to state change failures will be caught.
#ifdef UNIT_TEST
log_unit_test("[log_info_line(machine)]: [fail]")
#endif
return MCS_BLOCK
return fail
return MCS_CONTINUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
// Prevent access locks on doors from interfering with our interactions.
for(var/obj/item/stock_parts/access_lock/lock in machine.get_all_components_of_type(/obj/item/stock_parts/access_lock))
lock.locked = FALSE
// And ensure the door's closed
var/obj/machinery/door/the_door = machine
if(istype(the_door)) // just in case
the_door.operating = FALSE // A lot of doors refuse to change states if operating.
// Test hacking state
if(!machine.attackby(screwdriver, user))
return "Machine [log_info_line(machine)] did not respond to attackby with screwdriver."
Expand Down
22 changes: 11 additions & 11 deletions code/game/machinery/_machines_base/machinery_public_vars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/decl/public_access/public_variable
var/expected_type
var/can_write = FALSE
var/var_type = IC_FORMAT_BOOLEAN // Reuses IC defines for better compatibility.
var/var_type = VAR_FORMAT_BOOLEAN // Reuses IC defines for better compatibility.

var/has_updates = FALSE // Can register listeners for updates on change.
var/list/listeners = list()
Expand Down Expand Up @@ -40,27 +40,27 @@ Must be implemented by subtypes.
/decl/public_access/public_variable/proc/check_input_type(new_value)
. = FALSE
switch(var_type)
if(IC_FORMAT_ANY)
if(VAR_FORMAT_ANY)
return TRUE
if(IC_FORMAT_STRING)
if(VAR_FORMAT_STRING)
return istext(new_value)
if(IC_FORMAT_CHAR)
if(VAR_FORMAT_CHAR)
return istext(new_value) && length(new_value) == 1
if(IC_FORMAT_COLOR)
if(VAR_FORMAT_COLOR)
return sanitize_hexcolor(new_value, null) == new_value
if(IC_FORMAT_NUMBER)
if(VAR_FORMAT_NUMBER)
return isnum(new_value)
if(IC_FORMAT_DIR)
if(VAR_FORMAT_DIR)
return new_value in global.alldirs
if(IC_FORMAT_BOOLEAN)
if(VAR_FORMAT_BOOLEAN)
return new_value == !!new_value
if(IC_FORMAT_REF)
if(VAR_FORMAT_REF)
return isweakref(new_value)

// Public variables of these types need to against the contents of the list and the index for validity themselves.
if(IC_FORMAT_LIST)
if(VAR_FORMAT_LIST)
return islist(new_value)
if(IC_FORMAT_INDEX)
if(VAR_FORMAT_INDEX)
return isnum(new_value)

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Public vars at /obj/machinery level. Just because they are here does not mean th
desc = "An automatically generated area id, if this machine is tied to an area controller."
can_write = FALSE
has_updates = FALSE
var_type = IC_FORMAT_STRING
var_type = VAR_FORMAT_STRING

/decl/public_access/public_variable/area_uid/access_var(obj/machinery/machine)
return machine.area_uid()
Expand All @@ -51,7 +51,7 @@ Public vars at /obj/machinery level. Just because they are here does not mean th
desc = "A generic variable intended to give machines a text designator to sort them into categories by function."
can_write = TRUE
has_updates = TRUE
var_type = IC_FORMAT_STRING
var_type = VAR_FORMAT_STRING

/decl/public_access/public_variable/identifier/access_var(obj/machinery/machine)
return machine.identifier
Expand All @@ -67,7 +67,7 @@ Public vars at /obj/machinery level. Just because they are here does not mean th
desc = "Whether the machine is off (0) or on (positive). Some machines have multiple power states. Writing to this variable may turn the machine off or on."
can_write = TRUE
has_updates = FALSE
var_type = IC_FORMAT_NUMBER
var_type = VAR_FORMAT_NUMBER

/decl/public_access/public_variable/use_power/access_var(obj/machinery/machine)
return machine.use_power
Expand All @@ -85,7 +85,7 @@ Public vars at /obj/machinery level. Just because they are here does not mean th
desc = "The machine's name."
can_write = TRUE
has_updates = FALSE
var_type = IC_FORMAT_STRING
var_type = VAR_FORMAT_STRING

/decl/public_access/public_variable/name/access_var(obj/machinery/machine)
return machine.name
Expand All @@ -101,39 +101,39 @@ Public vars at /obj/machinery level. Just because they are here does not mean th
desc = "Obtain the list of reagents and their data in the machine."
can_write = FALSE
has_updates = TRUE
var_type = IC_FORMAT_LIST
var_type = VAR_FORMAT_LIST

/decl/public_access/public_variable/reagents/access_var(obj/machinery/machine)
return machine?.reagents?.reagent_data

/decl/public_access/public_variable/reagents/volumes
name = "reagents volumes"
desc = "Obtain the list of reagents and their volumes in the machine."
var_type = IC_FORMAT_LIST
var_type = VAR_FORMAT_LIST

/decl/public_access/public_variable/reagents/volumes/access_var(obj/machinery/machine)
return machine?.reagents?.reagent_volumes

/decl/public_access/public_variable/reagents/free_space
name = "reagents free space"
desc = "Obtain the volume of free space left for reagents in the machine."
var_type = IC_FORMAT_NUMBER
var_type = VAR_FORMAT_NUMBER

/decl/public_access/public_variable/reagents/free_space/access_var(obj/machinery/machine)
return REAGENTS_FREE_SPACE(machine?.reagents)

/decl/public_access/public_variable/reagents/total_volume
name = "reagents total volume"
desc = "Obtain the total volume of reagents in the machine."
var_type = IC_FORMAT_NUMBER
var_type = VAR_FORMAT_NUMBER

/decl/public_access/public_variable/reagents/total_volume/access_var(obj/machinery/machine)
return machine?.reagents?.total_volume

/decl/public_access/public_variable/reagents/maximum_volume
name = "reagents maximum volume"
desc = "Obtain the maximum volume of reagents that can fit in the machine."
var_type = IC_FORMAT_NUMBER
var_type = VAR_FORMAT_NUMBER

/decl/public_access/public_variable/reagents/maximum_volume/access_var(obj/machinery/machine)
return machine?.reagents?.maximum_volume
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
part_flags = PART_FLAG_HAND_REMOVE
place_verb = "place"
eject_handler = /decl/interaction_handler/remove_held_item/cup
var/image/cupholder_overlay
var/obj/item/cup

/obj/item/stock_parts/item_holder/cupholder/Destroy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
base_type = /obj/item/stock_parts/network_receiver/network_lock

var/auto_deny_all // Set this to TRUE to deny all access attempts if network connection is lost.
var/initial_network_id // The address to the network
var/initial_network_key // network KEY
var/selected_parent_group // Current selected parent_group for access assignment.

var/list/groups // List of lists of groups. In order to access the device, users must have membership in at least one
Expand All @@ -21,11 +19,6 @@

var/interact_sounds = list("keyboard", "keystroke")
var/interact_sound_volume = 40
var/static/legacy_compatibility_mode = TRUE // Makes legacy access on ids play well with mapped devices with network locks. Override if your server is fully using network-enabled ids or has no mapped access.

/obj/item/stock_parts/network_receiver/network_lock/modify_mapped_vars(map_hash)
..()
ADJUST_TAG_VAR(initial_network_id, map_hash)

/obj/item/stock_parts/network_receiver/network_lock/emag_act(remaining_charges, mob/user, emag_source)
. = ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@
desc = "A network receiver designed for use with machinery otherwise disconnected from a network."
icon_state = "net_lock"
part_flags = PART_FLAG_QDEL
var/initial_network_id // The address to the network
var/initial_network_key // network KEY

/obj/item/stock_parts/network_receiver/modify_mapped_vars(map_hash)
..()
ADJUST_TAG_VAR(initial_network_id, map_hash)
ADJUST_TAG_VAR(initial_network_key, map_hash)

/obj/item/stock_parts/network_receiver/Initialize(ml, material_key)
. = ..()
set_extension(src, /datum/extension/network_device/stock_part)
set_extension(src, /datum/extension/network_device/stock_part, initial_network_id, initial_network_key)

/obj/item/stock_parts/network_receiver/on_install(obj/machinery/machine)
. = ..()
Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/air_sensor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
desc = "A list of gas data from the sensor location; the list entries are two-entry lists with \"symbol\" and \"percent\" fields."
can_write = FALSE
has_updates = FALSE
var_type = IC_FORMAT_LIST
var_type = VAR_FORMAT_LIST

/decl/public_access/public_variable/gas/access_var(obj/machinery/sensor)
var/datum/gas_mixture/air_sample = sensor.return_air()
Expand All @@ -58,7 +58,7 @@
desc = "The pressure of the gas at the sensor."
can_write = FALSE
has_updates = FALSE
var_type = IC_FORMAT_STRING
var_type = VAR_FORMAT_STRING

/decl/public_access/public_variable/pressure/access_var(obj/machinery/sensor)
var/datum/gas_mixture/air_sample = sensor.return_air()
Expand All @@ -70,7 +70,7 @@
desc = "The temperature of the gas at the sensor."
can_write = FALSE
has_updates = FALSE
var_type = IC_FORMAT_NUMBER
var_type = VAR_FORMAT_NUMBER

/decl/public_access/public_variable/temperature/access_var(obj/machinery/sensor)
var/datum/gas_mixture/air_sample = sensor.return_air()
Expand Down
1 change: 0 additions & 1 deletion code/game/machinery/alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,6 @@ FIRE ALARM
var/time = 1 SECOND
var/timing = FALSE
var/last_process = 0
var/static/list/overlays_cache

var/sound_id
var/datum/sound_token/sound_token
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/buttons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
desc = "Whether the button is currently in the on state."
can_write = TRUE
has_updates = FALSE
var_type = IC_FORMAT_BOOLEAN
var_type = VAR_FORMAT_BOOLEAN

/decl/public_access/public_variable/button_state/access_var(obj/machinery/button/button)
return button.state
Expand Down
Loading
Loading