Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_knight_roaring_star_Other_15

(view raw script w/o annotations or w/e)
1
if (active == 1)
2
{
3
    var _hitbox = (obj_heart.sprite_index == spr_dodgeheart_smaller_2px) ? 0 : 2;
4
    if (!
scr_precise_hit
scr_precise_hit

function
scr_precise_hit(arg0 = 3, arg1 = false)
{ arg0 /= 2; var _hx = obj_heart.x + 10; var _hy = obj_heart.y + 10; if (arg0 <= 0) return collision_point(_hx, _hy, id, true, false); else if (arg1) return collision_circle(_hx, _hy, arg0, id, true, false); else return collision_rectangle(_hx - arg0, _hy - arg0, _hx + arg0, _hy + arg0, id, true, false); }
(_hitbox))
5
        exit;
6
    if (i_ex(obj_knight_roaring2))
7
    {
8
        with (obj_knight_enemy)
9
            event_user(2);
10
    }
11
    else
12
    {
13
        if (target != 3)
14
            
scr_damage
scr_damage

function
scr_damage()
{ if (global.inv < 0) {
scr_damage_cache();
if (global.chapter == 3) { with (obj_tennabattleconvo_controller) { damagecount++; damagecountthisturn++; } with (obj_tenna_enemy) gothit = true; with (obj_knight_enemy) progamer = false; } 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; } } var truedamage = 0; if ((global.chapter == 3 && i_ex(obj_tenna_enemy) && obj_tenna_enemy.minigameinsanity) || i_ex(obj_knight_roaring2)) truedamage = 1; chartarget = 3; if (global.chapter == 3 && i_ex(obj_knight_enemy) && truedamage == 0) { if (obj_knight_enemy.aoedamage == false) { if (target == 0) { if (global.hp[2] > 0 && global.hp[3] > 0) target = choose(1, 2); else if (global.hp[2] > 0) target = 1; else if (global.hp[3] > 0) target = 2; } if (obj_knight_enemy.myattackchoice != 13) { if (global.chararmor1[1] == 23 || global.chararmor2[1] == 23 || global.chararmor1[2] == 23 || global.chararmor2[2] == 23 || global.chararmor1[3] == 23 || global.chararmor2[3] == 23) { obj_knight_enemy.damagecounter++; if (obj_knight_enemy.damagecounter < 3) { if (global.hp[1] > 0 && (global.chararmor1[1] == 23 || global.chararmor2[1] == 23)) target = 0; if (global.hp[2] > 0 && (global.chararmor1[2] == 23 || global.chararmor2[2] == 23)) target = 1; if (global.hp[3] > 0 && (global.chararmor1[3] == 23 || global.chararmor2[3] == 23)) target = 2; } else { target = choose(0, 1, 2); repeat (2) { if (global.hp[1] < 1 && target == 0) target++; ...
();
15
        if (target == 3)
16
            
scr_damage_all
scr_damage_all

function
scr_damage_all()
{ if (global.inv < 0) { 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 * 30; target = _temptarget; } }
();
17
    }
18
    if (destroyonhit == 1)
19
        instance_destroy();
20
}