Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shadowman_sharpshoot_heart_Collision_obj_shadowman_sharpshoot_target

(view raw script w/o annotations or w/e)
1
if (i_ex(obj_shadowman_sharpshoot_target) && obj_shadowman_sharpshoot_target.type == 5)
2
    exit;
3
if (con == 0 && other.hittable == 1)
4
{
5
    con = 1;
6
    savey = other.parentid.y + 70 + irandom(35);
7
    event_user(0);
8
    if (other.type == 4)
9
    {
10
        with (obj_actor_tenna)
11
        {
12
            nose_sintimer = 0;
13
            nose_magnitude = 100;
14
            threepartmode = true;
15
            hitflash = 2;
16
        }
17
        snd_stop(snd_bump);
18
        snd_stop(snd_punch_ish_1);
19
        snd_play_x(snd_punch_ish_1, 0.5, 1.1);
20
        snd_play_x(snd_bump, 1.2, 0.7);
21
        if (obj_actor_tenna.lightemupcon != 4)
22
        {
23
            other.tennahp--;
24
            other.tennatransitionhp--;
25
        }
26
        if ((other.tennatransitionhp < 0 || other.tennahp < 1) && obj_lightemup_controller.transitioninit == 0)
27
        {
28
            other.tennatransitionhpmax -= 3;
29
            if (other.tennatransitionhpmax < 8)
30
                other.tennatransitionhpmax = 8;
31
            other.tennatransitionhp = other.tennatransitionhpmax;
32
            obj_lightemup_controller.transitioninit = 1;
33
            if (other.tennahp > 0)
34
            {
35
                obj_lightemup_controller.transitioninit = 2;
36
                obj_lightemup_controller.extra_timer = 0;
37
                with (obj_actor_tenna)
38
                {
39
                    geteasiertimer = round(geteasiertimer / 2);
40
                    geteasiertimer -= 50;
41
                    if (geteasiertimer < 0)
42
                        geteasiertimer = 0;
43
                }
44
            }
45
        }
46
        exit;
47
    }
48
    if (other.type == 5)
49
    {
50
        snd_stop(snd_bump);
51
        snd_play(snd_bump);
52
        exit;
53
    }
54
    if (other.type == 3)
55
    {
56
        with (obj_actor_tenna)
57
        {
58
            nose_sintimer = 0;
59
            nose_magnitude = 100;
60
            threepartmode = true;
61
        }
62
        with (obj_shadowman_enemy)
63
            board4sharpshootscene = true;
64
        snd_stop(snd_bump);
65
        snd_play(snd_bump);
66
    }
67
    if (other.type < 3)
68
    {
69
        if ((other.spare == false && (global.mercymod[other.parentid.myself] + other.parentid.sharpshootmercy) < 100) || (other.spare == true && other.sparehp > 0))
70
        {
71
            with (other)
72
                shake = 6;
73
            if (other.spare == false)
74
            {
75
                with (other.parentid)
76
                    sharpshootmercy += 10;
77
            }
78
            other.sparehp--;
79
            snd_stop(snd_bump);
80
            snd_play(snd_bump);
81
        }
82
        if ((other.spare == false && (global.mercymod[other.parentid.myself] + other.parentid.sharpshootmercy) >= 100 && other.type != 3) || (other.spare == true && other.sparehp <= 0))
83
        {
84
            with (other)
85
                event_user(0);
86
        }
87
    }
88
    if (other.type == 6)
89
    {
90
        if ((other.spare == false && (global.mercymod[other.parentid.myself] + other.parentid.sharpshootmercy) < 100) || (other.spare == true && other.sparehp > 0))
91
        {
92
            if (other.spare == false)
93
            {
94
                with (other.parentid)
95
                {
96
                    sharpshootmercy += 5;
97
                    sharpshootballoon = true;
98
                }
99
            }
100
            other.sparehp--;
101
            other.shake = 6;
102
            other.sprite_index = spr_zapper_spare_sharpshoot;
103
            other.changecolorcon = 1;
104
            other.changecolortimer = 0;
105
            snd_stop(snd_pinball);
106
            snd_play_x(snd_pinball, 1, 0.8 + random(0.4));
107
        }
108
        if (other.spare == true && other.sparehp < 1)
109
        {
110
            with (other)
111
                event_user(0);
112
        }
113
    }
114
    if (other.type == 7)
115
    {
116
        if ((other.spare == false && (global.mercymod[other.parentid.myself] + other.parentid.sharpshootmercy) < 100) || (other.spare == true && other.sparehp > 0))
117
        {
118
            if (other.spare == false)
119
            {
120
                with (other.parentid)
121
                {
122
                    sharpshootmercy += 5;
123
                    sharpshootballoon = true;
124
                }
125
            }
126
            other.sparehp--;
127
            other.shake = 6;
128
            other.sprite_index = spr_pippins_sharpshoot2;
129
            snd_stop(snd_bump);
130
            snd_play(snd_bump);
131
        }
132
        if (other.spare == true && other.sparehp < 1)
133
        {
134
            with (other)
135
                event_user(0);
136
        }
137
    }
138
    if (other.type == 8)
139
    {
140
        if ((other.spare == false && (global.mercymod[other.parentid.myself] + other.parentid.sharpshootmercy) < 100) || (other.spare == true && other.sparehp > 0))
141
        {
142
            if (other.spare == false)
143
            {
144
                with (other.parentid)
145
                {
146
                    sharpshootmercy += 5;
147
                    sharpshootballoon = true;
148
                }
149
            }
150
            other.sparehp--;
151
            other.shake = 6;
152
            other.sprite_index = spr_shutta_sharpshoot;
153
            snd_stop(snd_bump);
154
            snd_play(snd_bump);
155
        }
156
        if (other.spare == true && other.sparehp < 1)
157
        {
158
            with (other)
159
                event_user(0);
160
        }
161
    }
162
}