Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dogcar_ch4_Step_0

(view raw script w/o annotations or w/e)
1
if (mode == 0)
2
{
3
    y = obj_mainchara.y - 8;
4
    if (x <= obj_mainchara.x)
5
        x += 20;
6
}
7
if (place_meeting(x, y, obj_mainchara) && mode == 0)
8
{
9
    snd_stop(snd_hurt1);
10
    snd_play(snd_hurt1);
11
    snd_stop(snd_punchweak);
12
    snd_play(snd_punchweak);
13
    doghit = instance_create(x, y + 40, obj_animation);
14
    doghit.image_xscale = 2;
15
    doghit.image_yscale = 2;
16
    doghit.sprite_index = spr_dogcar_hit;
17
    x += 48;
18
    dmgwriter = instance_create(obj_mainchara.x, (obj_mainchara.y + obj_mainchara.myheight) - 24, obj_dmgwriter);
19
    dmgwriter.damage = choose(2, 3, 4, 5);
20
    dmgwriter.type = 0;
21
    dmgwriter.depth = -100;
22
    dmgwriter.hspeed = -10;
23
    global.interact = 1;
24
    with (obj_mainchara)
25
alarm[1]
26
    fakedamage += 4;
27
    if (fakedamage >= 120)
28
    {
29
        with (obj_bellListener)
30
            badcon++;
31
        mode = 1;
32
    }
33
}
34
if (place_meeting(x, y, obj_dogcar_gameover_ch4) && mode == 1)
35
{
36
    snd_stop(snd_hurt1);
37
    snd_play(snd_hurt1);
38
    snd_stop(snd_punchweak);
39
    snd_play(snd_punchweak);
40
    doghit = instance_create(x, y + 40, obj_animation);
41
    doghit.image_xscale = 2;
42
    doghit.image_yscale = 2;
43
    doghit.sprite_index = spr_dogcar_hit;
44
    doghit.depth = -300;
45
    x += 36;
46
    obj_dogcar_gameover_ch4.image_xscale -= 0.08;
47
    if (obj_dogcar_gameover_ch4.image_xscale <= 0.08)
48
    {
49
        with (obj_dogcar_gameover_ch4)
50
            instance_destroy();
51
    }
52
}