Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gerson_teleport_Alarm_0

(view raw script w/o annotations or w/e)
1
if (global.turntimer < 1)
2
    instance_destroy();
3
instance_destroy();
4
if (type == 1)
5
{
6
    if (image_xscale < 0)
7
    {
8
        gers = instance_create(x - 70, y - 23, obj_gerson_box_hit);
9
        if (first == 1)
10
            gers.timer = 10;
11
    }
12
    else
13
    {
14
        gers = instance_create(x + 70, y - 23, obj_gerson_box_hit);
15
        gers.image_xscale = -2;
16
        if (first == 1)
17
            gers.timer = 10;
18
    }
19
}
20
if (type == 2)
21
{
22
    if (swingdowntype == -4)
23
    {
24
        gers = instance_create(x + lengthdir_x(110, image_angle + 40), y + lengthdir_y(110, image_angle + 40), obj_gerson_swing_down);
25
        gers.swingdowntype = -1;
26
        gers.image_angle = image_angle - 90;
27
        gers.direction = image_angle + 180;
28
        if (special != 0)
29
            gers.special = special;
30
        with (gers)
31
            event_user(0);
32
    }
33
    else if (swingdowntype == -3 || swingdowntype == -5)
34
    {
35
        gers = instance_create(x + lengthdir_x(110, image_angle + 40), y + lengthdir_y(110, image_angle + 40), obj_gerson_swing_down);
36
        gers.swingdowntype = swingdowntype;
37
        gers.image_angle = image_angle - 90;
38
        gers.direction = image_angle + 180;
39
        with (gers)
40
            event_user(0);
41
    }
42
    else if (swingdowntype >= 10)
43
    {
44
        gers = instance_create(x + lengthdir_x(110, image_angle + 40), y + lengthdir_y(110, image_angle + 40), obj_gerson_swing_down);
45
        gers.swingdowntype = swingdowntype;
46
        gers.image_angle = image_angle - 90;
47
        gers.direction = image_angle + 180;
48
        with (gers)
49
            event_user(0);
50
    }
51
    else
52
    {
53
        gers = instance_create(x - 62, y - 112, obj_gerson_swing_down);
54
        if (x < obj_growtangle.x)
55
        {
56
            gers.image_xscale = -2;
57
            gers.x += 124;
58
        }
59
        gers.swingdowntype = swingdowntype;
60
        with (gers)
61
            event_user(0);
62
    }
63
}
64
if (type == 3)
65
{
66
    if (image_xscale < 0)
67
    {
68
        gers = instance_create(x - 130, y - 60, obj_gerson_bell_hit);
69
        gers.timer = -15;
70
    }
71
    else
72
    {
73
        gers = instance_create(x + 130 + 42, y - 60, obj_gerson_bell_hit);
74
        gers.image_xscale = -2;
75
        gers.timer = 6;
76
    }
77
}
78
if (type == 4)
79
    gers = instance_create(x + 60, y - 40, obj_gerson_hits_box);
80
if (type == 5)
81
{
82
    gers = instance_create(x - 60, y - 40, obj_gerson_hits_box);
83
    gers.image_xscale = 2;
84
}
85
if (type == 6)
86
    instance_create(x, y - 34, obj_gerson_speen);
87
if (type == 10)
88
{
89
    with (obj_hammer_of_justice_enemy)
90
        visible = true;
91
}