forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic cats and mini kitchen helpers (tgstation#79800)
## About The Pull Request this pr transforms cats into basic pets! cats now have some new behavior. they can carry fish and hunted mice in their mouths to deliver it to kittens, and kittens will eat them. ![catmouse](https://github.com/tgstation/tgstation/assets/138636438/8f146be4-c7b2-41d3-8301-734be49b5efc) ![catfish](https://github.com/tgstation/tgstation/assets/138636438/f8df54f2-9183-406d-afbd-f90f415f7f3d) if a kitten sees you holding food, it will point at you and meow loudly until u give it the food. becareful when putting male cats near each other, there is a small chance they get into a heated argument and meow loudly at each other until one of them flees. also added a new small cat house for cats. cats will use these homes if u build one near them (using 5 wood planks) ![cathouse](https://github.com/tgstation/tgstation/assets/138636438/9515a78c-fdfe-461b-bad2-6b497117c694) Chefs can craft the cake cat and breadcat. these are useful cats because they can help the chef around in the kitchen. they will turn stoves and grills off when food is ready, so they dont burn. and the cake cat will help the chef decorate his donuts ## Why It's Good For The Game refactors cats into basic mobs and gives them a deeper ai ## Changelog :cl: refactor: cats are now basic pets. please report any bugs. add: the cake cat and bread cat can now help the chef around in the kitchen /:cl:
- Loading branch information
1 parent
3516674
commit ce6f272
Showing
52 changed files
with
968 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
/// similar to finding a target but looks for food types in the // the what? | ||
/datum/ai_planning_subtree/find_food | ||
///behavior we use to find the food | ||
var/datum/ai_behavior/finding_behavior = /datum/ai_behavior/find_and_set/in_list | ||
///key of foods list | ||
var/food_list_key = BB_BASIC_FOODS | ||
|
||
/datum/ai_planning_subtree/find_food/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick) | ||
. = ..() | ||
if(controller.blackboard_key_exists(BB_BASIC_MOB_CURRENT_TARGET)) | ||
// Busy with something | ||
return | ||
|
||
controller.queue_behavior(/datum/ai_behavior/find_and_set/in_list, BB_BASIC_MOB_CURRENT_TARGET, controller.blackboard[BB_BASIC_FOODS]) | ||
controller.queue_behavior(finding_behavior, BB_BASIC_MOB_CURRENT_TARGET, controller.blackboard[food_list_key]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* element for mobs that can be consumed! | ||
*/ | ||
/datum/element/consumable_mob | ||
element_flags = ELEMENT_BESPOKE | ||
argument_hash_start_idx = 2 | ||
///reagents to give our consumer | ||
var/list/reagents_list | ||
|
||
/datum/element/consumable_mob/Attach(datum/target, list/reagents_list) | ||
. = ..() | ||
if(!isliving(target)) | ||
return ELEMENT_INCOMPATIBLE | ||
if(isnull((reagents_list))) | ||
stack_trace("No valid reagents list provided!") | ||
|
||
src.reagents_list = reagents_list | ||
RegisterSignal(target, COMSIG_ATOM_ATTACK_HAND, PROC_REF(on_consume)) | ||
|
||
/datum/element/consumable_mob/Detach(datum/target) | ||
. = ..() | ||
UnregisterSignal(target, COMSIG_ATOM_ATTACK_HAND) | ||
|
||
/datum/element/consumable_mob/proc/on_consume(atom/movable/source, mob/living/consumer) | ||
SIGNAL_HANDLER | ||
if(!consumer.combat_mode || !consumer.reagents) | ||
return | ||
for(var/reagent_type in reagents_list) | ||
if(isnull(reagents_list[reagent_type])) | ||
return | ||
consumer.reagents.add_reagent(reagent_type, reagents_list[reagent_type]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/obj/structure/cat_house | ||
name = "cat house" | ||
desc = "cozy home for cats" | ||
icon = 'icons/mob/simple/pets.dmi' | ||
icon_state = "cat_house" | ||
density = TRUE | ||
anchored = TRUE | ||
///cat residing in this house | ||
var/mob/living/resident_cat | ||
|
||
/obj/structure/cat_house/Initialize(mapload) | ||
. = ..() | ||
RegisterSignal(src, COMSIG_ATOM_ATTACK_BASIC_MOB, PROC_REF(enter_home)) | ||
|
||
/obj/structure/cat_house/proc/enter_home(datum/source, mob/living/attacker) | ||
SIGNAL_HANDLER | ||
|
||
if(isnull(resident_cat) && istype(attacker, /mob/living/basic/pet/cat)) | ||
attacker.forceMove(src) | ||
return | ||
if(resident_cat == attacker) | ||
attacker.forceMove(drop_location()) | ||
|
||
/obj/structure/cat_house/Entered(atom/movable/mover) | ||
. = ..() | ||
if(!istype(mover, /mob/living/basic/pet/cat)) | ||
return | ||
resident_cat = mover | ||
update_appearance(UPDATE_OVERLAYS) | ||
|
||
/obj/structure/cat_house/Exited(atom/movable/mover) | ||
. = ..() | ||
if(mover != resident_cat) | ||
return | ||
resident_cat = null | ||
update_appearance(UPDATE_OVERLAYS) | ||
|
||
/obj/structure/cat_house/update_overlays() | ||
. = ..() | ||
if(isnull(resident_cat)) | ||
return | ||
var/image/cat_icon = image(icon = resident_cat.icon, icon_state = resident_cat.icon_state, layer = LOW_ITEM_LAYER) | ||
cat_icon.transform = cat_icon.transform.Scale(0.7, 0.7) | ||
cat_icon.pixel_x = 0 | ||
cat_icon.pixel_y = -9 | ||
. += cat_icon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.