Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_martlet_feather_spiral_target_2_axis_Alarm_1

(view raw script w/o annotations or w/e)
1
var random_number = irandom_range(1, 5)
2
switch random_number
3
{
4
    case 1:
5
        feather_sprite = spr_battle_enemy_attack_martlet_feather_1
6
        break
7
    case 2:
8
        feather_sprite = spr_battle_enemy_attack_martlet_feather_2
9
        break
10
    case 3:
11
        feather_sprite = spr_battle_enemy_attack_martlet_feather_3
12
        break
13
    case 4:
14
        feather_sprite = spr_battle_enemy_attack_martlet_feather_4
15
        break
16
    case 5:
17
        feather_sprite = spr_battle_enemy_attack_martlet_feather_5
18
        break
19
    default:
20
        feather_sprite = spr_battle_enemy_attack_martlet_feather_1
21
}
22
23
for (i = 0; i < fcreate_count; i += 1)
24
{
25
    var fcreate_x = x + feather_radius * cos(degtorad(fcreate_angle_diff))
26
    var fcreate_y = y - feather_radius * sin(degtorad(fcreate_angle_diff))
27
    global.id_store = id
28
    instance_create(fcreate_x, fcreate_y, obj_battle_enemy_attack_martlet_feather_spiral_feather)
29
    id_feather[i] = global.id_store
30
    with (id_feather[i])
31
    {
32
        sprite_index = id_target.feather_sprite
33
        image_index = 0
34
        image_speed = 0
35
        image_angle = id_target.fcreate_angle_diff
36
        trail_sprite = sprite_index
37
    }
38
    fcreate_angle_diff -= fcreate_decrease
39
    if (fcreate_angle_diff < 0)
40
        fcreate_angle_diff += 360
41
}
42
can_spiral = true
43
switch feather_sprite
44
{
45
    case spr_battle_enemy_attack_martlet_feather_1:
46
    case 2274:
47
    case 2275:
48
        audio_play_sound(snd_mart_spiral_attack_2, 20, 0)
49
        break
50
    case 2276:
51
    case 2278:
52
        audio_play_sound(snd_mart_spiral_attack_1, 20, 0)
53
        break
54
    default:
55
        audio_play_sound(snd_mart_spiral_attack_1, 20, 0)
56
}