Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_rabbick_enemy_Draw_0

(view raw script w/o annotations or w/e)
1
animsiner += 1;
2
image_xscale = 2 - (blowamt / 100);
3
if (blown == 1)
4
    image_xscale = 2;
5
xoff = 0;
6
if (image_xscale < 2)
7
    xoff = (originalwidth - sprite_width) / 2;
8
blowanimtimer -= 1;
9
if (blowanimtimer > 6 && blown == 0)
10
{
11
    if (onoff == 2)
12
        onoff = 0;
13
    if (onoff == 1.5)
14
        onoff = 2;
15
    if (onoff == 0.5)
16
        onoff = 1;
17
    if (onoff == 0)
18
    {
19
        ashake = -shakeamt;
20
        onoff = 0.5;
21
    }
22
    if (onoff == 1)
23
    {
24
        ashake = shakeamt;
25
        if (shakeamt > 0)
26
            shakeamt -= 1;
27
        onoff = 1.5;
28
    }
29
    if (image_xscale > 1.5)
30
        draw_sprite_ext(spr_rabbick_enemy_hurt, 0, x + xoff + ashake, y, image_xscale, image_yscale, 0, c_white, 1);
31
    else
32
        draw_sprite_ext(spr_rabbick_enemy_hurt, 1, (x + xoff + ashake) - 8, y, image_xscale + 0.5, image_yscale, 0, c_white, 1);
33
}
34
else
35
{
36
    if (state == 3)
37
    {
38
        if (global.monsterhp[myself] <= (global.monstermaxhp[myself] / 3))
39
        {
40
            global.monsterstatus[myself] = 1;
41
            if (global.monstercomment[myself] == " ")
42
                global.monstercomment[myself] = 
(Tired)
scr_84_get_lang_string
scr_84_get_lang_string

function
scr_84_get_lang_string(arg0)
{ var lang_string_id = arg0; var str = ds_map_find_value(global.lang_map, lang_string_id); if (is_undefined(str)) { if (!ds_map_find_value(global.lang_missing_map, lang_string_id)) { ds_map_add(global.lang_missing_map, lang_string_id, true); show_debug_message("ERROR: string id " + lang_string_id + " for language " + global.lang + " is missing"); } str = "--missing-string--"; } return str; }
("obj_rabbick_enemy_slash_Draw_0_gml_45_0")
;
43
        }
44
        hurttimer -= 1;
45
        if (hurttimer < 0)
46
        {
47
            state = 0;
48
        }
49
        else
50
        {
51
            if (global.monster[myself] == 0)
52
                
scr_defeatrun
scr_defeatrun

function
scr_defeatrun()
{ if (global.chapter == 3 && i_ex(obj_tennabattleconvo_controller)) obj_tennabattleconvo_controller.enemydefeated = true; 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(); }
();
53
            hurtshake += 1;
54
            if (hurtshake > 1)
55
            {
56
                if (shakex > 0)
57
                    shakex -= 1;
58
                if (shakex < 0)
59
                    shakex += 1;
60
                shakex = -shakex;
61
                hurtshake = 0;
62
            }
63
            thissprite = hurtsprite;
64
            if (image_xscale > 1.5)
65
                draw_sprite_ext(thissprite, 0, x + xoff + shakex, y, image_xscale, image_yscale, 0, c_white, 1);
66
            else
67
                draw_sprite_ext(thissprite, 1, (x + xoff + shakex) - 8, y, image_xscale + 0.5, image_yscale, 0, c_white, 1);
68
        }
69
    }
70
    if (state == 0)
71
    {
72
        thissprite = idlesprite;
73
        if (global.mercymod[myself] >= global.mercymax[myself] || blown == 1)
74
            thissprite = sparedsprite;
75
        draw_sprite_ext(thissprite, animsiner / 5, x + xoff, y, image_xscale, image_yscale, 0, image_blend, 1);
76
        if (flash == 1)
77
        {
78
            fsiner += 1;
79
            d3d_set_fog(true, c_white, 0, 1);
80
            draw_sprite_ext(thissprite, animsiner / 5, x + xoff, y, image_xscale, image_yscale, 0, c_white, (-cos(fsiner / 5) * 0.4) + 0.6);
81
            d3d_set_fog(false, c_black, 0, 0);
82
        }
83
    }
84
    if (becomeflash == 0)
85
        flash = 0;
86
    becomeflash = 0;
87
}