Files
Bubberstation/code/modules/mob/living/basic/pets/fox.dm
LemonInTheDark 9696dd1a1d Targeting Datums Renamed (and global) (#79513)
## About The Pull Request

[Implements the backend required to make targeting datums
global](6901ead12e)

It's inconsistent with the rest of basic ai for these to have a high
degree of state, plus like, such a waste yaknow?

[Implements
GET_TARGETING_STRATEGY](d79c29134d)

Regexes used:
new.*(/datum/targetting_datum[^,(]*)\(*\)* -> GET_TARGETING_STRATEGY($1)

Renamed all instances of targetting to targeting (also targetting datum
-> targeting strategy)

I've used GET_TARGETING_STRATEGY at the source where the keys are
actually used, rather then in the listing. This works out just fine.

## Why It's Good For The Game

Not a misspelled name through the whole codebase, very slightly less
memory load for basically no downside (slight cpu cost maybe but not a
significant one.

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2023-11-09 14:44:24 +00:00

75 lines
2.5 KiB
Plaintext

/* Foxes.
*
* Foxes are cowardly creatures that will hunt any small animals, but only when no one is looking.
*/
/mob/living/basic/pet/fox
name = "fox"
desc = "They're a fox."
icon = 'icons/mob/simple/pets.dmi'
icon_state = "fox"
icon_living = "fox"
icon_dead = "fox_dead"
speak_emote = list("geckers", "barks")
butcher_results = list(/obj/item/food/meat/slab = 3)
response_help_continuous = "pets"
response_help_simple = "pet"
response_disarm_continuous = "gently pushes aside"
response_disarm_simple = "gently push aside"
response_harm_continuous = "kicks"
response_harm_simple = "kick"
gold_core_spawnable = FRIENDLY_SPAWN
can_be_held = TRUE
held_state = "fox"
melee_damage_lower = 5
melee_damage_upper = 5
attack_verb_continuous = "bites"
attack_verb_simple = "bite"
attack_sound = 'sound/weapons/bite.ogg'
attack_vis_effect = ATTACK_EFFECT_BITE
ai_controller = /datum/ai_controller/basic_controller/fox
/mob/living/basic/pet/fox/Initialize(mapload)
. = ..()
AddElement(/datum/element/pet_bonus, "pants and yaps happily!")
AddElement(/datum/element/footstep, footstep_type = FOOTSTEP_MOB_CLAW)
AddElement(/datum/element/tiny_mob_hunter, MOB_SIZE_SMALL)
AddElement(/datum/element/ai_retaliate)
/datum/ai_controller/basic_controller/fox
blackboard = list(
BB_ALWAYS_IGNORE_FACTION = TRUE,
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic/of_size/ours_or_smaller,
BB_FLEE_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
)
ai_movement = /datum/ai_movement/basic_avoidance
idle_behavior = /datum/idle_behavior/idle_random_walk
planning_subtrees = list(
/datum/ai_planning_subtree/target_retaliate/to_flee,
/datum/ai_planning_subtree/flee_target/from_flee_key,
/datum/ai_planning_subtree/simple_find_target/not_while_observed,
/datum/ai_planning_subtree/basic_melee_attack_subtree,
/datum/ai_planning_subtree/random_speech/fox,
)
// An AI controller for more docile foxes.
/datum/ai_controller/basic_controller/fox/docile
planning_subtrees = list(
/datum/ai_planning_subtree/target_retaliate/to_flee,
/datum/ai_planning_subtree/flee_target/from_flee_key,
/datum/ai_planning_subtree/random_speech/fox,
)
// The captain's fox, Renault
/mob/living/basic/pet/fox/renault
name = "Renault"
desc = "Renault, the Captain's trustworthy fox."
gender = FEMALE
gold_core_spawnable = NO_SPAWN
unique_pet = TRUE
// A more docile subtype that won't attack other animals.
/mob/living/basic/pet/fox/docile
ai_controller = /datum/ai_controller/basic_controller/fox/docile