diff --git a/code/modules/vehicles/trolley.dm b/code/modules/vehicles/trolley.dm index 51051d4eaf49..ded8e3187572 100644 --- a/code/modules/vehicles/trolley.dm +++ b/code/modules/vehicles/trolley.dm @@ -4,7 +4,7 @@ name = "trolley" desc = "It's mostly used to move crates around in bulk." icon = 'icons/obj/vehicles.dmi' - icon_state = "trolley_0" + icon_state = "trolley" max_integrity = 150 armor = list(MELEE = 0, BULLET = 0, LASER = 20, ENERGY = 0, BOMB = 10, BIO = 0, FIRE = 20, ACID = 0) var/amount_of_cargo = 0 @@ -46,6 +46,15 @@ playsound(src, pick('sound/effects/wounds/crack1.ogg', 'sound/effects/wounds/crack2.ogg'), 40) animate(src, pixel_y = -4, time = 0.5 SECONDS, easing = SINE_EASING) animate(occupants[1], pixel_y = 4, time = 0.5 SECONDS, easing = SINE_EASING) + if(amount_of_cargo) + handle_transform() + +/obj/vehicle/ridden/trolley/proc/handle_transform(unloading) + var/matrix/new_transform = matrix() + if(dir == WEST && !unloading) + new_transform.Scale(-1,1) + for(var/obj/structure/closet/crate/cargo in contents) + cargo.transform = new_transform /obj/vehicle/ridden/trolley/examine(mob/user) . = ..() @@ -96,8 +105,13 @@ /obj/vehicle/ridden/trolley/proc/load_cargo(obj/structure/closet/crate/cargo) cargo.close() cargo.forceMove(src) + vis_contents += cargo + cargo.layer = VEHICLE_RIDING_LAYER + cargo.pixel_y = 4 + if(amount_of_cargo) + cargo.pixel_y += 12 * amount_of_cargo amount_of_cargo++ - icon_state = "trolley_[amount_of_cargo]" + handle_transform() /obj/vehicle/ridden/trolley/proc/unload_cargo(mob/living/user) if(!amount_of_cargo) @@ -111,12 +125,15 @@ to_chat(user, span_warning("There's no space to unload from [src]!")) return + handle_transform(TRUE) + cargo.pixel_y = initial(pixel_y) + cargo.layer = initial(layer) + vis_contents -= cargo cargo.forceMove(deposit_turf) user.visible_message( span_notice("[user] unloads [cargo] from [src]."), span_notice("You unload [cargo] from [src].")) amount_of_cargo-- - icon_state = "trolley_[amount_of_cargo]" /obj/vehicle/ridden/trolley/attack_hand(mob/living/user, list/modifiers) . = ..() diff --git a/icons/obj/vehicles.dmi b/icons/obj/vehicles.dmi index 1894d484a2d3..8d10cf066edc 100644 Binary files a/icons/obj/vehicles.dmi and b/icons/obj/vehicles.dmi differ