Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_ceroba_shotgun_pacifist_checker_Alarm_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
var battle_box = 3154;
4
var battle_box_width = battle_box.sprite_width;
5
var bullet_width = 8;
6
var bullet_inc = battle_box_width / bullet_width;
7
var excl = irandom_range(1, (battle_box_width / bullet_inc) - 1);
8
do
9
    dir = choose("top", "bottom", "left", "right");
10
until (dir != dir_last);
11
dir_last = dir;
12
var j = 0;
13
var vsp = 0;
14
var hsp = 0;
15
for (var i = 16; i < (battle_box_width - 12); i += bullet_inc)
16
{
17
    j += 1;
18
    if (j != excl)
19
    {
20
        var xx, yy;
21
        switch (dir)
22
        {
23
            case "top":
24
                xx = battle_box.bbox_left + i;
25
                yy = battle_box.bbox_top - 20;
26
                vsp = 3;
27
                break;
28
            case "bottom":
29
                xx = battle_box.bbox_left + i;
30
                yy = battle_box.bbox_bottom + 20;
31
                vsp = -3;
32
                break;
33
            case "left":
34
                xx = battle_box.bbox_left - 20;
35
                yy = battle_box.bbox_top + i;
36
                hsp = 3;
37
                break;
38
            case "right":
39
                xx = battle_box.bbox_right + 20;
40
                yy = battle_box.bbox_top + i;
41
                hsp = -3;
42
                break;
43
        }
44
        show_debug_message(dir);
45
        var bullet = instance_create_depth(xx, yy, -100, obj_battle_enemy_attack_ceroba_flower_bullet_pacifist);
46
        bullet.vspeed = vsp;
47
        bullet.hspeed = hsp;
48
    }
49
}
50
alarm[0] = 35;
gml_Object_obj_battle_enemy_attack_ceroba_shotgun_pacifist_checker_Alarm_0.gml

if (live_call()) return global.live_result; var battle_box = 3154; var battle_box_width = battle_box.sprite_width; var bullet_width = 8; var bullet_inc = battle_box_width / bullet_width; var excl = irandom_range(1, (battle_box_width / bullet_inc) - 1); do dir = choose("top", "bottom", "left", "right"); until (dir != dir_last); dir_last = dir; var j = 0; var vsp = 0; var hsp = 0; for (var i = 16; i < (battle_box_width - 12); i += bullet_inc) { j += 1; if (j != excl) { var xx, yy; switch (dir) { case "top": xx = battle_box.bbox_left + i; yy = battle_box.bbox_top - 20; vsp = 3; break; case "bottom": xx = battle_box.bbox_left + i; yy = battle_box.bbox_bottom + 20; vsp = -3; break; case "left": xx = battle_box.bbox_left - 20; yy = battle_box.bbox_top + i; hsp = 3; break; case "right": xx = battle_box.bbox_right + 20; yy = battle_box.bbox_top + i; hsp = -3; break; } show_debug_message(dir); var bullet = instance_create_depth(xx, yy, -100, obj_battle_enemy_attack_ceroba_flower_bullet_pacifist); bullet.vspeed = vsp; bullet.hspeed = hsp; } } alarm[0] = 35;