Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_firespell_Draw_0

related scripts: Create_0Draw_0

(view raw script w/o annotations or w/e)
1
timer++;
2
if (timer == 1)
3
    snd_play(snd_firespell);
4
if (timer == 1)
5
{
6
    hex[0] = instance_create(x - 25, y - 20, obj_firespell_hexagon);
7
    hex[0].sprite_index = sprite_index;
8
}
9
if (timer == 4)
10
{
11
    hex[1] = instance_create(x + 25, y - 20, obj_firespell_hexagon);
12
    hex[1].sprite_index = sprite_index;
13
}
14
if (timer == 7)
15
{
16
    hex[2] = instance_create(x, y + 20, obj_firespell_hexagon);
17
    hex[2].sprite_index = sprite_index;
18
}
19
if (timer == 10)
20
{
21
    for (i = 0; i < 3; i++)
22
    {
23
        with (hex[i])
24
        {
25
            for (j = 0; j < 6; j++)
26
            {
27
                hexhex[j] = instance_create(x, y, obj_firespell_hexagon);
28
                hexhex[j].image_xscale = 2;
29
                hexhex[j].image_yscale = 2;
30
                hexhex[j].con = 1;
31
                hexhex[j].direction = 60 * j;
32
                hexhex[j].speed = 8;
33
                hexhex[j].friction = 0.2;
34
            }
35
        }
36
    }
37
}
38
if (timer == 11)
39
{
40
    with (hex[0])
41
        instance_destroy();
42
    with (hex[1])
43
        instance_destroy();
44
    with (hex[2])
45
        instance_destroy();
46
}
47
if (timer == 15)
48
{
49
    if (global.fighting == 1)
50
    {
51
        global.hittarget[star] = 0;
52
        if (damage >= global.monsterhp[star])
53
        {
54
            if (i_ex(global.monsterinstance[star]))
55
            {
56
                if (global.monsterinstance[star].freezable == 1)
57
                    global.flag[51 + star] = 6;
58
            }
59
        }
60
        
scr_damage_enemy
scr_damage_enemy

function
scr_damage_enemy(arg0, arg1)
{ dm = instance_create(global.monsterx[arg0], (global.monstery[arg0] + 20) - (global.hittarget[arg0] * 20), obj_dmgwriter); if (caster < 4) { dm.type = global.char[caster] - 1; if (global.char[caster] == 4) dm.type = 6; } if (caster == 5) dm.type = 5; dm.damage = arg1; global.monsterhp[arg0] -= arg1; with (global.monsterinstance[arg0]) { if (variable_instance_exists(id, "callback_on_damage")) callback_on_damage(id); } if (arg1 > 0) { with (global.monsterinstance[arg0]) { shakex = 9; state = 3; hurttimer = 30; } if (i_ex(global.monsterinstance[arg0])) global.monsterinstance[arg0].hurtamt = arg1; } global.hittarget[arg0] += 1; if (arg1 == 0) { with (global.monsterinstance[arg0]) { hurtamt = 0; if (hurttimer <= 15 && candodge == 1) { dodgetimer = 0; state = 4; } } } var a = 0; if (global.monsterhp[arg0] <= 0 && a == 0) { with (global.monsterinstance[arg0])
scr_monsterdefeat();
} }
(star, damage);
61
        if (global.monster[star] == 1)
62
        {
63
            with (target)
64
                __of = 
scr_oflash
scr_oflash

function
scr_oflash()
{ _oflash = instance_create(x, y, obj_oflash); _oflash.image_xscale = image_xscale; _oflash.image_speed = 0; _oflash.image_angle = image_angle; _oflash.image_index = image_index; _oflash.image_yscale = image_yscale; _oflash.sprite_index = sprite_index; _oflash.depth = depth - 1; _oflash.target = id; return _oflash; }
();
65
        }
66
    }
67
}
68
if (timer >= 10 && timer <= 30)
69
{
70
    draw_set_alpha(2.2 - (timer / 10));
71
    draw_set_color(c_white);
72
    d_circle(x, y, 60 - (timer * 6), true);
73
    d_circle(x, y, 61 - (timer * 6), true);
74
    d_circle(x, y, 62 - (timer * 6), true);
75
    draw_set_alpha(1);
76
}
77
if (timer == 60)
78
    instance_destroy();