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

* [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
/🆑

* [no gbp] raptors with the playful trait now play with their owners

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-05-20 06:22:01 -04:00
committed by GitHub
co-authored by Ben10Omintrix
parent 9a817ad7b6
commit ffd24e42a3
5 changed files with 39 additions and 1 deletions
@@ -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]!")