Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_ch2_noellepuzzle_key_noelle_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    if (ord(myString) <= 57)
4
        textImage = ord(myString) - 22;
5
    else
6
        textImage = ord(string_upper(myString)) - 65;
7
    init = 1;
8
}
9
var checkPress = 0;
10
if (i_ex(obj_actor) && !pressed && pressable && global.interact == 0)
11
{
12
    if (place_meeting(x, y, obj_actor))
13
        checkPress = 1;
14
}
15
if (checkPress)
16
{
17
    if (pressed == 0)
18
    {
19
        pressedBuffer = 2;
20
        pressed = 1;
21
        with (obj_ch2_noellepuzzle_screen)
22
            image_timer = 7;
23
        var _snd = snd_play(asset_get_index("snd_speak_and_spell_" + myString));
24
        var _volume = (buttonIndex == 7) ? 1 : max(1 - (buttonIndex / 4), 0);
25
        audio_sound_gain(_snd, _volume, 0);
26
        alarm[0]
 = 15;
gml_Object_obj_ch2_noellepuzzle_key_noelle_Alarm_0.gml

if (i_ex(obj_ch2_noellepuzzle_forcefield)) { with (obj_ch2_noellepuzzle_forcefield) { if (forcefield_id == other.forcefield_id) { snd_play(snd_spearappear); fadeout = true; } } }
27
        controller.finalString += myString;
28
        controller.buttonx = x;
29
        down = true;
30
        if (i_ex(obj_ch2_noellepuzzle_screen))
31
        {
32
            with (obj_ch2_noellepuzzle_screen)
33
            {
34
                if (forcefield_id == other.forcefield_id && myString != other.myString)
35
                {
36
                    snd_play(snd_wing);
37
                    myString = other.myString;
38
                }
39
            }
40
        }
41
    }
42
}
43
else if (pressable && global.interact == 0)
44
{
45
    if (pressedBuffer <= 0)
46
        pressed = 0;
47
}