-
Notifications
You must be signed in to change notification settings - Fork 1
/
Auto Screwdriver.wep.gml
107 lines (95 loc) · 2.44 KB
/
Auto Screwdriver.wep.gml
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
#define init
global.sprAutoScrewdriver = sprite_add_weapon("sprites/weapons/sprAutoScrewdriver.png", -2, 2);
#define weapon_name
return "AUTO SCREWDRIVER";
#define nts_weapon_examine
return{
"d": "A tool designed to fix tings up very quickly. #I'ts tiring to wield. ",
}
#define weapon_sprt
return global.sprAutoScrewdriver;
#define weapon_type
return 0;
#define weapon_auto
return true;
#define weapon_load
if !skill_get("screwdriver mastery"){
with instances_matching(CustomObject,"name","autoscrewtimer"){
if creator = other{
if timer <= 0{
return count+1
}
else{
return 2;
}
}
else{
return 2;
//sorry karm, but a 1 frame reload is just too fast
//frick you
}
}
}
return 2
#define weapon_cost
return 0;
#define weapon_swap
return sndSwapSword;
#define weapon_area
return 12;
#define weapon_text
return choose("SWINGING THIS GETS TIRING","PAPER DRILL");
#define weapon_fire
weapon_post(-8,2,4)
sound_play_pitch(sndScrewdriver,random_range(.9,1.2))
wepangle = -wepangle
motion_add(gunangle, 4)
var l = 10 * skill_get(mut_long_arms)
with instance_create(x + lengthdir_x(l, gunangle), y + lengthdir_y(l, gunangle), Shank)
{
creator = other
can_fix = true
motion_add(other.gunangle + random_range(-4, 4) * other.accuracy, 2 + (skill_get(13) * 3))
image_angle = direction
team = other.team
name = "autoslash"
with instance_create(x,y,CustomObject)
{
count = 1
timer = 45
timer2 = 30
on_step = autoscrew_step
creator = other.creator
with instances_matching(CustomObject,"name","autoscrewtimer")
{
if creator = other.creator
{
if timer <= 0{other.count += count}
other.timer = timer
instance_destroy()
}
}
timer -= current_time_scale
name = "autoscrewtimer"
with instances_matching(Shank,"name","autoslash")
{
if other.creator = creator
{
direction += random_range(-other.count,other.count)*creator.accuracy
image_angle = direction
}
}
}
}
#define autoscrew_step
if !instance_exists(creator){instance_destroy();exit}
if count > 30{count = 30}
if timer <=0{if irandom(abs(timer))!=0{repeat(ceil(abs(timer)/10)){instance_create(creator.x,creator.y,Sweat)}}}
timer2 -= current_time_scale
if timer2 <= 0
{
timer2=0
timer++
if timer > 45{timer = 45}
if count > 0{count--}
}