Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_queen_winebubble_Other_15

(view raw script w/o annotations or w/e)
1
if (active == 1)
2
{
3
    if (fuelbubble)
4
    {
5
        if (target != 3)
6
            scr_heal
scr_heal

function scr_heal(arg0, arg1) { abovemaxhp = 0; belowzero = 0; hltarget = global.char[arg0]; _curhp = global.hp[hltarget]; if (global.hp[hltarget] <= 0) belowzero = 1; if (global.hp[hltarget] > global.maxhp[hltarget]) abovemaxhp = 1; if (abovemaxhp == 0) { global.hp[hltarget] += arg1; if (global.hp[hltarget] > global.maxhp[hltarget]) global.hp[hltarget] = global.maxhp[hltarget]; } if (belowzero == 1 && global.hp[hltarget] >= 0) { if (global.hp[hltarget] < ceil(global.maxhp[hltarget] / 6)) global.hp[hltarget] = ceil(global.maxhp[hltarget] / 6); scr_revive(arg0); } snd_stop(snd_power); snd_play(snd_power); return global.hp[hltarget] - _curhp; }
(target, 6);
7
        if (target == 3)
8
            scr_healall
scr_healall

function scr_healall(arg0) { for (i = 0; i < 3; i += 1) { if (global.char[i] != 0) scr_heal(i, arg0); } }
(6);
9
    }
10
    else
11
    {
12
        if (target != 3)
13
            scr_damage
scr_damage

function scr_damage() { if (global.inv < 0) { scr_damage_cache(); var __element = 0; if (variable_instance_exists(id, "element")) { if (is_real(element)) __element = element; } if (target < 3) { if (global.hp[global.char[target]] <= 0) { scr_randomtarget_old(); target = mytarget; with (global.charinstance[target]) { image_blend = c_white; darkify = 0; } } } var __remtarget = -1; if (target == 4) { __remtarget = 4; scr_randomtarget_old(); target = mytarget; if ((global.hp[global.char[target]] / global.maxhp[global.char[target]]) < (scr_party_hpaverage() / 2)) { scr_randomtarget_old(); target = mytarget; } if ((global.hp[global.char[target]] / global.maxhp[global.char[target]]) < (scr_party_hpaverage() / 2)) { scr_randomtarget_old(); target = mytarget; } if (target == 0 && (global.hp[global.char[target]] / global.maxhp[global.char[target]]) < 0.35) { scr_randomtarget_old(); target = mytarget; } with (global.charinstance[target]) { image_blend = c_white; darkify = 0; } } chartarget = 3; tdamage = damage; var oldcalculation = 0; if (target < 3) { if (oldcalculation) tdamage = ceil(tdamage - (global.battledf[target] * 3)); else tdamage = scr_damage_calculation(tdamage, target); chartarget = global.char[target]; if (global.charaction[target] == 10) tdamage = ceil((2 * tdamage) / 3); tdamage = ceil(tdamage * scr_element_damage_reduction(__element, global.char[target])); if (tdamage < 1) tdamage = 1; } if (!instance_exists(obj_shake)) instance_create(0, 0, obj_shake); with (global.charinstance[target]) { hurt = 1; hurttimer = 0; } hpdiff = tdamage; with (obj_dmgwriter) { if (delaytimer >= 1) killactive = 1; } doomtype = -1; with (obj_heart) dmgnoise = 1; if (target < 3) { if (global.hp[chartarget] <= 0) { doomtype = 4; global.hp[chartarget] -= round(tdamage / 4); hpdiff = round(tdamage / 4); } else { global.hp[chartarget] -= tdamage; if (global.chapter == 2 && instance_exists(obj_gigaqueen_enemy) && global.hp[chartarget] <= 0) { global.hp[chartarget] = 1; with (o_boxingcontroller) event_user(3); } if (global.hp[chartarget] <= 0) ...
();
14
        if (target == 3)
15
            scr_damage_all
scr_damage_all

function scr_damage_all() { if (global.inv < 0) { scr_damage_cache(); remdamage = damage; _temptarget = target; for (ti = 0; ti < 3; ti += 1) { global.inv = -1; damage = remdamage; target = ti; if (global.hp[global.char[ti]] > 0 && global.char[ti] != 0) scr_damage(); } global.inv = global.invc * 40; target = _temptarget; scr_damage_check(); } }
();
16
    }
17
    if (destroyonhit == 1)
18
        instance_destroy();
19
}