|
1
|
if (!surface_exists(my_surface))
|
|
2
|
my_surface = surface_create(90, 90);
|
|
3
|
surface_set_target(my_surface);
|
|
4
|
draw_clear_alpha(c_black, 0);
|
|
5
|
draw_sprite_ext(sprite_index, image_index, 45, 45, xscale, yscale, image_angle, image_blend, image_alpha);
|
|
6
|
surface_reset_target();
|
|
7
|
var xoff = 0;
|
|
8
|
var yoff = 0;
|
|
9
|
if (shakeme)
|
|
10
|
{
|
|
11
|
if ((true_timer % 2) < 1)
|
|
12
|
xoff = -4;
|
|
13
|
else
|
|
14
|
xoff = 4;
|
|
15
|
}
|
|
16
|
if (light > 0 && light < 1)
|
|
17
|
{
|
|
18
|
lightshake = min(light * 8, 5);
|
|
19
|
d3d_set_fog(true, c_white, 0, 0);
|
|
20
|
draw_sprite_ext(sprite_index, image_index, x + 1 + xoff + (lightshake * choose(-1, 1)), y + yoff + (lightshake * choose(-1, 1)), xscale, xscale, image_angle, image_blend, light * 0.5);
|
|
21
|
d3d_set_fog(false, c_white, 0, 0);
|
|
22
|
}
|
|
23
|
if (light < 1)
|
|
24
|
{
|
|
25
|
for (a = 0; a < 90; a++)
|
|
26
|
{
|
|
27
|
var side = 1;
|
|
28
|
draw_surface_part(my_surface, 0, a, 90, 1, (x - 44) + (sin((a + timer) * 1) * (4 - (image_alpha * 4)) * side) + xoff, (y - 45) + a + yoff);
|
|
29
|
}
|
|
30
|
}
|
|
31
|
if (light > 0 && light < 1)
|
|
32
|
{
|
|
33
|
d3d_set_fog(true, c_white, 0, 0);
|
|
34
|
draw_sprite_ext(sprite_index, image_index, x + 1 + xoff, y + yoff, xscale, xscale, image_angle, image_blend, (light + light_damage) * 0.7);
|
|
35
|
d3d_set_fog(false, c_white, 0, 0);
|
|
36
|
}
|
|
37
|
if (light == 1)
|
|
38
|
{
|
|
39
|
d3d_set_fog(true, c_white, 0, 0);
|
|
40
|
lightshake = min(light * 8, 5);
|
|
41
|
draw_sprite_ext(sprite_index, image_index, x + 1 + xoff + (lightshake * choose(-1, 1)), y + yoff + (lightshake * choose(-1, 1)), (0.85 + (sin(true_timer * 1) * 0.5)) * big_shrink, (0.85 - (sin(true_timer * 1) * 0.5)) * big_shrink, image_angle, image_blend, light * 0.5);
|
|
42
|
draw_sprite_ext(sprite_index, image_index, x + 1 + xoff, y + yoff, (0.85 + (sin(true_timer * 1) * 0.5)) * big_shrink, (0.85 - (sin(true_timer * 1) * 0.5)) * big_shrink, image_angle, image_blend, light);
|
|
43
|
d3d_set_fog(false, c_white, 0, 0);
|
|
44
|
}
|