Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_npc_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    init = 1;
4
    if (extflag == "elnina1")
5
    {
6
        sprite_index = spr_board_elnina_glasses_left;
7
        pose = 4216;
8
        mask_index = spr_board_spritemask_32x32_lowerhalf;
9
    }
10
    if (extflag == "lanino1")
11
    {
12
        sprite_index = spr_board_lanino_glasses_right;
13
        pose = 3807;
14
        mask_index = spr_board_spritemask_32x32_lowerhalf;
15
    }
16
    if (extflag == "intro" || extflag == "b3tenna" || extflag == "b3shopping" || extflag == "b3bestcity" || extflag == "b3goodboy" || extflag == "b2intro" || extflag == "b3entertainment")
17
    {
18
        sprite_index = spr_board_npc_tenna;
19
        image_speed = 0.05;
20
        pose = 4355;
21
        mask_index = spr_board_spritemask_32x32_lowerhalf;
22
    }
23
    if (extflag == "b2bombfun2")
24
    {
25
        sprite_index = spr_board_mossblock;
26
        animate = false;
27
        image_index = 0;
28
        image_speed = 0;
29
        mask_index = sprite_index;
30
    }
31
    if (extflag == "bibliox")
32
    {
33
        sprite_index = spr_dw_ch3_board_npc_bibliox;
34
        image_speed = 0.05;
35
        read = global.flag[1141 ch3_bibliox_talk];
36
    }
37
    if (extflag == "cupboard")
38
        sprite_index = spr_board_cupboard;
39
    if (room == room_board_postshadowmantle)
40
        visible = false;
41
    if (sprite_index == spr_board_npc_pippins)
42
        pose = 3861;
43
    if (room == room_dw_b3bs_idcardpuzzle)
44
    {
45
        sprite_index = spr_board_watersign;
46
        animate = false;
47
    }
48
    idle = sprite_index;
49
    if (pose == -1)
50
        pose = idle;
51
}
52
if (active)
53
{
54
    if (updateDepth)
55
        
scr_depth_board
scr_depth_board

function
scr_depth_board()
{ depth = 1000000 - ((y * 10) + ((sprite_height - sprite_yoffset) * 10)); } function scr_board_depth() {
scr_depth_board();
}
();
56
    if (kr == 0)
57
    {
58
        with (obj_mainchara_board)
59
        {
60
            if (name == "kris")
61
                other.kr = id;
62
        }
63
    }
64
    if (su == 0)
65
    {
66
        with (obj_mainchara_board)
67
        {
68
            if (name == "susie")
69
                other.su = id;
70
        }
71
    }
72
    if (ra == 0)
73
    {
74
        with (obj_mainchara_board)
75
        {
76
            if (name == "ralsei")
77
                other.ra = id;
78
        }
79
    }
80
    buffer--;
81
    if (myinteract == 3 && !i_ex(obj_board_writer))
82
    {
83
        myinteract = 0;
84
        buffer = 3;
85
        global.interact = 0;
86
    }
87
    hitbuffer--;
88
    if (place_meeting(x, y, obj_board_swordhitbox) && hitbuffer <= 0 && room != room_board_postshadowmantle)
89
    {
90
        var sword = instance_place(x, y, obj_board_swordhitbox);
91
        if (sword.swordlv >= defense)
92
        {
93
            hitbuffer = 5;
94
            myhealth--;
95
            if (myhealth <= 0)
96
            {
97
                instance_create(centerx(), centery(), obj_board_enemydefeatsplash);
98
                instance_destroy();
99
            }
100
        }
101
    }
102
}
103
if (global.chapter == 3)
104
{
105
    if (room == room_board_2)
106
    {
107
        if (extflag == "b2photohint1")
108
        {
109
            if (global.flag[1041 got_half_flower] == 1)
110
                instance_destroy();
111
        }
112
        if (extflag == "b2photohint2")
113
        {
114
            if (global.flag[1042 got_spring_photo] == 1)
115
                instance_destroy();
116
        }
117
        if (extflag == "b2photohint3")
118
        {
119
            if (global.flag[1043 got_cactus_photo] == 1)
120
                instance_destroy();
121
        }
122
        if (extflag == "b2photohint4")
123
        {
124
            if (global.flag[1227 got_antlion_photo] == 1)
125
                instance_destroy();
126
        }
127
    }
128
}