Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shutta_photo_controller_Other_14

(view raw script w/o annotations or w/e)
1
reticle_over_good_shot = false;
2
if (place_meeting(x, y, obj_heroparent) || (place_meeting(x, y, obj_shutta_pipehand) && collision_circle(x, y, reticle_size + 60, obj_shutta_pipehand, false, true) && obj_shutta_pipehand.goodshot))
3
    reticle_over_good_shot = true;
4
switch (subact_state)
5
{
6
    case "init":
7
        with (enemy)
8
        {
9
            x = xstart;
10
            y = ystart;
11
            sprite_index = spr_shutta_idle;
12
            image_speed = 0.16666666666666666;
13
            
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);
14
        }
15
        with (obj_heroparent)
16
            
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);
17
        pipe1 = instance_create_depth(camerax() + 202, cameray() + 230, depth + 20, obj_shutta_pipe);
18
        pipe2 = instance_create_depth(camerax() + 322, cameray() + 230, depth + 20, obj_shutta_pipe);
19
        pipe3 = instance_create_depth(camerax() + 442, cameray() + 230, depth + 20, obj_shutta_pipe);
20
        if (difficulty == 1)
21
        {
22
            if (choose(0, 1) == 1)
23
            {
24
                pipe1.type = 1;
25
                pipe2.type = 2;
26
                pipe3.type = 1;
27
            }
28
            else
29
            {
30
                pipe1.type = 2;
31
                pipe2.type = 1;
32
                pipe3.type = 2;
33
            }
34
        }
35
        subact_state = "pipes";
36
        break;
37
    case "pipes":
38
        timerb++;
39
        pipetimer++;
40
        if ((pipetimer > 20 && difficulty == 0 && !i_ex(obj_shutta_pipehand)) || (pipetimer > 50 && difficulty == 1))
41
        {
42
            var pipe_chose = choose(0, 1, 2);
43
            var type = choose(0, 0, 0, 0, 0, 1, 1, 2, 2, 3);
44
            if (timerb > 100 && type3alreadyused == false && timer_duration == 200)
45
                type = 3;
46
            if (type3alreadyused == false && timer_duration == 100)
47
                type = 3;
48
            if (type == 3)
49
                type3alreadyused = true;
50
            if (difficulty == 1)
51
            {
52
                count++;
53
                type = 6;
54
                if (pipe_chose == 1)
55
                    type = 4;
56
            }
57
            hand = instance_create_depth(camerax() + 200, obj_shutta_pipe.y, obj_shutta_pipe.depth + 10, obj_shutta_pipehand);
58
            hand.type = type;
59
            if (pipe_chose == 0)
60
            {
61
                hand.x = pipe1.x;
62
                hand.target_pipe = pipe1;
63
            }
64
            if (pipe_chose == 1)
65
            {
66
                hand.x = pipe2.x;
67
                hand.target_pipe = pipe2;
68
            }
69
            if (pipe_chose == 2)
70
            {
71
                hand.x = pipe3.x;
72
                hand.target_pipe = pipe3;
73
            }
74
            pipetimer = -30 + irandom(30);
75
            if (difficulty == 1)
76
                pipetimer = -60;
77
        }
78
        if (timer == timer_duration)
79
        {
80
            subact_state = "post_capture";
81
            enemy.sprite_index = spr_shutta_idle;
82
            enemy.image_speed = 0.16666666666666666;
83
            timerb = 0;
84
        }
85
        break;
86
    case "capture":
87
        subact_state = "post_capture";
88
        if (got_kris && closest_hero == "kris")
89
        {
90
            enemy.photosuccesscount++;
91
            endmessage = message_nicephoto;
92
            if (enemy.amiabossfight == true)
93
            {
94
                obj_shutta_photo_controller.endmessage = message_kris;
95
                if (global.flag[513 shuttah_kris_pic] > 0)
96
                    obj_shutta_photo_controller.endmessage = message_kris2;
97
            }
98
            global.flag[513 shuttah_kris_pic] = 1;
99
        }
100
        else if (got_susie && closest_hero == "susie")
101
        {
102
            enemy.photosuccesscount++;
103
            endmessage = message_nicephoto;
104
            if (enemy.amiabossfight == true)
105
            {
106
                obj_shutta_photo_controller.endmessage = message_susie;
107
                if (global.flag[514 shuttah_susie_pic] > 0)
108
                    obj_shutta_photo_controller.endmessage = message_susie2;
109
            }
110
            global.flag[514 shuttah_susie_pic] = 1;
111
        }
112
        else if (got_ralsei && closest_hero == "ralsei")
113
        {
114
            enemy.photosuccesscount++;
115
            endmessage = message_nicephoto;
116
            if (enemy.amiabossfight == true)
117
            {
118
                if (global.flag[515 shuttah_ralsei_pic] == 0)
119
                    obj_shutta_photo_controller.endmessage = message_ralsei;
120
                if (global.flag[515 shuttah_ralsei_pic] > 0)
121
                    obj_shutta_photo_controller.endmessage = message_ralsei2;
122
            }
123
            global.flag[515 shuttah_ralsei_pic] = 1;
124
        }
125
        else if (place_meeting(x, y, obj_shutta_pipehand) && collision_circle(x, y, reticle_size + 60, obj_shutta_pipehand, false, true) && obj_shutta_pipehand.goodshot)
126
        {
127
            enemy.photosuccessballoon = 1;
128
            if (obj_shutta_pipehand.type == 3)
129
            {
130
                if (enemy.amiabossfight == true)
131
                    mercygained += 16;
132
                else
133
                    mercygained += 75;
134
            }
135
            else if (enemy.amiabossfight == true)
136
            {
137
                mercygained += 12;
138
            }
139
            else
140
            {
141
                mercygained += 50;
142
            }
143
            if (!i_ex(obj_shutta_text))
144
            {
145
                var _comment = instance_create(x, y, obj_shutta_text);
146
                _comment.text = comment_center;
147
                _comment.color = c_yellow;
148
            }
149
            obj_shutta_photo_controller.endmessage = message_nicephoto;
150
            if (enemy.amiabossfight == true)
151
                obj_shutta_photo_controller.endmessage = message_nicephoto2;
152
        }
153
        else
154
        {
155
            if (enemy.amiabossfight == true)
156
                mercygained += 6;
157
            else
158
                mercygained += 25;
159
            obj_shutta_photo_controller.endmessage = message_badphoto;
160
            if (enemy.amiabossfight == true)
161
                obj_shutta_photo_controller.endmessage = message_default;
162
            if (place_meeting(x, y, obj_shutta_pipehand) && !collision_circle(x, y, reticle_size, obj_shutta_shine, false, true))
163
            {
164
                if (enemy.amiabossfight == true)
165
                    obj_shutta_photo_controller.endmessage = message_notcentered;
166
            }
167
        }
168
        count = 0;
169
        with (obj_heroparent)
170
            
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);
171
        with (enemy)
172
        {
173
            
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);
174
            timerb = 0;
175
            pipetimer = 0;
176
            sprite_index = spr_shutta_idle;
177
            with (obj_shutta_pipe)
178
                con = 2;
179
        }
180
        break;
181
    case "post_capture":
182
        count = 0;
183
        with (obj_heroparent)
184
        {
185
            x = xstart;
186
            y = ystart;
187
        }
188
        with (enemy)
189
        {
190
            x = xstart;
191
            y = ystart;
192
            timerb = 0;
193
            pipetimer = 0;
194
            sprite_index = spr_shutta_idle;
195
            with (obj_shutta_pipe)
196
                con = 2;
197
        }
198
        break;
199
}