Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_playercamera_Other_10

(view raw script w/o annotations or w/e)
1
createphoto = false;
2
var photopoints = 10;
3
var _list = ds_list_create();
4
var _num = collision_rectangle_list(x + 4, y + 4, (x + (camwidth * 32)) - 4, (y + (camheight * 32)) - 4, obj_board_photoparent, false, true, _list, false);
5
if (_num > 0)
6
{
7
    for (var i = 0; i < _num; i++)
8
    {
9
        with (ds_list_find_value(_list, i))
10
            event_user(3);
11
        photoarray[i] = ds_list_find_value(_list, i);
12
    }
13
}
14
ds_list_destroy(_list);
15
var _list2 = ds_list_create();
16
_num = collision_rectangle_list(x + 4, y + 4, (x + (camwidth * 32)) - 4, (y + (camheight * 32)) - 4, obj_board_parent, false, true, _list, false);
17
if (_num > 0)
18
{
19
    for (var i = 0; i < _num; i++)
20
    {
21
        with (ds_list_find_value(_list2, i))
22
        {
23
            if (object_index == obj_mainchara_board)
24
            {
25
                var dontpose = false;
26
                var nosusiepose = true;
27
                if (name == "susie")
28
                {
29
                    if (i_ex(obj_board_grabobject))
30
                        dontpose = true;
31
                    with (obj_b2camera)
32
                    {
33
                        if (active)
34
                            nosusiepose = false;
35
                    }
36
                    with (obj_b2bossencounterroom)
37
                    {
38
                        if (active)
39
                            nosusiepose = false;
40
                    }
41
                }
42
                if (name != "kris" && !dontpose)
43
                {
44
                    var dopose = true;
45
                    if (name == "susie" && nosusiepose == true)
46
                        dopose = false;
47
                    if (dopose)
48
                    {
49
                        fun = 1;
50
                        facing = 0;
51
                        sprite_index = dsprite_item;
52
                    }
53
                }
54
                else if (i_ex(obj_b2camera))
55
                {
56
                    if (obj_b2camera.active == true && obj_b2camera.prebat == 0)
57
                    {
58
                        if (obj_b2camera.krisphoto == 0)
59
                            obj_b2camera.krisphoto = 1;
60
                    }
61
                }
62
            }
63
            if (object_index == obj_board_marker)
64
            {
65
                if (sprite_index == spr_board_rouxls)
66
                {
67
                    if (extflag == "photoless")
68
                    {
69
                        extflag = "photod";
70
                        var pointsDisplay = instance_create(centerx(), centery(), obj_board_pointsGetDisplay);
71
                        pointsDisplay.amount = -1;
72
                        if (global.flag[1044 points] == 0)
73
                            pointsDisplay.onlyvisual = true;
74
                    }
75
                }
76
            }
77
            if (object_index == obj_board_antlion)
78
            {
79
                if (con == 1)
80
                {
81
                    if (special)
82
                    {
83
                        with (object_index)
84
                            nospecialsanymore = true;
85
                        con = 99;
86
                        timer = 0;
87
                        other.createphoto = true;
88
                        other.flagtoset = 1227;
89
                        var memspeed = speed;
90
                        speed = 0;
91
                    }
92
                    else if (!photod)
93
                    {
94
                        var pointsDisplay = instance_create(centerx(), centery(), obj_board_pointsGetDisplay);
95
                        pointsDisplay.amount = photopoints;
96
                        photod = true;
97
                    }
98
                }
99
            }
100
            if (object_index == obj_chaseenemy_board)
101
            {
102
                var freezetime = 90;
103
                freeze = freezetime;
104
                speed = 0;
105
                remspeed = myspeed;
106
                
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
(id, 20, 2);
107
            }
108
            if (object_index == obj_board_sadfriendo || object_index == obj_board_overlookfriendo)
109
            {
110
                var dopose = 45;
111
                if (!variable_instance_exists(id, "photod"))
112
                    photod = 0;
113
                if (photod == 0)
114
                {
115
                    var pointsDisplay = instance_create(centerx(), centery(), obj_board_pointsGetDisplay);
116
                    pointsDisplay.amount = photopoints;
117
                    photod = 1;
118
                }
119
            }
120
            if (object_index == obj_board_npc)
121
            {
122
                var memspeed = image_speed;
123
                image_speed = 0.125;
124
                sprite_index = pose;
125
                scr_delay_var("sprite_index", idle, 45);
126
                if (memspeed != 1.25)
127
                    scr_delay_var("image_speed", memspeed, 45);
128
                if (photod == 0 && (room == room_board_2 || room == room_board_3))
129
                {
130
                    var pointsDisplay = instance_create(centerx(), centery(), obj_board_pointsGetDisplay);
131
                    pointsDisplay.amount = photopoints;
132
                    photod = 1;
133
                }
134
            }
135
            if ((object_index == obj_board_pippins_grabbable || object_index == obj_b2pippinsislandnpc) && (room == room_board_2 || room == room_board_3))
136
            {
137
                pose = 45;
138
                if (!variable_instance_exists(id, "photod"))
139
                    photod = 0;
140
                if (photod == 0)
141
                {
142
                    var pointsDisplay = instance_create(centerx(), centery(), obj_board_pointsGetDisplay);
143
                    pointsDisplay.amount = photopoints;
144
                    photod = 1;
145
                }
146
            }
147
            if (object_index == obj_board_shadowgunner)
148
            {
149
                global.flag[1061 shadowgunner_photos]++;
150
                if (image_alpha == 1)
151
                    event_user(0);
152
            }
153
            if (object_index == obj_board_enemy_bullet)
154
            {
155
                var puff = instance_create(x - 8, y - 8, obj_board_smokepuff);
156
                puff.image_blend = image_blend;
157
                puff.depth = other.depth - 1;
158
                var pointsDisplay = instance_create(x + 16, y, obj_board_pointsGetDisplay);
159
                pointsDisplay.amount = 1;
160
                pointsDisplay.depth = depth - 1;
161
                instance_destroy();
162
            }
163
            if (object_index == obj_board_photoblock)
164
                alarm_set(0, 15);
165
            if (object_index == obj_board_b2tornflower)
166
            {
167
                if (photographed == false)
168
                {
169
                    photographed = true;
170
                    other.createphoto = true;
171
                    other.flagtoset = 1041;
172
                    alarm[0]
 = 10;
gml_Object_obj_board_playercamera_Alarm_0.gml

with (instance_create(x + 64, y + 46, obj_board_perfumefountainphotoeffect)) { mydist = 72; depth = 899990; }
173
                }
174
            }
175
            if (object_index == obj_b2_photocactus)
176
            {
177
                if (photod == false)
178
                {
179
                    photod = true;
180
                    other.createphoto = true;
181
                    other.flagtoset = 1043;
182
                    alarm[0]
 = 10;
gml_Object_obj_board_playercamera_Alarm_0.gml

with (instance_create(x + 64, y + 46, obj_board_perfumefountainphotoeffect)) { mydist = 72; depth = 899990; }
183
                }
184
            }
185
            if (object_index == obj_b2perfumespring_triggerarea)
186
            {
187
                if (photographed == false)
188
                {
189
                    photographed = true;
190
                    other.createphoto = true;
191
                    other.flagtoset = 1042;
192
                    alarm[0]
 = 10;
gml_Object_obj_board_playercamera_Alarm_0.gml

with (instance_create(x + 64, y + 46, obj_board_perfumefountainphotoeffect)) { mydist = 72; depth = 899990; }
193
                }
194
            }
195
            if (object_index == obj_b2_greenxsolve)
196
            {
197
                if (photographed == false)
198
                {
199
                    photographed = true;
200
                    other.createphoto = true;
201
                    other.flagtoset = 1040;
202
                    alarm[0]
 = 10;
gml_Object_obj_board_playercamera_Alarm_0.gml

with (instance_create(x + 64, y + 46, obj_board_perfumefountainphotoeffect)) { mydist = 72; depth = 899990; }
203
                }
204
            }
205
        }
206
    }
207
}
208
ds_list_destroy(_list2);
209
if (room == room_dw_b3bs_cheaterpippins)
210
{
211
    if (i_ex(obj_b3bs_cheaterpippins))
212
    {
213
        var gotpips = false;
214
        var gotdice = false;
215
        if (i_ex(collision_rectangle(x + 16, y + 16, (x + (camwidth * 32)) - 16, (y + (camheight * 32)) - 16, obj_b3bs_cheaterpippins.bpip1, false, true)))
216
            gotpips = true;
217
        if (i_ex(collision_rectangle(x + 16, y + 16, (x + (camwidth * 32)) - 16, (y + (camheight * 32)) - 16, obj_b3bs_cheaterpippins.dice, false, true)))
218
            gotdice = true;
219
        if (gotdice == false && gotpips == true)
220
        {
221
            with (obj_b3bs_cheaterpippins)
222
            {
223
                dcon = 20;
224
                dtimer = 0;
225
                with (obj_board_shopwriter)
226
                    texttimer = 0;
227
                pwriter1.shopstring = stringsetloc(
ME ALONE?!#IT MEANS NOTHING!
"ME ALONE?!#IT MEANS NOTHING!", "obj_board_playercamera_slash_Other_10_gml_182_0"
);
228
                debug_print("got pips but no dice");
229
            }
230
        }
231
        if (gotdice == true && gotpips == false)
232
        {
233
            with (obj_b3bs_cheaterpippins)
234
            {
235
                dcon = 20;
236
                dtimer = 0;
237
                with (obj_board_shopwriter)
238
                    texttimer = 0;
239
                pwriter1.shopstring = stringsetloc(
A DIE ALONE?!#IT MEANS NOTHING!
"A DIE ALONE?!#IT MEANS NOTHING!", "obj_board_playercamera_slash_Other_10_gml_195_0"
);
240
                debug_print("got dice but no pips");
241
            }
242
        }
243
        if (gotpips == true && gotdice == true)
244
        {
245
            with (obj_b3bs_cheaterpippins)
246
            {
247
                dcon = 40;
248
                dtimer = 0;
249
                with (obj_board_shopwriter)
250
                    visible = false;
251
                debug_print("got evidence");
252
            }
253
        }
254
    }
255
}
256
if (i_ex(obj_b2bossencounterroom))
257
{
258
    var doit = 0;
259
    if (obj_b2bossencounterroom.active && obj_b2bossencounterroom.con == 2)
260
    {
261
        if (i_ex(collision_rectangle(x + 4, y + 4, (x + (camwidth * 32)) - 4, (y + (camheight * 32)) - 4, kris, false, true)) && i_ex(collision_rectangle(x + 4, y + 4, (x + (camwidth * 32)) - 4, (y + (camheight * 32)) - 4, susie, false, true)) && i_ex(collision_rectangle(x + 4, y + 4, (x + (camwidth * 32)) - 4, (y + (camheight * 32)) - 4, ralsei, false, true)))
262
        {
263
            debug_print("got 'em all!");
264
            notalk = true;
265
            doit = 1;
266
        }
267
    }
268
    if (doit)
269
    {
270
        kris.facing = 0;
271
        obj_b2bossencounterroom.con = 3;
272
        alarm[0]
 = 10;
gml_Object_obj_board_playercamera_Alarm_0.gml

with (instance_create(x + 64, y + 46, obj_board_perfumefountainphotoeffect)) { mydist = 72; depth = 899990; }
273
        flagtoset = 1040;
274
        createphoto = true;
275
    }
276
}
277
if (addgreenblocks == true)
278
{
279
    addgreenblocks = false;
280
    flagtoset = 1040;
281
    with (obj_board_b2greenblock)
282
        event_user(3);
283
    if (obj_b2greenx.usedralsei == true)
284
    {
285
        var ralblock = 0;
286
        with (obj_pushableblock_board)
287
        {
288
            if (sprite_index == spr_ralsei_board_stoolforme)
289
                ralblock = id;
290
        }
291
        if (i_ex(ralblock))
292
        {
293
            with (ralblock)
294
                
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(scr_board_photosparkle, 10);
295
        }
296
    }
297
}
298
if (flagtoset == 0)
299
{
300
    with (obj_board_grayregion)
301
        instance_destroy();
302
    gray = instance_create(x, y, obj_board_grayregion);
303
    gray.image_xscale = camwidth * 32;
304
    gray.image_yscale = camheight * 32;
305
}
306
with (obj_board_store_key)
307
{
308
    if (mytype == "lancer")
309
        buffer = 3;
310
}