Files
279949242c Riding touchup (offset fixed) (#7120)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

Gives people the option to be directed by someone buckled to them.
Offset gets handled nicer now, resize affects the riding offset, taurs
actually have their center set to it, and not their tail end if 200%, or
infront of them if 25% size.
The code to saddle up actual horses, shanks, and stormdrifter bulls is
fixed, too, as it didn't switch the riding handler, which didn't get
deleted, and such not switching to the controllable part.
A few typos got fixed, stumbled by typoing my own search for the 3 mobs
for their var.
Small rendering tweak to potentially draw bags ontop of tails (required
for saddlebags.)
Saddlebags now include the saddle option, and such makes it easier for
one to hold onto

## Why It's Good For The Game

People do look more like they are carried by the person they are buckled
to. The new option could allow some RP options, synth having a
controller or being just directed by holding some part of the body, or
maybe way to put the jousting compontent to use? The bucking gives an
option to remove someone riding one, as one otherwise has no control
over it. The saddlebag also even works as a saddle now, although that
can be removed if the freeded up hand is deemed too strong.

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
fix: taurs actually get their center calculated correctly, noticeable if
buckled sideways.
tweak: offsets get resized for riding.
fix: horse, shank, stomrdrifter bull saddeling
fix: taur bags actually get drawn over the taur body
add: ability to buck someone off your back
tweak: no riding hand needed if the taur is wearing a saddle.
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Co-authored-by: MarsMond <no@email>
2025-05-08 20:57:13 -07:00

80 lines
2.5 KiB
Plaintext

/datum/component/riding_filter/mob/human
expected_typepath = /mob/living/carbon/human
handler_typepath = /datum/component/riding_handler/mob/human
offhand_requirements_are_rigid = FALSE
/// offhands required to fireman someone
var/ridden_offhands_needed_fireman = 1
/// offhands required on the rider for piggybacking
var/rider_offhands_needed_piggyback = 1
/datum/component/riding_filter/mob/human/check_mount_attempt(mob/M, buckle_flags, mob/user, semantic)
if(!ishuman(M))
return FALSE // nah
var/mob/living/carbon/human/H = parent
var/saddle = H.item_by_slot_id(SLOT_ID_BACK)
if(saddle && istype(saddle, /obj/item/storage/backpack/saddlebag_common))
rider_offhands_needed_piggyback = FALSE
else
rider_offhands_needed_piggyback = TRUE
return ..()
/datum/component/riding_filter/mob/human/rider_offhands_needed(mob/rider, semantic)
return semantic == BUCKLE_SEMANTIC_HUMAN_FIREMAN? 0 : rider_offhands_needed_piggyback
/datum/component/riding_filter/mob/human/ridden_offhands_needed(mob/rider, semantic)
. = ..()
if(!rider)
var/atom/movable/AM = parent
var/tally = 0
for(var/i in AM.buckled_mobs)
if(AM.buckled_mobs[i] == BUCKLE_SEMANTIC_HUMAN_FIREMAN)
tally = 1
break
return max(., tally)
. = max(., semantic == BUCKLE_SEMANTIC_HUMAN_FIREMAN? ridden_offhands_needed_fireman : 0)
/datum/component/riding_handler/mob/human
expected_typepath = /mob/living/carbon/human
riding_handler_flags = CF_RIDING_HANDLER_EPHEMERAL
ridden_check_flags = CF_RIDING_CHECK_INCAPACITATED | CF_RIDING_CHECK_LYING
rider_offsets = list(
list(0, 6, 1, null),
list(-8, 6, -1, null),
list(0, 6, -1, null),
list(8, 6, -1, null)
)
rider_offset_format = CF_RIDING_OFFSETS_DIRECTIONAL
var/taur_handling = FALSE
/datum/component/riding_handler/mob/human/Initialize()
. = ..()
if(. == COMPONENT_INCOMPATIBLE)
return
var/mob/living/carbon/human/H = parent
taur_handling = isTaurTail(H.tail_style)
/datum/component/riding_handler/mob/human/rider_offsets(mob/rider, pos, semantic, list/default, dir)
. = ..()
if(taur_handling)//Already centering on it
.[1] = 0
.[2] = 3 //Also don't climb too high
if(semantic == BUCKLE_SEMANTIC_HUMAN_FIREMAN)
.[1] = -2
.[2] = 6
switch(dir)
if(NORTH)
.[3] = -1
if(EAST)
if(taur_handling)
.[1] = 6 //8 to remove the taur offset, the -2 of the fireman carry
if(SOUTH)
.[3] = 1
if(WEST)
if(taur_handling)
.[1] = -10
/datum/component/riding_handler/mob/human/controllable
riding_handler_flags = CF_RIDING_HANDLER_EPHEMERAL|CF_RIDING_HANDLER_IS_CONTROLLABLE