Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_knight_enemy_Draw_0

(view raw script w/o annotations or w/e)
1
if (!i_ex(obj_knight_roaring2))
2
    siner2++;
3
if (i_ex(obj_knight_swordtunnelanim))
4
    exit;
5
if (chargeupcon == 2)
6
{
7
    chargeuptimer++;
8
    d3d_set_fog(true, c_white, 0, 1);
9
    draw_sprite_ext(idlesprite, siner, x, y, image_xscale, image_yscale, image_angle, image_blend, (10 - chargeuptimer) / 10);
10
    d3d_set_fog(false, c_black, 0, 0);
11
    if (chargeuptimer == 10)
12
    {
13
        chargeupcon = 3;
14
        image_alpha = 0;
15
    }
16
    exit;
17
}
18
if (state == 0 || state == 3)
19
{
20
    if (ystart != global.monstermakey[myself])
21
    {
22
    }
23
    image_index = 0;
24
    y = ystart + (cos(siner2 / 8) * 8);
25
    aetimer++;
26
    if ((aetimer % 4) == 0 && image_alpha != 0 && chargeupcon == 0)
27
    {
28
        if (state == 0 && !i_ex(obj_knight_roaring2))
29
        {
30
            afterimage = instance_create_depth(x, y, depth + 1, obj_afterimage);
31
            afterimage.sprite_index = spr_roaringknight_idle;
32
            afterimage.image_index = image_index;
33
        }
34
        if (state == 3)
35
        {
36
            afterimage = instance_create_depth(x + shakex + hurtspriteoffx, y + hurtspriteoffy, depth + 1, obj_afterimage);
37
            afterimage.image_index = image_index;
38
            if ((hurttimer % 2) == 0 || stronghurtanim == false)
39
            {
40
                afterimage.sprite_index = idlesprite;
41
            }
42
            else
43
            {
44
                afterimage.sprite_index = spr_roaringknight_ball_transition;
45
                afterimage.image_index = 7;
46
            }
47
        }
48
        afterimage.image_alpha = 0.6;
49
        afterimage.fadeSpeed = 0.02;
50
        afterimage.hspeed = 2;
51
        afterimage.image_speed = 0;
52
        afterimage.image_xscale = image_xscale;
53
        afterimage.image_yscale = image_yscale;
54
    }
55
}
56
if (end_cutscene_version == 1)
57
{
58
    stronghurtanim = true;
59
    state = 3;
60
    shakex = 0;
61
}
62
if (state == 3 && hurttimer >= 0)
63
{
64
    if (haveusedroaring == true && end_cutscene_version == 0 && global.monsterhp[myself] <= (global.monstermaxhp[myself] * 0.8) && endcon != 1)
65
    {
66
        with (obj_spellphase)
67
        {
68
            
scr_attackphase
scr_attackphase

function
scr_attackphase()
{ with (obj_battlecontroller) { techwon = 0; if (
scr_monsterpop() == 0)
techwon = 1; if (techwon == 1)
scr_wincombat();
if (techwon == 0) { for (__hiti = 0; __hiti < 3; __hiti++) global.hittarget[__hiti] = 0; fightphase = 1; global.charturn = 3; if (global.charaction[0] == 4 || global.charaction[0] == 2) fightphase = 0; if (global.charaction[1] == 4 || global.charaction[1] == 2) fightphase = 0; if (global.charaction[2] == 4 || global.charaction[2] == 2) fightphase = 0; if (global.myfight == 4) fightphase = 1; if (fightphase == 1) { global.myfight = 1; instance_create(xx + 2, yy + 365, obj_attackpress); } else { global.myfight = 4; instance_create(0, 0, obj_spellphase); } } } }
();
69
            with (spellwriter)
70
                instance_destroy();
71
            with (obj_face)
72
                instance_destroy();
73
            instance_destroy();
74
        }
75
        end_cutscene_version = 1;
76
        endcon = 1;
77
        mus_fade(global.batmusic[1], 1);
78
        inst = instance_create(x, y, obj_shake);
79
        if (i_ex(inst))
80
        {
81
            inst.shakex = 30;
82
            inst.shakey = 8;
83
            inst.shakespeed = 2;
84
        }
85
        stronghurtanim = true;
86
        hurttimer = 999;
87
        snd_play_x(snd_knight_hurt, 0.8, 1);
88
        snd_play_x(snd_knight_hurt, 0.8, 0.7);
89
        snd_play_x(snd_knight_hurt, 0.8, 1.3);
90
    }
91
    if (end_cutscene_version == 1)
92
    {
93
        if ((hurttimer % 3) == 0 || stronghurtanim == false)
94
            draw_sprite_ext(idlesprite, siner, x + shakex + hurtspriteoffx, y + hurtspriteoffy, 2, 2, 0, image_blend, 1);
95
        else
96
            draw_sprite_ext(spr_roaringknight_ball_transition, 7, x + shakex + hurtspriteoffx, y + hurtspriteoffy, 2, 2, 0, image_blend, 1);
97
    }
98
    else if ((hurttimer % 2) == 0 || stronghurtanim == false)
99
    {
100
        draw_sprite_ext(idlesprite, siner, x + shakex + hurtspriteoffx, y + hurtspriteoffy, 2, 2, 0, image_blend, 1);
101
    }
102
    else
103
    {
104
        draw_sprite_ext(spr_roaringknight_ball_transition, 7, x + shakex + hurtspriteoffx, y + hurtspriteoffy, 2, 2, 0, image_blend, 1);
105
    }
106
    if (hurttimer == 29 && stronghurtanim == true && end_cutscene_version == 0)
107
        snd_play(snd_knight_hurtb);
108
    if (hurttimer == 15)
109
        stronghurtanim = false;
110
}
111
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);
112
if (whiteflash > 0)
113
{
114
    whiteflash--;
115
    d3d_set_fog(true, c_white, 0, 1);
116
    if (state == 3 && hurttimer >= 0)
117
        draw_sprite_ext(hurtsprite, 0, x + shakex + hurtspriteoffx, y + hurtspriteoffy, 2, 2, 0, image_blend, 0.62);
118
    if (state == 0)
119
        draw_sprite_ext(idlesprite, siner, x, y, image_xscale, image_yscale, image_angle, image_blend, 0.62);
120
    d3d_set_fog(false, c_black, 0, 0);
121
}
122
if (chargeupcon == 1)
123
{
124
    d3d_set_fog(true, c_white, 0, 1);
125
    draw_sprite_ext(idlesprite, siner, x, y, image_xscale, image_yscale, image_angle, image_blend, chargeuptimer / 10);
126
    d3d_set_fog(false, c_black, 0, 0);
127
}
128
if (becomeflash == 0)
129
    flash = 0;
130
becomeflash = 0;