[no gbp] raptors with the playful trait now play with their owners (#83294)

## About The Pull Request
i forgot to add this behavior to playful raptors, currently this trait
does nothing. raptors will now play with their owners and tease them if
they are nearby

## Why It's Good For The Game
adds more personality to raptors with the playful trait. also this
behavior can now be given to any other tameable mobs

## Changelog
🆑
fix: playful raptors now correctly play with owners
/🆑
This commit is contained in:
Ben10Omintrix
2024-05-19 21:29:59 -06:00
committed by GitHub
parent 90ab32949a
commit 2f3978773e
5 changed files with 39 additions and 1 deletions
+5
View File
@@ -19,6 +19,11 @@
///can this mob heal?
#define BB_BASIC_MOB_HEALER "BB_basic_mob_healer"
///the owner we will try to play with
#define BB_OWNER_TARGET "BB_owner_target"
///the list of interactions we can have with the owner
#define BB_INTERACTIONS_WITH_OWNER "BB_interactions_with_owner"
/// Store a single or list of emotes at this key
#define BB_EMOTE_KEY "BB_emotes"
@@ -0,0 +1,21 @@
/datum/ai_planning_subtree/find_and_hunt_target/play_with_owner
target_key = BB_OWNER_TARGET
hunting_behavior = /datum/ai_behavior/hunt_target/play_with_owner
finding_behavior = /datum/ai_behavior/find_hunt_target/find_owner
hunt_targets = list(/mob/living)
hunt_chance = 80
hunt_range = 9
/datum/ai_behavior/find_hunt_target/find_owner
action_cooldown = 1 MINUTES
behavior_flags = AI_BEHAVIOR_CAN_PLAN_DURING_EXECUTION
/datum/ai_behavior/find_hunt_target/find_owner/valid_dinner(mob/living/source, atom/friend, radius, datum/ai_controller/controller, seconds_per_tick)
return (friend != source) && (source.faction.Find(REF(friend))) && can_see(source, friend, radius)
/datum/ai_behavior/hunt_target/play_with_owner
/datum/ai_behavior/hunt_target/play_with_owner/target_caught(mob/living/hunter, atom/hunted)
var/list/interactions_list = hunter.ai_controller.blackboard[BB_INTERACTIONS_WITH_OWNER]
var/interaction_message = length(interactions_list) ? pick(interactions_list) : "Plays with"
hunter.manual_emote("[interaction_message] [hunted]!")
@@ -2,6 +2,12 @@
/datum/ai_controller/basic_controller/raptor
blackboard = list(
BB_INTERACTIONS_WITH_OWNER = list(
"Pecks",
"Nuzzles",
"Wags tail against",
"Playfully leans against"
),
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic/raptor,
BB_PET_TARGETING_STRATEGY = /datum/targeting_strategy/basic/raptor,
BB_BABIES_PARTNER_TYPES = list(/mob/living/basic/mining/raptor),
@@ -25,6 +31,7 @@
/datum/ai_planning_subtree/make_babies,
/datum/ai_planning_subtree/find_and_hunt_target/raptor_start_trouble,
/datum/ai_planning_subtree/express_happiness,
/datum/ai_planning_subtree/find_and_hunt_target/play_with_owner/raptor,
)
/datum/ai_controller/basic_controller/raptor/TryPossessPawn(atom/new_pawn)
@@ -39,7 +46,7 @@
/datum/targeting_strategy/basic/raptor
//dont attack anyone with the neutral faction.
//dont attack anyone with the neutral faction.
/datum/targeting_strategy/basic/raptor/faction_check(datum/ai_controller/controller, mob/living/living_mob, mob/living/the_target)
return (the_target.faction.Find(FACTION_NEUTRAL) || the_target.faction.Find(FACTION_RAPTOR))
@@ -60,3 +60,7 @@
return
return ..()
/datum/ai_planning_subtree/find_and_hunt_target/play_with_owner/raptor/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick)
if(!controller.blackboard[BB_RAPTOR_PLAYFUL])
return
return ..()
+1
View File
@@ -909,6 +909,7 @@
#include "code\datums\ai\basic_mobs\basic_subtrees\mine_walls.dm"
#include "code\datums\ai\basic_mobs\basic_subtrees\move_to_cardinal.dm"
#include "code\datums\ai\basic_mobs\basic_subtrees\opportunistic_ventcrawler.dm"
#include "code\datums\ai\basic_mobs\basic_subtrees\play_with_owners.dm"
#include "code\datums\ai\basic_mobs\basic_subtrees\prepare_travel_to_destination.dm"
#include "code\datums\ai\basic_mobs\basic_subtrees\ranged_skirmish.dm"
#include "code\datums\ai\basic_mobs\basic_subtrees\run_emote.dm"