Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_singlescreen_shadowguy_laser_machine_Collision_obj_susiezilla_player

(view raw script w/o annotations or w/e)
1
with (obj_susiezilla_gamecontroller)
2
{
3
    if (gameover)
4
        exit;
5
}
6
if (state != states.dead && state != states.hurt && ropeheight == 0)
7
{
8
    var _hit = other.id;
9
    if (_hit.hitactive)
10
    {
11
        snd_stop(snd_punchmed);
12
        snd_play(snd_punchmed);
13
        hp--;
14
        with (obj_susiezilla_gamecontroller)
15
        {
16
            spamton_hit = true;
17
            ending_type = 1;
18
        }
19
        
scr_susiezilla_hiteffect
scr_susiezilla_hiteffect

function
scr_susiezilla_hiteffect(arg0)
{ var _hit = arg0; var _hitmarker =
scr_dark_marker(round((_hit.myxcenter + myxcenter) / 2), round((_hit.myycenter + myycenter) / 2), spr_dogcar_hit);
scr_doom(_hitmarker, 4);
var hitscale = myhitscale; if (_hit.myhitscale > hitscale) hitscale = _hit.myhitscale;
scr_scale(hitscale, _hitmarker);
scr_lerpvar_instance(_hitmarker, "image_xscale", hitscale, 1, 4);
scr_lerpvar_instance(_hitmarker, "image_yscale", hitscale, 1, 4);
_hitmarker.depth = depth - 100; return _hitmarker; }
(_hit);
20
        var spawny = offset_index[hurt_index] * 7;
21
        repeat (2 + irandom(4))
22
        {
23
            with (instance_create_depth(x + 32 + ((10 + random(50)) * choose(-1, 1)), y - 24 - random(104 - spawny), depth + choose(-1, 1), obj_dozer_parts))
24
            {
25
                var facing = x - (other.x + 32);
26
                sprite_index = spr_susiezilla_spamcannon_chip;
27
                image_angle = irandom(360);
28
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("image_angle", image_angle, image_angle + ((90 + irandom(270)) * choose(-1, 1)), 30 + irandom(60));
29
                image_speed = 0;
30
                image_index = irandom(image_number - 1);
31
                image_xscale = 1 + (random(2) * choose(1, -1));
32
                image_yscale = image_xscale;
33
                h_speed = (sign(facing) * 2) + random(10);
34
                v_speed = -4 - random(8);
35
                ground = other.y;
36
            }
37
        }
38
        with (obj_susiezilla_laser_segment)
39
            instance_destroy();
40
        if (!hp)
41
        {
42
            image_index = 0;
43
            image_speed = 0;
44
            state = states.dead;
45
            state_timer = 0;
46
            mask_index = spr_nomask;
47
            with (obj_susiezilla_singlescreen_hud_score)
48
                score_change(other.value);
49
            with (obj_susiezilla_singlescreen_shadowguy_parent)
50
            {
51
                if (id != other.id)
52
                {
53
                    if (object_index != obj_susiezilla_singlescreen_shadowguy_in_dozer)
54
                        instant_defeat();
55
                    else
56
                        instant_defeat_dozer();
57
                }
58
            }
59
            with (obj_susiezilla_gamecontroller)
60
            {
61
                resolve_this = true;
62
                with (obj_script_delayed)
63
                {
64
                    if (target == other.id)
65
                        instance_destroy();
66
                }
67
                loss_counter = 0;
68
                enemy_count = 1;
69
            }
70
            snd_play(snd_splat);
71
            _hit.direction = 0;
72
            _hit.speed = 24;
73
            _hit.accel = 0;
74
            with (obj_susiezilla_gamecontroller)
75
            {
76
                check_enemies();
77
                mus_fade(global.currentsong[1], 60);
78
                var tetalk = stringsetloc(
* PHEW!!! YOU GUYS SAVED TV!!! YOU HAVE WON!!!
"* PHEW!!! YOU GUYS SAVED TV!!! YOU HAVE WON!!!", "obj_susiezilla_singlescreen_shadowguy_laser_machine_slash_Collision_obj_susiezilla_player_gml_147_0"
);
79
                
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_tennashouter, 60, tetalk, 90);
80
                with (obj_susiezilla_statue)
81
                {
82
                    if ((hp / maxhp) >= 0.95)
83
                    {
84
                        snd_play(snd_applause);
85
                        snd_play(snd_crowd_ooh);
86
                        instance_create_depth(clamp(obj_susiezilla_player.myxcenter, 160, room_width - 160), obj_susiezilla_player.y + 30, depth - 900000, obj_susiezilla_perfect_popularity);
87
                        with (obj_susiezilla_singlescreen_hud_score)
88
                            score_change(99);
89
                    }
90
                }
91
            }
92
        }
93
        else
94
        {
95
            state = states.hurt;
96
            hurt_timer = 0;
97
            shake = 4;
98
            flash = 10;
99
            with (obj_susiezilla_gamecontroller)
100
                shake = 8;
101
            snd_play(snd_screenshake);
102
            image_xscale = 2.5;
103
            image_yscale = 1.5;
104
            hurt_counter++;
105
            if (hurt_counter == 3)
106
            {
107
                hurt_index++;
108
                hurt_counter = 0;
109
            }
110
            laser_offset = offset_index[hurt_index];
111
            sprite_index = spr_susiezilla_spamcannon;
112
            image_index = hurt_index;
113
            image_speed = 0;
114
            _hit.direction = 0;
115
            _hit.speed = 32;
116
            _hit.accel = 0;
117
        }
118
    }
119
}