Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_sweet_corn_husk_a_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 (enemy_dead == false && enemy_spared == false)
4
    image_alpha = global.image_alpha_enemy_attacking;
5
if (enemy_dead == true)
6
{
7
    x = starting_point_x;
8
    y = starting_point_y;
9
    image_xscale = starting_point_xscale;
10
    image_yscale = starting_point_yscale;
11
    instance_create(starting_point_x, starting_point_y, obj_sweet_corn_dead);
12
    instance_destroy();
13
    exit;
14
    image_alpha = 0.5;
15
}
16
else if (enemy_spared == true)
17
{
18
    sprite_index = spr_sweet_corn_spared;
19
    x = starting_point_x;
20
    y = starting_point_y;
21
    image_xscale = starting_point_xscale;
22
    image_yscale = starting_point_yscale;
23
    image_alpha = 0.5;
24
}
25
if (damage_disjoint_count > 0)
26
{
27
    damage_disjoint_count -= 1;
28
}
29
else if (enemy_dead == false && enemy_spared == false)
30
{
31
    if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy)
32
        sprite_index = spr_sweet_corn_husk_critical;
33
    else
34
        sprite_index = spr_sweet_corn_husk;
35
}
36
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
37
{
38
    time_elapsed = 11;
39
    sign_modifier = -1;
40
    damage_disjoint_count = 12;
41
    no_loop_damage_disjoint_count = true;
42
}
43
else if (!instance_exists(obj_text_damage_count))
44
{
45
    no_loop_damage_disjoint_count = false;
46
}
47
if (damage_disjoint_count == 12)
48
    damage_disjoint_x = -50;
49
else if (damage_disjoint_count == 10)
50
    damage_disjoint_x = 50;
51
else if (damage_disjoint_count == 8)
52
    damage_disjoint_x = -20;
53
else if (damage_disjoint_count == 6)
54
    damage_disjoint_x = 20;
55
else if (damage_disjoint_count == 4)
56
    damage_disjoint_x = -10;
57
else if (damage_disjoint_count == 2)
58
    damage_disjoint_x = 10;
59
else if (damage_disjoint_count == 0)
60
    damage_disjoint_x = 0;
61
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0)
62
    sprite_index = spr_sweet_corn_dead;
63
x = draw_position_x + damage_disjoint_x;
64
y = draw_position_y + damage_disjoint_y;
65
image_xscale = starting_point_xscale;
66
image_yscale = starting_point_yscale;
67
if (!(instance_exists(obj_text_damage_count) && global.fight_number == 1) && enemy_dead == false && enemy_spared == false)
68
{
69
    game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
70
    animation_disjoint = sign_modifier * (max_rise - round(game_maker_cannot_do_math));
71
    time_elapsed += time_increase;
72
    if (time_elapsed >= time_max)
73
        time_elapsed = 0;
74
    image_xscale = starting_point_xscale + (animation_disjoint / image_alpha_divider);
75
    image_yscale = 1 / image_xscale;
76
}