-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsegway.dm
More file actions
133 lines (114 loc) · 3.82 KB
/
segway.dm
File metadata and controls
133 lines (114 loc) · 3.82 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/obj/structure/stool/bed/chair/segway
name = "Segway"
icon = 'icons/obj/vehicles.dmi'
icon_state = "segway"
anchored = 1
density = 1
//flags = OPENCONTAINER
//copypaste sorry
//var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
//var/obj/item/weapon/storage/bag/trash/mybag = null
/obj/structure/stool/bed/chair/segway/New()
handle_rotation()
//var/datum/reagents/R = new/datum/reagents(100)
//reagents = R
// R.my_atom = src
//obj/structure/stool/bed/chair/janicart/examine()
// set src in usr
// usr << "\icon[src] This pimpin' ride contains [reagents.total_volume] unit\s of water!"
// if(mybag)
// usr << "\A [mybag] is hanging on the pimpin' ride."
//obj/structure/stool/bed/chair/janicart/attackby(obj/item/W, mob/user)
// if(istype(W, /obj/item/weapon/mop))
// if(reagents.total_volume >= 2)
// reagents.trans_to(W, 2)
// user << "<span class='notice'>You wet the mop in the pimpin' ride.</span>"
// playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1)
// if(reagents.total_volume < 1)
// user << "<span class='notice'>This pimpin' ride is out of water!</span>"
// else if(istype(W, /obj/item/key))
// user << "Hold [W] in one of your hands while you drive this pimpin' ride."
// else if(istype(W, /obj/item/weapon/storage/bag/trash))
// user << "<span class='notice'>You hook the trashbag onto the pimpin' ride.</span>"
// user.drop_item()
// W.loc = src
// mybag = W
//obj/structure/stool/bed/chair/janicart/attack_hand(mob/user)
// if(mybag)
// mybag.loc = get_turf(user)
// user.put_in_hands(mybag)
// mybag = null
// else
// ..()
//
/obj/structure/stool/bed/chair/segway/relaymove(mob/user, direction)
if(user.stat || user.stunned || user.weakened || user.paralysis)
unbuckle()
// if(istype(user.l_hand, /obj/item/key) || istype(user.r_hand, /obj/item/key))
step(src, direction)
update_mob()
handle_rotation()
// else
// user << "<span class='notice'>You'll need the keys in one of your hands to drive this pimpin' ride.</span>"
/obj/structure/stool/bed/chair/segway/Move()
..()
if(buckled_mob)
if(buckled_mob.buckled == src)
buckled_mob.loc = loc
/obj/structure/stool/bed/chair/segway/buckle_mob(mob/M, mob/user)
if(M != user || !ismob(M) || get_dist(src, user) > 1 || user.restrained() || user.lying || user.stat || M.buckled || istype(user, /mob/living/silicon))
return
unbuckle()
M.visible_message(\
"<span class='notice'>[M] climbs onto the segway!</span>",\
"<span class='notice'>You climb onto the segway!</span>")
M.buckled = src
M.loc = loc
M.dir = dir
M.update_canmove()
buckled_mob = M
update_mob()
add_fingerprint(user)
return
/obj/structure/stool/bed/chair/segway/unbuckle()
if(buckled_mob)
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 0
..()
/obj/structure/stool/bed/chair/segway/handle_rotation()
if(dir == SOUTH)
layer = FLY_LAYER
else
layer = OBJ_LAYER
if(buckled_mob)
if(buckled_mob.loc != loc)
buckled_mob.buckled = null //Temporary, so Move() succeeds.
buckled_mob.buckled = src //Restoring
update_mob()
/obj/structure/stool/bed/chair/segway/proc/update_mob()
if(buckled_mob)
buckled_mob.dir = dir
switch(dir)
if(SOUTH)
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 2
if(WEST)
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 2
if(NORTH)
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 2
if(EAST)
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 2
/obj/structure/stool/bed/chair/segway/bullet_act(var/obj/item/projectile/Proj)
if(buckled_mob)
if(prob(65))
return buckled_mob.bullet_act(Proj)
visible_message("<span class='warning'>[Proj] ricochets off the segway's armor!</span>")
//obj/item/key
// name = "key"
// desc = "A keyring with a small steel key, and a pink fob reading \"Pussy Wagon\"."
// icon = 'icons/obj/vehicles.dmi'
// icon_state = "keys"
// w_class = 1