Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shutta_photo_controller_Other_18

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