Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_axis_energy_ball_boss_red_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
var battle_box = obj_dialogue_box_battle_transformation_any
4
var destroy_check = false
5
switch scene
6
{
7
    case 0:
8
        image_xscale = lerp(image_xscale, 2, 0.05)
9
        image_yscale = lerp(image_yscale, 2, 0.05)
10
        if (image_xscale > 1.99)
11
        {
12
            image_xscale = 2
13
            image_yscale = 2
14
            scene++
15
        }
16
        break
17
    case 1:
18
        instance_create_depth(x, y, (depth - 1), obj_battle_enemy_attack_axis_red_warning)
19
        image_xscale = 2.5
20
        image_yscale = 2.5
21
        scene++
22
        break
23
    case 2:
24
        image_xscale = lerp(image_xscale, 2, 0.15)
25
        image_yscale = lerp(image_yscale, 2, 0.15)
26
        cutscene_wait(throw_delay)
27
        break
28
    case 3:
29
        obj_axis_body.sprite_index = spr_axis_body_charge_release
30
        obj_axis_body.image_index = 0
31
        direction = point_direction(x, y, obj_heart_battle_fighting_parent.x, obj_heart_battle_fighting_parent.y)
32
        speed = launch_speed
33
        is_active = true
34
        scene++
35
        break
36
    case 4:
37
        break
38
}
39
40
if (!is_active)
41
    return;
42
if (place_meeting(x, y, obj_battle_enemy_attack_axis_shield) && deflect_noloop == false)
43
{
44
    obj_battle_enemy_attack_axis_shield.shield_hit = true
45
    var dir_add = point_direction(obj_battle_enemy_attack_axis_shield.x, (obj_battle_enemy_attack_axis_shield.y + 10), x, y)
46
    var dir_base = obj_battle_enemy_attack_axis_shield.direction
47
    direction = dir_add
48
    speed *= 1.2
49
    deflect_noloop = true
50
    is_deflected = true
51
}
52
if (place_meeting(x, y, obj_axis_body) && is_deflected == true)
53
{
54
    if (!obj_battlebox_controller_axis.shield_enabled)
55
    {
56
        instance_destroy()
57
        audio_play_sound(snd_monster_damage_hit, 1, 0)
58
        obj_axis_body.axis_damaged_act = true
59
        obj_battlebox_controller_axis.axis_trash_meter = 0
60
        obj_battlebox_controller_axis.axis_hit_count_current -= 1
61
        global.special_action_count += 1
62
        global.enemy_mode += 1
63
        global.attack_repeat = 0
64
        with (obj_axis_attack_controller_parent)
65
            instance_destroy()
66
    }
67
    else
68
    {
69
        instance_destroy()
70
        audio_play_sound(snd_pickaxe_ding, 1, 0)
71
    }
72
}
73
var col_generator = instance_place(x, y, obj_battle_enemy_axis_generator)
74
if (col_generator != noone && is_deflected == true)
75
{
76
    instance_destroy()
77
    instance_destroy(col_generator)
78
    obj_battlebox_controller_axis.axis_trash_meter = 0
79
    obj_battlebox_controller_axis.axis_hit_count_current -= 1
80
    audio_play_sound(snd_monster_damage_hit, 1, 0)
81
    obj_axis_body.axis_damaged_act = true
82
    global.special_action_count += 1
83
    global.enemy_mode += 1
84
    global.attack_repeat = 0
85
    with (obj_axis_attack_controller_parent)
86
        instance_destroy()
87
}
88
var hurt_player = false
89
if (obj_heart_battle_fighting_axis.movement_mode == 1)
90
{
91
    if (bbox_bottom >= battle_box.bbox_bottom)
92
        hurt_player = true
93
}
94
else if collision_rectangle((battle_box.x - 5), (battle_box.y - 5), (battle_box.x + 5), (battle_box.y + 5), id, false, false)
95
    hurt_player = true
96
if hurt_player
97
{
98
    instance_destroy(self, false)
99
    instance_create_depth(320, 320, -100, obj_battle_enemy_attack_axis_energy_ball_explosion)
100
}