Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_ponman_appear_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    if (obj_mainchara.x >= (x - 60) && obj_mainchara.x <= (x + 60))
4
    {
5
        con = 1;
6
        image_speed = 0.334;
7
        alarm[4]
 = 15;
gml_Object_obj_ponman_appear_Alarm_4.gml

con += 1;
8
    }
9
}
10
if (con == 2)
11
{
12
    image_index = 5;
13
    image_speed = 0;
14
    con = 3;
15
    alarm[4]
 = 15;
gml_Object_obj_ponman_appear_Alarm_4.gml

con += 1;
16
}
17
if (con == 4)
18
{
19
    eye_factor = 0;
20
    draw_eye = 1;
21
    maxy = y + 100;
22
    sprite_index = spr_ponman_jump;
23
    vspeed = -8;
24
    gravity = 1.5;
25
    con = 5;
26
}
27
if (con == 5)
28
{
29
    if (eye_factor < 5)
30
        eye_factor += 1;
31
    eye_angle = 270;
32
    eye_radius = ((vspeed * eye_factor) / 5) * 0.7;
33
    if (y >= maxy)
34
    {
35
        sprite_index = spr_ponman_idle;
36
        vspeed = 0;
37
        gravity = 0;
38
        con = 6;
39
        alarm[4]
 = 5;
gml_Object_obj_ponman_appear_Alarm_4.gml

con += 1;
40
        remspeed = 0;
41
        stopped = 0;
42
    }
43
}
44
if (con == 6)
45
    eye_radius *= 0.5;
46
if (con == 7)
47
{
48
    if (global.interact == 0)
49
    {
50
        if (stopped == 1)
51
        {
52
            speed = remspeed;
53
            stopped = 0;
54
        }
55
        
scr_depth
scr_depth

function
scr_depth()
{ depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
56
        if (eye_radius < 8)
57
            eye_radius += 2;
58
        eye_angle = point_direction(x + 32, y + 28, obj_mainchara.x + 20, obj_mainchara.y + 20);
59
        image_speed = 0.25;
60
        direction = eye_angle;
61
        maxspeed = 13;
62
        if (global.flag[502 times_ponman_fought] == 1)
63
            maxspeed = 11;
64
        if (global.flag[502 times_ponman_fought] >= 2)
65
            maxspeed = 9;
66
        if (room == room_field_checkers5)
67
            maxspeed = 9;
68
        if (speed < maxspeed)
69
            speed += 2;
70
        if (collision_rectangle(bbox_left, bbox_top, bbox_right, bbox_bottom, obj_mainchara, false, true))
71
        {
72
            myencounter = 13;
73
            if (global.flag[502 times_ponman_fought] == 1)
74
                myencounter = 14;
75
            if (global.flag[502 times_ponman_fought] >= 2)
76
                myencounter = choose(13, 14);
77
            if (room == room_field_checkers5)
78
                myencounter = 14;
79
            global.flag[502 times_ponman_fought] += 1;
80
            newme = instance_create(x, y, obj_testoverworldenemy);
81
            newme.sprite_index = spr_ponman_touched;
82
            newme.touchsprite = spr_ponman_touched;
83
            newme.slidesprite = spr_ponman_touched;
84
            newme.image_index = 5;
85
            newme.image_speed = 0;
86
            with (newme)
87
            {
88
                event_user(0);
89
                
scr_depth
scr_depth

function
scr_depth()
{ depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
90
            }
91
            global.encounterno = myencounter;
92
            with (obj_ponman_appear)
93
                fadecon = 1;
94
            instance_destroy();
95
        }
96
    }
97
    if (global.interact != 0)
98
    {
99
        stopped = 1;
100
        remspeed = speed;
101
        speed = 0;
102
        image_speed = 0;
103
    }
104
}
105
if (fadecon == 1)
106
{
107
    if (instance_exists(obj_battlecontroller))
108
        instance_destroy();
109
}
110
eyex = lengthdir_x(eye_radius, eye_angle);
111
eyey = lengthdir_y(eye_radius, eye_angle);