Skip to content

Commit

Permalink
446 runtimes on the wall, take one down, movit it around, 998 runtime…
Browse files Browse the repository at this point in the history
…s on the wall
  • Loading branch information
XeonMations committed Aug 14, 2024
1 parent e686c05 commit 92eb6a1
Show file tree
Hide file tree
Showing 69 changed files with 6,071 additions and 891 deletions.
21 changes: 18 additions & 3 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,10 @@
#include "code\datums\components\plumbing\splitter.dm"
#include "code\datums\components\slime\basic_scared_of_item.dm"
#include "code\datums\components\slime\emotion_buffer.dm"
#include "code\datums\components\slime\friendship_tracker.dm"
#include "code\datums\components\slime\generic_mob_hunger.dm"
#include "code\datums\components\slime\latch_feeding.dm"
#include "code\datums\components\slime\liquid_secretion.dm"
#include "code\datums\components\slime\mob_stacker.dm"
#include "code\datums\components\slime\pollution_scrubber.dm"
#include "code\datums\components\slime\vac_tagged.dm"
#include "code\datums\components\storage\storage.dm"
#include "code\datums\components\storage\concrete\_concrete.dm"
Expand Down Expand Up @@ -2667,7 +2665,6 @@
#include "code\modules\food_and_drinks\kitchen_machinery\grill.dm"
#include "code\modules\food_and_drinks\kitchen_machinery\icecream_vat.dm"
#include "code\modules\food_and_drinks\kitchen_machinery\microwave.dm"
#include "code\modules\food_and_drinks\kitchen_machinery\monkeyrecycler.dm"
#include "code\modules\food_and_drinks\kitchen_machinery\processor.dm"
#include "code\modules\food_and_drinks\kitchen_machinery\smartfridge.dm"
#include "code\modules\food_and_drinks\recipes\drinks_recipes.dm"
Expand Down Expand Up @@ -3785,6 +3782,24 @@
#include "code\modules\research\techweb\_techweb_node.dm"
#include "code\modules\research\techweb\all_nodes.dm"
#include "code\modules\research\xenobiology\xenobiology.dm"
#include "code\modules\research\xenobiology\crossbreeding\__corecross.dm"
#include "code\modules\research\xenobiology\crossbreeding\_clothing.dm"
#include "code\modules\research\xenobiology\crossbreeding\_misc.dm"
#include "code\modules\research\xenobiology\crossbreeding\_mobs.dm"
#include "code\modules\research\xenobiology\crossbreeding\_potions.dm"
#include "code\modules\research\xenobiology\crossbreeding\_status_effects.dm"
#include "code\modules\research\xenobiology\crossbreeding\_weapons.dm"
#include "code\modules\research\xenobiology\crossbreeding\burning.dm"
#include "code\modules\research\xenobiology\crossbreeding\charged.dm"
#include "code\modules\research\xenobiology\crossbreeding\chilling.dm"
#include "code\modules\research\xenobiology\crossbreeding\consuming.dm"
#include "code\modules\research\xenobiology\crossbreeding\industrial.dm"
#include "code\modules\research\xenobiology\crossbreeding\prismatic.dm"
#include "code\modules\research\xenobiology\crossbreeding\recurring.dm"
#include "code\modules\research\xenobiology\crossbreeding\regenerative.dm"
#include "code\modules\research\xenobiology\crossbreeding\reproductive.dm"
#include "code\modules\research\xenobiology\crossbreeding\selfsustaining.dm"
#include "code\modules\research\xenobiology\crossbreeding\stabilized.dm"
#include "code\modules\ruins\lavaland_ruin_code.dm"
#include "code\modules\ruins\lavalandruin_code\biodome_clown_planet.dm"
#include "code\modules\ruins\lavalandruin_code\pizzaparty.dm"
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,6 @@
#define BB_BASIC_MOB_CURRENT_TARGET "BB_basic_current_target"
#define BB_BASIC_MOB_CURRENT_TARGET_HIDING_LOCATION "BB_basic_current_target_hiding_location"
#define BB_TARGETTING_DATUM "targetting_datum"

/// Flag to set on if you want your mob to STOP running away
#define BB_BASIC_MOB_STOP_FLEEING "BB_basic_stop_fleeing"
2 changes: 0 additions & 2 deletions code/__DEFINES/dcs/signals/signals_mob/signals_living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@

///from base of mob/living/Stun() (amount, ignore_canstun)
#define COMSIG_LIVING_STATUS_STUN "living_stun"
///from mob/living/carbon/enter_stamina_stun()
#define COMSIG_LIVING_STAMINA_STUN "carbon_stamina_stun"
///from base of mob/living/Knockdown() (amount, ignore_canstun)
#define COMSIG_LIVING_STATUS_KNOCKDOWN "living_knockdown"
///from base of mob/living/Paralyze() (amount, ignore_canstun)
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,9 @@
#define COMSIG_STACK_MOVE "stack_move"
#define COMSIG_CHECK_CAN_ADD_NEW_STACK "check_stack_add"
#define COMSIG_MOBSTACKER_DESTROY "mobstack_destroy_stack"

/// Signal sent when a blackboard key is set to a new value
#define COMSIG_AI_BLACKBOARD_KEY_SET(blackboard_key) "ai_blackboard_key_set_[blackboard_key]"

/// Signal sent when a blackboard key is cleared
#define COMSIG_AI_BLACKBOARD_KEY_CLEARED(blackboard_key) "ai_blackboard_key_clear_[blackboard_key]"
5 changes: 5 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -603,3 +603,8 @@ GLOBAL_LIST_INIT(available_random_trauma_list, list(
#define STANDING_UP 0
/// Mob is lying down, usually associated with lying_angle values of 90 or 270.
#define LYING_DOWN 1

/// Default minimum body temperature mobs can exist in before taking damage
#define NPC_DEFAULT_MIN_TEMP 250
/// Default maximum body temperature mobs can exist in before taking damage
#define NPC_DEFAULT_MAX_TEMP 350
6 changes: 6 additions & 0 deletions code/__DEFINES/slimes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,9 @@

#define COMSIG_FRIENDSHIP_CHECK_LEVEL "friendship_check_level"
#define COMSIG_FRIENDSHIP_CHANGE "friendship_change"
#define COMSIG_FRIENDSHIP_PASS_FRIENDSHIP "friendship_passfriends"

#define TRAIT_RAINBOWED "rainbowed"

#define COMSIG_ATOM_MOUSE_ENTERED "mouse_entered"
#define COMSIG_CLIENT_HOVER_NEW "client_new_hover"
123 changes: 123 additions & 0 deletions code/datums/ai/_ai_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,126 @@ multiple modular subtrees with behaviors
if(iter_behavior.required_distance < minimum_distance)
minimum_distance = iter_behavior.required_distance
return minimum_distance


/// Used for above to track all the keys that have registered a signal
#define TRAIT_AI_TRACKING "tracked_by_ai"


/**
* Used to manage references to datum by AI controllers
*
* * tracked_datum - something being added to an ai blackboard
* * key - the associated key
*/
#define TRACK_AI_DATUM_TARGET(tracked_datum, key) do { \
if(isweakref(tracked_datum)) { \
var/datum/weakref/_bad_weakref = tracked_datum; \
stack_trace("Weakref (Actual datum: [_bad_weakref.resolve()]) found in ai datum blackboard! \
This is an outdated method of ai reference handling, please remove it."); \
}; \
else if(isdatum(tracked_datum)) { \
var/datum/_tracked_datum = tracked_datum; \
if(!HAS_TRAIT_FROM(_tracked_datum, TRAIT_AI_TRACKING, "[REF(src)]_[key]")) { \
RegisterSignal(_tracked_datum, COMSIG_PARENT_QDELETING, PROC_REF(sig_remove_from_blackboard), override = TRUE); \
ADD_TRAIT(_tracked_datum, TRAIT_AI_TRACKING, "[REF(src)]_[key]"); \
}; \
}; \
} while(FALSE)

/**
* Used to clear previously set reference handing by AI controllers
*
* * tracked_datum - something being removed from an ai blackboard
* * key - the associated key
*/
#define CLEAR_AI_DATUM_TARGET(tracked_datum, key) do { \
if(isdatum(tracked_datum)) { \
var/datum/_tracked_datum = tracked_datum; \
REMOVE_TRAIT(_tracked_datum, TRAIT_AI_TRACKING, "[REF(src)]_[key]"); \
if(!HAS_TRAIT(_tracked_datum, TRAIT_AI_TRACKING)) { \
UnregisterSignal(_tracked_datum, COMSIG_PARENT_QDELETING); \
}; \
}; \
} while(FALSE)

/**
* Sets the key to the passed "thing".
*
* * key - A blackboard key
* * thing - a value to set the blackboard key to.
*/
/datum/ai_controller/proc/set_blackboard_key(key, thing)
// Assume it is an error when trying to set a value overtop a list
if(islist(blackboard[key]))
CRASH("set_blackboard_key attempting to set a blackboard value to key [key] when it's a list!")
// Don't do anything if it's already got this value
if (blackboard[key] == thing)
return

// Clear existing values
if(!isnull(blackboard[key]))
clear_blackboard_key(key)

TRACK_AI_DATUM_TARGET(thing, key)
blackboard[key] = thing
post_blackboard_key_set(key)


/**
* Clears the passed key, resetting it to null
*
* Not intended for use with list keys - use [proc/remove_thing_from_blackboard_key] if you are removing a value from a list at a key
*
* * key - A blackboard key
*/
/datum/ai_controller/proc/clear_blackboard_key(key)
if(isnull(blackboard[key]))
return
CLEAR_AI_DATUM_TARGET(blackboard[key], key)
blackboard[key] = null
if(isnull(pawn))
return
SEND_SIGNAL(pawn, COMSIG_AI_BLACKBOARD_KEY_CLEARED(key))

/**
* Called after we set a blackboard key, forwards signal information.
*/
/datum/ai_controller/proc/post_blackboard_key_set(key)
if (isnull(pawn))
return
SEND_SIGNAL(pawn, COMSIG_AI_BLACKBOARD_KEY_SET(key))

/// Signal proc to go through every key and remove the datum from all keys it finds
/datum/ai_controller/proc/sig_remove_from_blackboard(datum/source)
SIGNAL_HANDLER

var/list/list/remove_queue = list(blackboard)
var/index = 1
while(index <= length(remove_queue))
var/list/next_to_clear = remove_queue[index]
for(var/inner_value in next_to_clear)
var/associated_value = next_to_clear[inner_value]
// We are a lists of lists, add the next value to the queue so we can handle references in there
// (But we only need to bother checking the list if it's not empty.)
if(islist(inner_value) && length(inner_value))
UNTYPED_LIST_ADD(remove_queue, inner_value)

// We found the value that's been deleted. Clear it out from this list
else if(inner_value == source)
next_to_clear -= inner_value

// We are an assoc lists of lists, the list at the next value so we can handle references in there
// (But again, we only need to bother checking the list if it's not empty.)
if(islist(associated_value) && length(associated_value))
UNTYPED_LIST_ADD(remove_queue, associated_value)

// We found the value that's been deleted, it was an assoc value. Clear it out entirely
else if(associated_value == source)
next_to_clear -= inner_value
SEND_SIGNAL(pawn, COMSIG_AI_BLACKBOARD_KEY_CLEARED(inner_value))

index += 1


#undef TRAIT_AI_TRACKING
159 changes: 0 additions & 159 deletions code/datums/components/slime/friendship_tracker.dm

This file was deleted.

4 changes: 0 additions & 4 deletions code/datums/components/slime/generic_mob_hunger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,3 @@

/datum/component/generic_mob_hunger/proc/remove_hunger_trait(trait)
REMOVE_TRAIT(parent, trait, "hunger_trait")

/obj/effect/overlay/happiness_overlay/hunger
full_icon = "full_hunger"
empty_icon = "empty_hunger"
Loading

0 comments on commit 92eb6a1

Please sign in to comment.