Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_room_teevie_large_02_Create_0

(view raw script w/o annotations or w/e)
1
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
() && global.tempflag[90] == -1)
2
{
3
    with (obj_mainchara)
4
        setxy(900, 1080);
5
    with (obj_caterpillarchara)
6
    {
7
        if (name == "susie")
8
            setxy(798, 1080);
9
        if (name == "ralsei")
10
            setxy(706, 1080);
11
        
scr_caterpillar_interpolate
scr_caterpillar_interpolate

function
scr_caterpillar_interpolate()
{ _newfacing =
scr_facing_letter_to_number(
scr_get_cardinal_direction(point_direction(x, y, obj_mainchara.x, obj_mainchara.y)));
remx[0] = obj_mainchara.x; remy[0] = obj_mainchara.y; facing[0] = _newfacing; for (_iaia = target; _iaia > 0; _iaia -= 1) { remx[_iaia] = lerp(obj_mainchara.x, x, _iaia / target); if (global.darkzone == 1) remy[_iaia] = lerp(obj_mainchara.y, y + 16, _iaia / target); else remy[_iaia] = lerp(obj_mainchara.y, y + 6, _iaia / target); facing[_iaia] = _newfacing; } }
();
12
    }
13
}
14
con = (
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ var flag_value = global.flag[arg0]; return flag_value; }
(1235) == 0) ? 0 : -1;
15
customcon = 0;
16
camera_pan = false;
17
camera_pan_timer = 0;
18
camera_pan_back = false;
19
camera_x_pos = 0;
20
employees = [];
21
move_employees = false;
22
employees_state = "unhappy";
23
current_employees_state = employees_state;
24
joyful_index = 0;
25
var tv_screen_01 = instance_create(0, 0, obj_dw_teevie_tv_screens);
26
with (tv_screen_01)
27
{
28
    x = 410;
29
    y = 40;
30
    width = 3;
31
    height = 3;
32
    depth = 1000150;
33
    tvbasesprite = spr_dw_teevie_tv_base;
34
}
35
var tv_screen_02 = instance_create(0, 0, obj_dw_teevie_tv_screens);
36
with (tv_screen_02)
37
{
38
    x = 690;
39
    y = 40;
40
    width = 3;
41
    height = 3;
42
    depth = 1000150;
43
    tvbasesprite = spr_dw_teevie_tv_base;
44
}
45
var quiz_controller_01 = instance_create(0, 0, obj_dw_ch3_teevie_quiz_controller);
46
with (quiz_controller_01)
47
{
48
    depth = 1000000;
49
    init_quiz("A", 440, 440, 1131);
50
}
51
var quiz_controller_02 = instance_create(0, 0, obj_dw_ch3_teevie_quiz_controller);
52
with (quiz_controller_02)
53
{
54
    depth = 1000100;
55
    init_quiz("B", 440, 840, 1132);
56
}
57
58
create_employees = function()
59
{
60
    employees = [];
61
    var _offset = 40;
62
    for (var i = 0; i < 6; i++)
63
    {
64
        var x_offset = ((i % 2) == 1) ? 0 : 10;
65
        var y_offset = ((i % 2) == 1) ? 40 : 0;
66
        var _zapper = instance_create(1900 + (i * 70) + x_offset + _offset, 960 + (i * 10) + y_offset, obj_dw_teevie_employee);
67
        with (_zapper)
68
        {
69
            init("zapper");
70
            unhappy();
71
            
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
72
        }
73
        employees[array_length(employees)] = _zapper;
74
    }
75
    for (var i = 0; i < 6; i++)
76
    {
77
        if (joyful_index == 0)
78
            joyful_index = array_length(employees);
79
        var x_offset = ((i % 2) == 1) ? 0 : 10;
80
        var y_offset = ((i % 2) == 1) ? 40 : 0;
81
        var _shadow = instance_create(1840 + (i * 80) + x_offset + _offset, (1040 - (i * 10)) + y_offset, obj_dw_teevie_employee);
82
        with (_shadow)
83
        {
84
            init("shadowman");
85
            unhappy();
86
            
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
87
        }
88
        employees[array_length(employees)] = _shadow;
89
    }
90
    for (var i = 0; i < 6; i++)
91
    {
92
        var x_offset = ((i % 2) == 1) ? 0 : 10;
93
        var y_offset = ((i % 2) == 1) ? 40 : 0;
94
        var _pippins = instance_create(1840 + (i * 60) + x_offset + _offset, 1020 + y_offset + (i * 5), obj_dw_teevie_employee);
95
        with (_pippins)
96
        {
97
            init("pippins");
98
            unhappy();
99
            
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
100
        }
101
        employees[array_length(employees)] = _pippins;
102
    }
103
    var _shadow_marker = instance_create(2010, 1040, obj_dw_teevie_employee);
104
    with (_shadow_marker)
105
    {
106
        init("shadowman");
107
        unhappy();
108
        
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
109
    }
110
    employees[array_length(employees)] = _shadow_marker;
111
    _shadow_marker = instance_create(2080, 1050, obj_dw_teevie_employee);
112
    with (_shadow_marker)
113
    {
114
        init("shadowman");
115
        unhappy();
116
        
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
117
    }
118
    employees[array_length(employees)] = _shadow_marker;
119
};
120
121
clean_up = function()
122
{
123
    var i = array_length(employees) - 1;
124
    while (i >= 0)
125
    {
126
        with (employees[i])
127
            instance_destroy();
128
        i--;
129
    }
130
    employees = [];
131
};