Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_sneo_wireheart_edit_Draw_0

(view raw script w/o annotations or w/e)
1
if (i_ex(boss))
2
{
3
    var xx = 50 - (boss.heart_release_con * 100);
4
    if (global.turntimer < 20)
5
        xx = 0;
6
    rembossx = lerp(rembossx, boss.x + xx, 0.16);
7
    rembossy = boss.y + 80;
8
}
9
if (destroyed == 1)
10
    invincibility_timer = 0;
11
var hidesprite = 0;
12
if (invincibility_timer > 0)
13
{
14
    if (invincibility_timer == 10 || invincibility_timer == 9 || invincibility_timer == 6 || invincibility_timer == 5 || invincibility_timer == 3 || invincibility_timer == 2)
15
        hidesprite = 1;
16
    invincibility_timer--;
17
}
18
if (hidesprite == 0)
19
{
20
    if (type == 3 && altbiter > 0 && altbiter < 3)
21
    {
22
        if (altbiter == 1)
23
        {
24
            for (i = 6; i >= 0; i--)
25
                draw_sprite_ext(spr_sneo_wireheart, 5, lerp(x, rembossx, i / 5), lerp(y, rembossy, i / hpos), 0.75, 0.75, 0, image_blend, image_alpha);
26
        }
27
        else
28
        {
29
            for (i = 6; i >= 0; i--)
30
                draw_sprite_ext(spr_sneo_wireheart, 5, lerp(x, rembossx, i / 6), lerp(y, rembossy, i / hpos), 0.75, 0.75, 0, image_blend, image_alpha);
31
        }
32
    }
33
    else
34
    {
35
        for (i = 10; i >= 0; i--)
36
            draw_sprite_ext(spr_sneo_wireheart, 4, lerp(x, rembossx, i / 9), lerp(y, rembossy, i / 9), image_xscale, image_yscale, 0, image_blend, image_alpha);
37
    }
38
    animtimer++;
39
    firedtimer--;
40
    image_index = 0;
41
    if (animtimer >= 5)
42
        image_index = 1;
43
    if (animtimer >= 10)
44
        animtimer = 0;
45
    if (firedtimer > 4)
46
        image_index = 3;
47
    draw_self();
48
    if (damagetimer > 0)
49
    {
50
        draw_sprite_ext(sprite_index, 2, x, y, image_xscale, image_yscale, image_angle, image_blend, damagetimer / 5);
51
        damagetimer -= 1;
52
    }
53
}
54
if (destroyed == 1)
55
{
56
    snd_play(snd_bomb);
57
    if (type == 4 && global.turntimer > 20)
58
    {
59
        bomb = instance_create(x, y, obj_sneo_heart_bomb_explode);
60
        bomb.depth = depth - 2;
61
    }
62
    else
63
    {
64
        scr_afterimage_cut
scr_afterimage_cut

function scr_afterimage_cut() { afterimage = instance_create(x, y, obj_afterimage_cut); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; with (afterimage) event_user(0); return afterimage; }
();
65
    }
66
    for (i = 10; i >= 0; i--)
67
    {
68
        piece = scr_marker
scr_marker

function scr_marker(arg0, arg1, arg2) { thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; } return thismarker; }
(lerp(x, rembossx, i / 9), lerp(y, rembossy, i / 9), spr_sneo_wireheart);
69
        piece.image_index = 4;
70
        piece.i = i;
71
        piece.depth = depth + 1;
72
        with (piece)
73
        {
74
            scr_script_delayed
scr_script_delayed

function scr_script_delayed() { var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(scr_afterimage_cut, i * 2);
75
            scr_script_delayed
scr_script_delayed

function scr_script_delayed() { var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(snd_play, i * 2, snd_bomb);
76
            scr_script_delayed
scr_script_delayed

function scr_script_delayed() { var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(snd_volume, i * 2, 142, 0.5, 0);
77
            scr_doom
scr_doom

function scr_doom(arg0, arg1) { with (instance_create_depth(0, 0, 0, obj_doom)) {alarm[0] target = arg0; } }
(id, (i * 2) + 1);
78
        }
79
    }
80
    if (altbiter == 1 || altbiter == 2)
81
        obj_spamton_neo_enemy.makeheartalt = altbiter + 2;
82
    if (type == 0 || (type == 1 && obj_spamton_neo_enemy.difficulty > 2))
83
    {
84
        with (obj_spamton_neo_enemy)
85
        {
86
            if (global.monsterhp[myself] == global.monstermaxhp[myself] && scr_sideb_get_phase
scr_sideb_get_phase

function scr_sideb_get_phase() { var phase = 0; if (global.flag[916 snowgrave_fail] == 0) { if (global.flag[915 snowgrave_plot] > 0 && global.flag[915 snowgrave_plot] < 4) phase = 1; if (global.flag[915 snowgrave_plot] >= 4 && global.flag[915 snowgrave_plot] < 7) phase = 2; if (global.flag[915 snowgrave_plot] >= 7 && global.flag[915 snowgrave_plot] < 20) phase = 3; if (global.flag[915 snowgrave_plot] >= 20) phase = 4; } return phase; }
() < 3)
87
            {
88
                obj_sneo_bulletcontroller.mercyaccumulated += 3;
89
                with (obj_spamton_neo_enemy)
90
                {
91
                    __mercydmgwriter = instance_create(global.monsterx[myself], (global.monstery[myself] + 20) - (global.hittarget[myself] * 20), obj_dmgwriter);
92
                    __mercydmgwriter.damage = 3;
93
                    __mercydmgwriter.type = 5;
94
                    global.hittarget[myself]++;
95
                }
96
            }
97
            else
98
            {
99
                global.monsterhp[0] -= ceil(global.monstermaxhp[0] * 0.03);
100
                if (global.monsterhp[0] < 0)
101
                    global.monsterhp[0] = 1;
102
            }
103
        }
104
    }
105
    instance_destroy();
106
}