Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_roaringknight_quickslash_big_Step_0

(view raw script w/o annotations or w/e)
1
timer++;
2
if (image_alpha < 1 && !slash)
3
    image_alpha += 0.05;
4
if (!slash && timer > 20)
5
    image_blend = merge_color(c_white, c_red, (timer - 20) / 19);
6
if (!slash)
7
{
8
    if (image_angle == 90)
9
    {
10
        y -= 20;
11
        if (y < (ystart - 66))
12
            y += 66;
13
        x = xstart;
14
    }
15
    else
16
    {
17
        x -= 20;
18
        if (x < (xstart - 66))
19
            x += 66;
20
    }
21
}
22
if (timer == 38)
23
{
24
    with (obj_roaringknight_quickslash_attack)
25
        final_slash_anim = true;
26
}
27
if (timer == 40)
28
{
29
    x = xstart;
30
    image_blend = c_white;
31
    active = true;
32
    slash = true;
33
    var _splitter = instance_create(obj_growtangle.x, obj_growtangle.y, obj_knight_split_growtangle);
34
    
scr_bullet_inherit
scr_bullet_inherit

function
scr_bullet_inherit(arg0)
{ if (i_ex(arg0)) { if (damage != -1) arg0.damage = damage; if (grazepoints != -1) arg0.grazepoints = grazepoints; if (timepoints != -1) arg0.timepoints = timepoints; if (inv != -1) arg0.inv = inv; if (target != -1) arg0.target = target; if (grazed != -1) arg0.grazed = 0; if (grazetimer != -1) arg0.grazetimer = 0; if (object_index == obj_dbulletcontroller) { arg0.creatorid = creatorid; arg0.creator = creator; } arg0.element = element; } }
(_splitter);
35
    sprite_index = spr_rk_quickslash;
36
    image_speed = 1;
37
    image_index = 0;
38
    image_yscale *= 2;
39
    snd_stop(snd_wideslash_low);
40
    snd_stop(snd_knight_hurtb);
41
    snd_play_x(snd_wideslash_low, 0.8, 0.9 + (random(4) / 10));
42
    with (obj_roaringknight_quickslash_attack)
43
        event_user(1);
44
}
45
if (timer == 34)
46
    active = false;
47
if (timer == 60 && playerstrike == 1)
48
{
49
    playerstrike = 0;
50
    obj_heart.image_alpha = 1;
51
    if (target != 3)
52
        
scr_damage_maxhp
scr_damage_maxhp

function
scr_damage_maxhp(arg0 = 1, arg1 = false, arg2 = false)
{ 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; if (global.chapter == 3 && i_ex(obj_knight_enemy) && !i_ex(obj_knight_roaring2)) { 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++; if (global.hp[2] < 1 && target == 1) target++; if (global.hp[3] < 1 && target == 2) target++; if (target > 2) target = 0; } if (target == 0 && (global.chararmor1[1] == 23 || global.chararmor2[1] == 23)) { } else if (target == 1 && (global.chararmor1[2] == 23 || global.chararmor2[2] == 23)) { } else if (target == 2 && (global.chararmor1[3] == 23 || global.chararmor2[3] == 23)) { ...
(1.25);
53
    instance_destroy();
54
}
55
if (image_angle == 90)
56
    x = obj_growtangle.xstart;