Skip to content

Commit

Permalink
add pony (tgstation#76955)
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptis authored and Absolucy committed May 17, 2024
1 parent b6d2d02 commit 38992e2
Show file tree
Hide file tree
Showing 11 changed files with 132 additions and 0 deletions.
9 changes: 9 additions & 0 deletions code/datums/ai/basic_mobs/basic_subtrees/speech_subtree.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@
emote_hear = list("snorts.")
emote_see = list("sniffs around.")

/datum/ai_planning_subtree/random_speech/pony
speech_chance = 3
emote_hear = list("whinnies!")
emote_see = list("horses around.")

/datum/ai_planning_subtree/random_speech/pony/tamed
speech_chance = 3
emote_see = list("snorts.")

/datum/ai_planning_subtree/random_speech/killer_tomato
speech_chance = 3
speak = list("gnashes.", "growls lowly.", "snarls.")
Expand Down
25 changes: 25 additions & 0 deletions code/datums/components/riding/riding_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,31 @@
set_vehicle_dir_layer(EAST, OBJ_LAYER)
set_vehicle_dir_layer(WEST, OBJ_LAYER)

/datum/component/riding/creature/pony/handle_specials()
. = ..()
vehicle_move_delay = 1.5
set_riding_offsets(RIDING_OFFSET_ALL, list(TEXT_NORTH = list(0, 9), TEXT_SOUTH = list(0, 9), TEXT_EAST = list(-2, 9), TEXT_WEST = list(2, 9)))
set_vehicle_dir_layer(SOUTH, ABOVE_MOB_LAYER)
set_vehicle_dir_layer(NORTH, OBJ_LAYER)
set_vehicle_dir_layer(EAST, OBJ_LAYER)
set_vehicle_dir_layer(WEST, OBJ_LAYER)

/datum/component/riding/creature/pony
COOLDOWN_DECLARE(pony_trot_cooldown)

/datum/component/riding/creature/pony/driver_move(atom/movable/movable_parent, mob/living/user, direction)
. = ..()

if (. == COMPONENT_DRIVER_BLOCK_MOVE || !COOLDOWN_FINISHED(src, pony_trot_cooldown))
return

var/mob/living/carbon/human/human_user = user

if(human_user && is_clown_job(human_user.mind?.assigned_role))
// there's a new sheriff in town
playsound(movable_parent, 'sound/creatures/pony/clown_gallup.ogg', 50)
COOLDOWN_START(src, pony_trot_cooldown, 500 MILLISECONDS)

/datum/component/riding/creature/bear/handle_specials()
. = ..()
set_riding_offsets(RIDING_OFFSET_ALL, list(TEXT_NORTH = list(1, 8), TEXT_SOUTH = list(1, 8), TEXT_EAST = list(-3, 6), TEXT_WEST = list(3, 6)))
Expand Down
8 changes: 8 additions & 0 deletions code/modules/cargo/packs/livestock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@
contains = list(/mob/living/basic/pig)
crate_name = "pig crate"

/datum/supply_pack/critter/pony
name = "Pony Crate"
desc = "Ponies, yay! (Just the one.)"
cost = CARGO_CRATE_VALUE * 6
access_view = ACCESS_SERVICE
contains = list(/mob/living/basic/pony)
crate_name = "pony crate"

/datum/supply_pack/critter/crab
name = "Crab Rocket"
desc = "CRAAAAAAB ROCKET. CRAB ROCKET. CRAB ROCKET. CRAB CRAB CRAB CRAB CRAB CRAB CRAB \
Expand Down
89 changes: 89 additions & 0 deletions code/modules/mob/living/basic/farm_animals/pony.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/mob/living/basic/pony
name = "pony"
desc = "Look at my horse, my horse is amazing!"
icon_state = "pony"
icon_living = "pony"
icon_dead = "pony_dead"
gender = MALE
mob_biotypes = MOB_ORGANIC | MOB_BEAST
speak_emote = list("neighs", "winnies")
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"
attack_verb_continuous = "kicks"
attack_verb_simple = "kick"
attack_sound = 'sound/weapons/punch1.ogg'
attack_vis_effect = ATTACK_EFFECT_KICK
melee_damage_lower = 5
melee_damage_upper = 10
health = 50
maxHealth = 50
gold_core_spawnable = FRIENDLY_SPAWN
blood_volume = BLOOD_VOLUME_NORMAL
ai_controller = /datum/ai_controller/basic_controller/pony

/mob/living/basic/pony/Initialize(mapload)
. = ..()

AddElement(/datum/element/pet_bonus, "whickers.")
AddElement(/datum/element/ai_retaliate)
AddElement(/datum/element/ai_flee_while_injured)
AddElement(/datum/element/waddling)
AddComponent(/datum/component/tameable, food_types = list(/obj/item/food/grown/apple), tame_chance = 25, bonus_tame_chance = 15, after_tame = CALLBACK(src, PROC_REF(tamed)))

/mob/living/basic/pony/proc/tamed(mob/living/tamer)
can_buckle = TRUE
buckle_lying = 0
playsound(src, 'sound/creatures/pony/snort.ogg', 50)
AddElement(/datum/element/ridable, /datum/component/riding/creature/pony)
visible_message(span_notice("[src] snorts happily."))

ai_controller.replace_planning_subtrees(list(
/datum/ai_planning_subtree/find_nearest_thing_which_attacked_me_to_flee,
/datum/ai_planning_subtree/flee_target,
/datum/ai_planning_subtree/random_speech/pony/tamed
))

/mob/living/basic/pony/proc/whinny_angrily()
manual_emote("whinnies ANGRILY!")

playsound(src, pick(list(
'sound/creatures/pony/whinny01.ogg',
'sound/creatures/pony/whinny02.ogg',
'sound/creatures/pony/whinny03.ogg'
)), 50)

/mob/living/basic/pony/take_damage(damage_amount, damage_type, damage_flag, sound_effect, attack_dir, armour_penetration)
. = ..()

if (prob(33))
whinny_angrily()

/mob/living/basic/pony/melee_attack(atom/target, list/modifiers, ignore_cooldown = FALSE)
. = ..()

if (!.)
return

whinny_angrily()

/datum/ai_controller/basic_controller/pony
blackboard = list(
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
BB_PET_TARGETTING_DATUM = /datum/targeting_strategy/basic/not_friends,
)

ai_traits = STOP_MOVING_WHEN_PULLED
ai_movement = /datum/ai_movement/basic_avoidance
idle_behavior = /datum/idle_behavior/idle_random_walk

planning_subtrees = list(
/datum/ai_planning_subtree/find_nearest_thing_which_attacked_me_to_flee,
/datum/ai_planning_subtree/flee_target,
/datum/ai_planning_subtree/target_retaliate,
/datum/ai_planning_subtree/basic_melee_attack_subtree,
/datum/ai_planning_subtree/random_speech/pony
)
Binary file modified icons/mob/simple/animal.dmi
Binary file not shown.
Binary file added sound/creatures/pony/clown_gallup.ogg
Binary file not shown.
Binary file added sound/creatures/pony/snort.ogg
Binary file not shown.
Binary file added sound/creatures/pony/whinny01.ogg
Binary file not shown.
Binary file added sound/creatures/pony/whinny02.ogg
Binary file not shown.
Binary file added sound/creatures/pony/whinny03.ogg
Binary file not shown.
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4253,6 +4253,7 @@
#include "code\modules\mob\living\basic\drone\visuals_icons.dm"
#include "code\modules\mob\living\basic\farm_animals\deer.dm"
#include "code\modules\mob\living\basic\farm_animals\pig.dm"
#include "code\modules\mob\living\basic\farm_animals\pony.dm"
#include "code\modules\mob\living\basic\farm_animals\rabbit.dm"
#include "code\modules\mob\living\basic\farm_animals\sheep.dm"
#include "code\modules\mob\living\basic\farm_animals\bee\_bee.dm"
Expand Down

0 comments on commit 38992e2

Please sign in to comment.