Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shutta_photo_controller_Other_17

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