Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_tenna_board4_enemy_Draw_0

(view raw script w/o annotations or w/e)
1
if (digit_flash_timer > 0)
2
    digit_flash_timer--;
3
if (
scr_isphase
scr_isphase

function
scr_isphase(arg0)
{ __isphase = 0; if (arg0 == "menu" && global.myfight == 0) __isphase = 1; if (arg0 == "acting" && global.myfight == 3) __isphase = 1; if (arg0 == "victory" && global.myfight == 7) __isphase = 1; if (arg0 == "attack" || arg0 == "fight") { if (global.myfight == 1) __isphase = 1; } if (arg0 == "spell" || arg0 == "item") { if (global.myfight == 4) __isphase = 1; } if (arg0 == "enemytalk" || arg0 == "balloon") { if (global.mnfight == 1) __isphase = 1; } if (arg0 == "enemyattack" || arg0 == "bullets") { if (global.mnfight == 2) __isphase = 1; } return __isphase; }
("menu") ||
scr_isphase
scr_isphase

function
scr_isphase(arg0)
{ __isphase = 0; if (arg0 == "menu" && global.myfight == 0) __isphase = 1; if (arg0 == "acting" && global.myfight == 3) __isphase = 1; if (arg0 == "victory" && global.myfight == 7) __isphase = 1; if (arg0 == "attack" || arg0 == "fight") { if (global.myfight == 1) __isphase = 1; } if (arg0 == "spell" || arg0 == "item") { if (global.myfight == 4) __isphase = 1; } if (arg0 == "enemytalk" || arg0 == "balloon") { if (global.mnfight == 1) __isphase = 1; } if (arg0 == "enemyattack" || arg0 == "bullets") { if (global.mnfight == 2) __isphase = 1; } return __isphase; }
("acting") || ilovetv_increase == 99)
4
    digit_alpha = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); } function scr_obj_movetowards_obj(arg0, arg1, arg2 = 0, arg3 = 0) { scr_obj_movetowards_point(arg0.x + arg2, arg0.y + arg3, arg1); } function scr_obj_movetowards_point(arg0, arg1, arg2) { var _distance = point_distance(x, y, arg0, arg1); if (arg2 >= _distance) { x = arg0; y = arg1; } else { var _direction = point_direction(x, y, arg0, arg1); x += lengthdir_x(arg2, _direction); y += lengthdir_y(arg2, _direction); } }
(digit_alpha, 1, 0.1);
5
else
6
    digit_alpha = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); } function scr_obj_movetowards_obj(arg0, arg1, arg2 = 0, arg3 = 0) { scr_obj_movetowards_point(arg0.x + arg2, arg0.y + arg3, arg1); } function scr_obj_movetowards_point(arg0, arg1, arg2) { var _distance = point_distance(x, y, arg0, arg1); if (arg2 >= _distance) { x = arg0; y = arg1; } else { var _direction = point_direction(x, y, arg0, arg1); x += lengthdir_x(arg2, _direction); y += lengthdir_y(arg2, _direction); } }
(digit_alpha, 0, 0.1);
7
if (digit_alpha > 0 && hidetvcount == false)
8
{
9
    var _first_digit = ilovetv div 10;
10
    var _second_digit = ilovetv % 10;
11
    var _col_factor = sin((digit_flash_timer / digit_flash_duration) * pi);
12
    var _col2 = merge_color(c_red, c_white, 0.5);
13
    var _col = merge_color(c_red, _col2, _col_factor);
14
    if (ilovetv == 99)
15
    {
16
        _col_factor = (sin(current_time / 30) * 0.5) + 0.5;
17
        _col = merge_color(c_orange, c_yellow, _col_factor);
18
    }
19
    var _xx = 280;
20
    var _yy = 20;
21
    if (!i_ex(obj_shadowman_sharpshoot_cursor))
22
    {
23
        draw_sprite_ext(spr_tv_counter_numbers, _first_digit, _xx, _yy, 2, 2, 0, _col, digit_alpha);
24
        draw_sprite_ext(spr_tv_counter_numbers, _second_digit, _xx + 40, _yy, 2, 2, 0, _col, digit_alpha);
25
    }
26
}
27
if (state == 3 && (hurttimer >= 0 || i_ex(obj_shadowman_sharpshoot_target)))
28
{
29
    tenna_actor.x = -1000;
30
    tenna_actor.y = -1000;
31
    draw_sprite_ext(hurtsprite, 0, camerax() + 525 + shakex + hurtspriteoffx, cameray() + 255 + hurtspriteoffy, 2, 2, 0, image_blend, 1);
32
}
33
if (state == 0)
34
{
35
    fsiner += 1;
36
    siner += 0.16666666666666666;
37
    thissprite = idlesprite;
38
    if (global.mercymod[myself] >= global.mercymax[myself])
39
        thissprite = sparedsprite;
40
}
41
if (becomeflash == 0)
42
{
43
    flash = 0;
44
    tenna_actor.flash = flash;
45
}
46
becomeflash = 0;