Undertale script viewer

← back to main script listing

gml_Object_obj_flowey_master_Other_17

(view raw script w/o annotations or w/e)
1
global.damage = 5;
2
if (global.soul_rescue == 0)
3
    global.damage = 1;
4
if (global.soul_rescue == 1)
5
    global.damage = 3 + floor(random(3));
6
if (global.soul_rescue == 2)
7
    global.damage = 10 + floor(random(3));
8
if (global.soul_rescue == 3)
9
    global.damage = 14 + floor(random(3));
10
if (global.soul_rescue == 4)
11
    global.damage = 18 + floor(random(4));
12
if (global.soul_rescue == 5)
13
    global.damage = 23 + floor(random(4));
14
if (global.soul_rescue >= 6)
15
{
16
    global.damage = 150 + floor(random(70));
17
    if (megadamage == 1)
18
        global.damage = 250 + floor(random(21));
19
    if (megadamage == 2)
20
        global.damage = 360 + floor(random(21));
21
    if (megadamage == 3)
22
        global.damage = 700 + floor(random(21));
23
    if (megadamage == 4)
24
        global.damage = 1200 + floor(random(21));
25
    if (megadamage == 8)
26
        global.damage = 6000;
27
}
28
if (global.damage > 100)
29
{
30
    with (obj_floweyx_tv)
31
        event_user(1);
32
    knockfactor = 6;
33
    alarm[11] = 1;
gml_Object_obj_flowey_master_Alarm_11.gml

obj_floweybodyparent.knockfactor = knockfactor; with (obj_floweybodyparent) { if (object_index != obj_floweyx_tv) { image_blend = make_color_rgb(255, 255 - (knockfactor * 5), 255 - (knockfactor * 5)); blend2 = make_color_rgb(255, 255 - (knockfactor * 5), 255 - (knockfactor * 5)); x = (xstart + random(knockfactor * 3)) - random(knockfactor * 3); y = (ystart + random(knockfactor * 3)) - random(knockfactor * 3); if (object_index == obj_fleshface || object_index == obj_floweyx_mouth) { x = xstart; y = ystart; } if (object_index == obj_sidestalk) { y -= 80; if (x > 320) x -= 40; if (x < 320) x += 40; } } } knockfactor -= 1; alarm[11] = 1; if (knockfactor < 0) alarm[11] = -1;
34
}
35
else
36
{
37
    with (obj_floweyx_tv)
38
        event_user(2);
39
}
40
global.floweyhp -= global.damage;
41
if (global.damage < 100)
42
    snd_play(snd_damage_c);
43
else
44
    snd_play(snd_heavydamage);
45
dd = instance_create(100, 140, obj_floweydmgwriter);
46
dd.alarm[2] = 60;
47
if (global.floweyhp <= 0)
48
{
49
    with (obj_flowey_fightbt)
50
        instance_destroy();
51
    with (obj_fx_bgen)
52
        instance_destroy();
53
    with (obj_flowey_bulletmaster)
54
        instance_destroy();
55
    with (obj_floweybullet_parent)
56
        instance_destroy();
57
    caster_stop(all);
58
    snd_play(snd_heavydamage);
59
    dd.alarm[2] = -1;
60
    dcon = 1;
61
    alarm[4] = 30;
62
}