Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_singlescreen_shadowguy_in_dozer_Step_0

(view raw script w/o annotations or w/e)
1
depth = 10000 - y;
2
with (obj_susiezilla_gamecontroller)
3
{
4
    var sourcedude = other.id;
5
    if (gameover)
6
    {
7
        other.speed = 0;
8
        other.image_speed = 0;
9
        with (obj_script_delayed)
10
        {
11
            if (target == sourcedude)
12
                instance_destroy();
13
        }
14
        with (obj_lerpvar)
15
        {
16
            if (target == sourcedude)
17
                instance_destroy();
18
        }
19
        other.gameover = true;
20
        exit;
21
    }
22
}
23
if (state == states.dead)
24
    exit;
25
if (hitstop <= 0)
26
{
27
    if (state == states.approach)
28
    {
29
        dozing_speed = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(dozing_speed, 3, 0.1);
30
        if (abs(x - obj_susiezilla_statue.x) > 64)
31
        {
32
            x = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(x, obj_susiezilla_statue.x, dozing_speed);
33
        }
34
        else
35
        {
36
            x -= (40 * facing);
37
            with (obj_susiezilla_statue)
38
                take_hit(other.facing, other.damage, other.knockback);
39
        }
40
    }
41
    if (state == states.ram)
42
    {
43
        state_timer++;
44
        if (state_timer == 1)
45
            xanchor = x;
46
        if (state_timer)
47
        {
48
            if (state_timer == 1)
49
            {
50
                speed = -facing * 4;
51
                pushalong = 15;
52
            }
53
            if (state_timer <= 16)
54
                speed = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(speed, 0, 0.25);
55
            if (state_timer > 16 && state_timer < 24)
56
            {
57
                pushalong = 30;
58
                x += (facing * 10);
59
                knockback = 30;
60
            }
61
            if (state_timer < 24)
62
            {
63
                var explosion = instance_create(x - (17 * facing), y - 85, obj_marker_animateOnce);
64
                explosion.image_speed = 0.5;
65
                explosion.depth = depth + 5;
66
                explosion.sprite_index = spr_susiezilla_houseexplosion;
67
                explosion.speed = 3;
68
                explosion.direction = 90 + irandom_range(-15, 15);
69
                explosion.image_angle = irandom(360);
70
                explosion.image_xscale = 1;
71
                explosion.image_yscale = 1;
72
                
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(explosion);
73
            }
74
            if (state_timer == 24)
75
            {
76
                snd_play_pitch(snd_damage, 0.5);
77
                with (obj_susiezilla_statue)
78
                    take_hit(other.facing, other.damage, other.knockback);
79
                knockback = 10;
80
                pushalong = 15;
81
            }
82
            if (state_timer > 28)
83
            {
84
                x = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(x, xanchor, 1);
85
                if (abs(x - xanchor) == 0)
86
                    state_timer = -16;
87
            }
88
        }
89
    }
90
    if (blockable)
91
    {
92
        if (i_ex(obj_susiezilla_player))
93
        {
94
            temp_mask = obj_susiezilla_player.mask_index;
95
            obj_susiezilla_player.mask_index = spr_susiezilla_susie_dozer_mask;
96
        }
97
        if (!obj_susiezilla_player.invuln && obj_susiezilla_player.canmove)
98
        {
99
            if ((facing == 1 && (obj_susiezilla_player.x + 32) > (x + (28 * facing))) || (facing != 1 && (obj_susiezilla_player.x + 32) < (x + (28 * facing))))
100
            {
101
                if (collision_rectangle(x + (26 * facing), y - 32, x + (38 * facing), y + 12, obj_susiezilla_player, true, true))
102
                {
103
                    flash = 10;
104
                    snd_stop(snd_board_door_close);
105
                    snd_stop(snd_metal_hit);
106
                    snd_play_x(snd_board_door_close, 1, 1);
107
                    snd_play_x(snd_metal_hit, 1, 1);
108
                    with (obj_susiezilla_player)
109
                    {
110
                        if (dashcon != 2)
111
                        {
112
                            take_hit(max(other.facing, 0), other.damage, other.knockback);
113
                        }
114
                        else
115
                        {
116
                            if (other.facing == 1)
117
                            {
118
                                x += 10;
119
                                hspeed = max(-hspeed * 0.75, other.pushalong);
120
                            }
121
                            if (other.facing == -1)
122
                            {
123
                                x -= 10;
124
                                hspeed = min(-hspeed * 0.75, -other.pushalong);
125
                            }
126
                        }
127
                    }
128
                }
129
            }
130
        }
131
        if (i_ex(obj_susiezilla_player))
132
            obj_susiezilla_player.mask_index = temp_mask;
133
    }
134
    hitdir = direction;
135
    hitspeed = speed;
136
    myxcenter = x;
137
    myycenter = y;
138
}