Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_heart_battle_effect_glow_Step_2

(view raw script w/o annotations or w/e)
1
if ((!instance_exists(obj_heart_battle_fighting_parent)) || global.current_pp_self <= 0)
2
{
3
    instance_destroy()
4
    return;
5
}
6
if (obj_heart_battle_fighting_parent.vulnerable == true)
7
{
8
    image_alpha += image_alpha_increase
9
    if (image_alpha >= 1)
10
    {
11
        image_alpha = 1
12
        image_alpha_increase = (-image_alpha_increase)
13
    }
14
    if (image_alpha <= 0)
15
    {
16
        image_alpha = 0
17
        image_alpha_increase = (-image_alpha_increase)
18
    }
19
}
20
else
21
{
22
    image_alpha = 0
23
    image_alpha_increase = abs(image_alpha_increase)
24
}
25
x = obj_heart_battle_fighting_parent.x
26
y = obj_heart_battle_fighting_parent.y
27
image_angle = obj_heart_battle_fighting_parent.image_angle
28
switch obj_heart_battle_fighting_parent.sprite_index
29
{
30
    case spr_heart_yellow_left:
31
        if instance_exists(obj_heart_battle_fighting_axis)
32
            image_angle = -90 + obj_heart_battle_fighting_axis.image_angle
33
        else
34
            image_angle += 90
35
        break
36
    case 1664:
37
        image_angle -= 90
38
        break
39
    case 1662:
40
    case 2747:
41
    case 2466:
42
    case 2668:
43
    case 2739:
44
        image_angle -= 180
45
        break
46
}