Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_npc_nosolid_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    init = 1;
4
    if (extflag == "elnina1")
5
        sprite_index = spr_board_elnina;
6
    if (extflag == "lanino1")
7
        sprite_index = spr_board_lanino;
8
    if (extflag == "intro")
9
    {
10
        sprite_index = spr_board_npc_tenna;
11
        image_speed = 0.05;
12
    }
13
    if (extflag == "1Q")
14
    {
15
    }
16
    if (room == room_board_postshadowmantle)
17
        visible = false;
18
}
19
if (updateDepth)
20
    
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();
}
();
21
if (kr == 0)
22
{
23
    with (obj_mainchara_board)
24
    {
25
        if (name == "kris")
26
            other.kr = id;
27
    }
28
}
29
if (su == 0)
30
{
31
    with (obj_mainchara_board)
32
    {
33
        if (name == "susie")
34
            other.su = id;
35
    }
36
}
37
if (ra == 0)
38
{
39
    with (obj_mainchara_board)
40
    {
41
        if (name == "ralsei")
42
            other.ra = id;
43
    }
44
}
45
if (active)
46
{
47
    buffer--;
48
    if (myinteract == 3 && !i_ex(obj_board_writer))
49
    {
50
        myinteract = 0;
51
        buffer = 3;
52
        global.interact = 0;
53
    }
54
    hitbuffer--;
55
    if (place_meeting(x, y, obj_board_swordhitbox) && hitbuffer <= 0)
56
    {
57
        var sword = instance_place(x, y, obj_board_swordhitbox);
58
        if (sword.swordlv >= defense)
59
        {
60
            hitbuffer = 5;
61
            myhealth--;
62
            if (myhealth <= 0)
63
            {
64
                instance_create(centerx(), centery(), obj_board_enemydefeatsplash);
65
                global.flag[1255 sword_route_kills]++;
66
                instance_destroy();
67
            }
68
        }
69
    }
70
}
71
if (global.chapter == 3)
72
{
73
    if (room == room_board_2)
74
    {
75
        if (extflag == "b2photohint2")
76
        {
77
            if (global.flag[1041 got_half_flower] == 1)
78
                instance_destroy();
79
        }
80
        if (extflag == "b2photohint3")
81
        {
82
            if (global.flag[1042 got_spring_photo] == 1)
83
                instance_destroy();
84
        }
85
    }
86
}