Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_start_enemy_attacking_dunebud_duo

(view raw script w/o annotations or w/e)
1
function scr_start_enemy_attacking_dunebud_duo
scr_start_enemy_attacking_dunebud_duo

function scr_start_enemy_attacking_dunebud_duo() //gml_Script_scr_start_enemy_attacking_dunebud_duo { instance_create(319, 320, obj_dialogue_box_battle_transformation_any) var battle_menu_number = global.battle_menu_number var fight_number = global.fight_number var act_number = global.act_number var enemy_dead = global.enemy_dead var enemy_dead_2 = global.enemy_dead_2 var enemy_spared = global.enemy_spared var enemy_spared_2 = global.enemy_spared_2 end_loop = false if (battle_menu_number == 1) { if (fight_number == 1) { if (enemy_dead == false && enemy_spared == false && global.action_3_selected_count < 2) { instance_create(220, 132, obj_quote_bubble_battle_yellow_2) instance_create(0, 0, obj_quote_battle_dunebud_a) instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red) } else if (enemy_dead_2 == false && enemy_spared_2 == false) { instance_create(242, 132, obj_quote_bubble_battle_yellow_2_reverse) instance_create(0, 0, obj_quote_battle_dunebud_b) instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red) } } else if (fight_number == 2) { if (enemy_dead_2 == false && enemy_spared_2 == false && global.action_3_selected_count_2 < 2) { instance_create(242, 132, obj_quote_bubble_battle_yellow_2_reverse) instance_create(0, 0, obj_quote_battle_dunebud_b) instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red) } else if (enemy_dead == false && enemy_spared == false) { instance_create(220, 132, obj_quote_bubble_battle_yellow_2) instance_create(0, 0, obj_quote_battle_dunebud_a) instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red) } } } else if (battle_menu_number == 2) { if (act_number == 1 && global.action_3_selected_count >= 2) act_number = 2 if (act_number == 2 && global.action_3_selected_count_2 >= 2) act_number = 1 if (act_number == 1) { instance_create(220, 132, obj_quote_bubble_battle_yellow_2) instance_create(0, 0, obj_quote_battle_dunebud_a) } else if (act_number == 2) { instance_create(242, 132, obj_quote_bubble_battle_yellow_2_reverse) instance_create(0, 0, obj_quote_battle_dunebud_b) } instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red) } else { var random_number = irandom_range(1, 2) while (end_loop == false) { if (random_number == 1 && enemy_dead == false && enemy_spared == false) { instance_create(220, 132, obj_quote_bubble_battle_yellow_2) instance_create(0, 0, obj_quote_battle_dunebud_a) instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red) end_loop = true break } else if (random_number == 2 && enemy_dead_2 == false && enemy_spared_2 == false) { instance_create(242, 132, obj_quote_bubble_battle_yellow_2_reverse) instance_create(0, 0, obj_quote_battle_dunebud_b) instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red) end_loop = true break } else { if (random_number == 1) random_number = 2 else random_number = 1 continue } } } }
() //gml_Script_scr_start_enemy_attacking_dunebud_duo
2
{
3
    instance_create(319, 320, obj_dialogue_box_battle_transformation_any)
4
    var battle_menu_number = global.battle_menu_number
5
    var fight_number = global.fight_number
6
    var act_number = global.act_number
7
    var enemy_dead = global.enemy_dead
8
    var enemy_dead_2 = global.enemy_dead_2
9
    var enemy_spared = global.enemy_spared
10
    var enemy_spared_2 = global.enemy_spared_2
11
    end_loop = false
12
    if (battle_menu_number == 1)
13
    {
14
        if (fight_number == 1)
15
        {
16
            if (enemy_dead == false && enemy_spared == false && global.action_3_selected_count < 2)
17
            {
18
                instance_create(220, 132, obj_quote_bubble_battle_yellow_2)
19
                instance_create(0, 0, obj_quote_battle_dunebud_a)
20
                instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red)
21
            }
22
            else if (enemy_dead_2 == false && enemy_spared_2 == false)
23
            {
24
                instance_create(242, 132, obj_quote_bubble_battle_yellow_2_reverse)
25
                instance_create(0, 0, obj_quote_battle_dunebud_b)
26
                instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red)
27
            }
28
        }
29
        else if (fight_number == 2)
30
        {
31
            if (enemy_dead_2 == false && enemy_spared_2 == false && global.action_3_selected_count_2 < 2)
32
            {
33
                instance_create(242, 132, obj_quote_bubble_battle_yellow_2_reverse)
34
                instance_create(0, 0, obj_quote_battle_dunebud_b)
35
                instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red)
36
            }
37
            else if (enemy_dead == false && enemy_spared == false)
38
            {
39
                instance_create(220, 132, obj_quote_bubble_battle_yellow_2)
40
                instance_create(0, 0, obj_quote_battle_dunebud_a)
41
                instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red)
42
            }
43
        }
44
    }
45
    else if (battle_menu_number == 2)
46
    {
47
        if (act_number == 1 && global.action_3_selected_count >= 2)
48
            act_number = 2
49
        if (act_number == 2 && global.action_3_selected_count_2 >= 2)
50
            act_number = 1
51
        if (act_number == 1)
52
        {
53
            instance_create(220, 132, obj_quote_bubble_battle_yellow_2)
54
            instance_create(0, 0, obj_quote_battle_dunebud_a)
55
        }
56
        else if (act_number == 2)
57
        {
58
            instance_create(242, 132, obj_quote_bubble_battle_yellow_2_reverse)
59
            instance_create(0, 0, obj_quote_battle_dunebud_b)
60
        }
61
        instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red)
62
    }
63
    else
64
    {
65
        var random_number = irandom_range(1, 2)
66
        while (end_loop == false)
67
        {
68
            if (random_number == 1 && enemy_dead == false && enemy_spared == false)
69
            {
70
                instance_create(220, 132, obj_quote_bubble_battle_yellow_2)
71
                instance_create(0, 0, obj_quote_battle_dunebud_a)
72
                instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red)
73
                end_loop = true
74
                break
75
            }
76
            else if (random_number == 2 && enemy_dead_2 == false && enemy_spared_2 == false)
77
            {
78
                instance_create(242, 132, obj_quote_bubble_battle_yellow_2_reverse)
79
                instance_create(0, 0, obj_quote_battle_dunebud_b)
80
                instance_create(round(obj_dialogue_box_battle_transformation_any.bbox_left + (obj_dialogue_box_battle_transformation_any.bbox_right - obj_dialogue_box_battle_transformation_any.bbox_left) / 2), round(obj_dialogue_box_battle_transformation_any.bbox_top + (obj_dialogue_box_battle_transformation_any.bbox_bottom - obj_dialogue_box_battle_transformation_any.bbox_top) / 2), obj_heart_battle_fighting_red)
81
                end_loop = true
82
                break
83
            }
84
            else
85
            {
86
                if (random_number == 1)
87
                    random_number = 2
88
                else
89
                    random_number = 1
90
                continue
91
            }
92
        }
93
    }
94
}