Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_dw_b3bs_rabbick_b_Step_0

(view raw script w/o annotations or w/e)
1
if (trigger == 1)
2
{
3
    trigcount++;
4
    global.flag[1105 cut_ribbick_fights] = trigcount;
5
    global.interact = 1;
6
    trigger = 2;
7
}
8
if (trigcount == 1)
9
{
10
    if (trigger == 2)
11
    {
12
        snd_play(snd_locker);
13
        var trash = instance_create(triggerer.x, triggerer.y, obj_dw_ch3_b3bs_trashcan);
14
        trash.itemflag = 1104;
15
        trash.flag = false;
16
        global.flag[1104 got_cut_ribbick_item] = 1;
17
        with (trash)
18
            event_user(0);
19
        with (triggerer)
20
            instance_destroy();
21
        triggerer = -1;
22
        trigger = 3;
23
    }
24
    if (trigger == 3 && !d_ex())
25
        trigger = 0;
26
}
27
if (trigcount == 2)
28
{
29
    if (trigger == 2)
30
    {
31
        snd_play(snd_locker);
32
        var trash = instance_create(triggerer.x, triggerer.y, obj_dw_ch3_b3bs_trashcan);
33
        trash.itemflag = 1104;
34
        trash.flag = false;
35
        trash.itemtype = "special";
36
        global.flag[1104 got_cut_ribbick_item] = 1;
37
        with (trash)
38
            event_user(0);
39
        with (triggerer)
40
            instance_destroy();
41
        triggerer = -1;
42
        trigger = 3;
43
    }
44
    if (trigger == 3 && !d_ex())
45
    {
46
        trigger = 0;
47
        snd_play(snd_impact);
48
        
scr_shakescreen
scr_shakescreen

function
scr_shakescreen()
{ instance_create(x, y, obj_shake); }
();
49
        door = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(258, 46, spr_dw_ch3_b3bs_door);
50
        door.depth = 1000050;
51
        safe_delete(doorblocker);
52
    }
53
}
54
if (trigcount == 3 || trigcount == 4 || trigcount == 6)
55
{
56
    if (trigger == 2)
57
    {
58
        var trash = instance_create(triggerer.x, triggerer.y, obj_dw_ch3_b3bs_trashcan);
59
        trash.itemflag = 1104;
60
        global.flag[1104 got_cut_ribbick_item] = 0;
61
        trash.itemtype = "money";
62
        trash.itemidchest = 20;
63
        trash.flag = false;
64
        if (trigcount == 4)
65
            trash.itemidchest = 43;
66
        if (trigcount == 6)
67
            trash.itemidchest = 1;
68
        with (trash)
69
            event_user(0);
70
        with (triggerer)
71
            instance_destroy();
72
        triggerer = -1;
73
        trigger = 3;
74
    }
75
}
76
if (trigcount == 5)
77
{
78
    if (trigger == 2)
79
    {
80
        timer++;
81
        var falltime = 6;
82
        if (timer == 1)
83
        {
84
            triggerer.sprite_index = spr_dw_ch3_b3bs_trashcan_fall;
85
            with (triggerer)
86
                
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_index", 0, 4, falltime);
87
        }
88
        if (timer == (1 + falltime))
89
        {
90
            snd_play(snd_impact);
91
            ribbick = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
((triggerer.x + 80) - 20, triggerer.y, spr_ribbick_Idle);
92
            with (ribbick)
93
            {
94
                image_alpha = 0;
95
                
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_alpha", 0, 1, 4, 2, "out");
96
                
scr_animate
scr_animate

function
scr_animate(arg0, arg1, arg2)
{ __animator = instance_create(x, y, obj_animator); __animator.target = id; __animator.initframe = arg0; __animator.endframe = arg1; __animator.fake_image_speed = arg2; return __animator; }
(2, 0, 0.125);
97
                hspeed = 6;
98
                friction = 0.5;
99
            }
100
        }
101
        if (timer == (1 + falltime + 10))
102
        {
103
            with (ribbick)
104
            {
105
                instance_create(x + 36, y, obj_excblcon);
106
                snd_play(snd_b);
107
            }
108
        }
109
        if (timer == (1 + falltime + 10 + 20))
110
        {
111
            encounterflag = 589;
112
            encounterno = 126;
113
            global.flag[54 encounter_pointer] = encounterflag;
114
            
scr_battle
scr_battle

function
scr_battle(arg0, arg1, arg2, arg3, arg4)
{ global.specialbattle = arg1; global.encounterno = arg0; if (global.flag[9 battle_music] != 2) { global.flag[9 battle_music] = 1; var batmusic = "battle.ogg"; if (global.chapter == 3) { if (global.encounterno == 111 && room == room_board_2) batmusic = "rudebuster_boss.ogg"; if (room == room_dw_b3bs_watercooler || room == room_dw_teevie_watercooler || room == room_dw_b3bs_zapper_b || room == room_dw_ranking_c) batmusic = "battle_vapor.ogg"; if (room == room_dw_teevie_chef) batmusic = "rouxls_battle.ogg"; } global.batmusic[0] = snd_init(batmusic); mus_volume(global.batmusic[1], 1, 0); } instance_create(0, 0, obj_battleback); instance_create(0, 0, obj_encounterbasic); __enemymarker[0] = arg2; __enemymarker[1] = arg3; __enemymarker[2] = arg4; for (__ien = 0; __ien < 3; __ien++) { if (global.monstertype[__ien] != 0(None)) { if (!i_ex(__enemymarker[__ien])) { __enemymarker[__ien] =
scr_dark_marker(global.monstermakex[__ien] + 300, global.monstermakey[__ien], object_get_sprite(global.monsterinstancetype[__ien]));
__enemymarker[__ien].depth = -__ien; } __enemymarker[__ien].__ien = __ien; with (__enemymarker[__ien]) { if (global.monstertype[other.__ien] == 103Tenna) { x = camerax() + 510; y = cameray() + 288;
scr_move_to_point_over_time(camerax() + 526, cameray() + 260, 20);
sprite_index = spr_tenna_point_up; } else if (global.monstertype[other.__ien] == 104Knight) { with (obj_ch3_PTB02_roaringknight) stopsiner2 = true;
scr_move_to_point_over_time(global.monstermakex[__ien], obj_ch3_PTB02_roaringknight.ystart + (cos(obj_ch3_PTB02_roaringknight.siner2 / 8) * 8), 20);
} else {
scr_move_to_point_over_time(global.monstermakex[__ien], global.monstermakey[__ien], 20);
} __doom = instance_create(x, y, obj_doom); __doom.target = id; __doom.alarm[0] = 25; } } } }
(encounterno, 0, ribbick);
115
        }
116
        if (timer == (1 + falltime + 10 + 20 + 60))
117
        {
118
            safe_delete(triggerer);
119
            timer = 0;
120
            trigger = 0;
121
        }
122
    }
123
}