Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shootout_window_Other_14

(view raw script w/o annotations or w/e)
1
char_timer++;
2
switch (char_state)
3
{
4
    case "init":
5
        char_timer = -1;
6
        char_alpha = 1;
7
        char_state = "idle";
8
        char_sprite = 4855;
9
        char_imgindex = 2/3;
10
        char_y = 40;
11
        char_x = 5;
12
        break;
13
    case "idle":
14
        if (krspopout)
15
        {
16
            if (char_imgindex < 4)
17
                char_imgindex += (1/3);
18
            if (image_index < 3)
19
                image_index += (1/3);
20
        }
21
        else
22
        {
23
            if (char_imgindex > 0)
24
                char_imgindex -= (1/3);
25
            if (image_index > 0)
26
                image_index -= (1/3);
27
            if (char_imgindex > 0)
28
                char_imgindex = 0;
29
            if (image_index > 0)
30
                image_index = 0;
31
        }
32
        break;
33
    case "hit":
34
        if (char_timer == 0)
35
        {
36
            char_alpha = 1;
37
            char_sprite = 601;
38
            if (obj_shootout_controller.shootout_type > 1)
39
                char_sprite = 4842;
40
            char_imgindex = 0;
41
            show_hit_spike = true;
42
            snd_play(snd_punchmed);
43
            var _hrt = 
scr_afterimage_grow
scr_afterimage_grow

function
scr_afterimage_grow()
{ afterimage = instance_create(x, y, obj_afterimage_grow); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
44
            _hrt.sprite_index = spr_shootout_heart_big_outline;
45
            _hrt.depth = obj_shootout_controller.depth - 1;
46
            _hrt.fade = 0.08;
47
            _hrt.xrate = 0.1;
48
            _hrt.yrate = 0.1;
49
        }
50
        if (char_timer >= 10)
51
            show_hit_spike = false;
52
        if (char_timer >= 15)
53
        {
54
            char_state = "idle";
55
            char_timer = -1;
56
        }
57
        break;
58
}
59
var _char_x = (char_x + sprite_yoffset) - 72;
60
var _char_y = (char_y + sprite_yoffset) - 122;
61
if (char_imgindex >= 3)
62
{
63
    trembletimer++;
64
    if (trembletimer == 1)
65
        _char_x += 1;
66
    if (trembletimer == 2)
67
        _char_x += 1;
68
    if (trembletimer == 3)
69
        _char_x += 1;
70
    if (trembletimer == 4)
71
        _char_x += 1;
72
    if (trembletimer == 5)
73
        _char_x += -1;
74
    if (trembletimer == 6)
75
        _char_x += -1;
76
    if (trembletimer == 7)
77
        _char_x += -1;
78
    if (trembletimer == 8)
79
        _char_x += -1;
80
    if (trembletimer == 8)
81
        trembletimer = 0;
82
}
83
if (i_ex(obj_shootout_controller) && (obj_shootout_controller.invtimer == 29 || obj_shootout_controller.invtimer == 28 || obj_shootout_controller.invtimer == 25 || obj_shootout_controller.invtimer == 24 || obj_shootout_controller.invtimer == 20 || obj_shootout_controller.invtimer == 19 || obj_shootout_controller.invtimer == 16 || obj_shootout_controller.invtimer == 15 || obj_shootout_controller.invtimer == 12 || obj_shootout_controller.invtimer == 11 || obj_shootout_controller.invtimer == 8 || obj_shootout_controller.invtimer == 7 || obj_shootout_controller.invtimer == 4 || obj_shootout_controller.invtimer == 3))
84
{
85
}
86
else
87
{
88
    draw_sprite_ext(spr_shootout_susie_popout, char_imgindex, _char_x + _x, _char_y + _y, 2, 2, 0, c_white, 1);
89
    draw_sprite_ext(spr_shootout_ralsei_popout, char_imgindex, _char_x + _x, _char_y + _y, 2, 2, 0, c_white, 1);
90
    draw_sprite_ext(char_sprite, char_imgindex, _char_x + _x, _char_y + _y, 2, 2, 0, c_white, 1);
91
}