Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_npc_king_Step_0

(view raw script w/o annotations or w/e)
1
if (myinteract == 3)
2
{
3
    if (i_ex(mydialoguer) == false)
4
    {
5
        global.interact = 0;
6
        myinteract = 0;
7
        with (obj_mainchara)
8
            onebuffer = 5;
9
        with (obj_caterpillarchara)
10
            fun = 0;
11
    }
12
}
13
if (global.flag[20 other_text_command] == 0)
14
    sprite_index = spr_king_sulk;
15
if (global.flag[20 other_text_command] == 1)
16
    sprite_index = spr_king_sulk_left;
17
if (global.flag[20 other_text_command] == 2)
18
    sprite_index = spr_king_sulk_right;
19
if (global.flag[20 other_text_command] == 3)
20
{
21
    sprite_index = spr_king_sulk_drink;
22
    image_speed = 0.2;
23
}
24
if (global.flag[20 other_text_command] == 4)
25
{
26
    if (!shake_con)
27
    {
28
        shake_con = true;
29
        
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
();
30
    }
31
    sprite_index = spr_npc_king_sulk_turn;
32
}
33
if (global.flag[20 other_text_command] == 5)
34
{
35
    if (!shake_con)
36
    {
37
        shake_con = true;
38
        
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
();
39
    }
40
    sprite_index = spr_king_sulk_drink_left;
41
    image_speed = 0.2;
42
}
43
if (!d_ex() && global.flag[20 other_text_command] > 0)
44
{
45
    global.flag[20 other_text_command] = 0;
46
    shake_con = false;
47
}
48
if (global.flag[20 other_text_command] == 3)
49
{
50
    if (x < 1380)
51
    {
52
        if (hspeed < 3)
53
            hspeed = 3;
54
        hspeed += 1;
55
        if (y >= (ystart - 60))
56
            y -= 4;
57
    }
58
    else
59
    {
60
        hspeed = 0;
61
    }
62
}
63
else if (x > xstart)
64
{
65
    if (y <= ystart)
66
        y += 4;
67
    hspeed -= 1;
68
}
69
else
70
{
71
    hspeed = 0;
72
}