-
Notifications
You must be signed in to change notification settings - Fork 1
/
Super Drill Launcher.wep.gml
237 lines (221 loc) · 6.71 KB
/
Super Drill Launcher.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
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
#define init
//global.gun
global.sprSuperDrillLauncher = sprite_add_weapon("sprites/weapons/sprSuperDrillLauncher.png",10,7)
global.sprDrill = sprite_add("sprites/projectiles/sprDrill.png" , 4, 7, 4)
global.sprDrillBlink = sprite_add("sprites/projectiles/sprDrillBlink.png", 2, 7, 4)
global.explosive = 0 //boolean, try turning it off
#define weapon_name
return "SUPER DRILL LAUNCHER"
#define weapon_type
return global.explosive ? 4 : 3
#define weapon_cost
return 10
#define weapon_area
return 13
#define weapon_load
return 55
#define weapon_swap
return sndSwapMotorized
#define weapon_auto
return 0
#define weapon_melee
return 0
#define weapon_laser_sight
return 1
#define weapon_sprt
return global.sprSuperDrillLauncher
#define nts_weapon_examine
return{
"d": "Ideal for probing walls for rare ores and gems. ",
}
#define weapon_text
return "WALL DIVERS"
#define weapon_fire
motion_add(gunangle-180,2)
weapon_post(10,-70,0)
var _fac = random_range(.8,1.2);
sound_play_pitch(sndSwapMotorized,.7*_fac)
sound_play_pitch(sndHeavyCrossbow,.7*_fac)
sound_play_pitch(sndSuperCrossbow,.7*_fac)
sound_play_pitch(sndDiscBounce,1.2*_fac)
sound_play_pitch(sndSuperSlugger,1.2*_fac)
sound_play_pitch(sndUltraEmpty,.7*_fac)
sound_play_drill(.5)
var _offset = -40;
var _angle = 20;
sleep(5)
repeat(5)
{
with instance_create(x,y,CustomProjectile){
motion_set(other.gunangle+ (_offset +random_range(-3,3))*other.accuracy,1)
friction = -1.5
image_speed = .4
maxspeed = 14
damage = 2
bounce = round(skill_get("compoundelbow") * 5)
sprite_index = global.sprDrill
lasthit = -4
hits = 0
ImmuneToDistortion = true;
walls = 6 + (skill_get(mut_bolt_marrow) * 4 * !global.explosive)
image_angle = direction
projectile_init(other.team,other)
repeat(4) instance_create(x,y,Smoke)
on_hit = global.explosive ? drill_explo : drill_hit
on_end_step = global.explosive ? drill_step : bolt_step
on_wall = drill_wall
}
_offset += _angle
}
#define bolt_step
if "target" in self && !instance_exists(target){
instance_create(x, y, SmallExplosion);
sound_play(sndExplosionS);
instance_delete(self);
exit;
}
if skill_get(mut_bolt_marrow){
var q = mod_script_call("mod","defpack tools","instance_nearest_matching_ne",x,y,hitme,"team",team)
if instance_exists(q) and distance_to_object(q) < 120{
var ang = angle_difference(direction, point_direction(x,y,q.x,q.y))
if abs(ang) < 50 direction -= ang/5
}
}
drill_step()
if speed > 0{
var flutes = 3, num = 360/(flutes)
var w = sprite_height/2 -1;
var ang = direction;
var n = 36
var spd = speed;
var off = (current_frame)*n
for (var i = 0; i < 360; i+=num){
i+=off
var _x = x + lengthdir_x(w*dsin(i),ang+90), _y = y + lengthdir_y(w*dsin(i),ang+90);
var _x2 = xprevious + lengthdir_x(w*dsin(i-n*current_time_scale),image_angle+90), _y2 = yprevious + lengthdir_y(w*dsin(i-n*current_time_scale),image_angle+90);
with instance_create(_x,_y,BoltTrail){
image_angle = point_direction(x,y,_x2,_y2)
image_xscale = point_distance(x,y,_x2,_y2)
if random(100) < 20*current_time_scale with instance_create(x,y,Dust) motion_add(other.image_angle,random(spd/2))
}
i-=off
}
}
image_angle = direction
#define drill_step
if speed > maxspeed speed = maxspeed
if speed > 0 image_speed = max(speed * .075,.4)
if "target" in self{
if !instance_exists(target){
instance_create(x, y, SmallExplosion);
sound_play(sndExplosionS);
instance_delete(self);
exit;
}else{
x = target.x + target.hspeed_raw - lengthdir_x(12, direction);
y = target.y + target.vspeed_raw - lengthdir_y(12, direction);
}
}
#define drill_wall
if bounce > 0{
bounce--;
view_shake_max_at(x, y, 2)
repeat(3)instance_create(x, y, Dust)
move_bounce_solid(false)
with other{
instance_create(x, y, FloorExplo)
instance_destroy()
}
}else if walls > 0
{
sound_play_drill(.4)
with other{instance_create(x,y,FloorExplo);instance_destroy()}
walls--
speed = 4
//sleep(15)
view_shake_at(x,y,3)
}
else
{
with drillstick_create(x, y){
target = noone;
direction = other.direction;
image_angle = direction;
}
instance_destroy()
}
#define drill_hit
view_shake_max_at(x,y,3*min(other.size,4))
sound_play_drill(.4)
//karm youre fucking insane if you think ill allow you to sleep for 35ms for TEN FRAMES IN A ROW
//seriously though, use them for big chunky freezes, not several small ones, that just makes it look like the game is running poorly
//sleep(35)
//speed = max(speed - 3, 3)
x = xprevious
y = yprevious
speed = 2
other.speed = 0
sleep(8)
view_shake_at(x,y,1)
projectile_hit(other,damage)
var mans = other;
if other = lasthit{
if ++hits > 10{
with drillstick_create(x, y){
target = mans;
direction = other.direction;
image_angle = direction;
}
instance_destroy();
exit;
}
}else{
lasthit = other
hits = 0
}
#define sound_play_drill(_vol)
if fork(){
repeat(8){
sound_play_pitchvol(sndJackHammer,.8,_vol)
sound_play_pitchvol(sndWallBreak,1.4,_vol)
sound_play_pitchvol(sndDiscHit,1.6,_vol)
wait(0)
}
exit
}
#define drillstick_create(X, Y)
var _i = instance_create(X, Y, CustomObject)
with _i{
timer = 0;
image_speed = 0;
sprite_index = global.sprDrill;
on_wall = void;
on_step = drillstick_step;
on_destroy = drillstick_destroy;
}
return _i;
#define drillstick_step
if !instance_exists(target) && target != noone{
instance_delete(self);
exit;
}
if target != noone{
x = target.x + target.hspeed_raw - lengthdir_x(12, direction);
y = target.y + target.vspeed_raw - lengthdir_y(12, direction);
}
var _t1 = 20,
_t2 = 12;
if timer >= _t1{
sprite_index = global.sprDrillBlink;
image_speed = .4;
if timer >= _t1 + _t2{
instance_destroy();
exit;
}
}
timer++;
#define drillstick_destroy
sleep(20)
instance_create(x + lengthdir_x(8, direction), y + lengthdir_y(8, direction), SmallExplosion);
sound_play(sndExplosionS);
#define void