Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_halo_bat_circle_Draw_0

(view raw script w/o annotations or w/e)
1
siner += 1;
2
if (i_ex(obj_heart))
3
{
4
    var eyeangle = point_direction(x, y, obj_heart.x + 10, obj_heart.y + 10);
5
    targetEyeX = lengthdir_x(6, eyeangle);
6
    targetEyeY = lengthdir_y(6, eyeangle);
7
}
8
eyex = lerp(eyex, targetEyeX, 0.2);
9
eyey = lerp(eyey, targetEyeY, 0.2);
10
var bat_sword_yoffset, bat_sword_yscale, bat_top_yoffset, bat_top_yxscale;
11
if (con == 0)
12
{
13
    bat_sword_yoffset = lerp(0, -10, animtimer / 10);
14
    bat_top_yoffset = lerp(0, 10, animtimer / 10);
15
    bat_sword_yscale = lerp(2, 0.5, animtimer / 10);
16
    bat_top_yxscale = lerp(2, 0.5, animtimer / 10);
17
}
18
if (con == 1)
19
{
20
    bat_sword_yoffset = -10;
21
    bat_top_yoffset = 10;
22
    bat_sword_yscale = 0.5;
23
    bat_top_yxscale = 0.5;
24
}
25
if (con == 2)
26
{
27
    bat_sword_yoffset = lerp(-10, 0, animtimer / 10);
28
    bat_top_yoffset = lerp(10, 0, animtimer / 10);
29
    bat_sword_yscale = lerp(0.5, 2, animtimer / 10);
30
    bat_top_yxscale = lerp(0.5, 2, animtimer / 10);
31
}
32
draw_sprite_ext(spr_halo_bat_sword, 0, x, y + bat_sword_yoffset, image_xscale, bat_sword_yscale, image_angle, image_blend, image_alpha);
33
draw_sprite_ext(spr_halo_bat_topBit, 0, x, y + bat_top_yoffset, image_xscale, bat_top_yxscale, image_angle, image_blend, image_alpha);
34
draw_sprite_ext(spr_halo_bat_leftWing_animated, siner * 0.25, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
35
draw_sprite_ext(spr_halo_bat_rightWing_animated, siner * 0.25, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
36
draw_sprite_ext(spr_halo_bat_black, 0, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
37
draw_sprite_ext(spr_halo_bat_eyeWhite, 0, x + round(eyex * 0.2), y + round(eyey * 0.2), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
38
draw_sprite_ext(spr_halo_bat_eyePupil, 0, x + round(eyex), y + round(eyey), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
39
draw_sprite_ext(spr_halo_bat_halo, 0, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
40
d3d_set_fog(true, c_black, 0, 1);
41
draw_sprite_ext(spr_halo_bat_leftWing_animated_ext, siner * 0.25, x, y, image_xscale, image_yscale, image_angle, image_blend, 0.4);
42
draw_sprite_ext(spr_halo_bat_rightWing_animated_ext, siner * 0.25, x, y, image_xscale, image_yscale, image_angle, image_blend, 0.4);
43
draw_sprite_ext(spr_halo_bat_halo, 0, x, y, image_xscale, image_yscale, image_angle, image_blend, 0.4);
44
draw_sprite_ext(spr_halo_bat_eyeWhite, 0, x + round(eyex * 0.2), y + round(eyey * 0.2), image_xscale, image_yscale, image_angle, image_blend, 0.4);
45
draw_sprite_ext(spr_halo_bat_eyePupil, 0, x + round(eyex), y + round(eyey), image_xscale, image_yscale, image_angle, image_blend, 0.4);
46
d3d_set_fog(false, c_black, 0, 0);
47
if (flash_alpha > 0)
48
{
49
    d3d_set_fog(true, c_white, 0, 1);
50
    draw_sprite_ext(spr_halo_bat_halo, 0, x, y, image_xscale, image_yscale, image_angle, image_blend, flash_alpha);
51
    draw_sprite_ext(spr_halo_bat_eyeWhite, 0, x + round(eyex * 0.2), y + round(eyey * 0.2), image_xscale, image_yscale, image_angle, image_blend, flash_alpha);
52
    draw_sprite_ext(spr_halo_bat_eyePupil, 0, x + round(eyex), y + round(eyey), image_xscale, image_yscale, image_angle, image_blend, flash_alpha);
53
    d3d_set_fog(false, c_white, 0, 0);
54
    flash_alpha -= 0.2;
55
}