Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shutta_photo_controller_Other_15

(view raw script w/o annotations or w/e)
1
if (i_ex(obj_shutta_palm_outoftree))
2
{
3
    if (obj_shutta_palm_outoftree.angle == 0)
4
    {
5
        if (x < (obj_shutta_palm_outoftree.x + 150) && x > (obj_shutta_palm_outoftree.x - 40) && y > (obj_shutta_palm_outoftree.y - 60) && y < (obj_shutta_palm_outoftree.y + 60))
6
        {
7
            if (obj_shutta_palm_outoftree.image_index >= 3)
8
                obj_shutta_palm_outoftree.goodphoto = true;
9
        }
10
        else
11
        {
12
            obj_shutta_palm_outoftree.goodphoto = false;
13
        }
14
    }
15
    if (obj_shutta_palm_outoftree.angle == 90)
16
    {
17
        if (x < (obj_shutta_palm_outoftree.x + 60) && x > (obj_shutta_palm_outoftree.x - 60) && y < (obj_shutta_palm_outoftree.y + 40) && y > (obj_shutta_palm_outoftree.y - 150))
18
        {
19
            if (obj_shutta_palm_outoftree.image_index >= 3)
20
                obj_shutta_palm_outoftree.goodphoto = true;
21
        }
22
        else
23
        {
24
            obj_shutta_palm_outoftree.goodphoto = false;
25
        }
26
    }
27
    if (obj_shutta_palm_outoftree.angle == 180)
28
    {
29
        if (x > (obj_shutta_palm_outoftree.x - 150) && x < (obj_shutta_palm_outoftree.x + 40) && y > (obj_shutta_palm_outoftree.y - 60) && y < (obj_shutta_palm_outoftree.y + 60))
30
        {
31
            if (obj_shutta_palm_outoftree.image_index >= 3)
32
                obj_shutta_palm_outoftree.goodphoto = true;
33
        }
34
        else
35
        {
36
            obj_shutta_palm_outoftree.goodphoto = false;
37
        }
38
    }
39
    if (obj_shutta_palm_outoftree.image_index < 3)
40
        obj_shutta_palm_outoftree.goodphoto = false;
41
}
42
reticle_over_good_shot = false;
43
if (place_meeting(x, y, obj_heroparent) || (i_ex(obj_shutta_palm_outoftree) && obj_shutta_palm_outoftree.goodphoto) || (i_ex(obj_shutta_car_outoftree) && place_meeting(x, y, obj_shutta_car_outoftree)))
44
    reticle_over_good_shot = true;
45
switch (subact_state)
46
{
47
    case "init":
48
        with (enemy)
49
        {
50
            x = xstart;
51
            y = ystart;
52
            sprite_index = spr_shutta_idle;
53
            image_speed = 0.16666666666666666;
54
            
scr_move_to_point_over_time
scr_move_to_point_over_time

function
scr_move_to_point_over_time(arg0, arg1, arg2)
{ _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(x + 170, y, 8);
55
        }
56
        with (obj_heroparent)
57
            
scr_move_to_point_over_time
scr_move_to_point_over_time

function
scr_move_to_point_over_time(arg0, arg1, arg2)
{ _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(x - 170, y, 8);
58
        palm1 = instance_create_depth(camerax() + 250, cameray() + 250, depth + 20, obj_shutta_palm);
59
        palm2 = instance_create_depth(camerax() + 410, cameray() + 250, depth + 20, obj_shutta_palm);
60
        subact_state = "palms";
61
        break;
62
    case "palms":
63
        if (timer < (timer_duration - 70) && !i_ex(obj_shutta_palm_outoftree) && !i_ex(obj_shutta_car_outoftree))
64
        {
65
            var palm_chose = choose(0, 1);
66
            var angle = choose(0, 180);
67
            if (difficulty == 1)
68
                angle = choose(0, 90, 180);
69
            var type = choose(0, 0, 0, 0, 0, 1, 1, 2, 2, 3);
70
            count++;
71
            if (count == 1 && difficulty == 0)
72
            {
73
                if (choose(0, 1) == 0)
74
                {
75
                    palm_chose = 0;
76
                    angle = 0;
77
                    type = 0;
78
                    fun = 0;
79
                }
80
                else
81
                {
82
                    palm_chose = 1;
83
                    angle = 180;
84
                    type = 0;
85
                    fun = 1;
86
                }
87
            }
88
            if (count == 1 && difficulty == 1)
89
                angle = 90;
90
            if (count == 2)
91
            {
92
                if (fun == 1)
93
                {
94
                    palm_chose = 0;
95
                    angle = 0;
96
                    type = 0;
97
                }
98
                else
99
                {
100
                    palm_chose = 1;
101
                    angle = 180;
102
                    type = 0;
103
                }
104
            }
105
            if (count == 3)
106
            {
107
                palm_chose = choose(0, 1);
108
                type = 3;
109
            }
110
            if (count == 4)
111
                type = 2;
112
            if (difficulty == 1)
113
            {
114
                if (palm_chose == 0 && angle == 0)
115
                    angle = 180;
116
                if (palm_chose == 1 && angle == 180)
117
                    angle = 0;
118
            }
119
            if (type == 3)
120
            {
121
                if (palm_chose == 0)
122
                {
123
                    car = instance_create_depth(palm1.x - 20, obj_shutta_palm.y - 48, palm1.depth + 2, obj_shutta_car_outoftree);
124
                    car.side = 1;
125
                    car.destinationx = palm2.x - 30;
126
                    car.hspeed = 12;
127
                }
128
                if (palm_chose == 1)
129
                {
130
                    car = instance_create_depth(palm2.x + 20, obj_shutta_palm.y - 48, palm1.depth + 2, obj_shutta_car_outoftree);
131
                    car.side = -1;
132
                    car.image_xscale = -1.4;
133
                    car.destinationx = palm1.x + 30;
134
                    car.hspeed = -12;
135
                }
136
            }
137
            else
138
            {
139
                shutta = instance_create_depth(x, obj_shutta_palm.y - 48, obj_shutta_palm.depth + 10, obj_shutta_palm_outoftree);
140
                shutta.angle = angle;
141
                if (palm_chose == 0)
142
                {
143
                    shutta.x = palm1.xstart;
144
                    if (angle == 90)
145
                        shutta.y = palm1.ystart - 120;
146
                }
147
                if (palm_chose == 1)
148
                {
149
                    shutta.x = palm2.xstart;
150
                    if (angle == 90)
151
                        shutta.y = palm2.ystart - 120;
152
                }
153
            }
154
        }
155
        if (timer == timer_duration)
156
        {
157
            subact_state = "post_capture";
158
            enemy.sprite_index = spr_shutta_idle;
159
            enemy.image_speed = 0.16666666666666666;
160
            timerb = 0;
161
        }
162
        break;
163
    case "capture":
164
        subact_state = "post_capture";
165
        if (got_kris && closest_hero == "kris")
166
        {
167
            endmessage = message_nicephoto;
168
            if (enemy.amiabossfight == true)
169
            {
170
                obj_shutta_photo_controller.endmessage = message_kris;
171
                if (global.flag[513 shuttah_kris_pic] > 0)
172
                    obj_shutta_photo_controller.endmessage = message_kris2;
173
            }
174
            global.flag[513 shuttah_kris_pic] = 1;
175
        }
176
        else if (got_susie && closest_hero == "susie")
177
        {
178
            endmessage = message_nicephoto;
179
            if (enemy.amiabossfight == true)
180
            {
181
                obj_shutta_photo_controller.endmessage = message_susie;
182
                if (global.flag[514 shuttah_susie_pic] > 0)
183
                    obj_shutta_photo_controller.endmessage = message_susie2;
184
            }
185
            global.flag[514 shuttah_susie_pic] = 1;
186
        }
187
        else if (got_ralsei && closest_hero == "ralsei")
188
        {
189
            endmessage = message_nicephoto;
190
            if (enemy.amiabossfight == true)
191
            {
192
                if (global.flag[515 shuttah_ralsei_pic] == 0)
193
                    obj_shutta_photo_controller.endmessage = message_ralsei;
194
                if (global.flag[515 shuttah_ralsei_pic] > 0)
195
                    obj_shutta_photo_controller.endmessage = message_ralsei2;
196
            }
197
            global.flag[515 shuttah_ralsei_pic] = 1;
198
        }
199
        else if ((i_ex(obj_shutta_palm_outoftree) && obj_shutta_palm_outoftree.goodphoto) || (i_ex(obj_shutta_car_outoftree) && place_meeting(x, y, obj_shutta_car_outoftree)))
200
        {
201
            enemy.photosuccessballoon = 1;
202
            if (enemy.amiabossfight == true)
203
            {
204
                if (fastphoto)
205
                    mercygained += 10;
206
                else
207
                    mercygained += 10;
208
            }
209
            else
210
            {
211
                mercygained += 100;
212
            }
213
            if (!i_ex(obj_shutta_text))
214
            {
215
                var _comment = instance_create(x, y, obj_shutta_text);
216
                _comment.text = comment_center;
217
                _comment.color = c_yellow;
218
            }
219
            obj_shutta_photo_controller.endmessage = message_nicephoto;
220
            if (enemy.amiabossfight == true)
221
                obj_shutta_photo_controller.endmessage = message_nicephoto2;
222
        }
223
        else
224
        {
225
            if (enemy.amiabossfight == true)
226
            {
227
                if (fastphoto)
228
                    mercygained += 3;
229
                else
230
                    mercygained += 3;
231
            }
232
            else if (fastphoto)
233
            {
234
                mercygained += 25;
235
            }
236
            else
237
            {
238
                mercygained += 25;
239
            }
240
            obj_shutta_photo_controller.endmessage = message_badphoto;
241
            if (enemy.amiabossfight == true)
242
                obj_shutta_photo_controller.endmessage = message_default;
243
            if (place_meeting(x, y, obj_shutta_palm_outoftree))
244
            {
245
                if (enemy.amiabossfight == true)
246
                    obj_shutta_photo_controller.endmessage = message_notcentered;
247
            }
248
        }
249
        count = 0;
250
        with (obj_heroparent)
251
            
scr_move_to_point_over_time
scr_move_to_point_over_time

function
scr_move_to_point_over_time(arg0, arg1, arg2)
{ _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(xstart, y, 3);
252
        with (enemy)
253
        {
254
            
scr_move_to_point_over_time
scr_move_to_point_over_time

function
scr_move_to_point_over_time(arg0, arg1, arg2)
{ _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(xstart, ystart, 3);
255
            timerb = 0;
256
            palmtimer = 0;
257
            sprite_index = spr_shutta_idle;
258
            with (obj_shutta_pipe)
259
                con = 2;
260
        }
261
        break;
262
    case "post_capture":
263
        count = 0;
264
        with (obj_heroparent)
265
        {
266
            
scr_move_to_point_over_time
scr_move_to_point_over_time

function
scr_move_to_point_over_time(arg0, arg1, arg2)
{ _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(xstart, y, 8);
267
            x = xstart;
268
            y = ystart;
269
        }
270
        with (enemy)
271
        {
272
            
scr_move_to_point_over_time
scr_move_to_point_over_time

function
scr_move_to_point_over_time(arg0, arg1, arg2)
{ _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(xstart, ystart, 8);
273
            x = xstart;
274
            y = ystart;
275
            timerb = 0;
276
            palmtimer = 0;
277
            sprite_index = spr_shutta_idle;
278
            with (obj_shutta_palm)
279
                con = 2;
280
        }
281
        break;
282
}