Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_ceroba_body_pacifist_phase_1_Step_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
if (death_sprite == true && sprite_index != spr_ceroba_murder_death)
4
{
5
    sprite_index = spr_ceroba_murder_death;
6
    image_speed = 0.25;
7
    image_index = 0;
8
}
9
if (global.enemy_dead == true)
10
{
11
    instance_create(x - 46, y - 10, obj_ceroba_dead);
12
    instance_destroy();
13
    exit;
14
    image_alpha = 0.5;
15
}
16
if (sprite_index == spr_ceroba_phase_switch && image_index >= 17)
17
{
18
    audio_sound_gain(mus_some_point_of_no_return, 1, 0);
19
    audio_sound_pitch(mus_some_point_of_no_return, 1);
20
    audio_play_sound(mus_some_point_of_no_return, 20, true);
21
    obj_heart_battle_menu.image_alpha = 1;
22
    instance_create(0, 0, obj_dialogue_battle_move_select_intro);
23
    sprite_index = spr_ceroba_body;
24
    obj_ceroba_staff.image_alpha = 1;
25
    obj_ceroba_ponytail.image_alpha = 1;
26
    obj_ceroba_hand_left.image_alpha = 1;
27
    obj_ceroba_hand_right.image_alpha = 1;
28
    obj_ceroba_head.image_alpha = 1;
29
    image_speed = 0;
30
    anim_stretch_current = 1;
31
    anim_stage = 1;
32
    anim_inc_multiplier = 2;
33
    image_yscale = 1;
34
}
35
var anim_loop_time_half = anim_loop_time / 2;
36
var anim_inc_current = ((anim_stretch_max - 1) / anim_loop_time_half) * anim_inc_multiplier;
37
if (anim_stage == 1)
38
{
39
    anim_stretch_current += anim_inc_current;
40
    anim_inc_multiplier -= (anim_inc_multiplier_max / anim_loop_time_half);
41
    if (anim_stretch_current >= anim_stretch_max)
42
    {
43
        anim_stretch_current = anim_stretch_max;
44
        anim_stage = 2;
45
        anim_inc_multiplier = anim_inc_multiplier_max;
46
    }
47
}
48
if (anim_stage == 2)
49
{
50
    anim_stretch_current -= ((anim_stretch_max - 1) / anim_loop_time_half);
51
    anim_inc_multiplier -= (anim_inc_multiplier_max / anim_loop_time_half);
52
    if (anim_stretch_current <= 1)
53
    {
54
        anim_stretch_current = 1;
55
        anim_stage = 1;
56
        anim_inc_multiplier = anim_inc_multiplier_max;
57
    }
58
}
59
if (sprite_index == spr_ceroba_body)
60
    image_yscale = anim_stretch_current;
61
else
62
    image_yscale = 1;
63
obj_ceroba_head.y = y - (anim_head_offset * image_yscale);
64
obj_ceroba_hand_right.y = y - (anim_hand_right_offset * image_yscale);
65
obj_ceroba_hand_left.y = y - (anim_hand_left_offset * image_yscale);
66
obj_ceroba_staff.y = y - (anim_staff_offset * image_yscale);
67
obj_ceroba_ponytail.y = obj_ceroba_head.y - anim_ponytail_offset;
68
if (damage_disjoint_count > 0)
69
    damage_disjoint_count -= 1;
70
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
71
{
72
    damage_disjoint_count = 12;
73
    no_loop_damage_disjoint_count = true;
74
}
75
else if (!instance_exists(obj_text_damage_count))
76
{
77
    no_loop_damage_disjoint_count = false;
78
}
79
if (damage_disjoint_count == 12)
80
{
81
    damage_disjoint_x = -50;
82
}
83
else if (damage_disjoint_count == 10)
84
{
85
    damage_disjoint_x = 50;
86
}
87
else if (damage_disjoint_count == 8)
88
{
89
    damage_disjoint_x = -20;
90
}
91
else if (damage_disjoint_count == 6)
92
{
93
    damage_disjoint_x = 20;
94
}
95
else if (damage_disjoint_count == 4)
96
{
97
    damage_disjoint_x = -10;
98
}
99
else if (damage_disjoint_count == 2)
100
{
101
    damage_disjoint_x = 10;
102
}
103
else if (damage_disjoint_count == 0)
104
{
105
    damage_disjoint_x = 0;
106
    if (sprite_index == spr_ceroba_hurt)
107
        sprite_index = spr_ceroba_body;
108
}
109
if (damage_disjoint_count > 0)
110
{
111
    sprite_index = spr_ceroba_hurt;
112
    if (global.battle_phase == 2)
113
        sprite_index = spr_ceroba_hurt_phase_2;
114
    image_xscale = 1;
115
    image_yscale = 1;
116
}
117
x = starting_point_x + damage_disjoint_x;