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

95 lines
3.1 KiB
Plaintext

/obj/vehicle/ridden/quadbike
name = "electric all terrain vehicle"
desc = "A rideable electric ATV designed for all terrain. Except space."
icon = 'icons/obj/vehicles_64x64.dmi'
icon_state = "quad"
integrity = 200
integrity_max = 200
riding_handler_type = /datum/component/riding_handler/vehicle/ridden/quadbike
key_type = /obj/item/key/quadbike
var/paint_color = "#666666" // Todo, put on _vehicle.dm
var/frame_state = "quad" //Custom-item proofing!
var/custom_frame = FALSE
/obj/vehicle/ridden/quadbike/nokey
key_type = null
/obj/item/key/quadbike
name = "key"
desc = "A keyring with a small steel key, and a blue fob reading \"ZOOM!\"."
icon = 'icons/obj/vehicles.dmi'
icon_state = "quad_keys"
w_class = WEIGHT_CLASS_TINY
/datum/component/riding_handler/vehicle/ridden/quadbike
vehicle_move_delay = 2
allowed_turf_types = list(
/turf/simulated,
/turf/unsimulated
)
vehicle_offsets = list(-16, 0)
rider_check_flags = list(CF_RIDING_CHECK_ARMS,
CF_RIDING_CHECK_RESTRAINED,
CF_RIDING_CHECK_UNCONSCIOUS,
CF_RIDING_CHECK_INCAPACITATED
)
/datum/component/riding_handler/vehicle/ridden/quadbike/
/datum/component/riding_handler/vehicle/ridden/quadbike
rider_offsets = list(
list(
list(0, 7, 0.1, null),
list(2, 2, 0.1, null),
list(0, 7, 0.1, null),
list(-2, 2, 0.1, null)
)
)
rider_offset_format = CF_RIDING_OFFSETS_ENUMERATED
riding_handler_flags = list(CF_RIDING_HANDLER_ALLOW_BORDER,
CF_RIDING_HANDLER_IS_CONTROLLABLE)
// Overlay shenanagens, WIP @ktoma36
/obj/vehicle/ridden/quadbike/random/Initialize(mapload)
. = ..()
paint_color = rgb(rand(1,255),rand(1,255),rand(1,255))
update_icon()
/obj/vehicle/ridden/quadbike/update_icon()
..()
cut_overlays()
var/list/overlays_to_add = list()
if(custom_frame)
var/image/Bodypaint = new(icon = 'icons/obj/custom_items_vehicle.dmi', icon_state = "[frame_state]_a", layer = src.layer)
Bodypaint.color = paint_color
overlays_to_add += Bodypaint
var/image/Overmob = new(icon = 'icons/obj/custom_items_vehicle.dmi', icon_state = "[frame_state]_overlay", layer = src.layer + 0.2) //over mobs
var/image/Overmob_color = new(icon = 'icons/obj/custom_items_vehicle.dmi', icon_state = "[frame_state]_overlay_a", layer = src.layer + 0.2) //over the over mobs, gives the color.
Overmob.plane = FLY_LAYER
Overmob_color.plane = FLY_LAYER
Overmob_color.color = paint_color
overlays_to_add += Overmob
overlays_to_add += Overmob_color
add_overlay(overlays_to_add)
return
var/image/Bodypaint = new(icon = 'icons/obj/vehicles_64x64.dmi', icon_state = "[frame_state]_a", layer = src.layer)
Bodypaint.color = paint_color
overlays_to_add += Bodypaint
var/image/Overmob = new(icon = 'icons/obj/vehicles_64x64.dmi', icon_state = "[frame_state]_overlay", layer = src.layer + 0.2) //over mobs
var/image/Overmob_color = new(icon = 'icons/obj/vehicles_64x64.dmi', icon_state = "[frame_state]_overlay_a", layer = src.layer + 0.2) //over the over mobs, gives the color.
Overmob.plane = FLY_LAYER
Overmob_color.plane = FLY_LAYER
Overmob_color.color = paint_color
overlays_to_add += Overmob
overlays_to_add += Overmob_color
add_overlay(overlays_to_add)