This repository was archived by the owner on May 22, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 458
Expand file tree
/
Copy pathatv.dm
More file actions
62 lines (54 loc) · 1.81 KB
/
atv.dm
File metadata and controls
62 lines (54 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/obj/vehicle/ridden/atv
name = "all-terrain vehicle"
desc = "An all-terrain vehicle built for traversing rough terrain with ease. One of the few old-Earth technologies that are still relevant on most planet-bound outposts."
icon_state = "atv"
key_type = /obj/item/key
var/static/mutable_appearance/atvcover
/obj/vehicle/ridden/atv/Initialize(mapload)
. = ..()
var/datum/component/riding/D = LoadComponent(/datum/component/riding)
D.vehicle_move_delay = 1
D.set_riding_offsets(RIDING_OFFSET_ALL, list(TEXT_NORTH = list(0, 4), TEXT_SOUTH = list(0, 4), TEXT_EAST = list(0, 4), TEXT_WEST = list( 0, 4)))
D.set_vehicle_dir_layer(SOUTH, ABOVE_MOB_LAYER)
D.set_vehicle_dir_layer(NORTH, OBJ_LAYER)
D.set_vehicle_dir_layer(EAST, OBJ_LAYER)
D.set_vehicle_dir_layer(WEST, OBJ_LAYER)
/obj/vehicle/ridden/atv/post_buckle_mob(mob/living/M)
add_overlay(atvcover)
return ..()
/obj/vehicle/ridden/atv/post_unbuckle_mob(mob/living/M)
if(!has_buckled_mobs())
cut_overlay(atvcover)
return ..()
//TURRETS!
/obj/vehicle/ridden/atv/turret
var/obj/machinery/porta_turret/syndicate/vehicle_turret/turret = null
/obj/machinery/porta_turret/syndicate/vehicle_turret
name = "mounted turret"
scan_range = 7
density = FALSE
/obj/vehicle/ridden/atv/turret/Initialize(mapload)
. = ..()
turret = new(loc)
turret.base = src
/obj/vehicle/ridden/atv/turret/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change)
. = ..()
if(turret)
turret.forceMove(get_turf(src))
switch(dir)
if(NORTH)
turret.pixel_x = 0
turret.pixel_y = 4
turret.layer = ABOVE_MOB_LAYER
if(EAST)
turret.pixel_x = -12
turret.pixel_y = 4
turret.layer = OBJ_LAYER
if(SOUTH)
turret.pixel_x = 0
turret.pixel_y = 4
turret.layer = OBJ_LAYER
if(WEST)
turret.pixel_x = 12
turret.pixel_y = 4
turret.layer = OBJ_LAYER