Undertale script viewer

← back to main script listing

gml_Object_obj_lastbeam_Draw_0

(view raw script w/o annotations or w/e)
1
timer += 1;
2
siner += 1;
3
col = make_color_hsv(siner * 11, 190, 250);
4
col2 = make_color_hsv((siner + 3) * 11, 190, 250);
5
col3 = make_color_hsv((siner + 5) * 11, 140, 250);
6
if (timer == beamtime)
7
{
8
    hits = 0;
9
    alarm[5] = 1;
gml_Object_obj_lastbeam_Alarm_5.gml

snd_play(snd_hurt1); if (instance_exists(obj_shaker) == 0) instance_create(0, 0, obj_shaker); if (hits == 0) global.hp = 1; if (hits == 1) global.hp = 1; if (hits == 2) global.hp = 0.9; if (hits == 3) global.hp = 0.5; if (hits == 4) global.hp = 0.1; if (hits == 5) global.hp = 0.01; if (hits == 6) global.flag[509 decimal_hp_state] = 1; if (hits == 7) global.flag[509 decimal_hp_state] = 2; if (hits == 8) global.flag[509 decimal_hp_state] = 3; if (hits == 9) global.flag[509 decimal_hp_state] = 4; hits += 1; alarm[5] = 40;
10
    obj_btparent.depth = -2000;
11
    depth = -1000;
12
    obj_heart.depth = -2100;
13
    shaken = 0;
14
    menu[0] = 751;
15
    menux[0] = obj_fightbt.x;
16
    menuy[0] = obj_fightbt.y;
17
    menu[1] = 753;
18
    menux[1] = obj_itembt.x;
19
    menuy[1] = obj_itembt.y;
20
    menu[2] = 755;
21
    menux[2] = obj_sparebt.x;
22
    menuy[2] = obj_sparebt.y;
23
    svol1 = 0.8;
24
    svol2 = 0;
25
    s1 = caster_play(beamsfx, svol1, 1);
26
    s2 = caster_loop(beamsfx2, 1, 1);
27
    ar = 0.7;
28
    bw = 60;
29
    if (range == 1)
30
        bw = 220;
31
    if (range == 2)
32
        bw = 120;
33
    mbw = bw;
34
    bw = 0;
35
}
36
if (timer > beamtime)
37
{
38
    if (timer < (beamtime + 6))
39
        bw += (mbw / 5);
40
    if (bw > 0)
41
    {
42
        if (svol2 < 0.8)
43
            svol2 += 0.05;
44
        caster_set_volume(s2, svol2);
45
        ob = sin(siner / 2) * (mbw / 5) * (bw / mbw);
46
        draw_set_alpha(ar);
47
        if (home == 0)
48
        {
49
            draw_triangle_color(x, y, x + bw + ob, room_height + 10, x - bw - ob, room_height + 10, col, col2, col2, 0);
50
            draw_triangle_color(x, y, x + bw + (ob / 2), room_height + 10, x - bw - (ob / 2), room_height + 10, col, col2, col2, 0);
51
            draw_triangle_color(x, y, (x + bw) - ob, room_height + 10, (x - bw) + ob, room_height + 10, col, col3, col3, 0);
52
            draw_sprite_ext(spr_beamcircle, 0, x, y, (7 + (sin(siner / 2) * 3.75)) * (bw / mbw), (7 + (sin(siner / 2) * 3.75)) * (bw / mbw), 0, col, ar);
53
            draw_sprite_ext(spr_beamcircle, 0, x, y, (6 + (sin(siner / 2) * 2.5)) * (bw / mbw), (6 + (sin(siner / 2) * 2.5)) * (bw / mbw), 0, col, ar);
54
            draw_sprite_ext(spr_beamcircle, 0, x, y, (5 + sin(siner / 2)) * (bw / mbw), (5 + sin(siner / 2)) * (bw / mbw), 0, col2, ar);
55
        }
56
        if (home == 1)
57
        {
58
            targetx = mouse_x;
59
            targety = mouse_y;
60
            tt = lengthdir_x(600, point_direction(x, y, targetx, targety));
61
            tt2 = lengthdir_y(600, point_direction(x, y, targetx, targety));
62
            draw_line_width_color(x, y, x + tt, y + tt2, bw + (ob * 2), col, col2);
63
            draw_line_width_color(x, y, x + tt, y + tt2, bw + ob, col, col2);
64
            draw_line_width_color(x, y, x + tt, y + tt2, bw, col, col3);
65
            factor = mbw / 60;
66
            draw_sprite_ext(spr_beamcircle, 0, x, y, (7 + (sin(siner / 2) * 3)) * (bw / mbw) * factor, (7 + (sin(siner / 2) * 3)) * (bw / mbw) * factor, 0, col, ar);
67
            draw_sprite_ext(spr_beamcircle, 0, x, y, (6 + (sin(siner / 2) * 2)) * (bw / mbw) * factor, (6 + (sin(siner / 2) * 2)) * (bw / mbw) * factor, 0, col, ar);
68
            draw_sprite_ext(spr_beamcircle, 0, x, y, (5 + sin(siner / 2)) * (bw / mbw) * factor, (5 + sin(siner / 2)) * (bw / mbw) * factor, 0, col2, ar);
69
        }
70
        if (last > 0 && timer == 120)
71
        {
72
            shaken = 1;
73
            bw += 100;
74
            mbw += 80;
75
            caster_set_pitch(s2, 1.3);
76
            blcon = instance_create(400, 50, obj_blconwdflowey);
77
            global.msc = 0;
78
            global.msg[0] = 
STOP IT!!
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_lastbeam_230")
;
79
            global.typer = 88;
80
            blconwd = instance_create(blcon.x + 25, blcon.y + 10, OBJ_NOMSCWRITER);
81
            blcon.depth = -2000;
82
            blconwd.depth = -2200;
83
        }
84
        if (timer == 190 || timer == 340)
85
        {
86
            if (last > 0)
87
            {
88
                with (blcon)
89
                    instance_destroy();
90
                with (blconwd)
91
                    instance_destroy();
92
            }
93
        }
94
        if (last > 0 && timer == 240)
95
        {
96
            shaken = 2;
97
            bw += 400;
98
            mbw += 260;
99
            caster_set_pitch(s2, 1.8);
100
            blcon = instance_create(400, 50, obj_blconwdflowey);
101
            global.msc = 0;
102
            global.msg[0] = 
STOP IT NOW!!!
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_lastbeam_255")
;
103
            global.typer = 88;
104
            blconwd = instance_create(blcon.x + 25, blcon.y + 10, OBJ_NOMSCWRITER);
105
            blcon.depth = -2000;
106
            blconwd.depth = -2200;
107
        }
108
        if (shaken == 1)
109
        {
110
            for (i = 0; i < 3; i += 1)
111
            {
112
                menu[i].x = (menux[i] + random(4)) - random(4);
113
                menu[i].y = (menuy[i] + random(4)) - random(4);
114
            }
115
        }
116
        if (shaken == 2)
117
        {
118
            for (i = 0; i < 3; i += 1)
119
            {
120
                menu[i].vspeed += 0.5;
121
                menu[i].image_angle += random(4) - random(4);
122
            }
123
            global.bmenucoord[0] = 1;
124
            global.mercy = 3;
125
        }
126
        draw_set_alpha(1);
127
        if (timer > (beamtime + 80 + last))
128
        {
129
            if (svol2 > 0)
130
                svol2 -= 0.1;
131
            caster_set_volume(s2, svol2);
132
            bw -= (mbw / 12);
133
            ar -= 0.04;
134
            if (bw <= 0)
135
            {
136
                caster_stop(s2);
137
                global.mnfight = 3;
138
                global.msg[0] = 
* ...
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_lastbeam_296")
;
139
                instance_destroy();
140
            }
141
        }
142
    }
143
}
144
scr_binfowrite
scr_binfowrite

draw_set_color(c_white); var namex = 30; var namey = 400; var namewidth = scr_draw_name_curs(namex, namey); draw_set_font(fnt_curs); draw_text(namex + namewidth, 400, " LV " + string(global.lv)); if (global.flag[271 fighting_sans] == 0) { draw_set_color(c_red); ossafe_fill_rectangle(275, 400, 275 + (global.maxhp * 1.2), 420); draw_set_color(c_yellow); ossafe_fill_rectangle(275, 400, 275 + (global.hp * 1.2), 420); draw_set_color(c_white); draw_set_font(fnt_curs); hpwrite = string(global.hp); if (global.hp < 10) hpwrite = "0" + string(global.hp); if (global.hp < 0) hpwrite = "0"; if (global.flag[509 decimal_hp_state] == 1) hpwrite = "00.001"; if (global.flag[509 decimal_hp_state] == 2) hpwrite = "00.0001"; if (global.flag[509 decimal_hp_state] == 3) hpwrite = "00.000001"; if (global.flag[509 decimal_hp_state] == 4) hpwrite = "00.0000000001"; draw_text(290 + (global.maxhp * 1.2), 400, hpwrite + " / " + string(global.maxhp)); } else { draw_set_color(merge_color(c_red, c_maroon, 0.5)); ossafe_fill_rectangle(255, 400, 255 + (global.maxhp * 1.2), 420); draw_set_color(c_yellow); ossafe_fill_rectangle(255, 400, 255 + (global.hp * 1.2), 420); draw_set_color(c_fuchsia); if (global.km > 40) global.km = 40; if (global.km >= global.hp) global.km = global.hp - 1; ossafe_fill_rectangle(255 + (global.hp * 1.2), 400, (255 + (global.hp * 1.2)) - (global.km * 1.2), 420); draw_sprite(spr_krmeter, 0, 265 + (global.maxhp * 1.2), 405); draw_set_color(c_white); draw_set_font(fnt_curs); hpwrite = string(global.hp); if (global.km > 0) draw_set_color(c_fuchsia); if (global.hp < 10) hpwrite = "0" + string(global.hp); if (global.hp < 0) hpwrite = "0"; draw_text(305 + (global.maxhp * 1.2), 400, hpwrite + " / " + string(global.maxhp)); draw_set_color(c_white); if (instance_exists(obj_hpname)) { with (obj_hpname) instance_destroy(); } draw_sprite(spr_hpname, 0, 220, 400); }
();