Undertale script viewer

← back to main script listing

gml_Object_obj_tsunderplane_Destroy_0

(view raw script w/o annotations or w/e)
1
if (mercymod > 10 && global.monsterhp[myself] == global.monstermaxhp[myself])
2
{
3
    global.goldreward[3] += 60;
4
    global.flag[149 spared_tsunderplane] = 1;
5
}
6
if (killed == 1)
7
{
8
    global.xpreward[3] += global.xpreward[myself];
9
    global.goldreward[3] += global.goldreward[myself];
10
    with (mypart1)
11
        event_user(0);
12
    global.kills += 1;
13
    global.areapop[global.area] -= 1;
14
    if (global.areapop[global.area] < 0)
15
        global.areapop[global.area] = 0;
16
    global.flag[12 killed_last] = 1;
17
}
18
if (killed == 0)
19
{
20
    with (obj_vulkin)
21
        specialmessage = 1;
22
    with (mypart1)
23
        instance_destroy();
24
    global.goldreward[3] += floor(global.goldreward[myself] * ((global.monstermaxhp[myself] - global.monsterhp[myself]) / global.monstermaxhp[myself]));
25
    global.monstersprite = sprite_index;
26
    ddd = instance_create(x, y, obj_spared);
27
    ddd.image_speed = 0;
28
    ddd.image_index = 1;
29
    global.flag[10 spared_last] = 1;
30
}
31
global.monster[myself] = 0;