Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_bullettester_Step_0

(view raw script w/o annotations or w/e)
1
if (global.mnfight != 2)
2
{
3
    global.hp[0] = 999;
4
    if (button1_p())
5
    {
6
        go = 1;
7
        global.myfight = -1;
8
        global.bmenuno = 0;
9
    }
10
    if (go)
11
        timer++;
12
    if (timer >= 1)
13
    {
14
        global.mnfight = 2;
15
        global.myfight = -1;
16
        if (!instance_exists(obj_growtangle))
17
            instance_create(__view_get(e__VW.XView, 0) + 320, __view_get(e__VW.YView, 0) + 170, obj_growtangle);
18
        if (!instance_exists(obj_heart))
19
            
scr_moveheart
scr_moveheart

function
scr_moveheart()
{ global.inv = 0; if (global.chapter == 4 && (i_ex(obj_hammer_of_justice_enemy) || i_ex(obj_sound_of_justice_enemy))) return instance_create(obj_herosusie.x - 250, obj_herosusie.y + 40, obj_moveheart); else return instance_create(obj_herokris.x + 10, obj_herokris.y + 40, obj_moveheart); }
();
20
        for (i = 1; i < 5; i++)
21
            global.hp[i] = global.maxhp[i];
22
        timer = 0;
23
        go = 0;
24
    }
25
}
26
if (global.turntimer >= 2)
27
    global.myfight = -1;
28
if (keyboard_check_pressed(vk_tab))
29
{
30
    if (window_get_width() == 1280)
31
        window_set_size(640, 480);
32
    else
33
        window_set_size(1280, 960);
34
}
35
if (keyboard_check_pressed(ord("1")))
36
{
37
    if (global.monster[0] == 0)
38
        global.monster[0] = 1;
39
    else if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() > 1)
40
        global.monster[0] = 0;
41
}
42
if (keyboard_check_pressed(ord("2")))
43
{
44
    if (global.monster[1] == 0)
45
        global.monster[1] = 1;
46
    else if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() > 1)
47
        global.monster[1] = 0;
48
}
49
if (keyboard_check_pressed(ord("3")))
50
{
51
    if (global.monster[2] == 0)
52
        global.monster[2] = 1;
53
    else if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() > 1)
54
        global.monster[2] = 0;
55
}
56
change = 1;
57
if (keyboard_check_direct(vk_shift))
58
    change = 10;
59
if (keyboard_check_pressed(219))
60
    global.monsterinstance[0].spawntype -= change;
61
if (keyboard_check_pressed(221))
62
    global.monsterinstance[0].spawntype += change;
63
if (keyboard_check_pressed(186))
64
    global.monsterinstance[1].spawntype -= change;
65
if (keyboard_check_pressed(222))
66
    global.monsterinstance[1].spawntype += change;
67
if (keyboard_check_pressed(190))
68
    global.monsterinstance[2].spawntype -= change;
69
if (keyboard_check_pressed(191))
70
    global.monsterinstance[2].spawntype += change;
71
if (keyboard_check_pressed(ord("4")))
72
{
73
    if (neverendingturn == 0)
74
    {
75
        neverendingturn = 1;
76
        global.turntimer = 99999;
77
    }
78
    else
79
    {
80
        neverendingturn = 0;
81
        global.turntimer = 240;
82
    }
83
}
84
if (keyboard_check_pressed(vk_space) || keyboard_check_pressed(ord("R")))
85
{
86
    snd_free_all();
87
    room_restart();
88
}
89
if (keyboard_check_pressed(ord("I")))
90
    global.tempflag[27]++;
91
if (keyboard_check_pressed(ord("U")) && global.tempflag[27] > 0)
92
    global.tempflag[27]--;
93
if (keyboard_check(vk_shift) && keyboard_check_pressed(ord("1")))
94
{
95
    var newvalue = get_string("Enter Attack #1 number | current=" + string(string(global.monsterinstance[0].spawntype)), "");
96
    global.monsterinstance[0].spawntype = real(newvalue);
97
}
98
if (keyboard_check(vk_shift) && keyboard_check_pressed(ord("2")))
99
{
100
    var newvalue = get_string("Enter Attack #2 number | current=" + string(string(global.monsterinstance[1].spawntype)), "");
101
    global.monsterinstance[1].spawntype = real(newvalue);
102
}
103
if (keyboard_check(vk_shift) && keyboard_check_pressed(ord("3")))
104
{
105
    var newvalue = get_string("Enter Attack #3 number | current=" + string(string(global.monsterinstance[2].spawntype)), "");
106
    global.monsterinstance[2].spawntype = real(newvalue);
107
}
108
if (keyboard_check(vk_shift) && keyboard_check(vk_control) && keyboard_check_pressed(ord("I")))
109
{
110
    var inst = get_string("enter instance name", "");
111
    var _xx = get_string("enter X position", string(camerax() + 320));
112
    var _yy = get_string("enter Y position", string(cameray() + 240));
113
    var __depth = get_string("enter depth", 0);
114
    if (inst != -1)
115
        instance_create_depth(real(_xx), real(_yy), real(__depth), asset_get_index(inst));
116
}
117
if (keyboard_check_pressed(vk_numpad3))
118
{
119
    if (room_speed == 30)
120
        room_speed = 5;
121
    else
122
        room_speed = 30;
123
}
124
if (keyboard_check_pressed(vk_backspace))
125
    drawdebug = 1 - drawdebug;
126
if (keyboard_check_pressed(ord("B")))
127
    room_goto(room_bullettest_new);
128
global.tempflag[20] = global.monster[0];
129
global.tempflag[21] = global.monster[1];
130
global.tempflag[22] = global.monster[2];
131
global.tempflag[23] = global.monsterinstance[0].spawntype;
132
global.tempflag[24] = global.monsterinstance[1].spawntype;
133
global.tempflag[25] = global.monsterinstance[2].spawntype;
134
135
enum e__VW
136
{
137
    XView,
138
    YView,
139
    WView,
140
    HView,
141
    Angle,
142
    HBorder,
143
    VBorder,
144
    HSpeed,
145
    VSpeed,
146
    Object,
147
    Visible,
148
    XPort,
149
    YPort,
150
    WPort,
151
    HPort,
152
    Camera,
153
    SurfaceID
154
}