Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_mike_controller_Create_0

(view raw script w/o annotations or w/e)
1
if (!variable_global_exists("mic_sensitivity"))
2
    global.mic_sensitivity = global.flag[1701];
3
__usable = true;
4
audio_record = -4;
5
instance_create_depth(0, 0, depth - 6, obj_mike_hand);
6
battle_active = false;
7
8
reset_control = function()
9
{
10
    battle_test = false;
11
    show_controls = true;
12
    type = 5;
13
    last_type = type;
14
    reload = 0;
15
    phase = 0;
16
    vis = true;
17
    wingbox_volume_thereshold = 1;
18
    line_width = 140;
19
    line_height = 0;
20
    line_xpos = 0;
21
    line_ypos = -32;
22
    line_side = choose(1, -1);
23
    for (i = 0; i < 36; i++)
24
        line_y[i] = line_ypos + (cameray() + (cameraheight() / 2));
25
    circle_width = 120;
26
    circle_height = round(circle_width * 0.75);
27
    circle_offset = -32;
28
    grazenoise = 0;
29
    swatnoise = 0;
30
    sign_xstart = camerax() + (camerawidth() / 2);
31
    sign_ystart = cameray() - 100;
32
    sign_x = sign_xstart;
33
    sign_y = sign_ystart;
34
    sign_col = 8421504;
35
    sign_index = 0;
36
    sign_action = 0;
37
    sign_vspeed = 0;
38
    sign_bounce = 0;
39
    sign_sound = 0;
40
    sign_x2 = sign_xstart;
41
    sign_y2 = sign_ystart;
42
    sign_col2 = 8421504;
43
    sign_action2 = 0;
44
    var i = 0;
45
    hand_sprite[i++] = spr_mike_hand;
46
    hand_sprite[i++] = spr_mike_grab1;
47
    hand_sprite[i++] = spr_mike_grab2;
48
    hand_sprite[i++] = spr_mike_give1;
49
    hand_sprite[i++] = spr_mike_give2;
50
    hand_sprite[i++] = spr_mike_ouch;
51
    hand_sprite[i++] = spr_mike_grab3;
52
    hand_xscale = 1;
53
    hand_speed = 0;
54
    hand_type = 0;
55
    hand_shake = 0;
56
    hand_act = 0;
57
    hand_target = -1;
58
    msx = 0;
59
    msy = 0;
60
    hand_fruit = -1;
61
    fruit_scale = 0;
62
    fruit_scale2 = 0;
63
    fruit_scale3 = 0;
64
    if (instance_number(obj_mainchara) == 1)
65
    {
66
        x = obj_mainchara.x;
67
        y = obj_mainchara.y;
68
    }
69
    mx = x;
70
    my = y;
71
    hand_anim = 10;
72
    hand_distance = 140;
73
    hand_angle = 0;
74
    hand_yscale = 1;
75
    hand_yscale2 = 1;
76
    hand_wait = 0;
77
    wait = 0;
78
};
79
80
reset_control();
81
battlewriter = 19212912;
82
myface = 1913918291;
83
tp = 0;
84
tpy = 50;
85
bp = 0;
86
bpy = 152;
87
intro = 1;
88
bcolor = merge_color(c_purple, c_black, 0.7);
89
bcolor = merge_color(bcolor, c_dkgray, 0.5);
90
for (i = 0; i < 3; i += 1)
91
{
92
    global.acting[i] = 0;
93
    global.actingsingle[i] = 0;
94
    global.actingsimul[i] = 0;
95
    global.actingtarget[i] = 0;
96
    global.actingchoice[i] = 0;
97
    global.charaction[i] = 0;
98
    global.charspecial[i] = 0;
99
    global.chartarget[i] = 0;
100
    global.faceaction[i] = 0;
101
    global.rembmenuno[i] = 0;
102
    global.targeted[i] = 0;
103
    global.battleat[i] = global.at[global.char[i]] + global.itemat[global.char[i]][0] + global.itemat[global.char[i]][1] + global.itemat[global.char[i]][2];
104
    global.battledf[i] = global.df[global.char[i]] + global.itemdf[global.char[i]][0] + global.itemdf[global.char[i]][1] + global.itemdf[global.char[i]][2];
105
    global.battlemag[i] = global.mag[global.char[i]] + global.itemmag[global.char[i]][0] + global.itemmag[global.char[i]][1] + global.itemmag[global.char[i]][2];
106
    global.battleactcount[i] = 0;
107
    global.monsterattackname[i] = " ";
108
    for (j = 0; j < 18; j++)
109
    {
110
        global.battlespell[i][j] = 0;
111
        global.battlespellname[i][j] = " ";
112
        global.battlespelldesc[i][j] = " ";
113
        global.battlespellcost[i][j] = 0;
114
        global.battlespelltarget[i][j] = 2;
115
        global.battlespellspecial[i][j] = 0;
116
    }
117
}
118
mmy[0] = 0;
119
mmy[1] = 0;
120
mmy[2] = 0;
121
mmy[3] = 0;
122
slmxx = 0;
123
slmyy = 0;
124
s_siner = 0;
125
t_siner = 0;
126
reset = 0;
127
timeron = 1;
128
noreturn = 0;
129
hpcolor[0] = c_aqua;
130
hpcolor[1] = c_fuchsia;
131
hpcolor[2] = c_lime;
132
hpcolor[3] = c_yellow;
133
xx = camerax();
134
yy = cameray();
135
newx = camerax() + (camerawidth() / 2);
136
newy = cameray() + (cameraheight() / 2) + line_ypos;
137
dir = 270;
138
new_dir = 270;
139
phase = 0;
140
circle_distance = 100;
141
for (i = 0; i < 36; i++)
142
{
143
    circle_xx[i] = camerax() + (camerawidth() / 2) + lengthdir_x(circle_distance, (i / 36) * 360);
144
    circle_yy[i] = (cameray() + (cameraheight() / 2) + lengthdir_y(circle_distance * 0.75, (i / 36) * 360)) - 32;
145
    circle_speed[i] = 0;
146
}
147
size1 = 0;
148
size2 = 31;
149
size3 = 10;
150
wing_angle1 = 180;
151
wing_angle2 = 180;
152
wing_angle3 = 0;
153
microphone_volume = 0;
154
microphone_volume2 = 0;
155
us_old = -1;
156
mic_buff = 0;
157
event_user(9);
158
var recordercount = audio_get_recorder_count();
159
debug_print("audio recorder count=" + string(recordercount));
160
if (recordercount <= 0)
161
{
162
    if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
163
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("No Microphone!");
164
}
165
if (!variable_global_exists("right_click_mic"))
166
    global.right_click_mic = 0;
167
if (!variable_global_exists("use_mic"))
168
    global.use_mic = !(global.is_console || onSteamDeck());
169
if (global.use_mic && room != room_dw_castle_tv_zone_3)
170
{
171
    if (!variable_global_exists("microphone"))
172
        global.microphone = 0;
173
    audio_record = audio_start_recording(global.microphone);
174
    audio_buffer = buffer_create(9600, buffer_fixed, 2);
175
}
176
if (!variable_global_exists("microphone"))
177
    global.microphone = 0;
178
if (global.microphone > audio_get_recorder_count())
179
    global.microphone = 0;
180
x_target = 0;
181
y_target = 0;
182
speedx = 0;
183
speedy = 0;
184
prevx = x;
185
prevy = y;