Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_climb_boostenemy_Step_0

(view raw script w/o annotations or w/e)
1
if (is_culled)
2
    exit;
3
if (damagecon == 1)
4
{
5
    if (!invincible)
6
    {
7
        damagecon = 2;
8
        active = 0;
9
    }
10
    else
11
    {
12
        damagecon = 0;
13
    }
14
}
15
if (damagecon == 2)
16
{
17
    timer = 0;
18
    image_blend = c_white;
19
    var animation = instance_create(x + 20, y + 20, obj_animation);
20
    animation.sprite_index = spr_attack_cut1;
21
    animation.depth = depth - 10;
22
    animation.image_xscale = 2;
23
    animation.image_yscale = 2;
24
    if (i_ex(obj_rotating_tower_controller_new))
25
    {
26
        animation.x = obj_rotating_tower_controller_new.tower_x;
27
        animation.y = obj_rotating_tower_controller_new.krisy;
28
    }
29
    snd_play_x(snd_swing, 0.4, 1.2);
30
    snd_play_x(snd_laz_c, 0.3, 1.2);
31
    if (i_ex(obj_rotating_tower_controller_new))
32
        
scr_shakeobj_tower
scr_shakeobj_tower

function
scr_shakeobj_tower()
{ var _shakeobj = instance_create(x, y, obj_shakeobj_tower); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
();
33
    else
34
        
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
();
35
    hp--;
36
    if (hp > 0)
37
    {
38
        damagecon = 0;
39
        with (obj_climb_kris)
40
        {
41
            fallingcon = 1;
42
            fallingtimer = 20;
43
        }
44
    }
45
    else
46
    {
47
        damagecon = 3;
48
    }
49
}
50
if (damagecon == 3)
51
{
52
    timer++;
53
    if (timer == 8)
54
    {
55
        var animation = instance_create(x + 20, y + 20, obj_animation);
56
        animation.sprite_index = spr_attack_slap2;
57
        animation.image_blend = c_white;
58
        animation.image_speed = 0.5;
59
        animation.depth = depth - 1;
60
        animation.image_xscale = 2;
61
        animation.image_yscale = 2;
62
        if (i_ex(obj_rotating_tower_controller_new))
63
        {
64
            animation.x = obj_rotating_tower_controller_new.tower_x;
65
            animation.y = obj_rotating_tower_controller_new.krisy;
66
        }
67
        animation = instance_create(x + 20, y + 20, obj_animation);
68
        animation.sprite_index = spr_attack_slap2;
69
        animation.image_blend = c_black;
70
        animation.image_speed = 0.5;
71
        animation.depth = depth - 1;
72
        animation.image_xscale = 3;
73
        animation.image_yscale = 3;
74
        if (i_ex(obj_rotating_tower_controller_new))
75
        {
76
            animation.x = obj_rotating_tower_controller_new.tower_x;
77
            animation.y = obj_rotating_tower_controller_new.krisy;
78
        }
79
        with (animation)
80
            
scr_afterimage
scr_afterimage

function
scr_afterimage()
{ afterimage = instance_create(x, y, obj_afterimage); 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; return afterimage; }
();
81
        snd_play_x(snd_swing, 1, 0.5);
82
        snd_play_x(snd_damage, 0.5, 0.5);
83
        snd_play_x(snd_punchmed, 0.4, 1);
84
    }
85
    if (timer == 10)
86
    {
87
        var xx = x;
88
        if (i_ex(obj_rotating_tower_controller_new))
89
            xx = obj_rotating_tower_controller_new.tower_x;
90
        for (var i = -5; i <= 5; i++)
91
        {
92
            with (instance_create(xx + (30 * i), y, obj_marker_fancy))
93
            {
94
                sprite_index = spr_climb_booster_shard_single;
95
                timer = random_range(-20, 0);
96
                gravity = 0.5;
97
                depth = other.depth - 1;
98
                
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
99
                image_xscale = 2 - (abs(i) * 0.2);
100
                rotation_mult = (-i + random_range(-0.4, 0.4)) * random_range(0.8, 1.2) * 4;
101
                vspeed = (-20 + abs(i)) - random_range(4, 12);
102
                friction = 0.3;
103
                hspeed = i * random_range(1.8, 2.2);
104
                
105
                step_func = function()
106
                {
107
                    image_angle += rotation_mult;
108
                    timer++;
109
                    if (timer >= 6)
110
                    {
111
                        image_alpha -= 0.1;
112
                        if (image_alpha <= 0)
113
                            instance_destroy();
114
                    }
115
                };
116
            }
117
        }
118
        instance_destroy();
119
    }
120
}