Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_violetta_body_Step_0

(view raw script w/o annotations or w/e)
1
var enemy_dead = global.enemy_dead;
2
var enemy_spared = global.enemy_spared;
3
if (damage_disjoint_count > 0)
4
    damage_disjoint_count -= 1;
5
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
6
{
7
    damage_disjoint_count = 12;
8
    no_loop_damage_disjoint_count = true;
9
    audio_play_sound(enemy_hurt_noise, 1, 0, 1, 0, enemy_hurt_pitch);
10
}
11
else if (!instance_exists(obj_text_damage_count))
12
{
13
    no_loop_damage_disjoint_count = false;
14
}
15
if (damage_disjoint_count == 12)
16
    damage_disjoint_x = -50;
17
else if (damage_disjoint_count == 10)
18
    damage_disjoint_x = 50;
19
else if (damage_disjoint_count == 8)
20
    damage_disjoint_x = -20;
21
else if (damage_disjoint_count == 6)
22
    damage_disjoint_x = 20;
23
else if (damage_disjoint_count == 4)
24
    damage_disjoint_x = -10;
25
else if (damage_disjoint_count == 2)
26
    damage_disjoint_x = 10;
27
else if (damage_disjoint_count == 0)
28
    damage_disjoint_x = 0;
29
x = starting_point_x + damage_disjoint_x;
30
if (enemy_dead == true)
31
{
32
    x = starting_point_x;
33
    y = starting_point_y;
34
    image_xscale = 1;
35
    image_yscale = 1;
36
    instance_create(starting_point_x, starting_point_y, obj_flowergirls_dead);
37
    instance_destroy();
38
    instance_destroy(obj_violetta_head);
39
    instance_destroy(obj_violetta_hands);
40
    exit;
41
    image_alpha = 0.5;
42
}
43
else if (enemy_spared == true)
44
{
45
    sprite_index = spr_violetta_spared;
46
    instance_destroy(obj_violetta_head);
47
    instance_destroy(obj_violetta_hands);
48
    x = starting_point_x;
49
    y = starting_point_y;
50
    image_xscale = 1;
51
    image_yscale = 1;
52
    image_speed = 0;
53
    image_index = 0;
54
    image_alpha = 0.5;
55
    if (no_loop_create_clouds == false)
56
    {
57
        for (i = 0; i <= 11; i += 1)
58
            instance_create(x, y - 22, obj_spare_cloud);
59
    }
60
    no_loop_create_clouds = true;
61
}
62
if (!enemy_dead && !enemy_spared)
63
{
64
    var anim_loop_time_half = anim_loop_time / 2;
65
    var anim_inc_current = ((anim_stretch_max - 1) / anim_loop_time_half) * anim_inc_multiplier;
66
    if (anim_stage == 1)
67
    {
68
        anim_stretch_current += anim_inc_current;
69
        anim_inc_multiplier -= (anim_inc_multiplier_max / anim_loop_time_half);
70
        if (anim_stretch_current >= anim_stretch_max)
71
        {
72
            anim_stretch_current = anim_stretch_max;
73
            anim_stage = 2;
74
            anim_inc_multiplier = anim_inc_multiplier_max;
75
        }
76
    }
77
    if (anim_stage == 2)
78
    {
79
        anim_stretch_current -= ((anim_stretch_max - 1) / anim_loop_time_half);
80
        anim_inc_multiplier -= (anim_inc_multiplier_max / anim_loop_time_half);
81
        if (anim_stretch_current <= 1)
82
        {
83
            anim_stretch_current = 1;
84
            anim_stage = 1;
85
            anim_inc_multiplier = anim_inc_multiplier_max;
86
        }
87
    }
88
    image_yscale = anim_stretch_current;
89
    obj_violetta_head.y = y - (anim_head_offset * image_yscale);
90
    obj_violetta_hands.y = y - (anim_hands_offset * image_yscale);
91
    obj_violetta_head.x = obj_violetta_head.xstart + damage_disjoint_x;
92
    obj_violetta_hands.x = obj_violetta_hands.xstart + damage_disjoint_x;
93
    if (damage_disjoint_x != 0)
94
        obj_violetta_head.sprite_index = spr_violet_head_hurt;
95
    else if (global.enemy_low_hp)
96
        obj_violetta_head.sprite_index = spr_violet_head_lowhp;
97
    else
98
        obj_violetta_head.sprite_index = spr_violet_head;
99
}