Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_enemy_timer_attacks_sweet_corn_duo

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

function scr_enemy_timer_attacks_sweet_corn_duo() //gml_Script_scr_enemy_timer_attacks_sweet_corn_duo { var enemy_attack = global.enemy_attack if (instance_exists(obj_dialogue_box_battle_transformation_any) && enemy_attack == "Candy Spear Corn" && obj_heart_battle_fighting_parent.moveable == true) { script_execute(gml_Script_scr_enemy_attack_candy_spear_corn) if (global.attack_counter >= 0) { global.attack_counter -= 1 if (global.attack_counter < 0) global.attack_counter = global.attack_counter_max } if ((!instance_exists(obj_battle_enemy_attack_spear_corn)) && (!instance_exists(obj_battle_enemy_attack_spear_corn_warning))) instance_create(obj_heart_battle_fighting_parent.x, (obj_dialogue_box_battle_transformation_any.bbox_bottom - 5), obj_battle_enemy_attack_spear_corn_warning) } else if (instance_exists(obj_dialogue_box_battle_transformation_any) && enemy_attack == "Homing Spear Corn" && obj_heart_battle_fighting_parent.moveable == true) { if (!instance_exists(obj_battle_enemy_attack_homing_corn)) 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), (obj_dialogue_box_battle_transformation_any.bbox_top - 20), obj_battle_enemy_attack_homing_corn) if ((!instance_exists(obj_battle_enemy_attack_spear_corn)) && (!instance_exists(obj_battle_enemy_attack_spear_corn_warning))) instance_create(obj_heart_battle_fighting_parent.x, (obj_dialogue_box_battle_transformation_any.bbox_bottom - 5), obj_battle_enemy_attack_spear_corn_warning) } else if (instance_exists(obj_dialogue_box_battle_transformation_any) && (enemy_attack == "Candy Corn" || enemy_attack == "Spear Corn" || enemy_attack == "Homing Corn") && obj_heart_battle_fighting_parent.moveable == true) script_execute(gml_Script_scr_enemy_timer_attacks_sweet_corn_solo) }
() //gml_Script_scr_enemy_timer_attacks_sweet_corn_duo
2
{
3
    var enemy_attack = global.enemy_attack
4
    if (instance_exists(obj_dialogue_box_battle_transformation_any) && enemy_attack == "Candy Spear Corn" && obj_heart_battle_fighting_parent.moveable == true)
5
    {
6
        script_execute(gml_Script_scr_enemy_attack_candy_spear_corn)
7
        if (global.attack_counter >= 0)
8
        {
9
            global.attack_counter -= 1
10
            if (global.attack_counter < 0)
11
                global.attack_counter = global.attack_counter_max
12
        }
13
        if ((!instance_exists(obj_battle_enemy_attack_spear_corn)) && (!instance_exists(obj_battle_enemy_attack_spear_corn_warning)))
14
            instance_create(obj_heart_battle_fighting_parent.x, (obj_dialogue_box_battle_transformation_any.bbox_bottom - 5), obj_battle_enemy_attack_spear_corn_warning)
15
    }
16
    else if (instance_exists(obj_dialogue_box_battle_transformation_any) && enemy_attack == "Homing Spear Corn" && obj_heart_battle_fighting_parent.moveable == true)
17
    {
18
        if (!instance_exists(obj_battle_enemy_attack_homing_corn))
19
            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), (obj_dialogue_box_battle_transformation_any.bbox_top - 20), obj_battle_enemy_attack_homing_corn)
20
        if ((!instance_exists(obj_battle_enemy_attack_spear_corn)) && (!instance_exists(obj_battle_enemy_attack_spear_corn_warning)))
21
            instance_create(obj_heart_battle_fighting_parent.x, (obj_dialogue_box_battle_transformation_any.bbox_bottom - 5), obj_battle_enemy_attack_spear_corn_warning)
22
    }
23
    else if (instance_exists(obj_dialogue_box_battle_transformation_any) && (enemy_attack == "Candy Corn" || enemy_attack == "Spear Corn" || enemy_attack == "Homing Corn") && obj_heart_battle_fighting_parent.moveable == true)
24
        script_execute(gml_Script_scr_enemy_timer_attacks_sweet_corn_solo)
25
}