Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Code Bounty] Horses and Cowboy stuff #3541

Merged
merged 11 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/__DEFINES/projectiles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#define CALIBER_38 ".38"
/// The caliber used by the chaplain's revolver.
#define CALIBER_77 ".77"
/// The caliber used by long revolver and long rifle
#define CALIBER_45L ".45l"
/// The caliber used by the C-20r SMG, the tommygun, and the M1911 pistol.
#define CALIBER_45 ".45"
/// The caliber used by sniper rifles and the desert eagle.
Expand Down
10 changes: 10 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,16 @@
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
26 changes: 26 additions & 0 deletions code/datums/components/riding/riding_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,32 @@
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
88 changes: 88 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,88 @@
/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,
)

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
)
13 changes: 13 additions & 0 deletions code/modules/projectiles/ammunition/ballistic/revolver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,16 @@
name = ".38 Iceblox bullet casing"
desc = "A .38 Iceblox bullet casing."
projectile_type = /obj/projectile/bullet/c38/iceblox

// .45 (Lever Rifle and Long Revolver)

/obj/item/ammo_casing/g45l
name = ".45 Long bullet casing "
desc = "A .45 Long bullet casing."
projectile_type = /obj/projectile/bullet/g45l

/obj/item/ammo_casing/g45l/rubber
name = ".45 Long rubber bullet casing"
desc = "A .45 Long rubber bullet casing."
caliber = ".45l"
projectile_type = /obj/projectile/bullet/g45l/rubber
14 changes: 14 additions & 0 deletions code/modules/projectiles/boxes_magazines/ammo_boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@
desc = "Designed to quickly reload revolvers. Iceblox bullets contain a cryogenic payload."
ammo_type = /obj/item/ammo_casing/c38/iceblox

/obj/item/ammo_box/g45l
name = "ammo box (.45 Long Lethal)"
desc = "This box contains .45 Long lethal cartridges."
ammo_type = /obj/item/ammo_casing/g45l
icon_state = "45box"
max_ammo = 24

/obj/item/ammo_box/g45l/rubber
name = "ammo box (.45 Long Rubber)"
desc = "Brought to you at great expense,this box contains .45 Long rubber cartridges."
icon_state = "45box"
ammo_type = /obj/item/ammo_casing/g45l/rubber
max_ammo = 24

/obj/item/ammo_box/c9mm
name = "ammo box (9mm)"
icon_state = "9mmbox"
Expand Down
6 changes: 6 additions & 0 deletions code/modules/projectiles/boxes_magazines/internal/revolver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@
/obj/item/ammo_box/magazine/internal/rus357/Initialize(mapload)
stored_ammo += new ammo_type(src)
. = ..()

/obj/item/ammo_box/magazine/internal/cylinder/rev45l
name = ".45 Long revolver cylinder"
ammo_type = /obj/item/ammo_casing/g45l
caliber = CALIBER_45L
max_ammo = 6
5 changes: 5 additions & 0 deletions code/modules/projectiles/boxes_magazines/internal/shotgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@
name = "triple-barrel shotgun internal magazine"
ammo_type = /obj/item/ammo_casing/shotgun/incapacitate
max_ammo = 3

/obj/item/ammo_box/magazine/internal/shot/levergun
name = "brush gun internal magazine"
ammo_type = /obj/item/ammo_casing/g45l
max_ammo = 6
13 changes: 13 additions & 0 deletions code/modules/projectiles/guns/ballistic/revolver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@

accepted_magazine_type = /obj/item/ammo_box/magazine/internal/cylinder/rev762

/obj/item/gun/ballistic/revolver/r45l
name = "\improper .45 Long Revolver"
desc = "A cheap .45 Long Revolver. Pray the timing keeps."
icon_state = "45revolver"
accepted_magazine_type = /obj/item/ammo_box/magazine/internal/cylinder/rev45l
obj_flags = UNIQUE_RENAME

unique_reskin = list("Default" = "45revolver",
"Cowboy" = "357colt",
"Lucky" = "lucky" //Well do ya?
)

// A gun to play Russian Roulette!
// You can spin the chamber to randomize the position of the bullet.
Expand Down Expand Up @@ -286,3 +297,5 @@
user.emote("scream")
user.drop_all_held_items()
user.Paralyze(80)


20 changes: 20 additions & 0 deletions code/modules/projectiles/guns/ballistic/shotgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,23 @@
/obj/item/gun/ballistic/shotgun/hook/afterattack_secondary(atom/target, mob/user, proximity_flag, click_parameters)
hook.afterattack(target, user, proximity_flag, click_parameters)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN

// Lever gun
/obj/item/gun/ballistic/shotgun/leveraction
name = "brush gun"
desc = "While lever-actions have been horribly out of date for hundreds of years now, \
putting a nicely sized hole in a man-sized target with a .45 Long round has stayed relatively timeless."
icon_state = "brushgun"
bolt_wording = "Lever"
cartridge_wording = "bullet"
accepted_magazine_type = /obj/item/ammo_box/magazine/internal/shot/levergun
projectile_wound_bonus = 10
projectile_damage_multiplier = 1.1
w_class = WEIGHT_CLASS_BULKY
force = 10
flags_1 = CONDUCT_1
semi_auto = FALSE
internal_magazine = TRUE
casing_ejector = FALSE
weapon_weight = WEAPON_HEAVY

17 changes: 17 additions & 0 deletions code/modules/projectiles/projectile/bullets/revolver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,20 @@
ricochet_auto_aim_range = 6
ricochet_incidence_leeway = 80
ricochet_decay_chance = 1

// .45 (Lever Rifle and Long Revolver)

/obj/projectile/bullet/g45l/rubber
name = ".45 Long rubber bullet"
damage = 5
stamina = 35
weak_against_armour = TRUE
sharpness = NONE
embedding = null

/obj/projectile/bullet/g45l
name = ".45 Long bullet"
damage = 35
wound_bonus = -5
sharpness = SHARP_EDGED
embedding = list(embed_chance=25, fall_chance=2, jostle_chance=2, ignore_throwspeed_threshold=TRUE, pain_stam_pct=0.4, pain_mult=3, jostle_pain_mult=5, rip_time=1 SECONDS)
24 changes: 24 additions & 0 deletions code/modules/research/designs/autolathe/security_designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,30 @@
)
departmental_flags = DEPARTMENT_BITFLAG_SECURITY

/datum/design/g45l
name = "Ammo Box (.45 Long) (Rubber)"
id = "g45l"
build_type = AUTOLATHE
materials = list(/datum/material/iron = 30000)
build_path = /obj/item/ammo_box/g45l/rubber
category = list(
RND_CATEGORY_HACKED,
RND_CATEGORY_WEAPONS + RND_SUBCATEGORY_WEAPONS_AMMO,
)
departmental_flags = DEPARTMENT_BITFLAG_SECURITY

/datum/design/g45lethal
name = "Ammo Box (.45 Long) (Lethal)"
id = "g45lethal"
build_type = AUTOLATHE
materials = list(/datum/material/iron = 35000)
build_path = /obj/item/ammo_box/g45l
category = list(
RND_CATEGORY_HACKED,
RND_CATEGORY_WEAPONS + RND_SUBCATEGORY_WEAPONS_AMMO,
)
departmental_flags = DEPARTMENT_BITFLAG_SECURITY

/datum/design/c9mm
name = "Ammo Box (9mm) (Lethal)"
id = "c9mm"
Expand Down
Binary file modified icons/mob/clothing/back.dmi
Binary file not shown.
Binary file modified icons/obj/weapons/guns/ballistic.dmi
Binary file not shown.
29 changes: 29 additions & 0 deletions monkestation/code/modules/cargo/crates/imports.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,32 @@
access = ACCESS_ARMORY
access_view = ACCESS_ARMORY
crate_type = /obj/structure/closet/crate/secure/weapon


/datum/supply_pack/imports/Lrevolvercrate
name = "Long Revolver Crate"
desc = "We got these old revolvers from a unnamed man, enjoy them"
cost = CARGO_CRATE_VALUE * 10
contains = list(
/obj/item/gun/ballistic/revolver/r45l = 2,
/obj/item/ammo_box/g45l = 1,
/obj/item/ammo_box/g45l/rubber = 1,
)
crate_name = "Long Revolver crate"
access = ACCESS_ARMORY
access_view = ACCESS_ARMORY
crate_type = /obj/structure/closet/crate/secure/weapon

/datum/supply_pack/imports/Briflecrate
name = "Bush Rifle Crate"
desc = "These old rifles were sold to us by a unnamed man, quite the bargin"
cost = CARGO_CRATE_VALUE * 7
contains = list(
/obj/item/gun/ballistic/shotgun/leveraction = 3,
/obj/item/ammo_box/g45l = 2,
/obj/item/ammo_box/g45l/rubber = 1,
)
crate_name = "Bush Rifle crate"
access = ACCESS_ARMORY
access_view = ACCESS_ARMORY
crate_type = /obj/structure/closet/crate/secure/weapon
5 changes: 5 additions & 0 deletions monkestation/code/modules/loadouts/items/neck.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,14 @@ GLOBAL_LIST_INIT(loadout_necks, generate_loadout_items(/datum/loadout_item/neck)
item_path = /obj/item/clothing/neck/tie/bunnytie/tied

/datum/loadout_item/neck/boatcloak

name = "Boat cloak"
item_path = /obj/item/clothing/neck/boatcloak

/datum/loadout_item/neck/ranger_poncho
name = "Ranger Poncho"
item_path = /obj/item/clothing/neck/ranger_poncho

/datum/loadout_item/neck/polycloak
name = "Poly cloak"
item_path = /obj/item/clothing/neck/polycloak
Expand Down
4 changes: 4 additions & 0 deletions monkestation/code/modules/store/store_items/neck.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ GLOBAL_LIST_INIT(store_neck, generate_store_items(/datum/store_item/neck))
name = "Boat cloak"
item_path = /obj/item/clothing/neck/boatcloak
item_cost = 7500
/datum/store_item/neck/ranger_poncho
name = "Ranger Poncho"
item_path = /obj/item/clothing/neck/ranger_poncho
item_cost = 5000

/datum/store_item/neck/polycloak
name = "Poly cloak"
Expand Down
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 @@ -4341,6 +4341,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
Loading