Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_climb_evilgrowth_Step_0

(view raw script w/o annotations or w/e)
1
if (damagecon == 1)
2
{
3
    if (!invincible)
4
    {
5
        damagecon = 2;
6
        active = 0;
7
    }
8
    else
9
    {
10
        damagecon = 0;
11
    }
12
}
13
if (damagecon == 2)
14
{
15
    timer = 0;
16
    image_blend = c_white;
17
    var animation = instance_create(x + 20, y + 20, obj_animation);
18
    animation.sprite_index = spr_attack_cut1;
19
    animation.depth = depth - 10;
20
    animation.image_xscale = 2;
21
    animation.image_yscale = 2;
22
    if (i_ex(obj_rotating_tower_controller_new))
23
    {
24
        animation.x = obj_rotating_tower_controller_new.krisx;
25
        animation.y = obj_rotating_tower_controller_new.krisy;
26
    }
27
    snd_play_x(snd_swing, 0.4, 1.2);
28
    snd_play_x(snd_laz_c, 0.3, 1.2);
29
    if (i_ex(obj_rotating_tower_controller_new))
30
        
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); }
();
31
    else
32
        
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); }
();
33
    hp--;
34
    if (hp > 0)
35
    {
36
        damagecon = 0;
37
        with (obj_climb_kris)
38
        {
39
            fallingcon = 1;
40
            fallingtimer = 20;
41
        }
42
    }
43
    else
44
    {
45
        snd_play(snd_explosion, 0.5);
46
        damagecon = 3;
47
        eyetimer = 16;
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.krisx;
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.krisx;
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
        damagecon = 4;
85
    }
86
}
87
image_index = max(0, (floor(current_time / 150) % 4) - 1);
88
if (progresscon == 0 && hp == 2)
89
{
90
    progresscon = 1;
91
    with (obj_climb_animationmarker)
92
    {
93
        if (index == 221 && place_meeting(x, y, other))
94
            event_user(10);
95
    }
96
    obj_rotating_tower_controller_new.tower_xshake = 5;
97
    eyetimer = 8;
98
    var e = instance_create(200, obj_climb_kris.y + 6, obj_climb_explosion);
99
    e.dowing = true;
100
}
101
else if (progresscon == 1 && hp == 1)
102
{
103
    progresscon = 2;
104
    with (obj_climb_animationmarker)
105
    {
106
        if (index == 222 && place_meeting(x, y, other))
107
            event_user(10);
108
    }
109
    var e = instance_create(440, obj_climb_kris.y + 6, obj_climb_explosion);
110
    e.image_xscale = -1;
111
    e.dowing = true;
112
    obj_rotating_tower_controller_new.tower_xshake = 5;
113
    eyetimer = 12;
114
}
115
if (eyetimer > 0)
116
{
117
    if (eyetimer < 16)
118
    {
119
        eyetimer--;
120
        eyey -= eyetimer;
121
    }
122
    else
123
    {
124
        eyey = 0;
125
    }
126
}
127
if (damagecon == 4)
128
{
129
    timer += 1;
130
    image_alpha -= 0.05;
131
    obj_rotating_tower_controller_new.tower_xshake = clamp(20 - (timer * 0.5), 0, 3) * (((floor(20 - timer) % 2) * 2) - 1);
132
}