Deltarune script viewer

← back to main script listing

gml_Object_obj_controller_mansion_traffic_Step_0

(view raw script w/o annotations or w/e)
1
if (obj_mainchara.x >= 1246 && (!i_ex(carGen)) && victory == false)
2
{
3
    carGen = instance_create(1241, 120, obj_traffic_car_generator)
4
    carGen.image_xscale = 2
5
    carGen.image_yscale = 2
6
    carGen.group = 0
7
    carGen.gen_rate = 5
8
    carGen.timer = -5
9
    carGen.gen_speed = 12
10
    carGen.car_sprite = spr_traffic_car
11
    carGen.skipEvery = 0
12
    carGen.walking = 0
13
    carGen.speedadjust = 1
14
    carGen.alwayswalking = 1
15
    carGen.prepopulate = 0
16
}
17
if (obj_mainchara.x < 1246 && i_ex(carGen))
18
{
19
    with (carGen)
20
        instance_destroy()
21
}
22
if (victory == true)
23
{
24
    if instance_exists(obj_traffic_car)
25
    {
26
        with (obj_traffic_car)
27
        {
28
            animsiner = 0
29
            if place_meeting(x, y, obj_mouse_traffic)
30
            {
31
                other.hitcount++
32
                run = instance_create((x - 6 - 5), (y - 24 + 92), obj_traffic_car_run)
33
                if ((other.hitcount % 2) == 0)
34
                    run.dir = 1
35
                instance_destroy()
36
            }
37
        }
38
    }
39
    if (con == 0)
40
    {
41
        global.flag[370 solved_mansion_traffic] = 1
42
        global.interact = 1
43
        with (obj_traffic_car)
44
        {
45
            if (y <= obj_mainchara.y && x > 1160)
46
                active = 0
47
            else
48
                vspeed = 8
49
            if (x < (camerax() - 100) || x > (camerax() + 100 + 640) || y < (cameray() - 100) || y > (cameray() + 100 + 480))
50
                instance_destroy()
51
        }
52
        with (obj_traffic_car_generator)
53
            instance_destroy()
54
        timer = 0
55
        con++
56
    }
57
    if (con == 1)
58
    {
59
        timer++
60
        if (timer == 1)
61
        {
62
            hole = scr_dark_marker
scr_dark_marker

function scr_dark_marker(argument0, argument1, argument2) //gml_Script_scr_dark_marker { thismarker = instance_create(argument0, argument1, obj_marker) with (thismarker) { sprite_index = argument2 image_speed = 0 image_xscale = 2 image_yscale = 2 } return thismarker; }
(1400, 1360, spr_mouseHole)
63
            with (hole)
64
                scr_depth
scr_depth

function scr_depth() //gml_Script_scr_depth { depth = 100000 - (y * 10 + sprite_height * 10) }
()
65
            hole.image_index = 5
66
            hole.image_speed = 0
67
        }
68
        if (timer == 2)
69
            hole.image_index = 4
70
        if (timer == 3)
71
            hole.image_index = 3
72
        if (timer == 4)
73
            hole.image_index = 2
74
        if (timer == 5)
75
            hole.image_index = 1
76
        if (timer == 6)
77
            hole.image_index = 0
78
        if (timer == 15)
79
        {
80
            mousetail = scr_dark_marker
scr_dark_marker

function scr_dark_marker(argument0, argument1, argument2) //gml_Script_scr_dark_marker { thismarker = instance_create(argument0, argument1, obj_marker) with (thismarker) { sprite_index = argument2 image_speed = 0 image_xscale = 2 image_yscale = 2 } return thismarker; }
(1420, 1380, spr_holemouse_tail)
81
            mousetail.image_angle = -90
82
            mousetail.image_speed = 0
83
            with (mousetail)
84
                scr_depth
scr_depth

function scr_depth() //gml_Script_scr_depth { depth = 100000 - (y * 10 + sprite_height * 10) }
()
85
            mouse1 = scr_dark_marker
scr_dark_marker

function scr_dark_marker(argument0, argument1, argument2) //gml_Script_scr_dark_marker { thismarker = instance_create(argument0, argument1, obj_marker) with (thismarker) { sprite_index = argument2 image_speed = 0 image_xscale = 2 image_yscale = 2 } return thismarker; }
(1418, 1380, spr_holemouse_emerge)
86
            with (mouse1)
87
                scr_depth
scr_depth

function scr_depth() //gml_Script_scr_depth { depth = 100000 - (y * 10 + sprite_height * 10) }
()
88
            snd_play(snd_mouse)
89
        }
90
        if (timer == 30)
91
            instance_create(1420, 1390, obj_mouse_traffic)
92
        if (timer == 35 || timer == 40 || timer == 45 || timer == 50)
93
        {
94
            instance_create(1420, 1390, obj_mouse_traffic)
95
            snd_play(snd_mouse)
96
        }
97
        if (timer == 30)
98
        {
99
            with (mouse1)
100
                instance_destroy()
101
            with (mousetail)
102
                instance_destroy()
103
        }
104
        if (timer == 50)
105
            hole.image_index++
106
        if (timer == 51)
107
            hole.image_index++
108
        if (timer == 52)
109
            hole.image_index++
110
        if (timer == 53)
111
            hole.image_index++
112
        if (timer == 54)
113
            hole.image_index++
114
        if (timer == 55)
115
        {
116
            with (hole)
117
                instance_destroy()
118
        }
119
        if (timer > 50 && (!instance_exists(obj_mouse_traffic)))
120
            con++
121
    }
122
    if (con == 2)
123
    {
124
        if instance_exists(obj_traffic_road_trigger)
125
        {
126
            with (obj_traffic_road_trigger)
127
            {
128
                x = room_width * 2
129
                y = room_height * 2
130
            }
131
        }
132
        global.interact = 0
133
        global.facing = 0
134
        con++
135
    }
136
}
137
if scr_debug
scr_debug

function scr_debug() //gml_Script_scr_debug { if (global.debug == 1) return 1; }
()
138
{
139
    if keyboard_check_pressed(vk_space)
140
    {
141
        obj_mainchara.x = 1143
142
        obj_mainchara.y = 360
143
    }
144
}