[READY]VEHICLE REFACTOR - Riding datums --> Components, Vehicles --> /obj/vehicle, staging for mech overhaul later on
This commit is contained in:
committed by
CitadelStationBot
parent
6217206bae
commit
66c66f0bd7
@@ -65,6 +65,7 @@
|
||||
M.throw_alert("buckled", /obj/screen/alert/restrained/buckled)
|
||||
post_buckle_mob(M)
|
||||
|
||||
SendSignal(COMSIG_MOVABLE_BUCKLE, M, force)
|
||||
return TRUE
|
||||
|
||||
/obj/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE)
|
||||
@@ -82,8 +83,9 @@
|
||||
buckled_mob.update_canmove()
|
||||
buckled_mob.clear_alert("buckled")
|
||||
buckled_mobs -= buckled_mob
|
||||
SendSignal(COMSIG_MOVABLE_UNBUCKLE, buckled_mob, force)
|
||||
|
||||
post_buckle_mob(.)
|
||||
post_unbuckle_mob(.)
|
||||
|
||||
/atom/movable/proc/unbuckle_all_mobs(force=FALSE)
|
||||
if(!has_buckled_mobs())
|
||||
@@ -91,11 +93,12 @@
|
||||
for(var/m in buckled_mobs)
|
||||
unbuckle_mob(m, force)
|
||||
|
||||
//Handle any extras after buckling/unbuckling
|
||||
//Called on buckle_mob() and unbuckle_mob()
|
||||
//Handle any extras after buckling
|
||||
//Called on buckle_mob()
|
||||
/atom/movable/proc/post_buckle_mob(mob/living/M)
|
||||
return
|
||||
|
||||
//same but for unbuckle
|
||||
/atom/movable/proc/post_unbuckle_mob(mob/living/M)
|
||||
|
||||
//Wrapper procs that handle sanity and user feedback
|
||||
/atom/movable/proc/user_buckle_mob(mob/living/M, mob/user, check_loc = TRUE)
|
||||
|
||||
@@ -102,7 +102,11 @@
|
||||
appearance = saved_appearance
|
||||
if(istype(M.buckled, /obj/vehicle))
|
||||
var/obj/vehicle/V = M.buckled
|
||||
V.riding_datum.force_dismount(M)
|
||||
GET_COMPONENT_FROM(VRD, /datum/component/riding, V)
|
||||
if(VRD)
|
||||
VRD.force_dismount(M)
|
||||
else
|
||||
V.unbuckle_mob(M, force = TRUE)
|
||||
M.loc = src
|
||||
master = C
|
||||
master.active_dummy = src
|
||||
|
||||
@@ -474,7 +474,7 @@
|
||||
attack_verb = list("smacked", "whacked", "slammed", "smashed")
|
||||
|
||||
/obj/item/melee/skateboard/attack_self(mob/user)
|
||||
new /obj/vehicle/scooter/skateboard(get_turf(user))
|
||||
new /obj/vehicle/ridden/scooter/skateboard(get_turf(user))
|
||||
qdel(src)
|
||||
|
||||
/obj/item/melee/baseball_bat
|
||||
|
||||
@@ -66,16 +66,16 @@
|
||||
"<span class='italics'>You hear squelching...</span>")
|
||||
|
||||
/obj/structure/bed/nest/post_buckle_mob(mob/living/M)
|
||||
if(M in buckled_mobs)
|
||||
M.pixel_y = 0
|
||||
M.pixel_x = initial(M.pixel_x) + 2
|
||||
M.layer = BELOW_MOB_LAYER
|
||||
add_overlay(nest_overlay)
|
||||
else
|
||||
M.pixel_x = M.get_standard_pixel_x_offset(M.lying)
|
||||
M.pixel_y = M.get_standard_pixel_y_offset(M.lying)
|
||||
M.layer = initial(M.layer)
|
||||
cut_overlay(nest_overlay)
|
||||
M.pixel_y = 0
|
||||
M.pixel_x = initial(M.pixel_x) + 2
|
||||
M.layer = BELOW_MOB_LAYER
|
||||
add_overlay(nest_overlay)
|
||||
|
||||
/obj/structure/bed/nest/post_unbuckle_mob(mob/living/M)
|
||||
M.pixel_x = M.get_standard_pixel_x_offset(M.lying)
|
||||
M.pixel_y = M.get_standard_pixel_y_offset(M.lying)
|
||||
M.layer = initial(M.layer)
|
||||
cut_overlay(nest_overlay)
|
||||
|
||||
/obj/structure/bed/nest/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
|
||||
switch(damage_type)
|
||||
|
||||
@@ -85,21 +85,21 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/bed/roller/post_buckle_mob(mob/living/M)
|
||||
if(M in buckled_mobs)
|
||||
density = TRUE
|
||||
icon_state = "up"
|
||||
M.pixel_y = initial(M.pixel_y)
|
||||
else
|
||||
density = FALSE
|
||||
icon_state = "down"
|
||||
M.pixel_x = M.get_standard_pixel_x_offset(M.lying)
|
||||
M.pixel_y = M.get_standard_pixel_y_offset(M.lying)
|
||||
density = TRUE
|
||||
icon_state = "up"
|
||||
M.pixel_y = initial(M.pixel_y)
|
||||
|
||||
/obj/structure/bed/roller/Moved()
|
||||
. = ..()
|
||||
if(has_gravity())
|
||||
playsound(src, 'sound/effects/roll.ogg', 100, 1)
|
||||
|
||||
/obj/structure/bed/roller/post_unbuckle_mob(mob/living/M)
|
||||
density = FALSE
|
||||
icon_state = "down"
|
||||
M.pixel_x = M.get_standard_pixel_x_offset(M.lying)
|
||||
M.pixel_y = M.get_standard_pixel_y_offset(M.lying)
|
||||
|
||||
/obj/item/roller
|
||||
name = "roller bed"
|
||||
desc = "A collapsed roller bed that can be carried around."
|
||||
|
||||
@@ -91,7 +91,11 @@
|
||||
layer = OBJ_LAYER
|
||||
|
||||
/obj/structure/chair/post_buckle_mob(mob/living/M)
|
||||
..()
|
||||
. = ..()
|
||||
handle_layer()
|
||||
|
||||
/obj/structure/chair/post_unbuckle_mob()
|
||||
. = ..()
|
||||
handle_layer()
|
||||
|
||||
/obj/structure/chair/proc/spin()
|
||||
@@ -167,12 +171,18 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/chair/comfy/post_buckle_mob(mob/living/M)
|
||||
..()
|
||||
. = ..()
|
||||
update_armrest()
|
||||
|
||||
/obj/structure/chair/comfy/proc/update_armrest()
|
||||
if(has_buckled_mobs())
|
||||
add_overlay(armrest)
|
||||
else
|
||||
cut_overlay(armrest)
|
||||
|
||||
/obj/structure/chair/comfy/post_unbuckle_mob()
|
||||
. = ..()
|
||||
update_armrest()
|
||||
|
||||
/obj/structure/chair/comfy/brown
|
||||
color = rgb(255,113,0)
|
||||
|
||||
Reference in New Issue
Block a user