Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_o_coaster_controller_Step_0

(view raw script w/o annotations or w/e)
1
if (endcoaster == 0)
2
{
3
    if (obj_berdlyb_enemy.kriscoaster == 0 && krisgooffscreen == 1)
4
    {
5
    }
6
    if (obj_berdlyb_enemy.suscoaster == 0 && susiegooffscreen == 1)
7
    {
8
    }
9
    if (obj_berdlyb_enemy.ralcoaster == 0 && ralseigooffscreen == 1)
10
    {
11
    }
12
}
13
if (endcoaster == 1)
14
{
15
    if (HeroCoaster[0].x < HeroCoaster[0].xstart && HeroCoaster[0].gooffscreen == 1)
16
        HeroCoaster[0].x += 30;
17
    if (HeroCoaster[1].x < HeroCoaster[1].xstart && HeroCoaster[1].gooffscreen == 1)
18
        HeroCoaster[1].x += 30;
19
    if (HeroCoaster[2].x < HeroCoaster[2].xstart && HeroCoaster[2].gooffscreen == 1)
20
        HeroCoaster[2].x += 30;
21
    if (HeroCoaster[0].x > HeroCoaster[0].xstart && HeroCoaster[0].gooffscreen == 1)
22
        HeroCoaster[0].x = HeroCoaster[0].xstart;
23
    if (HeroCoaster[1].x > HeroCoaster[1].xstart && HeroCoaster[1].gooffscreen == 1)
24
        HeroCoaster[1].x = HeroCoaster[1].xstart;
25
    if (HeroCoaster[2].x > HeroCoaster[2].xstart && HeroCoaster[2].gooffscreen == 1)
26
        HeroCoaster[2].x = HeroCoaster[2].xstart;
27
}
28
if (playerinputtimer < 12 || actcon == 1)
29
    playerinputtimer++;
30
if (playerinputtimer == 150)
31
    playerinput = 1;
32
if (obj_berdlyb_enemy.bumpactstarted == 1 && obj_berdlyb_enemy.ralseigo == 0 && obj_berdlyb_enemy.susiego == 0 && obj_berdlyb_enemy.krisgo == 0 && o_coaster_berdly.movecon == 0)
33
    endcoaster = 1;
34
if (endcoaster == 1)
35
{
36
    with (o_coastersmoke)
37
        instance_destroy();
38
    with (obj_writer)
39
        instance_destroy();
40
    endcoastertimer = 20;
41
    if (endcoastertimer == 20)
42
    {
43
        endcoaster = 0;
44
        endcoastertimer = 0;
45
        krisgooffscreen = 0;
46
        susiegooffscreen = 0;
47
        ralseigooffscreen = 0;
48
        HeroCoaster[0].gooffscreen = 0;
49
        HeroCoaster[1].gooffscreen = 0;
50
        HeroCoaster[2].gooffscreen = 0;
51
        with (o_coaster_hero)
52
            forceact = 0;
53
        if (HeroCoaster[0].con == 0 && HeroCoaster[1].con == 0 && HeroCoaster[2].con == 0)
54
        {
55
            buttonspressed = 0;
56
            with (obj_berdlyb_enemy)
57
            {
58
                bumpwait = 1;
59
alarm[7]
60
                acting = 0;
61
                actcon = 1;
62
                actconsus = 0;
63
                actconral = 0;
64
                rideactgo = 0;
65
                bumpactstarted = 0;
66
                bumpactfast = 0;
67
                with (o_coaster_hero)
68
                    draw_button_press = 0;
69
                if (global.mercymod[myself] < global.mercymax[myself])
70
                    
scr_mercyadd
scr_mercyadd

function
scr_mercyadd(arg0, arg1)
{ global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; if (global.mercymod[arg0] >= 100) global.mercymod[arg0] = 100; var _playsound = 1; if (arg1 <= 0) _playsound = 0; if (i_ex(obj_dmgwriter)) { with (obj_dmgwriter) { if (type == 5) _playsound = 0; } } if (_playsound) { var _pitch = 0.8; if (arg1 < 99) _pitch = 1; if (arg1 <= 50) _pitch = 1.2; if (arg1 <= 25) _pitch = 1.4; snd_play_x(snd_mercyadd, 0.8, _pitch); } __mercydmgwriter = instance_create(global.monsterx[arg0], (global.monstery[arg0] + 20) - (global.hittarget[arg0] * 20), obj_dmgwriter); __mercydmgwriter.damage = arg1; __mercydmgwriter.type = 5; global.hittarget[arg0]++; }
(myself, o_coaster_controller.bumpmercy);
71
                if (global.mercymod[myself] >= 100)
72
                    endcon = 1;
73
            }
74
            bumpmercy = 0;
75
            actcon = 0;
76
        }
77
    }
78
}