[MIRROR] Snowmobiles and Quadhancements V2

This commit is contained in:
Heroman3003
2022-10-29 17:40:04 +10:00
committed by CHOMPStation2
parent 3edcd6a977
commit 0010d61709
16 changed files with 296 additions and 25 deletions

View File

@@ -105,3 +105,13 @@
end_sound = 'sound/machines/air_pump/airpumpshutdown.ogg'
volume = 15
pref_check = /datum/client_preference/air_pump_noise
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/datum/looping_sound/vehicle_engine
start_sound = 'sound/machines/vehicle/engine_start.ogg'
start_length = 2
mid_sounds = list('sound/machines/vehicle/engine_mid.ogg'=1)
mid_length = 6
end_sound = 'sound/machines/vehicle/engine_end.ogg'
volume = 20

View File

@@ -225,3 +225,28 @@
/datum/riding/boat/get_offsets(pass_index) // list(dir = x, y, layer)
return list("[NORTH]" = list(1, 2), "[SOUTH]" = list(1, 2), "[EAST]" = list(1, 2), "[WEST]" = list(1, 2))
/datum/riding/snowmobile
only_one_driver = TRUE // Keep your hands to yourself back there!
/datum/riding/snowmobile/get_offsets(pass_index) // list(dir = x, y, layer)
var/H = 3 // Horizontal seperation.
var/V = 2 // Vertical seperation.
var/O = 2 // Vertical offset.
switch(pass_index)
if(1) // Person on front.
return list(
"[NORTH]" = list( 0, O+V, MOB_LAYER),
"[SOUTH]" = list( 0, O, ABOVE_MOB_LAYER),
"[EAST]" = list( H, O, MOB_LAYER),
"[WEST]" = list(-H, O, MOB_LAYER)
)
if(2) // Person on back.
return list(
"[NORTH]" = list( 0, O, ABOVE_MOB_LAYER),
"[SOUTH]" = list( 0, O+V, MOB_LAYER),
"[EAST]" = list(-H, O, MOB_LAYER),
"[WEST]" = list( H, O, MOB_LAYER)
)
else
return null // This will runtime, but we want that since this is out of bounds.

View File

@@ -814,12 +814,20 @@
/datum/design/item/mechfab/vehicle/quadbike_chassis
name = "Quad bike Chassis"
desc = "A space-bike's un-assembled frame."
desc = "A quad bike's un-assembled frame."
id = "vehicle_chassis_quadbike"
req_tech = list(TECH_MATERIAL = 5, TECH_ENGINEERING = 6, TECH_MAGNET = 3, TECH_POWER = 2)
materials = list(MAT_STEEL = 15000, MAT_SILVER = 3000, MAT_PLASTIC = 3000, MAT_OSMIUM = 1000)
build_path = /obj/item/weapon/vehicle_assembly/quadbike
/datum/design/item/mechfab/vehicle/snowmobile_chassis
name = "Snowmobile Chassis"
desc = "A snowmobile's un-assembled frame."
id = "vehicle_chassis_snowmobile"
req_tech = list(TECH_MATERIAL = 5, TECH_ENGINEERING = 6, TECH_MAGNET = 3, TECH_POWER = 2)
materials = list(MAT_STEEL = 12000, MAT_SILVER = 3000, MAT_PLASTIC = 3000, MAT_OSMIUM = 1000)
build_path = /obj/item/weapon/vehicle_assembly/snowmobile
/*
* Rigsuits
*/

View File

@@ -48,6 +48,7 @@
key = new key_type(src)
var/image/I = new(icon = 'icons/obj/vehicles_vr.dmi', icon_state = "cargo_engine_overlay", layer = src.layer + 0.2) //over mobs //VOREStation edit
add_overlay(I)
update_icon()
turn_off() //so engine verbs are correctly set
/obj/vehicle/train/engine/Move(var/turf/destination)

View File

@@ -12,7 +12,6 @@
density = TRUE
slowdown = 10 //It's a vehicle frame, what do you expect?
w_class = 5
pixel_x = -16
var/build_stage = 0
var/obj/item/weapon/cell/cell = null
@@ -38,6 +37,7 @@
name = "all terrain vehicle assembly"
desc = "The frame of an ATV."
icon_state = "quad-frame"
pixel_x = -16
/obj/item/weapon/vehicle_assembly/quadbike/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
..()
@@ -143,11 +143,13 @@
user.drop_from_inventory(src)
qdel(src)
return
..()
/obj/item/weapon/vehicle_assembly/quadtrailer
name = "all terrain trailer"
desc = "The frame of a small trailer."
icon_state = "quadtrailer-frame"
pixel_x = -16
/obj/item/weapon/vehicle_assembly/quadtrailer/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
..()
@@ -272,3 +274,104 @@
user.drop_from_inventory(src)
qdel(src)
return
/*
* Snowmobile.
*/
/obj/item/weapon/vehicle_assembly/snowmobile
name = "snowmobile assembly"
desc = "The frame of a snowmobile."
icon = 'icons/obj/vehicles.dmi'
icon_state = "snowmobile-frame"
/obj/item/weapon/vehicle_assembly/snowmobile/attackby(var/obj/item/W as obj, var/mob/user as mob)
switch(build_stage)
if(0)
if(istype(W, /obj/item/stack/material/steel))
var/obj/item/stack/material/steel/S = W
if (S.get_amount() < 6)
to_chat(user, "<span class='warning'>You need six sheets of steel to add treads to \the [src].</span>")
return
to_chat(user, "<span class='notice'>You start to add treads to [src].</span>")
if(do_after(user, 40) && build_stage == 0)
if(S.use(6))
to_chat(user, "<span class='notice'>You add treads to \the [src].</span>")
increase_step("tracked [initial(name)]")
return
if(1)
if(istype(W, /obj/item/weapon/stock_parts/console_screen))
user.drop_item()
qdel(W)
to_chat(user, "<span class='notice'>You add the lights to \the [src].</span>")
increase_step()
return
if(2)
if(istype(W, /obj/item/weapon/stock_parts/spring))
user.drop_item()
qdel(W)
to_chat(user, "<span class='notice'>You add the control system to \the [src].</span>")
increase_step()
return
if(3)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if (C.get_amount() < 2)
to_chat(user, "<span class='warning'>You need two coils of wire to wire [src].</span>")
return
to_chat(user, "<span class='notice'>You start to wire [src].</span>")
if(do_after(user, 40) && build_stage == 3)
if(C.use(2))
to_chat(user, "<span class='notice'>You wire \the [src].</span>")
increase_step("wired [initial(name)]")
return
if(4)
if(istype(W, /obj/item/weapon/cell))
user.drop_item()
W.forceMove(src)
cell = W
to_chat(user, "<span class='notice'>You add the power supply to \the [src].</span>")
increase_step("powered [initial(name)]")
return
if(5)
if(istype(W, /obj/item/weapon/stock_parts/motor))
user.drop_item()
qdel(W)
to_chat(user, "<span class='notice'>You add the motor to \the [src].</span>")
increase_step()
return
if(6)
if(istype(W, /obj/item/stack/material/plasteel))
var/obj/item/stack/material/plasteel/PL = W
if (PL.get_amount() < 2)
to_chat(user, "<span class='warning'>You need two sheets of plasteel to add reinforcement to \the [src].</span>")
return
to_chat(user, "<span class='notice'>You start to add reinforcement to [src].</span>")
if(do_after(user, 40) && build_stage == 6)
if(PL.use(2))
to_chat(user, "<span class='notice'>You add reinforcement to \the [src].</span>")
increase_step("reinforced [initial(name)]")
return
if(7)
if(W.is_wrench() || W.is_screwdriver())
playsound(src, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin your finishing touches on \the [src].</span>")
if(do_after(user, 20) && build_stage == 7)
playsound(src, W.usesound, 30, 1)
var/obj/vehicle/train/engine/quadbike/snowmobile/built/product = new(src)
to_chat(user, "<span class='notice'>You finish \the [product]</span>")
product.loc = get_turf(src)
product.cell = cell
cell.forceMove(product)
cell = null
user.drop_from_inventory(src)
qdel(src)
return
..()

View File

@@ -19,7 +19,9 @@
key_type = /obj/item/weapon/key/quadbike
var/frame_state = "quad" //Custom-item proofing!
var/paint_base = 'icons/obj/vehicles_64x64.dmi'
var/custom_frame = FALSE
var/datum/looping_sound/vehicle_engine/soundloop
paint_color = "#ffffff"
@@ -28,7 +30,10 @@
/obj/vehicle/train/engine/quadbike/New()
cell = new /obj/item/weapon/cell/high(src)
key = new key_type(src)
soundloop = new(list(src), FALSE)
. = ..()
turn_off()
update_icon()
/obj/vehicle/train/engine/quadbike/built/New()
key = new key_type(src)
@@ -38,6 +43,10 @@
paint_color = rgb(rand(1,255),rand(1,255),rand(1,255))
..()
/obj/vehicle/train/engine/quadbike/Destroy()
QDEL_NULL(soundloop)
return ..()
/obj/item/weapon/key/quadbike
name = "key"
desc = "A keyring with a small steel key, and a blue fob reading \"ZOOM!\"."
@@ -47,12 +56,18 @@
/obj/vehicle/train/engine/quadbike/Moved(atom/old_loc, direction, forced = FALSE)
. = ..() //Move it move it, so we can test it test it.
if(!istype(loc, old_loc.type) && !istype(old_loc, loc.type)) //Did we move at all, and are we changing turf types?
get_turf_speeds(old_loc)
handle_vehicle_icon()
/obj/vehicle/train/engine/quadbike/proc/get_turf_speeds(atom/prev_loc)
// Same speed if turf type doesn't change
if(istype(loc, prev_loc.type) || istype(prev_loc, loc.type))
return
if(istype(loc, /turf/simulated/floor/water))
speed_mod = outdoors_speed_mod * 4 //It kind of floats due to its tires, but it is slow.
else if(istype(loc, /turf/simulated/floor/outdoors/rocks))
speed_mod = initial(speed_mod) //Rocks are good, rocks are solid.
else if(istype(loc, /turf/simulated/floor/outdoors/dirt) || istype(loc, /turf/simulated/floor/outdoors/grass))
else if(istype(loc, /turf/simulated/floor/outdoors/dirt) || istype(loc, /turf/simulated/floor/outdoors/grass) || istype(loc, /turf/simulated/floor/outdoors/newdirt) || istype(loc, /turf/simulated/floor/outdoors/newdirt_nograss))
speed_mod = outdoors_speed_mod //Dirt and grass are the outdoors bench mark.
else if(istype(loc, /turf/simulated/floor/outdoors/mud))
speed_mod = outdoors_speed_mod * 1.5 //Gets us roughly 1. Mud may be fun, but it's not the best.
@@ -61,6 +76,8 @@
else
speed_mod = initial(speed_mod)
update_car(train_length, active_engines)
/obj/vehicle/train/engine/quadbike/proc/handle_vehicle_icon()
switch(dir) //Due to being a Big Boy sprite, it has to have special pixel shifting to look 'normal' when being driven.
if(1)
pixel_y = -6
@@ -71,7 +88,6 @@
if(8)
pixel_y = 0
/obj/vehicle/train/engine/quadbike/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/multitool) && open)
var/new_paint = input(usr, "Please select paint color.", "Paint Color", paint_color) as color|null
@@ -99,12 +115,12 @@
add_overlay(Overmob_color)
return
var/image/Bodypaint = new(icon = 'icons/obj/vehicles_64x64.dmi', icon_state = "[frame_state]_a", layer = src.layer)
var/image/Bodypaint = new(icon = paint_base, icon_state = "[frame_state]_a", layer = src.layer)
Bodypaint.color = paint_color
add_overlay(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.
var/image/Overmob = new(icon = paint_base, icon_state = "[frame_state]_overlay", layer = src.layer + 0.2) //over mobs
var/image/Overmob_color = new(icon = paint_base, icon_state = "[frame_state]_overlay_a", layer = src.layer + 0.2) //over the over mobs, gives the color.
Overmob.plane = MOB_PLANE
Overmob_color.plane = MOB_PLANE
Overmob_color.color = paint_color
@@ -152,6 +168,18 @@
var/turf/T = get_step(M, pick(throw_dirs))
M.throw_at(T, 1, 1, src)
/obj/vehicle/train/engine/quadbike/turn_on()
..()
if(on)
src.visible_message("\The [src] rumbles to life.", "You hear something rumble deeply.")
soundloop.start()
/obj/vehicle/train/engine/quadbike/turn_off()
if(on)
src.visible_message("\The [src] putters before turning off.", "You hear something putter slowly.")
soundloop.stop()
..()
/*
* Trailer bits and bobs.
*/

View File

@@ -0,0 +1,82 @@
/obj/vehicle/train/engine/quadbike/snowmobile
name = "snowmobile"
desc = "An electric snowmobile for traversing snow and ice with ease! Other terrain, not so much."
description_info = "Use ctrl-click to quickly toggle the engine if you're adjacent. Alt-click to quickly remove keys. Click-drag yourself or another person to mount as a passenger (passengers can't drive!)."
icon = 'icons/obj/vehicles.dmi'
icon_state = "snowmobile"
load_item_visible = 1
speed_mod = 0.6 //Speed on non-specially-defined tiles
car_limit = 0 //No trailers.
max_buckled_mobs = 2
active_engines = 1
key_type = /obj/item/key/snowmobile
outdoors_speed_mod = 0.7 //The general 'outdoors' speed. I.E., the general difference you'll be at when driving outside on ideal terrain (...Snow)
frame_state = "snowmobile" //Custom-item proofing!
paint_base = 'icons/obj/vehicles.dmi'
pixel_x = 0
latch_on_start = 0
var/riding_datum_type = /datum/riding/snowmobile
/obj/item/key/snowmobile
name = "key"
desc = "A keyring with a small steel key, and an ice-blue fob reading \"CHILL\"."
icon = 'icons/obj/vehicles.dmi'
icon_state = "sno_keys"
w_class = ITEMSIZE_TINY
/obj/vehicle/train/engine/quadbike/snowmobile/random/Initialize()
paint_color = rgb(rand(1,255),rand(1,255),rand(1,255))
. = ..()
/obj/vehicle/train/engine/quadbike/snowmobile/Initialize()
. = ..()
riding_datum = new riding_datum_type(src)
/obj/vehicle/train/engine/quadbike/snowmobile/built/Initialize()
dir = 2 //To match the under construction frame
. = ..()
/obj/vehicle/train/engine/quadbike/snowmobile/get_turf_speeds(atom/prev_loc)
// Same speed if turf type doesn't change
if(istype(loc, prev_loc.type) || istype(prev_loc, loc.type))
return
if(istype(loc, /turf/simulated/floor/water))
speed_mod = outdoors_speed_mod * 6 //Well that was a stupid idea wasn't it?
else if(istype(loc, /turf/simulated/floor/outdoors/rocks))
speed_mod = initial(speed_mod) * 1.5 //Rocks are hard, hard and skids don't mix so you're relying on the treads. Basically foot speed.
else if(istype(loc, /turf/simulated/floor/outdoors/dirt) || istype(loc, /turf/simulated/floor/outdoors/grass) || istype(loc, /turf/simulated/floor/outdoors/newdirt) || istype(loc, /turf/simulated/floor/outdoors/newdirt_nograss))
speed_mod = outdoors_speed_mod //Dirt and grass aren't strictly what this is designed for but its a baseline.
else if(istype(loc, /turf/simulated/floor/outdoors/mud))
speed_mod = outdoors_speed_mod * 1.4 //Workable, not great though.
else if(istype(loc, /turf/simulated/floor/outdoors/snow) || istype(loc, /turf/simulated/floor/outdoors/ice))
speed_mod = outdoors_speed_mod * 0.8 //Now we're talking!
else
speed_mod = initial(speed_mod)
update_car(train_length, active_engines)
/obj/vehicle/train/engine/quadbike/snowmobile/handle_vehicle_icon()
return
//Required for the riding datum to behave:
/obj/vehicle/train/engine/quadbike/snowmobile/MouseDrop_T(var/atom/movable/C, var/mob/user as mob)
if(ismob(C))
if(C in buckled_mobs)
user_unbuckle_mob(C, user)
else
user_buckle_mob(C, user)
else
..(C, user)
/obj/vehicle/train/engine/quadbike/snowmobile/attack_hand(var/mob/user as mob)
if(user == load)
unload(load, user)
to_chat(user, "You unbuckle yourself from \the [src].")
return
if(user in buckled_mobs)
unbuckle_mob(user)
return
else if(!load && load(user, user))
to_chat(user, "You buckle yourself to \the [src].")
return

View File

@@ -13,6 +13,7 @@
var/active_engines = 0
var/train_length = 0
var/latch_on_start = 1
var/obj/vehicle/train/lead
var/obj/vehicle/train/tow
@@ -25,6 +26,7 @@
/obj/vehicle/train/Initialize()
. = ..()
for(var/obj/vehicle/train/T in orange(1, src))
if(latch_on_start)
latch(T, null)
/obj/vehicle/train/Move()

View File

@@ -197,12 +197,17 @@
return FALSE
if(powered && cell.charge < charge_use)
return FALSE
if(on)
return FALSE
on = 1
playsound(src, 'sound/machines/vehicle/ignition.ogg', 50, 1, -3)
set_light(initial(light_range))
update_icon()
return TRUE
/obj/vehicle/proc/turn_off()
if(!on)
return FALSE
if(!mechanical)
return FALSE
on = 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -45225,6 +45225,9 @@
/obj/effect/floor_decal/steeldecal/steel_decals_central5{
dir = 1
},
/obj/vehicle/train/engine/quadbike/snowmobile/random{
dir = 1
},
/turf/simulated/floor/tiled/old_tile/gray,
/area/surface/station/garage)
"uBP" = (

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -4276,7 +4276,11 @@
#include "code\modules\vehicles\cargo_train.dm"
#include "code\modules\vehicles\construction.dm"
#include "code\modules\vehicles\quad.dm"
<<<<<<< HEAD
#include "code\modules\vehicles\Securitrain_vr.dm"
=======
#include "code\modules\vehicles\snowmobile.dm"
>>>>>>> c813361179... Merge pull request #14002 from VOREStation/upstream-merge-8776
#include "code\modules\vehicles\train.dm"
#include "code\modules\vehicles\vehicle.dm"
#include "code\modules\ventcrawl\ventcrawl.dm"