Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shutta_photo_controller_Other_19

(view raw script w/o annotations or w/e)
1
var _trueralsei = -1;
2
if (i_ex(obj_actor) && image_alpha >= 1)
3
{
4
    for (var i = 0; i < instance_number(obj_actor); i++)
5
    {
6
        _lg[i] = instance_find(obj_actor, i);
7
        if (_lg[i].dsprite == spr_ralsei_walk_down)
8
            _trueralsei = _lg[i];
9
    }
10
}
11
reticle_over_good_shot = false;
12
switch (subact_state)
13
{
14
    case "init":
15
        with (enemy)
16
        {
17
            x = xstart;
18
            y = ystart;
19
            sprite_index = spr_shutta_idle;
20
            image_speed = 0.16666666666666666;
21
        }
22
        with (obj_monsterparent)
23
            
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);
24
        with (obj_heroparent)
25
            
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);
26
        rotating_controller = instance_create(x, y - 60, obj_shutta_nobyacttest);
27
        rotating_controller.difficulty = difficulty;
28
        rotating_controller.type = 0;
29
        disablemovement = false;
30
        subact_state = "ralsei";
31
        break;
32
    case "ralsei":
33
        timerb++;
34
        pipetimer++;
35
        if (timer == timer_duration)
36
        {
37
            subact_state = "post_capture";
38
            enemy.sprite_index = spr_shutta_idle;
39
            enemy.image_speed = 0.16666666666666666;
40
            timerb = 0;
41
        }
42
        break;
43
    case "capture":
44
        subact_state = "post_capture";
45
        if (got_kris && closest_hero == "kris")
46
        {
47
            endmessage = message_nicephoto;
48
            if (enemy.amiabossfight == true)
49
            {
50
                obj_shutta_photo_controller.endmessage = message_kris;
51
                if (global.flag[513 shuttah_kris_pic] > 0)
52
                    obj_shutta_photo_controller.endmessage = message_kris2;
53
            }
54
            global.flag[513 shuttah_kris_pic] = 1;
55
        }
56
        else if (got_susie && closest_hero == "susie")
57
        {
58
            endmessage = message_nicephoto;
59
            if (enemy.amiabossfight == true)
60
            {
61
                obj_shutta_photo_controller.endmessage = message_susie;
62
                if (global.flag[514 shuttah_susie_pic] > 0)
63
                    obj_shutta_photo_controller.endmessage = message_susie2;
64
            }
65
            global.flag[514 shuttah_susie_pic] = 1;
66
        }
67
        else if (got_ralsei && closest_hero == "ralsei")
68
        {
69
            endmessage = message_nicephoto;
70
            if (enemy.amiabossfight == true)
71
            {
72
                if (global.flag[515 shuttah_ralsei_pic] == 0)
73
                    obj_shutta_photo_controller.endmessage = message_ralsei;
74
                if (global.flag[515 shuttah_ralsei_pic] > 0)
75
                    obj_shutta_photo_controller.endmessage = message_ralsei2;
76
            }
77
            global.flag[515 shuttah_ralsei_pic] = 1;
78
        }
79
        else if (_trueralsei != -1 && place_meeting(x, y, _trueralsei) && collision_circle(x, y, reticle_size + 35, _trueralsei, false, true))
80
        {
81
            enemy.photosuccessballoon = 1;
82
            if (enemy.amiabossfight == true)
83
            {
84
                if (powerphoto)
85
                    mercygained += 10;
86
                mercygained += 10;
87
            }
88
            else
89
            {
90
                if (powerphoto)
91
                    mercygained += 20;
92
                mercygained += 80;
93
            }
94
            if (!i_ex(obj_shutta_text))
95
            {
96
                var _comment = instance_create(x, y, obj_shutta_text);
97
                _comment.text = comment_center;
98
                _comment.color = c_yellow;
99
            }
100
            obj_shutta_photo_controller.endmessage = message_nicephoto;
101
            if (enemy.amiabossfight == true)
102
                obj_shutta_photo_controller.endmessage = message_nicephoto2;
103
            with (obj_actor)
104
            {
105
                if (dsprite == spr_ralsei_walk_down)
106
                {
107
                    depth -= 99999;
108
                    sprite_index = spr_ralsei_pose;
109
                }
110
            }
111
        }
112
        else
113
        {
114
            if (enemy.amiabossfight == true)
115
            {
116
                if (powerphoto)
117
                    mercygained += 6;
118
                mercygained += 6;
119
            }
120
            else
121
            {
122
                if (powerphoto)
123
                    mercygained += 25;
124
                mercygained += 25;
125
            }
126
            obj_shutta_photo_controller.endmessage = message_badphoto;
127
            if (enemy.amiabossfight == true)
128
                obj_shutta_photo_controller.endmessage = stringsetloc(
* Wrong! No! I need a picture of Ralsei!!
"* Wrong! No! I need a picture of Ralsei!!", "obj_shutta_photo_controller_slash_Other_19_gml_129_0"
);
129
        }
130
        count = 0;
131
        with (obj_heroparent)
132
            
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);
133
        with (enemy)
134
        {
135
            
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);
136
            timerb = 0;
137
            pipetimer = 0;
138
            sprite_index = spr_shutta_idle;
139
        }
140
        with (obj_shutta_nobyacttest)
141
            delaydeath = 2;
142
        break;
143
    case "post_capture":
144
        count = 0;
145
        with (obj_heroparent)
146
        {
147
            x = xstart;
148
            y = ystart;
149
        }
150
        with (obj_monsterparent)
151
        {
152
            x = xstart;
153
            y = ystart;
154
        }
155
        with (enemy)
156
        {
157
            x = xstart;
158
            y = ystart;
159
            timerb = 0;
160
            pipetimer = 0;
161
            sprite_index = spr_shutta_idle;
162
        }
163
        with (obj_shutta_nobyacttest)
164
            delaydeath = 2;
165
        break;
166
}