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 pathpen.dm
More file actions
258 lines (226 loc) · 7.82 KB
/
pen.dm
File metadata and controls
258 lines (226 loc) · 7.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
/* Pens!
* Contains:
* Pens
* Sleepy Pens
* Parapens
* Edaggers
*/
/*
* Pens
*/
/obj/item/pen
desc = "It's a normal black ink pen."
name = "pen"
icon = 'yogstation/icons/obj/bureaucracy.dmi'
icon_state = "pen"
item_state = "pen"
slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_EARS
throwforce = 0
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
materials = list(/datum/material/iron=10)
pressure_resistance = 2
grind_results = list(/datum/reagent/iron = 2, /datum/reagent/iodine = 1)
sharpness = SHARP_POINTY
var/colour = "black" //what colour the ink is!
var/degrees = 0
var/font = PEN_FONT
/obj/item/pen/suicide_act(mob/user)
user.visible_message(span_suicide("[user] is scribbling numbers all over [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit sudoku..."))
return(BRUTELOSS)
/obj/item/pen/blue
desc = "It's a normal blue ink pen."
icon_state = "pen_blue"
colour = "blue"
/obj/item/pen/red
desc = "It's a normal red ink pen."
icon_state = "pen_red"
colour = "red"
/obj/item/pen/invisible
desc = "It's an invisible pen marker."
icon_state = "pen"
colour = "white"
/obj/item/pen/fourcolor
desc = "It's a fancy four-color ink pen, set to black."
name = "four-color pen"
colour = "black"
/obj/item/pen/fourcolor/attack_self(mob/living/carbon/user)
switch(colour)
if("black")
colour = "red"
if("red")
colour = "green"
if("green")
colour = "blue"
else
colour = "black"
to_chat(user, span_notice("\The [src] will now write in [colour]."))
desc = "It's a fancy four-color ink pen, set to [colour]."
/obj/item/pen/fountain
name = "fountain pen"
desc = "It's a common fountain pen, with a faux wood body."
icon_state = "pen-fountain"
font = FOUNTAIN_PEN_FONT
/obj/item/pen/fountain/captain
name = "captain's fountain pen"
desc = "It's an expensive Oak fountain pen. The nib is quite sharp."
icon_state = "pen-fountain-o"
force = 5
throwforce = 5
throw_speed = 4
colour = "crimson"
materials = list(/datum/material/gold = 750)
sharpness = SHARP_POINTY
resistance_flags = FIRE_PROOF
unique_reskin = list("Oak" = "pen-fountain-o",
"Gold" = "pen-fountain-g",
"Rosewood" = "pen-fountain-r",
"Black and Silver" = "pen-fountain-b",
"Command Blue" = "pen-fountain-cb"
)
/obj/item/pen/fountain/captain/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 200, 115) //the pen is mightier than the sword
/obj/item/pen/fountain/captain/reskin_obj(mob/M)
..()
if(current_skin)
desc = "It's an expensive [current_skin] fountain pen. The nib is quite sharp."
/obj/item/pen/attack_self(mob/living/carbon/user)
var/deg = input(user, "What angle would you like to rotate the pen head to? (1-360)", "Rotate Pen Head") as null|num
if(deg && (deg > 0 && deg <= 360))
degrees = deg
to_chat(user, span_notice("You rotate the top of the pen to [degrees] degrees."))
SEND_SIGNAL(src, COMSIG_PEN_ROTATED, deg, user)
/obj/item/pen/attack(mob/living/M, mob/user,stealth)
if(!istype(M))
return
if(!force)
if(M.can_inject(user, 1))
to_chat(user, span_warning("You stab [M] with the pen."))
if(!stealth)
to_chat(M, span_danger("You feel a tiny prick!"))
. = 1
log_combat(user, M, "stabbed", src)
else
. = ..()
/obj/item/pen/afterattack(obj/O, mob/living/user, proximity)
. = ..()
//Changing Name/Description of items. Only works if they have the 'unique_rename' flag set
if(isobj(O) && proximity && (O.obj_flags & UNIQUE_RENAME))
var/penchoice = input(user, "What would you like to edit?", "Rename or change description?") as null|anything in list("Rename","Change description")
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
return
if(penchoice == "Rename")
var/input = stripped_input(user,"What do you want to name \the [O.name]?", ,"", MAX_NAME_LEN)
var/oldname = O.name
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
return
if(oldname == input)
to_chat(user, "You changed \the [O.name] to... well... \the [O.name].")
else
O.name = input
to_chat(user, "\The [oldname] has been successfully been renamed to \the [input].")
O.renamedByPlayer = TRUE
if(penchoice == "Change description")
var/input = stripped_input(user,"Describe \the [O.name] here", ,"", 100)
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
return
O.desc = input
to_chat(user, "You have successfully changed \the [O.name]'s description.")
/*
* Sleepypens
*/
/obj/item/pen/sleepy/attack(mob/living/M, mob/user)
if(!is_syndicate(user)) // if non syndicate , it is just a regular pen as they don't know how to activate hidden payload.
. = ..()
return
if(!istype(M))
return
if(!..())
return
if(!reagents.total_volume || !M.reagents)
return
to_chat(user, span_warning("You begin to injecting [src]'s contents into [M]"))
if(!do_after(user, 0.5 SECONDS, M))
return
reagents.reaction(M, INJECT, reagents.total_volume)
reagents.trans_to(M, reagents.total_volume, transfered_by = user)
/obj/item/pen/sleepy/Initialize()
. = ..()
create_reagents(75)
reagents.add_reagent(/datum/reagent/toxin/chloralhydrate, 20)
reagents.add_reagent(/datum/reagent/toxin/mutetoxin, 15)
reagents.add_reagent(/datum/reagent/toxin/staminatoxin, 10)
reagents.add_reagent(/datum/reagent/toxin/sodium_thiopental, 30)
/*
* (Alan) Edaggers
*/
/obj/item/pen/edagger
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") //these wont show up if the pen is off
sharpness = SHARP_EDGED
var/on = FALSE
/obj/item/pen/edagger/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 60, 100, 0, 'sound/weapons/blade1.ogg', TRUE)
/obj/item/pen/edagger/suicide_act(mob/user)
. = BRUTELOSS
if(on)
user.visible_message(span_suicide("[user] forcefully rams the pen into their mouth!"))
else
user.visible_message(span_suicide("[user] is holding a pen up to their mouth! It looks like [user.p_theyre()] trying to commit suicide!"))
attack_self(user)
/obj/item/pen/edagger/attack_self(mob/living/user)
if(on)
on = FALSE
force = initial(force)
throw_speed = initial(throw_speed)
w_class = initial(w_class)
name = initial(name)
hitsound = initial(hitsound)
embedding = embedding.setRating(embed_chance = EMBED_CHANCE)
throwforce = initial(throwforce)
playsound(user, 'sound/weapons/saberoff.ogg', 5, 1)
to_chat(user, span_warning("[src] can now be concealed."))
else
if(!is_syndicate(user)) // this is just a normal pen to non syndicates as they don't know how to switch it on.
. = ..()
return
on = TRUE
force = 18
throw_speed = 4
w_class = WEIGHT_CLASS_NORMAL
name = "energy dagger"
hitsound = 'sound/weapons/blade1.ogg'
embedding = embedding.setRating(embed_chance = 100) //rule of cool
throwforce = 35
playsound(user, 'sound/weapons/saberon.ogg', 5, 1)
to_chat(user, span_warning("[src] is now active."))
var/datum/component/butchering/butchering = src.GetComponent(/datum/component/butchering)
butchering.butchering_enabled = on
update_icon()
/obj/item/pen/edagger/update_icon()
if(on)
icon_state = "edagger"
item_state = "edagger"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
else
icon_state = initial(icon_state) //looks like a normal pen when off.
item_state = initial(item_state)
lefthand_file = initial(lefthand_file)
righthand_file = initial(righthand_file)
/obj/item/pen/charcoal
name = "charcoal stylus"
desc = "It's just a wooden stick with some compressed ash on the end. At least it can write."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "pen-charcoal"
colour = "dimgray"
font = CHARCOAL_FONT
grind_results = list(/datum/reagent/ash = 5)
/datum/crafting_recipe/charcoal_stylus
name = "Charcoal Stylus"
result = /obj/item/pen/charcoal
reqs = list(/obj/item/stack/sheet/mineral/wood = 1, /datum/reagent/ash = 30)
time = 3 SECONDS
category = CAT_PRIMAL