Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_jg_1_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
var box = obj_dialogue_box_battle_transformation_any
4
audio_listener_position(audio_pos_x_current, 0, 0)
5
switch audio_pos
6
{
7
    case "left":
8
        audio_pos_x = -300
9
        break
10
    case "middle":
11
        audio_pos_x = 0
12
        break
13
    case "right":
14
        audio_pos_x = 300
15
        break
16
}
17
18
attack_duration = 60
19
spawn_offset_x_max = 40
20
audio_pos_x_current = lerp(audio_pos_x_current, audio_pos_x, 0.1)
21
spawn_interval_max = 2
22
if (spawn_notes == true)
23
{
24
    switch audio_pos
25
    {
26
        case "left":
27
            var xx = 290
28
            break
29
        case "right":
30
            xx = 340
31
            break
32
    }
33
34
    if (spawn_interval > 0)
35
        spawn_interval--
36
    else
37
    {
38
        instance_create_depth((xx + spawn_offset_x), (box.bbox_bottom + 10), (obj_heart_battle_fighting_red.depth - 1), obj_battle_enemy_attack_goosic_speaker_note)
39
        spawn_interval = spawn_interval_max
40
        spawn_offset_x += (spawn_offset_x_inc * spawn_offset_dir)
41
        if (spawn_offset_x >= spawn_offset_x_max || spawn_offset_x <= (-spawn_offset_x_max))
42
        {
43
            spawn_offset_dir *= -1
44
            spawn_offset_x += (spawn_offset_x_inc * spawn_offset_dir * 2)
45
        }
46
    }
47
}