-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathscrewdriver.dm
147 lines (133 loc) · 5.58 KB
/
screwdriver.dm
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
/obj/item/screwdriver
name = "screwdriver"
desc = "You can be totally screwy with this."
icon = 'icons/obj/tools.dmi'
icon_state = "screwdriver_map"
inhand_icon_state = "screwdriver"
worn_icon_state = "screwdriver"
belt_icon_state = "screwdriver"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
flags_1 = CONDUCT_1 | IS_PLAYER_COLORABLE_1
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_TINY
force = 5
throwforce = 5
throw_range = 5
stamina_cost = 5
stamina_damage = 10
stamina_critical_chance = 30
custom_materials = list(/datum/material/iron=75)
attack_verb_continuous = list("stabs")
attack_verb_simple = list("stab")
hitsound = 'sound/weapons/bladeslice.ogg'
usesound = list('sound/items/screwdriver.ogg', 'sound/items/screwdriver2.ogg')
tool_behaviour = TOOL_SCREWDRIVER
toolspeed = 1
armor = list(BLUNT = 0, PUNCTURE = 0, SLASH = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, FIRE = 50, ACID = 30)
drop_sound = 'sound/items/handling/screwdriver_drop.ogg'
pickup_sound = 'sound/items/handling/screwdriver_pickup.ogg'
sharpness = SHARP_POINTY
greyscale_config = /datum/greyscale_config/screwdriver
greyscale_config_inhand_left = /datum/greyscale_config/screwdriver_inhand_left
greyscale_config_inhand_right = /datum/greyscale_config/screwdriver_inhand_right
greyscale_config_belt = /datum/greyscale_config/screwdriver_belt
/// If the item should be assigned a random color
var/random_color = TRUE
/// List of possible random colors
var/static/list/screwdriver_colors = list(
"blue" = "#1861d5",
"red" = "#ff0000",
"pink" = "#d5188d",
"brown" = "#a05212",
"green" = "#0e7f1b",
"cyan" = "#18a2d5",
"yellow" = "#ffa500"
)
/obj/item/screwdriver/suicide_act(mob/user)
user.visible_message(span_suicide("[user] is stabbing [src] into [user.p_their()] [pick("temple", "heart")]! It looks like [user.p_theyre()] trying to commit suicide!"))
return(BRUTELOSS)
/obj/item/screwdriver/Initialize(mapload)
if(random_color)
var/our_color = pick(screwdriver_colors)
set_greyscale(colors=list(screwdriver_colors[our_color]))
. = ..()
AddElement(/datum/element/eyestab)
/obj/item/screwdriver/abductor
name = "alien screwdriver"
desc = "An ultrasonic screwdriver."
icon = 'icons/obj/abductor.dmi'
icon_state = "screwdriver_a"
inhand_icon_state = "screwdriver_nuke"
custom_materials = list(/datum/material/iron=5000, /datum/material/silver=2500, /datum/material/plasma = 1000, /datum/material/titanium = 2000, /datum/material/diamond = 2000)
usesound = 'sound/items/pshoom.ogg'
toolspeed = 0.1
random_color = FALSE
greyscale_config_inhand_left = null
greyscale_config_inhand_right = null
/obj/item/screwdriver/abductor/get_belt_overlay()
return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "screwdriver_alien")
/obj/item/screwdriver/power
name = "hand drill"
desc = "A simple powered hand drill."
icon_state = "drill"
belt_icon_state = null
inhand_icon_state = "drill"
worn_icon_state = "drill"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
custom_materials = list(/datum/material/iron=3500, /datum/material/silver=1500, /datum/material/titanium=2500) //what research value?
force = 8 //might or might not be too high, subject to change
w_class = WEIGHT_CLASS_SMALL
throwforce = 8
throw_speed = 1.5
throw_range = 3//it's heavier than a screw driver/wrench, so it does more damage, but can't be thrown as far
attack_verb_continuous = list("drills", "screws", "jabs", "whacks")
attack_verb_simple = list("drill", "screw", "jab", "whack")
hitsound = 'sound/items/drill_hit.ogg'
usesound = 'sound/items/drill_use.ogg'
toolspeed = 0.7
random_color = FALSE
greyscale_config = null
greyscale_config_belt = null
greyscale_config_inhand_left = null
greyscale_config_inhand_right = null
/obj/item/screwdriver/power/Initialize(mapload)
. = ..()
AddComponent(/datum/component/transforming, \
force_on = force, \
throwforce_on = throwforce, \
hitsound_on = hitsound, \
w_class_on = w_class, \
clumsy_check = FALSE)
RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform))
/*
* Signal proc for [COMSIG_TRANSFORMING_ON_TRANSFORM].
*
* Toggles between crowbar and wirecutters and gives feedback to the user.
*/
/obj/item/screwdriver/power/proc/on_transform(obj/item/source, mob/user, active)
SIGNAL_HANDLER
tool_behaviour = (active ? TOOL_WRENCH : TOOL_SCREWDRIVER)
balloon_alert(user, "attached [active ? "bolt bit" : "screw bit"]")
playsound(user ? user : src, 'sound/items/change_drill.ogg', 50, TRUE)
return COMPONENT_NO_DEFAULT_MESSAGE
/obj/item/screwdriver/power/examine()
. = ..()
. += span_notice("It's fitted with a [tool_behaviour == TOOL_SCREWDRIVER ? "screw" : "bolt"] bit.")
/obj/item/screwdriver/power/suicide_act(mob/user)
if(tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message(span_suicide("[user] is putting [src] to [user.p_their()] temple. It looks like [user.p_theyre()] trying to commit suicide!"))
else
user.visible_message(span_suicide("[user] is pressing [src] against [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!"))
playsound(loc, 'sound/items/drill_use.ogg', 50, TRUE, -1)
return(BRUTELOSS)
/obj/item/screwdriver/cyborg
name = "automated screwdriver"
desc = "A powerful automated screwdriver, designed to be both precise and quick."
icon = 'icons/obj/items_cyborg.dmi'
icon_state = "screwdriver_cyborg"
hitsound = 'sound/items/drill_hit.ogg'
usesound = 'sound/items/drill_use.ogg'
toolspeed = 0.5
random_color = FALSE