Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_ceroba_transformation_mask_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
if mask_is_vulnerable
4
{
5
    var x_target = obj_ceroba_body_pacifist_phase_2.x - sprite_get_xoffset(obj_ceroba_body_pacifist_phase_2.sprite_index) + 330
6
    var y_target = obj_ceroba_body_pacifist_phase_2.y - sprite_get_yoffset(obj_ceroba_body_pacifist_phase_2.sprite_index) + 259
7
    x = x_target
8
    y = y_target
9
    var collider_id = instance_place(x, y, obj_heart_yellow_shot)
10
    if (collider_id != noone)
11
    {
12
        audio_play_sound(snd_arc_hit, 1, 0)
13
        x += random_range(-2, 2)
14
        y += random_range(-2, 2)
15
        instance_create_depth(collider_id.x, (collider_id.y - collider_id.sprite_height), -999, obj_heart_yellow_shot_destroy)
16
        bullet_hit_draw_timer = 5
17
        if (collider_id.object_index == obj_heart_yellow_shot_big)
18
            mask_hit_points -= 3
19
        else
20
            mask_hit_points -= 1
21
        instance_destroy(collider_id)
22
        var xp = x
23
        var yp = y
24
        part_emitter_region(mask_ps, mask_pe_effect_1, (xp - 1), (xp + 1), (yp - 1), (yp + 1), 0, 0)
25
        part_emitter_burst(mask_ps, mask_pe_effect_1, mask_pt_effect_1, 4)
26
        if (mask_hit_points <= 0)
27
        {
28
            if (global.hotland_flag[2] < 3)
29
            {
30
                audio_play_sound(snd_rock_break, 1, 0)
31
                scr_screenshake_battle
scr_screenshake_battle

function scr_screenshake_battle() //gml_Script_scr_screenshake_battle { instance_destroy(obj_screenshake_battle) var screenshake = instance_create(0, 0, obj_screenshake_battle) battle_screenshake_duration = argument[0] battle_screenshake_intensity = argument[1] battle_screenshake_dec = battle_screenshake_intensity / battle_screenshake_duration }
(6, 2)
32
                if (global.hotland_flag[2] == 1)
33
                    sprite_index = spr_ceroba_mask_2
34
                if (global.hotland_flag[2] == 2)
35
                    sprite_index = spr_ceroba_mask_3
36
                mask_new = instance_create_depth(x_target, y_target, depth, obj_ceroba_mask_overworld_transition)
37
                mask_new.sprite_index = sprite_index
38
                part_emitter_burst(mask_ps, mask_pe_effect_1, mask_pt_effect_1, 6)
39
                instance_destroy()
40
            }
41
            else
42
                instance_create_depth(x, y, depth, obj_battle_enemy_ceroba_phase_2_outro)
43
        }
44
    }
45
    audio_sound_gain(global.battle_music, (mask_hit_points / mask_hit_points_max), 500)
46
    if variable_instance_exists(id, "bullet_hit_draw_timer")
47
    {
48
        if (bullet_hit_draw_timer > 0)
49
            bullet_hit_draw_timer -= 1
50
    }
51
    return;
52
}
53
if instance_exists(obj_ceroba_body_pacifist_phase_1)
54
{
55
    switch obj_ceroba_body_pacifist_phase_1.sprite_index
56
    {
57
        case spr_ceroba_transformation_p1_7:
58
            attach_points = [[-400, -400], [148, 114], [149, 110], [149, 106], [148, 140], [147, 146], [147, 150], [147, 146], [147, 150], [147, 150], [147, 146], [147, 150], [147, 150], [147, 146], [147, 150], [147, 150], [147, 146], [147, 150], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [145, 86], [145, 86], [145, 86], [145, 86], [145, 86], [145, 84], [145, 84], [145, 82]]
59
            scr_point_attach
scr_point_attach

function scr_point_attach() //gml_Script_scr_point_attach { if live_call() return global.live_result; var coords = argument[0] var target_instance = argument[1] if (!instance_exists(target_instance)) { show_debug_message("Target attach point instance does not exist!") return false; } var x_offset = sprite_get_xoffset(target_instance.sprite_index) var y_offset = sprite_get_yoffset(target_instance.sprite_index) if (argument_count > 2 && argument[2] == true) { x_offset = 0 y_offset = 0 } var array_index = clamp(target_instance.image_index, 0, (array_length(coords) - 1)) x = target_instance.x - x_offset + coords[array_index][0] y = target_instance.y - y_offset + coords[array_index][1] }
(attach_points, 773)
60
            break
61
        default:
62
            break
63
    }
64
65
}
66
if instance_exists(obj_ceroba_body_pacifist_phase_2)
67
{
68
    switch obj_ceroba_body_pacifist_phase_2.sprite_index
69
    {
70
        case spr_ceroba_p2_1:
71
            return;
72
        case -4:
73
            attach_points = [[-1, -174]]
74
            break
75
        case 2828:
76
            attach_points = [[321, 167], [321, 167], [321, 163], [321, 147], [321, 155], [323, 173], [323, 181], [323, 181], [323, 179], [323, 177], [323, 173], [323, 171], [321, 169]]
77
            break
78
        case 986:
79
            attach_points = [[-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [330, 265], [330, 271], [330, 264], [330, 261], [330, 259]]
80
            break
81
        case 3514:
82
            attach_points = [[330, 259]]
83
            break
84
        case 2823:
85
            if (obj_ceroba_body_pacifist_phase_2.image_index > 40)
86
                sprite_index = spr_ceroba_mask_2
87
            attach_points = [[330, 259], [330, 259], [330, 259], [330, 259], [330, 259], [330, 259], [330, 259], [334, 253], [335, 253], [333, 253], [333, 253], [329, 267], [330, 263], [330, 261], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [329, 271], [329, 283], [-400, -400]]
88
            break
89
        default:
90
            attach_points = [[-4000, -4000]]
91
            break
92
    }
93
94
    scr_point_attach
scr_point_attach

function scr_point_attach() //gml_Script_scr_point_attach { if live_call() return global.live_result; var coords = argument[0] var target_instance = argument[1] if (!instance_exists(target_instance)) { show_debug_message("Target attach point instance does not exist!") return false; } var x_offset = sprite_get_xoffset(target_instance.sprite_index) var y_offset = sprite_get_yoffset(target_instance.sprite_index) if (argument_count > 2 && argument[2] == true) { x_offset = 0 y_offset = 0 } var array_index = clamp(target_instance.image_index, 0, (array_length(coords) - 1)) x = target_instance.x - x_offset + coords[array_index][0] y = target_instance.y - y_offset + coords[array_index][1] }
(attach_points, 2833)
95
}