Files
Bubberstation/code/modules/vehicles/speedbike.dm
T
5165d42c1c [MIRROR] Ridden vehicles pass bullets, checks for new incapacitation traits for whether or not you fall off (#1521)
* Ridden vehicles pass bullets, checks for new incapacitation traits for whether or not you fall off (#54376)

Ridden vehicles now pass any objects that normally pass tables. This includes bullets, thrown objects, and probably dwarves?

Ridden vehicles check for the various incapacitation traits instead of just usable hands for whether you fall off. Doesn't fix corpses buckled to these objects but that'll require more work to fix because it's all tied into relay_move.

This doesn't affect any ridden object that doesn't checks for hand availability. Like skateboards and wheelchairs (although how exactly your wheelchair is moving without hands or mechanical parts is beyond me).

* Ridden vehicles pass bullets, checks for new incapacitation traits for whether or not you fall off

Co-authored-by: necromanceranne <40847847+necromanceranne@users.noreply.github.com>
2020-10-30 17:28:08 +00:00

96 lines
3.5 KiB
Plaintext

/obj/vehicle/ridden/space
name = "Generic Space Vehicle!"
/obj/vehicle/ridden/space/Initialize()
. = ..()
var/datum/component/riding/D = LoadComponent(/datum/component/riding)
D.override_allow_spacemove = TRUE
/obj/vehicle/ridden/space/speedbike
name = "Speedbike"
icon = 'icons/obj/bike.dmi'
icon_state = "speedbike_blue"
layer = LYING_MOB_LAYER
rider_check_flags = REQUIRES_LEGS | REQUIRES_ARMS | UNBUCKLE_DISABLED_RIDER
var/overlay_state = "cover_blue"
var/mutable_appearance/overlay
/obj/vehicle/ridden/space/speedbike/Initialize()
. = ..()
overlay = mutable_appearance(icon, overlay_state, ABOVE_MOB_LAYER)
add_overlay(overlay)
var/datum/component/riding/D = LoadComponent(/datum/component/riding)
D.set_riding_offsets(RIDING_OFFSET_ALL, list(TEXT_NORTH = list(0, -8), TEXT_SOUTH = list(0, 4), TEXT_EAST = list(-10, 5), TEXT_WEST = list( 10, 5)))
D.vehicle_move_delay = 0
D.set_vehicle_dir_offsets(NORTH, -16, -16)
D.set_vehicle_dir_offsets(SOUTH, -16, -16)
D.set_vehicle_dir_offsets(EAST, -18, 0)
D.set_vehicle_dir_offsets(WEST, -18, 0)
/obj/vehicle/ridden/space/speedbike/Move(newloc,move_dir)
if(has_buckled_mobs())
new /obj/effect/temp_visual/dir_setting/speedbike_trail(loc,move_dir)
return ..()
/obj/vehicle/ridden/space/speedbike/red
icon_state = "speedbike_red"
overlay_state = "cover_red"
//BM SPEEDWAGON
/obj/vehicle/ridden/space/speedwagon
name = "BM Speedwagon"
desc = "Push it to the limit, walk along the razor's edge."
icon = 'icons/obj/car.dmi'
icon_state = "speedwagon"
layer = LYING_MOB_LAYER
var/static/mutable_appearance/overlay = mutable_appearance(icon, "speedwagon_cover", ABOVE_MOB_LAYER)
max_buckled_mobs = 4
var/crash_all = FALSE //CHAOS
pixel_y = -48
pixel_x = -48
/obj/vehicle/ridden/space/speedwagon/Initialize()
. = ..()
add_overlay(overlay)
var/datum/component/riding/D = LoadComponent(/datum/component/riding)
D.vehicle_move_delay = 0
D.set_riding_offsets(1, list(TEXT_NORTH = list(-10, -4), TEXT_SOUTH = list(16, 3), TEXT_EAST = list(-4, 30), TEXT_WEST = list(4, -3)))
D.set_riding_offsets(2, list(TEXT_NORTH = list(19, -5, 4), TEXT_SOUTH = list(-13, 3, 4), TEXT_EAST = list(-4, -3, 4.1), TEXT_WEST = list(4, 28, 3.9)))
D.set_riding_offsets(3, list(TEXT_NORTH = list(-10, -18, 4.2), TEXT_SOUTH = list(16, 25, 3.9), TEXT_EAST = list(-22, 30), TEXT_WEST = list(22, -3, 4.1)))
D.set_riding_offsets(4, list(TEXT_NORTH = list(19, -18, 4.2), TEXT_SOUTH = list(-13, 25, 3.9), TEXT_EAST = list(-22, 3, 3.9), TEXT_WEST = list(22, 28)))
D.set_vehicle_dir_offsets(NORTH, -48, -48)
D.set_vehicle_dir_offsets(SOUTH, -48, -48)
D.set_vehicle_dir_offsets(EAST, -48, -48)
D.set_vehicle_dir_offsets(WEST, -48, -48)
for(var/i in GLOB.cardinals)
D.set_vehicle_dir_layer(i, BELOW_MOB_LAYER)
/obj/vehicle/ridden/space/speedwagon/Bump(atom/A)
. = ..()
if(A.density && has_buckled_mobs())
var/atom/throw_target = get_edge_target_turf(A, dir)
if(crash_all)
if(ismovable(A))
var/atom/movable/AM = A
AM.throw_at(throw_target, 4, 3)
visible_message("<span class='danger'>[src] crashes into [A]!</span>")
playsound(src, 'sound/effects/bang.ogg', 50, TRUE)
if(ishuman(A))
var/mob/living/carbon/human/H = A
H.Paralyze(100)
H.adjustStaminaLoss(30)
H.apply_damage(rand(20,35), BRUTE)
if(!crash_all)
H.throw_at(throw_target, 4, 3)
visible_message("<span class='danger'>[src] crashes into [H]!</span>")
playsound(src, 'sound/effects/bang.ogg', 50, TRUE)
/obj/vehicle/ridden/space/speedwagon/Moved()
. = ..()
if(has_buckled_mobs())
for(var/atom/A in range(2, src))
if(!(A in buckled_mobs))
Bump(A)