Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_halo_enemy_Draw_0

(view raw script w/o annotations or w/e)
1
if (acting == 4)
2
{
3
    global.faceaction[0] = 0;
4
    global.faceaction[1] = 0;
5
    global.faceaction[2] = 0;
6
}
7
firstframe++;
8
if (firstframe == 1)
9
    exit;
10
if (!i_ex(obj_halo_bat_circle) && !i_ex(obj_halo_bat_aim))
11
    floatsiner++;
12
y = ystart + (sin(floatsiner / 12) * 4);
13
scr_enemy_drawhurt_generic
scr_enemy_drawhurt_generic

function
scr_enemy_drawhurt_generic()
{ if (state == 3 && hurttimer >= 0) draw_sprite_ext(hurtsprite, 0, x + shakex + hurtspriteoffx, y + hurtspriteoffy, 2, 2, 0, image_blend, 1); }
();
14
if (state == 0)
15
{
16
    siner += 1;
17
    animsiner++;
18
    fsiner += 1;
19
    eyetimer++;
20
    if (eyetimer == 30)
21
    {
22
        var eyeangle = 160 + irandom(40);
23
        targetEyeX = lengthdir_x(6, eyeangle);
24
        targetEyeY = lengthdir_y(6, eyeangle);
25
    }
26
    if (eyetimer == 90)
27
    {
28
        eyetimer = (0 + irandom(8)) - irandom(8);
29
        targetEyeX = 0;
30
        targetEyeY = 0;
31
    }
32
    eyex = lerp(eyex, targetEyeX, 0.2);
33
    eyey = lerp(eyey, targetEyeY, 0.2);
34
    wingAnimating = 1;
35
    if (wingAnimating == 0)
36
    {
37
        wingSpriteL = 5804;
38
        wingSpriteR = 4533;
39
    }
40
    else
41
    {
42
        wingSpriteL = 5030;
43
        wingSpriteR = 5351;
44
    }
45
    thissprite = idlesprite;
46
    if (global.mercymod[myself] >= global.mercymax[myself])
47
        thissprite = sparedsprite;
48
    draw_monster_body_part_ext(spr_halo_bat_sword, 0, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
49
    draw_monster_body_part_ext(spr_halo_bat_topBit, 0, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
50
    draw_monster_body_part_ext(wingSpriteL, siner * 0.25, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
51
    draw_monster_body_part_ext(wingSpriteR, siner * 0.25, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
52
    draw_monster_body_part_ext(spr_halo_bat_black, 0, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
53
    draw_monster_body_part_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);
54
    if (global.mercymod[myself] < 100)
55
        draw_monster_body_part_ext(spr_halo_bat_eyePupil, 0, x + round(eyex), y + round(eyey), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
56
    if (global.mercymod[myself] >= 100)
57
        draw_monster_body_part_ext(spr_halo_bat_eyePupil_spare, 0, x + round(eyex * 0.2), y + round(eyey * 0.2), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
58
    draw_monster_body_part_ext(spr_halo_bat_halo, 0, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
59
}
60
if (becomeflash == 0)
61
    flash = 0;
62
becomeflash = 0;
63
if (init == 0)
64
{
65
    init = 1;
66
    textlength = string_length(text);
67
}
68
if (talked == 1 && 
scr_isphase
scr_isphase

function
scr_isphase(arg0)
{ __isphase = 0; if (arg0 == "menu" && global.myfight == 0) __isphase = 1; if (arg0 == "acting" && global.myfight == 3) __isphase = 1; if (arg0 == "victory" && global.myfight == 7) __isphase = 1; if (arg0 == "attack" || arg0 == "fight") { if (global.myfight == 1) __isphase = 1; } if (arg0 == "spell" || arg0 == "item") { if (global.myfight == 4) __isphase = 1; } if (arg0 == "enemytalk" || arg0 == "balloon") { if (global.mnfight == 1) __isphase = 1; } if (arg0 == "enemyattack" || arg0 == "bullets") { if (global.mnfight == 2) __isphase = 1; } return __isphase; }
("enemytalk"))
69
{
70
    draw_set_halign(fa_center);
71
    draw_set_valign(fa_middle);
72
    draw_set_color(c_white);
73
    draw_set_font(fnt_dotumche);
74
    if (global.lang == "ja")
75
        draw_set_font(fnt_ja_kakugo);
76
    angle -= 1;
77
    extravar++;
78
    if (extravar > 1)
79
    {
80
        var angle_diff = 0;
81
        var letter_count = 1;
82
        repeat (textlength)
83
        {
84
            draw_text_transformed(x + lengthdir_x(radius, angle_diff + angle), (y - 90) + (surface_h / 2) + lengthdir_y(radius, angle_diff + angle), string_char_at(text, letter_count), 1, 1, angle_diff + 270 + angle);
85
            var dist = -8;
86
            if (global.lang == "ja")
87
            {
88
                dist = -15;
89
                if (exspace)
90
                    dist = -13;
91
            }
92
            angle_diff += dist;
93
            letter_count++;
94
        }
95
    }
96
    draw_set_halign(fa_left);
97
    draw_set_valign(fa_top);
98
}
99
else
100
{
101
    extravar = 0;
102
}