Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attacking_code_3_Alarm_1

(view raw script w/o annotations or w/e)
1
var attack_missed = false
2
if instance_exists(obj_text_damage_count)
3
{
4
    with (obj_text_damage_count)
5
        instance_destroy()
6
}
7
if instance_exists(obj_text_miss)
8
{
9
    attack_missed = true
10
    with (obj_text_miss)
11
        instance_destroy()
12
}
13
with (obj_target_bar_battle)
14
    instance_destroy()
15
if instance_exists(obj_battle_hp_enemy_attacking_parent)
16
{
17
    with (obj_battle_hp_enemy_attacking_parent)
18
        instance_destroy()
19
}
20
if (global.current_hp_enemy_3 < 0)
21
    global.current_hp_enemy_3 = 0
22
if (global.current_hp_enemy_3 == 0)
23
{
24
    var enemy_count = global.enemy_count
25
    global.enemy_dead_3 = true
26
    if (enemy_count == 3)
27
    {
28
        if ((global.enemy_dead == true || global.enemy_spared == true) && (global.enemy_dead_2 == true || global.enemy_spared_2 == true))
29
        {
30
            with (obj_battle_generator)
31
                audio_extend = false
32
            audio_stop_all()
33
            instance_create(0, 0, obj_dialogue_battle_win_enemy)
34
            audio_play_sound(snd_monster_damage_death, 20, false)
35
        }
36
        else
37
        {
38
            global.enemy_sparing_3 = false
39
            scr_determine_special_effect_enemy
scr_determine_special_effect_enemy

function scr_determine_special_effect_enemy(argument0) //gml_Script_scr_determine_special_effect_enemy { var battle_enemy_name = global.battle_enemy_name if (global.game_mode == "customs") { } else if (global.game_mode == "yellow") { switch battle_enemy_name { case "martlet pacifist": scr_enemy_mode_shift_martlet_pacifist(argument0) break case "martlet genocide": scr_enemy_mode_shift_martlet_genocide(argument0) break } } global.special_effect_end_value = argument0 }
("Fight 3")
40
            global.important_cutscene = script_execute(gml_Script_scr_determine_important_cutscene_attacking)
41
            global.can_attack = script_execute(gml_Script_scr_determine_can_attack_attacking)
42
            if (global.important_cutscene == false && global.can_attack == true)
43
                global.enemy_attacking = true
44
            if (global.can_attack == false)
45
            {
46
                with (obj_dialogue_box_battle)
47
                    no_loop_can_attack = false
48
            }
49
        }
50
    }
51
}
52
else
53
{
54
    if (!attack_missed)
55
        global.enemy_sparing_3 = false
56
    scr_determine_special_effect_enemy
scr_determine_special_effect_enemy

function scr_determine_special_effect_enemy(argument0) //gml_Script_scr_determine_special_effect_enemy { var battle_enemy_name = global.battle_enemy_name if (global.game_mode == "customs") { } else if (global.game_mode == "yellow") { switch battle_enemy_name { case "martlet pacifist": scr_enemy_mode_shift_martlet_pacifist(argument0) break case "martlet genocide": scr_enemy_mode_shift_martlet_genocide(argument0) break } } global.special_effect_end_value = argument0 }
("Fight 3")
57
    global.important_cutscene = script_execute(gml_Script_scr_determine_important_cutscene_attacking)
58
    global.can_attack = script_execute(gml_Script_scr_determine_can_attack_attacking)
59
    if (global.important_cutscene == false && global.can_attack == true)
60
        global.enemy_attacking = true
61
    if (global.can_attack == false)
62
    {
63
        with (obj_dialogue_box_battle)
64
            no_loop_can_attack = false
65
    }
66
}
67
instance_destroy()