Files
Bubberstation/code/modules/mob/living/basic/pets/dog/_dog.dm
Sealed101 cc57581b73 Dog wit the butter (feat. a bunch of dog-related code improvements) (#77039)
## About The Pull Request
Adds a `dog_fashion` for the stick of butter.(screenshot is outdated as
Lisa won't have butter no more)
![butter
dawgs](https://github.com/tgstation/tgstation/assets/75863639/a22e702c-98a8-4283-abd9-28d4a9fb3bd0)

Also cleans up dog.dm because it was SHIT and FUCK and MY FUCKING GOD
TWO INITIALIZE()s TWO TIMES IN A SINGLE FILE WHAT IN THE GODDAMN

Most noticeably, Lisa properly won't wear any hats, and puppies properly
can't wear head/back items (by just removing those item slots from the
strip/equip menu. if some admeme wants to fumble around they may still
equip shit there. but otherwise for a normal player those slots are
inaccessible).
Basic mobs now also send signals when they run
`appear_dead`/`appear_alive` procs, which corgis hook into to update
their dead fashion overlays.
The side-effect of getting that to work is that dogs (and any basic mob
that uses `play_dead` ai behavior) are so good at feigning death, that
they fool medical HUDs and other related things. They're just that good.
There's a bunch of other things involved and I was mostly just being
angry at the state of the file so I'll check back when I gather all
things changed.


![strippy](https://github.com/tgstation/tgstation/assets/75863639/ec4d17a2-d4df-401c-bd1f-7c4ee1b95671)


## Why It's Good For The Game


https://github.com/tgstation/tgstation/assets/75863639/b34589cb-94d6-4b80-bf0f-1814c08da100



## Changelog
🆑
add: dog with a butter on 'em
add: dead dog with da butter on 'em (dogs feigning death are so good at
it, they appear dead to medical HUDs and other things)
add: Nars-Ian now can revive from the dead if he consumes a pet
fix: fixes dog fashion items with no speech modifiers set making dressed
up corgis unable to perform their speech or emote behaviors
fix: fixes old Ian losing his mobility ride when shaved with a razor
fix: fixes pets not dropping their collar when gibbed
fix: butter don't go on Lisa and corgi puppies (Lisa won't wear hats and
corgi puppies can't wear hats and back slot items)
/🆑
2023-07-27 12:54:07 -06:00

95 lines
3.7 KiB
Plaintext

// Add 'walkies' as valid input
/datum/pet_command/follow/dog
speech_commands = list("heel", "follow", "walkies")
// Add 'good dog' as valid input
/datum/pet_command/good_boy/dog
speech_commands = list("good dog")
// Set correct attack behaviour
/datum/pet_command/point_targetting/attack/dog
attack_behaviour = /datum/ai_behavior/basic_melee_attack/dog
/datum/pet_command/point_targetting/attack/dog/set_command_active(mob/living/parent, mob/living/commander)
. = ..()
parent.ai_controller.set_blackboard_key(BB_DOG_HARASS_HARM, TRUE)
//Dogs.
/mob/living/basic/pet/dog
mob_biotypes = MOB_ORGANIC|MOB_BEAST
response_help_continuous = "pets"
response_help_simple = "pet"
response_disarm_continuous = "bops"
response_disarm_simple = "bop"
response_harm_continuous = "kicks"
response_harm_simple = "kick"
speak_emote = list("barks", "woofs")
faction = list(FACTION_NEUTRAL)
can_be_held = TRUE
ai_controller = /datum/ai_controller/basic_controller/dog
// The dog attack pet command can raise melee attack above 0
attack_verb_continuous = "bites"
attack_verb_simple = "bite"
attack_sound = 'sound/weapons/bite.ogg'
attack_vis_effect = ATTACK_EFFECT_BITE
/// Instructions you can give to dogs
var/static/list/pet_commands = list(
/datum/pet_command/idle,
/datum/pet_command/free,
/datum/pet_command/good_boy/dog,
/datum/pet_command/follow/dog,
/datum/pet_command/point_targetting/attack/dog,
/datum/pet_command/point_targetting/fetch,
/datum/pet_command/play_dead,
)
/mob/living/basic/pet/dog/Initialize(mapload)
. = ..()
AddElement(/datum/element/pet_bonus, "woofs happily!")
AddElement(/datum/element/footstep, FOOTSTEP_MOB_CLAW)
AddElement(/datum/element/unfriend_attacker, untamed_reaction = "%SOURCE% fixes %TARGET% with a look of betrayal.")
AddComponent(/datum/component/tameable, food_types = list(/obj/item/food/meat/slab/human/mutant/skeleton, /obj/item/stack/sheet/bone), tame_chance = 30, bonus_tame_chance = 15, after_tame = CALLBACK(src, PROC_REF(tamed)), unique = FALSE)
AddComponent(/datum/component/obeys_commands, pet_commands)
var/dog_area = get_area(src)
for(var/obj/structure/bed/dogbed/dog_bed in dog_area)
if(dog_bed.update_owner(src)) //No muscling in on my turf you fucking parrot
break
///Updates dog speech and emotes
/mob/living/basic/pet/dog/proc/update_dog_speech(datum/ai_planning_subtree/random_speech/speech)
speech.speak = string_list(list("YAP", "Woof!", "Bark!", "AUUUUUU"))
speech.emote_hear = string_list(list("barks!", "woofs!", "yaps.","pants."))
speech.emote_see = string_list(list("shakes [p_their()] head.", "chases [p_their()] tail.","shivers."))
///Proc to run on a successful taming attempt
/mob/living/basic/pet/dog/proc/tamed(mob/living/tamer)
visible_message(span_notice("[src] licks at [tamer] in a friendly manner!"))
/// A dog bone fully heals a dog, and befriends it if it's not your friend.
/obj/item/dog_bone
name = "jumbo dog bone"
desc = "A tasty femur full of juicy marrow, the perfect gift for your best friend."
w_class = WEIGHT_CLASS_SMALL
icon = 'icons/obj/food/meat.dmi'
icon_state = "skeletonmeat"
custom_materials = list(/datum/material/bone = SHEET_MATERIAL_AMOUNT * 4)
force = 3
throwforce = 5
attack_verb_continuous = list("attacks", "bashes", "batters", "bludgeons", "whacks")
attack_verb_simple = list("attack", "bash", "batter", "bludgeon", "whack")
/obj/item/dog_bone/pre_attack(atom/target, mob/living/user, params)
if (!isdog(target) || user.combat_mode)
return ..()
var/mob/living/basic/pet/dog/dog_target = target
if (dog_target.stat != CONSCIOUS)
return ..()
dog_target.emote("spin")
dog_target.fully_heal()
if (dog_target.befriend(user))
dog_target.tamed(user)
new /obj/effect/temp_visual/heart(target.loc)
qdel(src)
return TRUE