Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_flowery_enemy_Draw_0

related scripts: Alarm_4Alarm_6CleanUp_0Create_0Draw_0 KeyPress_13Other_10Other_11Other_15Other_22Other_4Step_0

(view raw script w/o annotations or w/e)
1
var floating = true;
2
with (obj_lerpvar)
3
{
4
    if (target == other.id)
5
        floating = false;
6
}
7
if (acting == 101)
8
{
9
    d_rectangle_color(camerax() + 240, cameray() + 290, (camerax() + 210 + 210) - (acttimer * 0.9), cameray() + 300, 16776960, 16776960, 16776960, 16776960, 0);
10
    draw_sprite_ext(spr_poppup_hourglass, 0, camerax() + 240, cameray() + 295, 2, 2, 0, c_white, image_alpha);
11
    d3d_set_fog(true, c_white, 0, 0);
12
    if (button1_p() == 1)
13
        draw_sprite_ext(spr_poppup_hourglass, 0, camerax() + 240, cameray() + 295, 2, 2, 0, c_white, image_alpha);
14
    d3d_set_fog(false, c_white, 0, 0);
15
}
16
if (state == 10)
17
{
18
    ashake = 0;
19
    xoff = 0;
20
    animsiner += 1;
21
    if (blown == 1)
22
        image_xscale = 2;
23
    if (image_xscale < 2)
24
        xoff = (originalwidth - sprite_width) / 2;
25
    blowanimtimer--;
26
    if (blowanimtimer > 6)
27
    {
28
        if (onoff == 2)
29
            onoff = 0;
30
        if (onoff == 1.5)
31
            onoff = 2;
32
        if (onoff == 0.5)
33
            onoff = 1;
34
        if (onoff == 0)
35
        {
36
            ashake = -shakeamt;
37
            onoff = 0.5;
38
        }
39
        if (onoff == 1)
40
        {
41
            ashake = shakeamt;
42
            if (shakeamt > 0)
43
                shakeamt -= 1;
44
            onoff = 1.5;
45
        }
46
    }
47
    draw_sprite_ext(sprite_index, image_index, x + xoff + ashake, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
48
    if (sprite_index == spr_flowery_wind && image_index > 0)
49
        image_index += 0.25;
50
    if (sprite_index == spr_flowery_wind && image_index >= 8)
51
        image_index = 0;
52
    if (sprite_index == spr_flowery_condescend && image_index > 5.5)
53
    {
54
        state = 0;
55
        image_index = 0;
56
    }
57
    if (sprite_index == spr_flowery_kiss && image_index > 3.5)
58
    {
59
        state = 0;
60
        image_index = 0;
61
        image_speed = 0;
62
    }
63
}
64
else if ((state == 3 && hurttimer >= 0) || force_hurt_sprite == true || global.monsterhp[myself] <= (global.monstermaxhp[myself] * 0.99))
65
{
66
    draw_sprite_ext(hurtsprite, 0, x + shakex + hurtspriteoffx, y + hurtspriteoffy, 2, 2, 0, image_blend, 1);
67
    if (green_and_orange_enter == 2 && orange_adjust_con == 0)
68
    {
69
        orange_marker.y += 14;
70
        orange_adjust_con = 1;
71
    }
72
}
73
else
74
{
75
    if (floating)
76
        y = ystart + (sin(float_siner * 0.33) * 5);
77
    
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); } }
(image_speed);
78
}
79
if (becomeflash == 0)
80
    flash = 0;
81
becomeflash = 0;
82
xoff = 0;
83
animsiner += 1;
84
if (blown == 1)
85
    image_xscale = 2;
86
if (image_xscale < 2)
87
    xoff = (originalwidth - sprite_width) / 2;
88
blowanimtimer--;
89
if (blowanimtimer > 6)
90
{
91
    if (onoff == 2)
92
        onoff = 0;
93
    if (onoff == 1.5)
94
        onoff = 2;
95
    if (onoff == 0.5)
96
        onoff = 1;
97
    if (onoff == 0)
98
    {
99
        ashake = -shakeamt;
100
        onoff = 0.5;
101
    }
102
    if (onoff == 1)
103
    {
104
        ashake = shakeamt;
105
        if (shakeamt > 0)
106
            shakeamt -= 1;
107
        onoff = 1.5;
108
    }
109
}
110
if (
scr_debug
scr_debug

function
scr_debug()
{ return global.debug == 1; }
())
111
{
112
    if (keyboard_check_pressed(vk_end))
113
    {
114
        draw_test = !draw_test;
115
        scr_debug_clear_all();
116
    }
117
}
118
if (draw_test)
119
{
120
    if (
scr_debug
scr_debug

function
scr_debug()
{ return global.debug == 1; }
() && !i_ex(obj_debug_orangeheartcontroller))
121
    {
122
        draw_set_font(fnt_main);
123
        draw_set_halign(fa_center);
124
        draw_set_valign(fa_middle);
125
        draw_set_color(c_yellow);
126
        draw_text(camerax() + 320, cameray() + 20, "<-ctrl-   " + _category + "  -alt->");
127
        if (pattern_category)
128
        {
129
            for (var a = 0; a < category_size; a++)
130
            {
131
                draw_set_color(c_gray);
132
                if ((pattern_test % 10) == a)
133
                    draw_set_color(c_white);
134
                draw_text(camerax() + 240 + (20 * a), cameray() + 40, string(a + 1));
135
            }
136
        }
137
        draw_set_valign(fa_top);
138
        draw_set_halign(fa_center);
139
        draw_text(camerax() + (camerawidth() / 2), cameray() + 26, "Phase: " + string(phase));
140
        draw_text(camerax() + (camerawidth() / 2), cameray() + 39, "P to skip phase");
141
        draw_set_halign(fa_left);
142
    }
143
}
144
if (floating)
145
    float_siner += 0.25;