-
Notifications
You must be signed in to change notification settings - Fork 1
/
impact fist.wep.gml
172 lines (148 loc) · 4.88 KB
/
impact fist.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
#define init
global.sprMegaImpactFist = sprite_add_weapon("sprites/weapons/sprImpactFist.png", 4, 8);
global.sprMegaRealFist = sprite_add_precise("sprites/projectiles/sprImpactFistProj.png", 4, 0, 13);
global.sprMegaRealFistUpg = sprite_add_precise("sprites/projectiles/sprImpactFistProjUpg.png", 4, 0, 13);
#define sprite_add_precise(sprite, subimages, xoffset, yoffset)
var q = sprite_add(sprite, subimages, xoffset, yoffset);
if fork(){
var t = sprite_get_texture(q, 0),
w = 150;
while(t == sprite_get_texture(q, 0) && w-- > 0){
wait 0;
}
sprite_collision_mask(q, 1, 1, 0, 0, 0, 0, 0, 0)
exit
}
return q
#define weapon_name
return "IMPACT FIST"
#define weapon_sprt
return global.sprMegaImpactFist;
#define weapon_type
return 0;
#define weapon_cost
return 0;
#define weapon_auto
return false;
#define weapon_load
return 50;
#define weapon_text
return "OBLITERATE"
#define nts_weapon_examine
return{
"d": "A comically large fist to pound your enemies into a fine paste with. ",
}
#define weapon_melee
return 0;
#define weapon_swap
return sndSwapShotgun;
#define weapon_area
return 9;
#define weapon_fire()
var f = other.race == "steroids" and other.specfiring
with instance_create(x, y - 4 * f, CustomSlash) {
sprite_index = skill_get(mut_long_arms) ? global.sprMegaRealFistUpg : global.sprMegaRealFist
creator = other
team = other.team
direction = other.gunangle
image_angle = direction
damage = 34
hand = f
image_xscale = 1.5
image_speed = 0
if GameCont.crown = crwn_death image_index = 1
if GameCont.crown = crwn_destiny image_index = 2
if skill_get(mut_last_wish) image_index = 3
lifespan = 0
on_end_step = fiststep
on_hit = fisthit
on_wall = fistwall
on_anim = fistanim
on_projectile = fistproj
on_grenade = fistproj
hitlist = []
}
var r = random_range(.9,1.2)
sound_play_pitchvol(sndShotgun,.7*r,1);
sound_play_pitchvol(sndAssassinAttack,.8*r,1);
weapon_post(-4,56,56);
#define fistproj
if lifespan < 10 with other if typ > 0 instance_destroy()
#define fistwall
#define fistanim
#define fisthit
if lifespan <= 4 && (projectile_canhit_melee(other) || (array_find_index(hitlist, other) == -1)) {
array_push(hitlist, other)
projectile_hit(other, damage, direction, 40)
//other.speed += 40
sleep(100)
view_shake_at(x,y,15)
sound_play_pitchvol(sndImpWristKill,1.2,.8)
sound_play_pitchvol(sndExplosion,1.5,.8)
sound_play_pitchvol(sndImpWristHit,1,.8)
sound_play_pitchvol(sndWallBreak,1.4,.8)
repeat(other.size*3+3)*6 with instance_create(x+lengthdir_x(20,direction),y+lengthdir_y(20,direction),Smoke) {
sprite_index = sprDust;
speed += random_range(8,13);
var d = random_range(-90,90)
direction = other.direction+choose(d, d, 80, -80)-180;
}
if other.size < 4 && !is_any(other, ProtoStatue, Nothing, Nothing2, GuardianStatue, Generator, GeneratorInactive, TechnoMancer) {
var dir = direction
with other{
var s = 5, l = 80
var _x = lengthdir_x(s, dir), _y = lengthdir_y(s, dir)
var n = l
while n > 0{
n -= s
repeat(s/2 * n/l) with instance_create(x,y,Dust){
motion_set(dir - 180 + random_range(-65, 65), random_range(3, 9))
}
xprevious = x
yprevious = y
x += _x
y += _y
if place_meeting(x, y, Wall){
instance_create(x, y, size > 0 ? Explosion : SmallExplosion)
sound_play(sndExplosion)
break
}
}
}
}
}
#define is_any
for (var i = 1; i < argument_count; i++) {
if instance_is(argument[0], argument[i]) return true
}
return false
#define fiststep
if instance_exists(creator){
var c = creator
image_yscale = c.right * sign(!hand - .1)
var _k = hand ? c.bwkick : c.wkick
if lifespan >= 10{
with c{
weapon_post(0, 4 * current_time_scale, 4 * current_time_scale)
if other.hand bwkick = other.lifespan/3
else wkick = other.lifespan/3
}
sound_play_pitchvol(sndCrossReload, (_k + 2)/12, .7)
image_xscale += approach(image_xscale, 0, 3.5, current_time_scale)
}
else{
if lifespan <= 3 and lifespan > 1 image_xscale += approach(image_xscale, .6, 1.5, current_time_scale)
else if lifespan > 3 image_xscale += approach(image_xscale, 1, 1.5, current_time_scale)
}
var _k = hand ? c.bwkick : c.wkick
x = c.x + lengthdir_x(14 - _k - current_time_scale, c.gunangle)
y = c.y + lengthdir_y(14 - _k - current_time_scale, c.gunangle) - 4 * hand
if c.back or hand depth = -2
else depth = -3
direction = c.gunangle
image_angle = direction
}
lifespan += current_time_scale
if lifespan > 16 instance_destroy()
#define approach(a, b, n, dn)
return (b - a) * (1 - power((n - 1)/n, dn))