Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_clubsenemy_Draw_0

(view raw script w/o annotations or w/e)
1
if (notail == 1)
2
{
3
    siner += 1;
4
    draw_sprite_ext(spr_clubs_tail_attack, 0, x, y, 2, 2, 0, image_blend, 1);
5
    exit;
6
}
7
if (state == 3)
8
{
9
    if (global.monsterhp[myself] <= (global.monstermaxhp[myself] / 2))
10
    {
11
        global.monsterstatus[myself] = 1;
12
        if (global.monstercomment[myself] == " ")
13
            global.monstercomment[myself] = stringsetloc(
(Tired)
"(Tired)", "obj_clubsenemy_slash_Draw_0_gml_15_0"
);
14
    }
15
    hurttimer -= 1;
16
    if (hurttimer < 0)
17
    {
18
        state = 0;
19
    }
20
    else
21
    {
22
        if (global.monster[myself] == 0)
23
        {
24
            global.flag[522 clover_violence] += 1;
25
            scr_defeatrun
scr_defeatrun

function scr_defeatrun() { var __frozen; if (object_is_ancestor(object_index, obj_monsterparent)) { __frozen = 0; if (global.flag[51 + myself] == 6) __frozen = 1; if (__frozen == 1) { _rtext = instance_create(global.monsterx[myself], global.monstery[myself] - 40, obj_recruitanim); _rtext.image_index = 12; if (recruitable == 1) global.flag[global.monstertype[myself] + 600] = -1; global.flag[63 violenced_last] = 1; } if (recruitable == 1 && global.flag[61 disable_recruiting] == 0 && __frozen == 0) { global.flag[63 violenced_last] = 1; if (global.flag[global.monstertype[myself] + 600] != -1) { global.flag[global.monstertype[myself] + 600] = -1; _rtext = instance_create(global.monsterx[myself], global.monstery[myself] - 40, obj_recruitanim); _rtext.image_index = 7; } } } else { fatal = 0; } if (!__frozen) { if (fatal == 1) defeatanim = instance_create(x, y, obj_deathanim); else defeatanim = instance_create(x, y, obj_defeatanim); } else if (__frozen) { defeatanim = instance_create(x, y, obj_frozennpc); defeatanim.depth = depth; defeatanim.inbattle = 1; } defeatanim.sprite_index = sprite_index; defeatanim.sprite_index = hurtsprite; defeatanim.image_index = 0; defeatanim.image_xscale = image_xscale; defeatanim.image_yscale = image_yscale; instance_destroy(); }
();
26
        }
27
        hurtshake += 1;
28
        if (hurtshake > 1)
29
        {
30
            if (shakex > 0)
31
                shakex -= 1;
32
            if (shakex < 0)
33
                shakex += 1;
34
            shakex = -shakex;
35
            hurtshake = 0;
36
        }
37
        draw_sprite_ext(spr_clubs_hurt, 0, x + shakex, y, 2, 2, 0, image_blend, 1);
38
    }
39
}
40
if (state == 0)
41
{
42
    siner += 1;
43
    thissprite = spr_clubs_idle;
44
    if (global.mercymod[myself] >= global.mercymax[myself])
45
        thissprite = spr_clubs_spared;
46
    draw_sprite_ext(thissprite, siner / 6, x, y, 2, 2, 0, image_blend, 1);
47
    if (flash == 1)
48
    {
49
        fsiner += 1;
50
        d3d_set_fog(true, c_white, 0, 1);
51
        draw_sprite_ext(thissprite, siner / 6, x, y, 2, 2, 0, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
52
        d3d_set_fog(false, c_black, 0, 0);
53
    }
54
}
55
if (becomeflash == 0)
56
    flash = 0;
57
becomeflash = 0;
58
if (actcon == 15)
59
{
60
    if (clockalpha <= 1)
61
        clockalpha += 0.05;
62
}
63
else if (clockalpha >= 0)
64
{
65
    clockalpha -= 0.05;
66
}
67
if (room == room_dw_castle_dojo && instance_exists(obj_dojofx))
68
{
69
    draw_set_color(c_red);
70
    draw_set_halign(fa_center);
71
    scr_84_set_draw_font
scr_84_set_draw_font

function scr_84_set_draw_font(arg0) { global.chemg_font = arg0; draw_set_font(scr_84_get_font(arg0)); }
("mainbig");
72
    var timestring = string(round(topic_timer / 30));
73
    if (round(topic_timer / 30) < 10)
74
        timestring = "0" + timestring;
75
    if (topic_con != 0)
76
    {
77
        var timetextstring = stringsetloc(
TIME:
"TIME: ", "obj_clubsenemy_slash_Draw_0_gml_98_0"
);
78
        var totaltimetextstring = timetextstring + timestring;
79
        draw_set_color(c_black);
80
        draw_rectangle((camerax() + 320) - (string_width(totaltimetextstring) / 2) - 10, (cameray() + 298) - (string_height(totaltimetextstring) / 2), camerax() + 320 + (string_width(totaltimetextstring) / 2) + 10, cameray() + 298 + (string_height(totaltimetextstring) / 2) + 40, 0);
81
        draw_set_color(c_red);
82
        draw_text(camerax() + 320, cameray() + 290, totaltimetextstring);
83
        draw_set_halign(fa_left);
84
        draw_set_color(c_white);
85
    }
86
    cx = obj_dojofx.ball.x;
87
    cy = obj_dojofx.ball.y + 65;
88
    if ((topic_timer / topic_timer_total) < 0.25)
89
    {
90
        cx = lerp(cx, cx + (sin(topic_timer_total - topic_timer) * 6), 0.125);
91
        cy = lerp(cy, cy + (cos(topic_timer_total - topic_timer) * 6), 0.125);
92
    }
93
    progress = (topic_timer / topic_timer_total) * 360;
94
    draw_sprite_ext(spr_clubs_clock_background, 0, cx - 56, cy - 57, 2, 2, 0, c_white, clockalpha);
95
    draw_sprite_ext(spr_clubs_clock_background, 1, cx - 56, cy - 57, 2, 2, 0, c_white, (1 - (topic_timer / topic_timer_total)) * clockalpha);
96
    draw_sprite_ext(spr_clubs_clock_smallhand, 0, cx, cy, 2, 2, 360 - (progress * 10), c_white, clockalpha);
97
    draw_sprite_ext(spr_clubs_clock_bighand, 0, cx, cy, 2, 2, 360 - progress, c_white, clockalpha);
98
}