Undertale script viewer

← back to main script listing

gml_Object_obj_butterflybullet_Collision_744

(view raw script w/o annotations or w/e)
1
if (green == 0)
2
    scr_damagestandard
scr_damagestandard

if (argument0 != 3) { check = 1; if (argument0 == 1) { check = 0; if (abs(obj_heart.xprevious - obj_heart.x) > 0.01 || abs(obj_heart.yprevious - obj_heart.y) > 0.01) check = 1; } if (argument0 == 2) { check = 0; if (abs(obj_heart.xprevious - obj_heart.x) < 0.01 && abs(obj_heart.yprevious - obj_heart.y) < 0.01) check = 1; } } puredmg = dmg; if (global.hp > 20) dmg += 1; if (global.hp >= 30) dmg += 1; if (global.hp >= 40) dmg += 1; if (global.hp >= 50) dmg += 1; if (global.hp >= 60) dmg += 1; if (global.hp >= 70) dmg += 1; if (global.hp >= 80) dmg += 1; if (global.hp >= 90) dmg += 1; if (global.invc < 1 && check == 1) { dmgamt = round(dmg - ((global.df + global.adef) / 5)); if (dmgamt < argument1) dmgamt = argument1; if (argument2 > 0 && dmgamt > argument2) dmgamt = argument2; if (argument3 > 0) dmgamt = argument3; if (dmgamt < 1) dmgamt = 1; global.hp -= dmgamt; if (global.hp < 0) global.hp = 0; snd_play(snd_hurt1); global.hshake = 2; global.shakespeed = 2; global.vshake = 2; instance_create(0, 0, obj_shaker); global.invc = global.inv; if (argument4 > 0) global.invc = (argument4 / 20) * global.inv; if (global.battlegroup == 22) { if (global.hp < 1) obj_torielboss.sprite_index = spr_torielboss_mouthcover; } } dmg = puredmg;
(0, 3, 0, 0, 0);
3
if (green == 1)
4
{
5
    if (instance_exists(obj_whimsalot))
6
    {
7
        global.msg[0] = 
* Whimsalot doesn't want to
fight anymore.
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_butterflybullet_102")
;
8
        obj_whimsalot.mercymod += 40;
9
    }
10
    if (global.hp < global.maxhp)
11
        global.hp += 1;
12
    snd_play(snd_power);
13
    instance_destroy();
14
    pop = scr_monstersum
scr_monstersum

return global.monster[0] + global.monster[1] + global.monster[2];
();
15
    if (pop == 1)
16
        global.turntimer = 20;
17
}