Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_martlet_package_Create_0

(view raw script w/o annotations or w/e)
1
damage_number = scr_determine_damage_number_enemy
scr_determine_damage_number_enemy

function scr_determine_damage_number_enemy(argument0, argument1, argument2) //gml_Script_scr_determine_damage_number_enemy { var enemy_count = global.enemy_count if (global.battle_enemy_name_1 == argument0) return 1; else if (enemy_count >= 2 && global.battle_enemy_name_2 == argument1) return 2; else if (enemy_count >= 3 && global.battle_enemy_name_3 == argument2) return 3; else return 0; }
("martlet", "void", "void")
2
if (!instance_exists(obj_martlet_body))
3
{
4
    angle_sway = 7
5
    fly_speed = irandom_range(5, 6)
6
    package_vsp = -10
7
    package_grav = 0.7
8
}
9
else
10
{
11
    angle_sway = 5
12
    fly_speed = irandom_range(4, 5)
13
    package_vsp = -9
14
    package_grav = 0.5
15
}
16
if (x > 320)
17
{
18
    fly_speed *= -1
19
    angle_sway *= -1
20
}
21
battle_box_bottom = obj_dialogue_box_battle_transformation_any.bbox_bottom - (sprite_get_height(sprite_index) - sprite_get_yoffset(sprite_index))
22
var warning_x = x
23
var warning_y = y
24
var warning_vsp = package_vsp
25
while (warning_y < battle_box_bottom)
26
{
27
    warning_vsp += package_grav
28
    warning_x += fly_speed
29
    warning_y += warning_vsp
30
}
31
instance_create(warning_x, (battle_box_bottom - 10), obj_battle_enemy_attack_martlet_package_warning)
32
can_move = false
33
fade_out = false
34
image_speed = 0
35
image_index = 0
36
image_alpha = 0