Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_spamton_neo_enemy_Step_2

(view raw script w/o annotations or w/e)
1
if (obj_spamton_neo_enemy.singleshotmercy > 9)
2
{
3
    with (obj_spamton_neo_enemy)
4
    {
5
        if (instance_exists(obj_sneo_bulletcontroller) && obj_sneo_bulletcontroller.type == 1.5)
6
        {
7
            obj_sneo_bulletcontroller.mercyaccumulated += 1;
8
            __mercydmgwriter = instance_create(global.monsterx[myself], (global.monstery[myself] + 20) - (global.hittarget[myself] * 20), obj_dmgwriter);
9
            __mercydmgwriter.damage = 1;
10
            __mercydmgwriter.type = 5;
11
            global.hittarget[myself]++;
12
        }
13
        else
14
        {
15
            scr_mercyadd
scr_mercyadd

function scr_mercyadd(arg0, arg1) { global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; if (global.mercymod[arg0] >= 100) global.mercymod[arg0] = 100; var _playsound = 1; if (arg1 <= 0) _playsound = 0; if (i_ex(obj_dmgwriter)) { with (obj_dmgwriter) { if (type == 5) _playsound = 0; } } if (_playsound) { var _pitch = 0.8; if (arg1 < 99) _pitch = 1; if (arg1 <= 50) _pitch = 1.2; if (arg1 <= 25) _pitch = 1.4; snd_play_x(snd_mercyadd, 0.8, _pitch); } __mercydmgwriter = instance_create(global.monsterx[arg0], (global.monstery[arg0] + 20) - (global.hittarget[arg0] * 20), obj_dmgwriter); __mercydmgwriter.damage = arg1; __mercydmgwriter.type = 5; global.hittarget[arg0]++; }
(myself, 1);
16
        }
17
        singleshotmercy = 0;
18
    }
19
}
20
if (!instance_exists(obj_sneo_bulletcontroller))
21
{
22
    idealx[5] = 0;
23
    idealrot[5] = 0;
24
    partsiner[5] = 0;
25
    partrot[5] = 0;
26
    partx[5] = 0;
27
    party[5] = 0;
28
    partxoff[5] = sprite_get_xoffset(partsprite[5]) * 2;
29
    partyoff[5] = sprite_get_yoffset(partsprite[5]) * 2;
30
}
31
if (global.fighting == 1)
32
{
33
    if (prevmercy != global.mercymod[myself])
34
    {
35
        var mercygainedthisturn = global.mercymod[myself] - prevmercy;
36
        repeat (mercygainedthisturn)
37
        {
38
            prevmercy++;
39
            if ((prevmercy % 2) == 0)
40
            {
41
                var i = irandom(5);
42
                var a = -1;
43
                var maxv = 0;
44
                repeat (6)
45
                {
46
                    if (partvisible[i] == 1 && partweakened[i] > 0)
47
                    {
48
                        a = i;
49
                        break;
50
                    }
51
                    i++;
52
                    if (i > 5)
53
                        i = 0;
54
                    if (partvisible[i] == 1)
55
                        maxv++;
56
                }
57
                if (vinebgcount < 1)
58
                    maxvinecount = maxv;
59
                var multicut = 1;
60
                var c = irandom(5);
61
                var d = 0;
62
                var maxvines = 0;
63
                while (d == 0)
64
                {
65
                    if (x == x)
66
                    {
67
                        if (partvisible[c] == 1)
68
                        {
69
                            partvisible[c] = 0;
70
                            vine = instance_create(x, y, obj_sneo_vine_cut);
71
                            vine.x1 = x + partx[c] + (partxoff[c] / 1.2) + (c * 5) + (sin(partsiner[c] / 30) * 2);
72
                            vine.x2 = x + partx[c] + (partxoff[c] / 1.5) + (c * 8);
73
                            vine.y1 = ((y + party[c]) - 10) + partyoff[c];
74
                            vine.y2 = -400;
75
                            vine.depth = depth + 1;
76
                            vine.vineid = c;
77
                            vfx = instance_create(x + partx[c] + (partxoff[c] / 1.2) + (c * 5), y - 20, obj_sneo_vine_weak);
78
                            vfx.depth = depth - 5;
79
                            if (!audio_is_playing(snd_damage))
80
                                snd_play(snd_damage);
81
                            c = irandom(5);
82
                            maxvines++;
83
                            a--;
84
                            if (maxvines >= multicut)
85
                                d = 1;
86
                            obj_spamton_neo_enemy.vinebgcount -= 1;
87
                        }
88
                        else
89
                        {
90
                            c++;
91
                            if (c > 5)
92
                                c = 0;
93
                        }
94
                    }
95
                    else if (partweakened[c] == 0)
96
                    {
97
                        partweakened[c] = 1;
98
                        vfx = instance_create(x + partx[c] + (partxoff[c] / 1.2) + (c * 5), y - 20, obj_sneo_vine_weak);
99
                        vfx.depth = depth - 5;
100
                        if (!audio_is_playing(snd_damage))
101
                            snd_play(snd_damage);
102
                        c = irandom(5);
103
                        maxvines++;
104
                        a++;
105
                        if (maxvines >= multicut)
106
                            d = 1;
107
                    }
108
                    else
109
                    {
110
                        c++;
111
                        if (c > 5)
112
                            c = 0;
113
                    }
114
                    var max_break = 0;
115
                    i = 0;
116
                    repeat (6)
117
                    {
118
                        if (partvisible[i] == 1)
119
                            max_break = 1;
120
                        i++;
121
                    }
122
                    if (max_break == 0)
123
                        d = 1;
124
                }
125
            }
126
        }
127
        if (obj_spamton_neo_enemy.vinebgcount > -2 && !instance_exists(obj_sneo_throwkris_vine_controller))
128
        {
129
            for (var i = 0; i < 6; i += 1)
130
            {
131
                if (obj_spamton_neo_enemy.partvisible[i] == 0)
132
                {
133
                    obj_spamton_neo_enemy.vineid = i;
134
                    vine = instance_create(x, y, obj_sneo_vine_transition);
135
                }
136
            }
137
        }
138
        weakentimer = 1;
139
        weakenshakeamount = 10;
140
    }
141
}
142
if (global.fighting == 1)
143
    prevmercy = global.mercymod[myself];