Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_guardener_attack_7_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
switch scene
5
{
6
    case 0:
7
        var xx = choose((box.bbox_left + 40), (box.bbox_right - 40))
8
        var yy = choose((box.bbox_top + 40), (box.bbox_bottom - 40))
9
        if place_free(xx, yy)
10
        {
11
            gear_current = instance_create_depth(xx, yy, (obj_heart_battle_fighting_parent.depth - 10), obj_battle_enemy_attack_guardener_launcher_destroyable_fadein)
12
            cutscene_advance()
13
        }
14
        break
15
    case 1:
16
        cutscene_wait(0.25)
17
        break
18
    case 2:
19
        if (gear_current.y < box.y)
20
        {
21
            var launch_dir_new = "up"
22
            var dir_new = 180
23
            yy = box.bbox_bottom + 5
24
        }
25
        else
26
        {
27
            launch_dir_new = "down"
28
            dir_new = 0
29
            yy = box.bbox_top - 5
30
        }
31
        xx = gear_current.x
32
        var arm = instance_create_depth(xx, yy, (obj_heart_battle_fighting_parent.depth - 1), obj_battle_enemy_attack_guardener_arm)
33
        arm.launch_dir = launch_dir_new
34
        arm.image_angle = dir_new
35
        arm.arm_return = 10
36
        cutscene_advance()
37
        break
38
    case 3:
39
        if cutscene_wait(2)
40
        {
41
            attack_count -= 1
42
            if (attack_count > 0)
43
                cutscene_advance(0)
44
            else
45
                instance_destroy()
46
        }
47
        break
48
}