Skip to content

Commit

Permalink
why did this not send?
Browse files Browse the repository at this point in the history
  • Loading branch information
Syndicat-Meow committed Dec 26, 2024
1 parent 273d2a0 commit d792645
Show file tree
Hide file tree
Showing 34 changed files with 70,949 additions and 68,603 deletions.
138,896 changes: 70,345 additions & 68,551 deletions _maps/RandomZLevels/moonoutpost19.dmm

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions code/__DEFINES/ai/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
///Finish the behavior successfully
#define AI_BEHAVIOR_SUCCEEDED (1<<1)
///Finish the behavior unsuccessfully
<<<<<<< Updated upstream

Check failure on line 34 in code/__DEFINES/ai/ai.dm

View workflow job for this annotation

GitHub Actions / Run Linters

got '<<', expected one of: newline, '/', identifier

Check warning on line 34 in code/__DEFINES/ai/ai.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0000: Error recovery had to skip to code/__DEFINES/ai/ai.dm:36:1
#define AI_BEHAVIOR_FAILED (1<<1)
=======

Check warning on line 36 in code/__DEFINES/ai/ai.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0000: Error recovery had to skip to code/__DEFINES/ai/ai.dm:38:1
#define AI_BEHAVIOR_FAILED (1<<2)
>>>>>>> Stashed changes

Check warning on line 38 in code/__DEFINES/ai/ai.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0000: Error recovery had to skip to code/__DEFINES/atmospherics/atmos_helpers.dm:51:1

#define AI_BEHAVIOR_INSTANT (NONE)

Expand Down
16 changes: 15 additions & 1 deletion code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_CLUMSY" = TRAIT_CLUMSY,
"TRAIT_COAGULATING" = TRAIT_COAGULATING,
"TRAIT_COLDBLOODED" = TRAIT_COLDBLOODED,
"TRAIT_COLD_BLOODED" = TRAIT_COLD_BLOODED,
"TRAIT_CONVERSION_FLASHED" = TRAIT_CONVERSION_FLASHED,
"TRAIT_CORPSELOCKED" = TRAIT_CORPSELOCKED,
"TRAIT_CRITICAL_CONDITION" = TRAIT_CRITICAL_CONDITION,
Expand Down Expand Up @@ -516,10 +517,10 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_WINE_TASTER" = TRAIT_WINE_TASTER,
"TRAIT_WING_BUFFET" = TRAIT_WING_BUFFET,
"TRAIT_WING_BUFFET_TIRED" = TRAIT_WING_BUFFET_TIRED,
"TRAIT_WOUND_LICKER" = TRAIT_WOUND_LICKER,
"TRAIT_XENO_HOST" = TRAIT_XENO_HOST,
"TRAIT_XENO_IMMUNE" = TRAIT_XENO_IMMUNE,
"TRAIT_XRAY_VISION" = TRAIT_XRAY_VISION,
"TRAIT_COLD_BLOODED" = TRAIT_COLD_BLOODED,
"TRAIT_ZOMBIE_CONSUMED" = TRAIT_ZOMBIE_CONSUMED,
/* "TRAIT_ADAMANTINE_EXTRACT_ARMOR" = TRAIT_ADAMANTINE_EXTRACT_ARMOR, */
/* "TRAIT_ALWAYS_WANTED" = TRAIT_ALWAYS_WANTED, */
Expand Down Expand Up @@ -610,7 +611,10 @@ GLOBAL_LIST_INIT(traits_by_type, list(
/* "TRAIT_TOSS_GUN_HARD" = TRAIT_TOSS_GUN_HARD, */
/* "TRAIT_UNHUSKABLE" = TRAIT_UNHUSKABLE, */
/* "TRAIT_USER_SCOPED" = TRAIT_USER_SCOPED, */
<<<<<<< Updated upstream
"TRAIT_WOUND_LICKER" = TRAIT_WOUND_LICKER,
=======
>>>>>>> Stashed changes
/* "TRAIT_XRAY_HEARING" = TRAIT_XRAY_HEARING, */
),
/obj/item = list(
Expand Down Expand Up @@ -652,8 +656,18 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_UNCATCHABLE" = TRAIT_UNCATCHABLE,
"TRAIT_UNCOMPOSTABLE" = TRAIT_UNCOMPOSTABLE,
"TRAIT_WIELDED" = TRAIT_WIELDED,
<<<<<<< Updated upstream
/* "TRAIT_BAIT_UNCONSUMABLE" = TRAIT_BAIT_UNCONSUMABLE, */
"TRAIT_BAKEABLE" = TRAIT_BAKEABLE,
=======
"TRAIT_BAKEABLE" = TRAIT_BAKEABLE,
"TRAIT_FEATHERED" = TRAIT_FEATHERED,
"TRAIT_NON_IMPORTANT_SHOE_BLOCK" = TRAIT_NON_IMPORTANT_SHOE_BLOCK,
"TRAIT_LABOURED_BREATHING" = TRAIT_LABOURED_BREATHING,
"TRAIT_ASSISTED_BREATHING" = TRAIT_ASSISTED_BREATHING,
"TRAIT_NO_ORGAN_DECAY" = TRAIT_NO_ORGAN_DECAY,
/* "TRAIT_BAIT_UNCONSUMABLE" = TRAIT_BAIT_UNCONSUMABLE, */
>>>>>>> Stashed changes
/* "TRAIT_BYPASS_RANGED_ARMOR" = TRAIT_BYPASS_RANGED_ARMOR, */
/* "TRAIT_CONTRABAND_BLOCKER" = TRAIT_CONTRABAND_BLOCKER, */
/* "TRAIT_GERM_SENSITIVE" = TRAIT_GERM_SENSITIVE, */
Expand Down
8 changes: 5 additions & 3 deletions code/datums/ai/babies/babies_behaviors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@
if(other.gender != living_pawn.gender && !(other.flags_1 & HOLOGRAM_1)) //Better safe than sorry ;_;
controller.set_blackboard_key(target_key, other)
return AI_BEHAVIOR_DELAY | AI_BEHAVIOR_SUCCEEDED
<<<<<<< Updated upstream

Check warning on line 41 in code/datums/ai/babies/babies_behaviors.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0000: Error recovery had to skip to code/datums/ai/babies/babies_behaviors.dm:44:1

return AI_BEHAVIOR_DELAY | AI_BEHAVIOR_FAILED
=======

Check warning on line 44 in code/datums/ai/babies/babies_behaviors.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0000: Error recovery had to skip to code/datums/ai/babies/babies_behaviors.dm:45:1
>>>>>>> Stashed changes

Check warning on line 45 in code/datums/ai/babies/babies_behaviors.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0000: Error recovery had to skip to code/datums/ai/babies/babies_behaviors.dm:52:1

return AI_BEHAVIOR_DELAY | AI_BEHAVIOR_FAILED

/**
* Reproduce.
Expand All @@ -56,13 +60,11 @@
set_movement_target(controller, target)

/datum/ai_behavior/make_babies/perform(seconds_per_tick, datum/ai_controller/controller, target_key, child_types_key)
. = ..()
var/mob/target = controller.blackboard[target_key]
if(QDELETED(target) || target.stat != CONSCIOUS)
return AI_BEHAVIOR_DELAY | AI_BEHAVIOR_FAILED
var/mob/living/basic/living_pawn = controller.pawn
//living_pawn.set_combat_mode(FALSE)
living_pawn.istate &= ~ISTATE_HARM
living_pawn.set_combat_mode(FALSE)
living_pawn.melee_attack(target)
return AI_BEHAVIOR_DELAY | AI_BEHAVIOR_SUCCEEDED

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@

controller.set_blackboard_key(hiding_location_key, hiding_target)

if(melee_attacks || !ismob(target))
if(hiding_target) //Slap it!
basic_mob.melee_attack(hiding_target)
else
basic_mob.melee_attack(target)
if(hiding_target) //Slap it!
basic_mob.melee_attack(hiding_target)
else
basic_mob.melee_attack(target)

if(terminate_after_action)
return AI_BEHAVIOR_DELAY | AI_BEHAVIOR_SUCCEEDED
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ai/basic_mobs/basic_ai_behaviors/climb_tree.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
behavior_flags = AI_BEHAVIOR_REQUIRE_MOVEMENT | AI_BEHAVIOR_REQUIRE_REACH

/datum/ai_behavior/climb_tree/setup(datum/ai_controller/controller, target_key)
. = ..()

var/atom/target = controller.blackboard[target_key]
if(QDELETED(target))
return FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

/datum/ai_behavior/run_away_from_target/perform(seconds_per_tick, datum/ai_controller/controller, target_key, hiding_location_key)
if (controller.blackboard[BB_BASIC_MOB_STOP_FLEEING])
<<<<<<< Updated upstream

Check warning on line 22 in code/datums/ai/basic_mobs/basic_ai_behaviors/run_away_from_target.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0000: Error recovery had to skip to code/datums/ai/basic_mobs/basic_ai_behaviors/run_away_from_target.dm:23:1
=======

Check warning on line 23 in code/datums/ai/basic_mobs/basic_ai_behaviors/run_away_from_target.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0000: Error recovery had to skip to code/datums/ai/basic_mobs/basic_ai_behaviors/run_away_from_target.dm:25:1
finish_action(controller, succeeded = FALSE, target_key = target_key, hiding_location_key = hiding_location_key)
>>>>>>> Stashed changes

Check warning on line 25 in code/datums/ai/basic_mobs/basic_ai_behaviors/run_away_from_target.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0000: Error recovery had to skip to code/datums/ai/basic_mobs/basic_ai_behaviors/run_away_from_target.dm:27:2
return AI_BEHAVIOR_DELAY
var/atom/target = controller.blackboard[hiding_location_key] || controller.blackboard[target_key]
if (QDELETED(target) || !can_see(controller.pawn, target, run_distance))
Expand Down Expand Up @@ -59,10 +63,15 @@
. = ..()
if (clear_failed_targets)
controller.clear_blackboard_key(target_key)
<<<<<<< Updated upstream

/datum/ai_behavior/run_away_from_target/run_and_shoot
clear_failed_targets = FALSE

=======
/datum/ai_behavior/run_away_from_target/run_and_shoot
clear_failed_targets = FALSE
>>>>>>> Stashed changes
/datum/ai_behavior/run_away_from_target/run_and_shoot/perform(seconds_per_tick, datum/ai_controller/controller, target_key, hiding_location_key)
var/atom/target = controller.blackboard[target_key]
if(QDELETED(target))
Expand Down
10 changes: 10 additions & 0 deletions code/datums/ai/basic_mobs/basic_subtrees/find_food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@
var/emotes_blackboard_list = BB_EAT_EMOTES

/datum/ai_planning_subtree/find_food/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick)
<<<<<<< Updated upstream
if(controller.blackboard[BB_NEXT_FOOD_EAT] > world.time)
return
if(!controller.blackboard_key_exists(found_food_key))
controller.queue_behavior(finding_behavior, found_food_key, controller.blackboard[food_list_key])
=======
var/list/foods_list = controller.blackboard[food_list_key]
if(!length(foods_list))
CRASH("the types of food has not been supplied in the [food_list_key] key!")
if(controller.blackboard[BB_NEXT_FOOD_EAT] > world.time)
return
if(!controller.blackboard_key_exists(found_food_key))
controller.queue_behavior(finding_behavior, found_food_key, foods_list)
>>>>>>> Stashed changes
return
controller.queue_behavior(/datum/ai_behavior/interact_with_target/eat_food, found_food_key, emotes_blackboard_list)
return SUBTREE_RETURN_FINISH_PLANNING
Expand Down
52 changes: 34 additions & 18 deletions code/datums/ai/generic/find_and_set.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,17 @@

/datum/ai_behavior/find_and_set/edible/search_tactic(datum/ai_controller/controller, locate_path, search_range)
var/mob/living/living_pawn = controller.pawn
var/list/food_candidates = list()
for(var/held_candidate as anything in living_pawn.held_items)
if(!held_candidate || !IsEdible(held_candidate))
continue
food_candidates += held_candidate

var/list/local_results = locate(locate_path) in oview(search_range, controller.pawn)
for(var/local_candidate in local_results)
if(!IsEdible(local_candidate))
continue
food_candidates += local_candidate
if(food_candidates.len)
return pick(food_candidates)
for(var/atom/held_candidate as anything in living_pawn.held_items)
if(IsEdible(held_candidate))
return held_candidate

for(var/atom/local_candidate as anything in oview(search_range, controller.pawn))
if(IsEdible(local_candidate) && istype(local_candidate, locate_path))
return local_candidate

return null


/**
* Variant of find and set that only checks in hands, search range should be excluded for this
Expand All @@ -74,12 +72,8 @@
/datum/ai_behavior/find_and_set/in_list

/datum/ai_behavior/find_and_set/in_list/search_tactic(datum/ai_controller/controller, locate_paths, search_range)
var/list/found = list()
for(var/locate_path in locate_paths)
var/single_locate = ..(controller, locate_path, search_range)
if(single_locate)
found += single_locate
if(found.len)
var/list/found = typecache_filter_list(oview(search_range, controller.pawn), locate_paths)
if(length(found))
return pick(found)

/// Like find_and_set/in_list, but we return the turf location of the item instead of the item itself.
Expand Down Expand Up @@ -181,3 +175,25 @@
var/mob/living/living_pawn = controller.pawn
var/potential_friend = living_pawn.faction.Find(REF(friend)) ? friend : null
return potential_friend


/datum/ai_behavior/find_and_set/in_list/turf_types

/datum/ai_behavior/find_and_set/in_list/turf_types/search_tactic(datum/ai_controller/controller, locate_paths, search_range)
var/list/found = RANGE_TURFS(search_range, controller.pawn)
shuffle_inplace(found)
for(var/turf/possible_turf as anything in found)
if(!is_type_in_typecache(possible_turf, locate_paths))
continue
if(can_see(controller.pawn, possible_turf, search_range))
return possible_turf
return null

/datum/ai_behavior/find_and_set/in_list/closest_turf

/datum/ai_behavior/find_and_set/in_list/closest_turf/search_tactic(datum/ai_controller/controller, locate_paths, search_range)
var/list/found = RANGE_TURFS(search_range, controller.pawn)
for(var/turf/possible_turf as anything in found)
if(!is_type_in_typecache(possible_turf, locate_paths) || !can_see(controller.pawn, possible_turf, search_range))
found -= possible_turf
return (length(found)) ? get_closest_atom(/turf, found, controller.pawn) : null
59 changes: 41 additions & 18 deletions code/datums/ai/hunting_behavior/hunting_behaviors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,37 @@

/// Finds a specific atom type to hunt.
/datum/ai_behavior/find_hunt_target
///is this only meant to search for turf types?
var/search_turf_types = FALSE

/datum/ai_behavior/find_hunt_target/perform(seconds_per_tick, datum/ai_controller/controller, hunting_target_key, types_to_hunt, hunt_range)
var/mob/living/living_mob = controller.pawn

for(var/atom/possible_dinner as anything in typecache_filter_list(range(hunt_range, living_mob), types_to_hunt))
if(!valid_dinner(living_mob, possible_dinner, hunt_range))
var/list/interesting_objects = search_turf_types ? RANGE_TURFS(hunt_range, living_mob) : oview(hunt_range, living_mob)
for(var/atom/possible_dinner as anything in typecache_filter_list(interesting_objects, types_to_hunt))
if(!valid_dinner(living_mob, possible_dinner, hunt_range, controller, seconds_per_tick))
continue
controller.set_blackboard_key(hunting_target_key, possible_dinner)
return AI_BEHAVIOR_DELAY | AI_BEHAVIOR_SUCCEEDED
return AI_BEHAVIOR_DELAY | AI_BEHAVIOR_FAILED

<<<<<<< Updated upstream
/datum/ai_behavior/find_hunt_target/proc/valid_dinner(mob/living/source, atom/dinner, radius)
=======
/datum/ai_behavior/find_hunt_target/proc/valid_dinner(mob/living/source, atom/dinner, radius, datum/ai_controller/controller, seconds_per_tick)
>>>>>>> Stashed changes
if(isliving(dinner))
var/mob/living/living_target = dinner
if(living_target.stat == DEAD) //bitch is dead
return FALSE

return can_see(source, dinner, radius)

/datum/ai_behavior/find_hunt_target/search_turf_types
search_turf_types = TRUE

/// Hunts down a specific atom type.
/datum/ai_behavior/hunt_target
behavior_flags = AI_BEHAVIOR_REQUIRE_MOVEMENT
behavior_flags = AI_BEHAVIOR_REQUIRE_MOVEMENT | AI_BEHAVIOR_REQUIRE_REACH
/// How long do we have to wait after a successful hunt?
var/hunt_cooldown = 5 SECONDS
/// Do we reset the target after attacking something, so we can check for status changes.
Expand Down Expand Up @@ -117,25 +126,23 @@
if(always_reset_target && hunting_target_key)
controller.clear_blackboard_key(hunting_target_key)

/datum/ai_behavior/hunt_target/unarmed_attack_target
///do we toggle combat mode before interacting with the object?
var/switch_combat_mode = FALSE
/datum/ai_behavior/hunt_target/interact_with_target
///what combat mode should we use to interact with
var/behavior_combat_mode = TRUE

/datum/ai_behavior/hunt_target/unarmed_attack_target/target_caught(mob/living/hunter, obj/structure/cable/hunted)
hunter.UnarmedAttack(hunted, TRUE)
/datum/ai_behavior/hunt_target/interact_with_target/target_caught(mob/living/hunter, obj/structure/cable/hunted)
var/datum/ai_controller/controller = hunter.ai_controller
controller.ai_interact(target = hunted, combat_mode = behavior_combat_mode)

/datum/ai_behavior/hunt_target/unarmed_attack_target/finish_action(datum/ai_controller/controller, succeeded, hunting_target_key, hunting_cooldown_key)
. = ..()
if(!switch_combat_mode)
return
var/mob/living/living_pawn = controller.pawn
living_pawn.istate = initial(living_pawn.istate)
/datum/ai_behavior/hunt_target/interact_with_target/combat_mode_off
behavior_combat_mode = FALSE

/datum/ai_behavior/hunt_target/unarmed_attack_target/switch_combat_mode
switch_combat_mode = TRUE
/datum/ai_behavior/hunt_target/interact_with_target/reset_target
always_reset_target = TRUE

/datum/ai_behavior/hunt_target/unarmed_attack_target/reset_target
/datum/ai_behavior/hunt_target/interact_with_target/reset_target_combat_mode_off
always_reset_target = TRUE
behavior_combat_mode = FALSE

/datum/ai_behavior/hunt_target/use_ability_on_target
always_reset_target = TRUE
Expand All @@ -152,3 +159,19 @@
var/datum/action/cooldown/ability = hunter.ai_controller.blackboard[ability_key]
ability.InterceptClickOn(hunter, null, hunted)


/datum/ai_behavior/hunt_target/latch_onto

/datum/ai_behavior/hunt_target/latch_onto/setup(datum/ai_controller/controller, hunting_target_key, hunting_cooldown_key)
. = ..()
var/mob/living/living_pawn = controller.pawn
if(living_pawn.buckled)
return FALSE

/datum/ai_behavior/hunt_target/latch_onto/target_caught(mob/living/hunter, obj/hunted)
if(hunter.buckled)
return FALSE
if(!hunted.buckle_mob(hunter, force = TRUE))
return FALSE
hunted.visible_message(span_notice("[hunted] has been latched onto by [hunter]!"))
return TRUE
7 changes: 7 additions & 0 deletions code/datums/components/bakeable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
/// Reagents that should be added to the result
var/list/added_reagents

<<<<<<< Updated upstream
/datum/component/bakeable/Initialize(bake_result, required_bake_time, positive_result, use_large_steam_sprit, list/added_reagents)
=======
/// Reagents that should be added to the result
var/list/added_reagents

/datum/component/bakeable/Initialize(bake_result, required_bake_time, positive_result, use_large_steam_sprite)
>>>>>>> Stashed changes
. = ..()
if(!isitem(parent)) //Only items support baking at the moment
return COMPONENT_INCOMPATIBLE
Expand Down
35 changes: 35 additions & 0 deletions code/datums/elements/attack_zone_randomiser.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/// Pick a random attack zone before you attack something
/datum/element/attack_zone_randomiser
element_flags = ELEMENT_BESPOKE
argument_hash_start_idx = 2
/// List of attack zones you can select, should be a subset of GLOB.all_body_zones
var/list/valid_attack_zones

/datum/element/attack_zone_randomiser/Attach(datum/target, list/valid_attack_zones = GLOB.all_body_zones)
. = ..()
if (!isliving(target))
return ELEMENT_INCOMPATIBLE
RegisterSignals(target, list(COMSIG_HOSTILE_PRE_ATTACKINGTARGET, COMSIG_LIVING_UNARMED_ATTACK), PROC_REF(randomise))
src.valid_attack_zones = valid_attack_zones

/datum/element/attack_zone_randomiser/Detach(datum/source)
UnregisterSignal(source, list (COMSIG_HOSTILE_PRE_ATTACKINGTARGET, COMSIG_LIVING_UNARMED_ATTACK))
return ..()

/// If we're attacking a carbon, pick a random defence zone
/datum/element/attack_zone_randomiser/proc/randomise(mob/living/source, atom/target)
SIGNAL_HANDLER
if (!iscarbon(target))
return
if (!isnull(source.mind) && !isnull(source.hud_used?.zone_select))
return
var/mob/living/living_target = target
var/list/blacklist_zones = GLOB.all_body_zones - valid_attack_zones
var/new_zone = living_target.get_random_valid_zone(blacklisted_parts = blacklist_zones, bypass_warning = TRUE)
if (isnull(new_zone))
new_zone = BODY_ZONE_CHEST
var/atom/movable/screen/zone_sel/zone_selector = source.hud_used?.zone_select
if (isnull(zone_selector))
source.zone_selected = new_zone
else
zone_selector.set_selected_zone(new_zone, source, should_log = FALSE)
Loading

0 comments on commit d792645

Please sign in to comment.