Deltarune script viewer

← back to main script listing

gml_Object_obj_spamton_enemy_Draw_0

(view raw script w/o annotations or w/e)
1
if (bodymode == 0)
2
{
3
    if (state == 3)
4
    {
5
        scr_enemyhurt_tired_after_damage
scr_enemyhurt_tired_after_damage

function scr_enemyhurt_tired_after_damage(arg0) { if (global.monsterhp[myself] <= (global.monstermaxhp[myself] * arg0)) scr_monster_make_tired(myself); }
(0.5);
6
        hurttimer -= 1;
7
        if (hurttimer < 0 && global.monster[myself] > 0)
8
        {
9
            state = 0;
10
        }
11
        else
12
        {
13
            if (global.monster[myself] == 0)
14
                hurtsprite = idlesprite;
15
            hurtshake += 1;
16
            if (hurtshake > 1)
17
            {
18
                if (shakex > 0)
19
                    shakex -= 1;
20
                if (shakex < 0)
21
                    shakex += 1;
22
                shakex = -shakex;
23
                hurtshake = 0;
24
            }
25
            draw_sprite_ext(hurtsprite, 0, x + shakex + hurtspriteoffx, y + hurtspriteoffy, 2, 2, 0, image_blend, 1);
26
        }
27
    }
28
    if (global.flag[20 manual_face_sprite] == 0)
29
    {
30
        idlesprite = spr_spamton_idle;
31
        shakeamt = 0;
32
    }
33
    if (global.flag[20 manual_face_sprite] == 1)
34
    {
35
        idlesprite = spr_spamton_dark;
36
        shakeamt = 0;
37
    }
38
    if (global.flag[20 manual_face_sprite] == 2)
39
    {
40
        idlesprite = spr_spamton_laugh_left;
41
        shakeamt = 2;
42
    }
43
    if (global.flag[20 manual_face_sprite] == 3)
44
    {
45
        idlesprite = spr_cutscene_14_spamton_grab;
46
        shakeamt = 2;
47
    }
48
    if (global.flag[20 manual_face_sprite] == 4)
49
    {
50
        idlesprite = spr_cutscene_14_spamton_arms_up;
51
        shakeamt = 0;
52
    }
53
    if (global.flag[20 manual_face_sprite] == 5)
54
    {
55
        idlesprite = spr_cutscene_14_spamton_laugh_right;
56
        shakeamt = 2;
57
    }
58
    if (global.flag[20 manual_face_sprite] == 6)
59
    {
60
        idlesprite = spr_cutscene_14_spamton_laugh_large;
61
        shakeamt = 2;
62
    }
63
    if (state == 0)
64
    {
65
        if (shakeamt > 0)
66
        {
67
            x = remx + random_range(-shakeamt, shakeamt);
68
            y = remy + random_range(-shakeamt, shakeamt);
69
        }
70
        else
71
        {
72
            x = remx;
73
            y = remy;
74
        }
75
    }
76
    scr_enemy_drawidle_generic
scr_enemy_drawidle_generic

function scr_enemy_drawidle_generic(arg0) { if (state == 0) { fsiner += 1; siner += arg0; thissprite = idlesprite; if (global.mercymod[myself] >= global.mercymax[myself]) thissprite = sparedsprite; draw_monster_body_part(thissprite, siner, x, y); } }
(0.16666666666666666);
77
    if (becomeflash == 0)
78
        flash = 0;
79
    becomeflash = 0;
80
}
81
if (bodymode == 1)
82
{
83
    if (bodycon == 0)
84
    {
85
        bodytimer = 0;
86
        bodycon = 1;
87
    }
88
    if (bodycon == 1)
89
    {
90
        if (bodytimer <= 16)
91
            bodytimer++;
92
        if (bodytimer >= 16 && bodyadvance == 1)
93
        {
94
            bodyadvance = 0;
95
            bodysiner = 0;
96
            bodytimer = 0;
97
            bodycon = 2;
98
        }
99
        else
100
        {
101
            draw_sprite_ext(spr_spamton_head_grow, bodytimer / 3, x, y, image_xscale, image_xscale, image_angle, c_white, 1);
102
        }
103
    }
104
    if (bodycon == 2)
105
    {
106
        bodysiner++;
107
        headpiece.x = x - 12;
108
        headpiece.y = (y + (sin(bodysiner) * 6)) - 94;
109
        if (bodyadvance == 1)
110
        {
111
            bodyadvance = 0;
112
            bodytimer = 16;
113
            bodycon = 3;
114
            with (headpiece)
115
                x = -999;
116
        }
117
        else
118
        {
119
            draw_sprite_ext(spr_spamton_laugh_bottom, 0, x - 12, y - 94, image_xscale, image_xscale, image_angle, c_white, 1);
120
            draw_sprite_ext(spr_spamton_laugh_middle, 0, x - 12, y - 104 - (sin(bodysiner) * 4), image_xscale, image_xscale, image_angle, c_white, 1);
121
        }
122
    }
123
    if (bodycon == 3)
124
    {
125
        bodytimer--;
126
        if (bodytimer <= 0)
127
        {
128
            bodyadvance = 0;
129
            bodysiner = 0;
130
            bodytimer = 0;
131
            bodycon = 0;
132
            bodymode = 0;
133
        }
134
        draw_sprite_ext(spr_spamton_head_grow, bodytimer / 3, x, y, image_xscale, image_xscale, image_angle, c_white, 1);
135
    }
136
}
137
if (scr_debug
scr_debug

function scr_debug() { if (global.debug == 1) return 1; }
())
138
{
139
    if (keyboard_check_pressed(ord("B")))
140
    {
141
        if (bodymode == 0)
142
        {
143
            bodymode = 1;
144
        }
145
        else
146
        {
147
            bodymode = 0;
148
            headpiece.x = -999;
149
        }
150
    }
151
    if (keyboard_check_pressed(ord("N")))
152
        bodyadvance = 1;
153
    if (keyboard_check_pressed(ord("1")))
154
        bulletoverride = 0;
155
    if (keyboard_check_pressed(ord("2")))
156
        bulletoverride = 1;
157
    if (keyboard_check_pressed(ord("3")))
158
        bulletoverride = 2;
159
    if (keyboard_check_pressed(ord("0")))
160
        bulletoverride = -1;
161
}