Fixes riding offsets not counting rider size

Fixes riding offsets not counting rider size or the difference between the two, which would end up resulting in small riders on large mounts sitting nowhere near the back of the mount
This commit is contained in:
Verkister
2022-01-08 18:45:06 +02:00
parent 22a34d927b
commit 7cae8d2016
4 changed files with 21 additions and 14 deletions
+1
View File
@@ -8,6 +8,7 @@
var/key_name = "the keys" // What the 'keys' for the thing being rided on would be called.
var/atom/movable/ridden = null // The thing that the datum is attached to.
var/only_one_driver = FALSE // If true, only the person in 'front' (first on list of riding mobs) can drive.
var/rider_size = 1 // VOREStation Edit to figure out offsets for rider.
/datum/riding/New(atom/movable/_ridden)
ridden = _ridden
@@ -208,12 +208,13 @@
/datum/riding/dogborg/get_offsets(pass_index) // list(dir = x, y, layer)
var/mob/living/L = ridden
var/scale = L.size_multiplier
var/scale_difference = (L.size_multiplier - rider_size) * 10
var/list/values = list(
"[NORTH]" = list(0, 10*scale, ABOVE_MOB_LAYER),
"[SOUTH]" = list(0, 10*scale, BELOW_MOB_LAYER),
"[EAST]" = list(-5*scale, 10*scale, ABOVE_MOB_LAYER),
"[WEST]" = list(5*scale, 10*scale, ABOVE_MOB_LAYER))
"[NORTH]" = list(0, 10*scale + scale_difference, ABOVE_MOB_LAYER),
"[SOUTH]" = list(0, 10*scale + scale_difference, BELOW_MOB_LAYER),
"[EAST]" = list(-5*scale, 10*scale + scale_difference, ABOVE_MOB_LAYER),
"[WEST]" = list(5*scale, 10*scale + scale_difference, ABOVE_MOB_LAYER))
return values
@@ -254,6 +255,7 @@
. = ..()
if(.)
riding_datum.rider_size = M.size_multiplier
buckled_mobs[M] = "riding"
/mob/living/silicon/robot/MouseDrop_T(mob/living/M, mob/living/user) //Prevention for forced relocation caused by can_buckle. Base proc has no other use.
@@ -301,12 +301,13 @@
/datum/riding/simple_mob/get_offsets(pass_index) // list(dir = x, y, layer)
var/mob/living/simple_mob/L = ridden
var/scale = L.size_multiplier
var/scale_difference = (L.size_multiplier - rider_size) * 10
var/list/values = list(
"[NORTH]" = list(0, L.mount_offset_y*scale, ABOVE_MOB_LAYER),
"[SOUTH]" = list(0, L.mount_offset_y*scale, BELOW_MOB_LAYER),
"[EAST]" = list(-L.mount_offset_x*scale, L.mount_offset_y*scale, ABOVE_MOB_LAYER),
"[WEST]" = list(L.mount_offset_x*scale, L.mount_offset_y*scale, ABOVE_MOB_LAYER))
"[NORTH]" = list(0, L.mount_offset_y*scale + scale_difference, ABOVE_MOB_LAYER),
"[SOUTH]" = list(0, L.mount_offset_y*scale + scale_difference, BELOW_MOB_LAYER),
"[EAST]" = list(-L.mount_offset_x*scale, L.mount_offset_y*scale + scale_difference, ABOVE_MOB_LAYER),
"[WEST]" = list(L.mount_offset_x*scale, L.mount_offset_y*scale + scale_difference, ABOVE_MOB_LAYER))
return values
@@ -333,6 +334,7 @@
. = ..()
if(.)
riding_datum.rider_size = H.size_multiplier
buckled_mobs[H] = "riding"
/mob/living/simple_mob/attack_hand(mob/user as mob)
@@ -26,14 +26,15 @@
//Hoooo boy.
/datum/riding/taur/get_offsets(pass_index) // list(dir = x, y, layer)
var/mob/living/L = ridden
var/scale_x = L.icon_scale_x * L.size_multiplier //VOREStation Edit
var/scale_y = L.icon_scale_y * L.size_multiplier //VOREStation Edit
var/scale_x = L.icon_scale_x * L.size_multiplier //VOREStation Edit Start
var/scale_y = L.icon_scale_y * L.size_multiplier
var/scale_difference = (L.size_multiplier - rider_size) * 10
var/list/values = list(
"[NORTH]" = list(0, 8*scale_y, ABOVE_MOB_LAYER),
"[SOUTH]" = list(0, 8*scale_y, BELOW_MOB_LAYER),
"[EAST]" = list(-10*scale_x, 8*scale_y, ABOVE_MOB_LAYER),
"[WEST]" = list(10*scale_x, 8*scale_y, ABOVE_MOB_LAYER))
"[NORTH]" = list(0, 8*scale_y + scale_difference, ABOVE_MOB_LAYER),
"[SOUTH]" = list(0, 8*scale_y + scale_difference, BELOW_MOB_LAYER),
"[EAST]" = list(-10*scale_x, 8*scale_y + scale_difference, ABOVE_MOB_LAYER),
"[WEST]" = list(10*scale_x, 8*scale_y + scale_difference, ABOVE_MOB_LAYER)) //VOREStation Edit End
return values
@@ -74,6 +75,7 @@
. = ..()
if(.)
riding_datum.rider_size = M.size_multiplier
buckled_mobs[M] = "riding"
/mob/living/carbon/human/MouseDrop_T(mob/living/M, mob/living/user) //Prevention for forced relocation caused by can_buckle. Base proc has no other use.