Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gerson_green_switch_Step_0

(view raw script w/o annotations or w/e)
1
if (image_index > 4)
2
{
3
    if (timer < 1)
4
    {
5
        chev = instance_create(x - 15, y, obj_gerson_green_chevron);
6
        chev.image_blend = merge_color(c_lime, c_black, 0.2 * timer);
7
    }
8
    timer++;
9
}
10
if (image_index <= 3 && image_alpha == 1)
11
{
12
    y = lerp(y, cameray() + (cameraheight() / 2), 0.3);
13
    if (i_ex(_oflash))
14
        _oflash.y = y;
15
}
16
if (image_index > 6.5)
17
{
18
    with (obj_hammer_of_justice_enemy)
19
        image_alpha = 1;
20
    with (obj_sound_of_justice_enemy)
21
        image_alpha = 1;
22
    image_alpha = 0;
23
    image_speed = 0;
24
    timer2++;
25
    if (timer2 > 3)
26
        y = lerp(y, ystart, 0.4);
27
    if (i_ex(obj_hammer_of_justice_enemy))
28
        obj_hammer_of_justice_enemy.y = y;
29
    if (i_ex(obj_sound_of_justice_enemy))
30
        obj_sound_of_justice_enemy.y = y;
31
    if (timer2 == 10)
32
    {
33
        if (i_ex(obj_hammer_of_justice_enemy))
34
            obj_hammer_of_justice_enemy.y = obj_hammer_of_justice_enemy.ystart;
35
        if (i_ex(obj_sound_of_justice_enemy))
36
            obj_sound_of_justice_enemy.y = obj_sound_of_justice_enemy.ystart;
37
        instance_destroy();
38
    }
39
}
40
if (image_index > 3 && type == 1)
41
    image_index = 3;