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