Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_enemy_timer_attacks_dalv

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

function scr_enemy_timer_attacks_dalv() //gml_Script_scr_enemy_timer_attacks_dalv { var enemy_attack = global.enemy_attack if (instance_exists(obj_dialogue_box_battle_transformation_any) && obj_heart_battle_fighting_parent.moveable == true) { if (enemy_attack == "Dalv Lightning Vertical") { script_execute(gml_Script_scr_enemy_attack_dalv_lightning_vertical) if (global.attack_counter >= 0) { global.attack_counter -= 1 if (global.attack_counter < 0) global.attack_counter = global.attack_counter_max } } else if (enemy_attack == "Dalv Lightning Dual") { script_execute(gml_Script_scr_enemy_attack_dalv_lightning_dual) if (global.attack_counter >= 0) { global.attack_counter -= 1 if (global.attack_counter < 0) global.attack_counter = global.attack_counter_max } } else if (enemy_attack == "Dalv Lightning Balls") { script_execute(gml_Script_scr_enemy_attack_dalv_lightning_balls) if (global.attack_counter >= 0) { global.attack_counter -= 1 if (global.attack_counter < 0) global.attack_counter = global.attack_counter_max } } else if (enemy_attack == "Dalv Lightning Shift" && (!instance_exists(obj_battle_enemy_attack_dalv_lightning_shift_main))) 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)) + 1), 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_battle_enemy_attack_dalv_lightning_shift_main) else if (enemy_attack == "Dalv Lightning Spinner" && (!instance_exists(obj_battle_enemy_attack_dalv_lightning_spinner))) 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_battle_enemy_attack_dalv_lightning_spinner) else if (enemy_attack == "Dalv Lightning Bolt") { with (obj_dalv_body) { if (cloak_direction == 0) cloak_direction = 1 } if ((!instance_exists(obj_battle_enemy_attack_dalv_lightning_bolt)) && obj_dalv_body.cloak_out == true) script_execute(gml_Script_scr_enemy_attack_dalv_lightning_bolt) } } }
() //gml_Script_scr_enemy_timer_attacks_dalv
2
{
3
    var enemy_attack = global.enemy_attack
4
    if (instance_exists(obj_dialogue_box_battle_transformation_any) && obj_heart_battle_fighting_parent.moveable == true)
5
    {
6
        if (enemy_attack == "Dalv Lightning Vertical")
7
        {
8
            script_execute(gml_Script_scr_enemy_attack_dalv_lightning_vertical)
9
            if (global.attack_counter >= 0)
10
            {
11
                global.attack_counter -= 1
12
                if (global.attack_counter < 0)
13
                    global.attack_counter = global.attack_counter_max
14
            }
15
        }
16
        else if (enemy_attack == "Dalv Lightning Dual")
17
        {
18
            script_execute(gml_Script_scr_enemy_attack_dalv_lightning_dual)
19
            if (global.attack_counter >= 0)
20
            {
21
                global.attack_counter -= 1
22
                if (global.attack_counter < 0)
23
                    global.attack_counter = global.attack_counter_max
24
            }
25
        }
26
        else if (enemy_attack == "Dalv Lightning Balls")
27
        {
28
            script_execute(gml_Script_scr_enemy_attack_dalv_lightning_balls)
29
            if (global.attack_counter >= 0)
30
            {
31
                global.attack_counter -= 1
32
                if (global.attack_counter < 0)
33
                    global.attack_counter = global.attack_counter_max
34
            }
35
        }
36
        else if (enemy_attack == "Dalv Lightning Shift" && (!instance_exists(obj_battle_enemy_attack_dalv_lightning_shift_main)))
37
            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)) + 1), 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_battle_enemy_attack_dalv_lightning_shift_main)
38
        else if (enemy_attack == "Dalv Lightning Spinner" && (!instance_exists(obj_battle_enemy_attack_dalv_lightning_spinner)))
39
            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_battle_enemy_attack_dalv_lightning_spinner)
40
        else if (enemy_attack == "Dalv Lightning Bolt")
41
        {
42
            with (obj_dalv_body)
43
            {
44
                if (cloak_direction == 0)
45
                    cloak_direction = 1
46
            }
47
            if ((!instance_exists(obj_battle_enemy_attack_dalv_lightning_bolt)) && obj_dalv_body.cloak_out == true)
48
                script_execute(gml_Script_scr_enemy_attack_dalv_lightning_bolt)
49
        }
50
    }
51
}