mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-31 12:01:47 +00:00
About The Pull Request Chiefly this refactors dogs to use the newer component/datum system for "pet which follows instructions". It also refactors it a little bit because I had better ideas while working on this than I had last week. Specifically, instead of passing around keys we just stick a weakref to our currently active behaviour in the blackboard. Basically the same but skipping an unecessary step. Additionally it adds a component for the previous "befriending a mob by clicking it repeatedly" behaviour which hopefully we won't use too much because it's not very exciting (I am planning on replacing it for dogs some time after Christmas). The biggest effort in here was making the Fetch command more generic, which includes multiple behaviours (which might be used on their own?) and another component (for holding an item without hands). Additionally I noticed that dogs would keep following my instructions after they died. This seems unideal, and would be unideal for virtually any AI controller, so I added it as an AI_flag just in case there's some circumstance where you do want to process AI on a dead mob. Finally this should replicate all behaviour Ian already had plus "follow" (from rats) and a new bonus easter egg reaction, however I noticed that the fetch command is supposed to have Ian eat any food that you try to get him to fetch. This has been broken for some time and I will be away from my desk for a couple weeks pretty soon, so I wrote the behaviour for this but left it unused. I will come back to this in the future, once I figure out a way to implement it which does not require adding the "you can hit this" flag to every edible item. Also I had to refit the recent addition of dogs barking at felinids to fit into this, with a side effect that now dogs won't get mad at a Felinid they are friends with. This... feels like intended behaviour anyway? Why It's Good For The Game It's good for these to work the same way instead of reimplementing the same behaviour in multiple files. Being able to have Ian (or other dogs) follow you around the station is both fun and cute, and also makes him significantly more vulnerable to being murdered. Changelog cl add: Ian has learned some new tricks, tell him what a good boy he is! add: Ian will come on a walk with you, if you are his friend. refactor: Ian's tricks work the same way as some other mobs' tricks and should be extendable to future mobs. fix: Dogs no longer run at the maximum possible speed for a mob at all times. add: When Ian gets old, he also slows down. Poor little guy. add: Dogs will no longer dislike the presence of Felinids who have taken the time to befriend them. /cl
40 lines
1.4 KiB
Plaintext
40 lines
1.4 KiB
Plaintext
/datum/ai_controller/basic_controller/dog
|
|
blackboard = list(
|
|
BB_DOG_HARASS_HARM = TRUE,
|
|
BB_VISION_RANGE = AI_DOG_VISION_RANGE,
|
|
BB_PET_TARGETTING_DATUM = new /datum/targetting_datum/not_friends(),
|
|
)
|
|
ai_movement = /datum/ai_movement/basic_avoidance
|
|
idle_behavior = /datum/idle_behavior/idle_dog
|
|
planning_subtrees = list(
|
|
/datum/ai_planning_subtree/random_speech/dog,
|
|
/datum/ai_planning_subtree/pet_planning,
|
|
/datum/ai_planning_subtree/dog_harassment,
|
|
)
|
|
|
|
/**
|
|
* Same thing but with make tiny corgis and use access cards.
|
|
*/
|
|
/datum/ai_controller/basic_controller/dog/corgi
|
|
blackboard = list(
|
|
BB_DOG_HARASS_HARM = TRUE,
|
|
BB_VISION_RANGE = AI_DOG_VISION_RANGE,
|
|
BB_PET_TARGETTING_DATUM = new /datum/targetting_datum/not_friends(),
|
|
BB_BABIES_PARTNER_TYPES = list(/mob/living/basic/pet/dog),
|
|
BB_BABIES_CHILD_TYPES = list(/mob/living/basic/pet/dog/corgi/puppy = 95, /mob/living/basic/pet/dog/corgi/puppy/void = 5),
|
|
)
|
|
|
|
planning_subtrees = list(
|
|
/datum/ai_planning_subtree/random_speech/dog,
|
|
/datum/ai_planning_subtree/make_babies, // Ian WILL prioritise sex over following your instructions
|
|
/datum/ai_planning_subtree/pet_planning,
|
|
/datum/ai_planning_subtree/dog_harassment,
|
|
)
|
|
|
|
/datum/ai_controller/basic_controller/dog/corgi/get_access()
|
|
var/mob/living/basic/pet/dog/corgi/corgi_pawn = pawn
|
|
if(!istype(corgi_pawn))
|
|
return
|
|
|
|
return corgi_pawn.access_card
|