Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_o_coaster_hero_old_Draw_0

(view raw script w/o annotations or w/e)
1
if (draw_button_press == 1 && obj_berdlyb_enemy.bumpactstarted == 1)
2
{
3
    draw_button_press_timer++;
4
    if (draw_button_press_timer > 12)
5
        draw_button_press_timer = 0;
6
    var xx1 = x + 129;
7
    var yy1 = y - 24;
8
    var xx2 = x + 163;
9
    var yy2 = y + 8;
10
    if (draw_button_press_timer > 7)
11
        draw_rectangle_color(xx1, yy1, xx2, yy2, c_white, c_white, c_white, c_white, 0);
12
    else if (HeroID == 0)
13
        draw_rectangle_color(xx1, yy1, xx2, yy2, c_aqua, c_aqua, c_aqua, c_aqua, 0);
14
    else if (HeroID == 1)
15
        draw_rectangle_color(xx1, yy1, xx2, yy2, c_fuchsia, c_fuchsia, c_fuchsia, c_fuchsia, 0);
16
    else if (HeroID == 2)
17
        draw_rectangle_color(xx1, yy1, xx2, yy2, c_lime, c_lime, c_lime, c_lime, 0);
18
    draw_rectangle_color(xx1 + 2, yy1 + 2, xx2 - 2, yy2 - 2, c_black, c_black, c_black, c_black, 0);
19
    xx1 = x + 135;
20
    yy1 = y - 25;
21
    if (HeroID == 0)
22
        draw_text_ext_transformed(xx1, yy1, "Z!", 9999, 9999, 2, 2, 0);
23
    if (HeroID == 1)
24
        draw_text_ext_transformed(xx1, yy1, "X!", 9999, 9999, 2, 2, 0);
25
    if (HeroID == 2)
26
        draw_text_ext_transformed(xx1, yy1, "C!", 9999, 9999, 2, 2, 0);
27
}
28
if (nitro == 1)
29
{
30
    flametimer++;
31
    if (flametimer >= 3)
32
    {
33
        flametimer = 0;
34
        flame = instance_create(x + 0, y - 10, o_boxingflame);
35
        flame.direction = 180;
36
        flame.speed = 6;
37
        flame.friction = 0.2;
38
        flame.depth = depth + 10;
39
    }
40
    flameindextimer++;
41
    if (flameindextimer == 4)
42
    {
43
        flameindextimer = 0;
44
        if (flameindex == 0)
45
            flameindex = 1;
46
        else
47
            flameindex = 0;
48
    }
49
    draw_sprite_ext(spr_bhero, 9 + flameindex, x + 12, y - 10, 0.25, 0.5, 90, c_orange, 0.6);
50
}
51
var a = 2;
52
if (sprite_index == spr_susieb_actready)
53
    a = 1.5;
54
if (sprite_index == spr_susieb_act)
55
    a = 1.5;
56
if (sprite_index == spr_susieb_attackready)
57
    a = 1.5;
58
if (sprite_index == spr_susieb_attack)
59
    a = 1.5;
60
if (sprite_index == spr_susieb_defend)
61
    a = 1.5;
62
if (sprite_index == spr_susie_rudebuster)
63
    a = 1.5;
64
if (sprite_index == spr_susie_spell)
65
    a = 1.5;
66
if (sprite_index == spr_susie_spellready)
67
    a = 1.5;
68
if (sprite_index == spr_susie_actready)
69
    a = 1.5;
70
if (sprite_index == spr_susie_act)
71
    a = 1.5;
72
if (sprite_index == spr_susie_attackready)
73
    a = 1.5;
74
if (sprite_index == spr_susie_attack)
75
    a = 1.5;
76
if (sprite_index == spr_susie_defend)
77
    a = 1.5;
78
var hurt = 0;
79
if (sprite_index == spr_krisb_hurt)
80
    hurt = 1;
81
if (sprite_index == spr_susie_hurt)
82
    hurt = 1;
83
if (sprite_index == spr_susieb_hurt)
84
    hurt = 1;
85
if (sprite_index == spr_ralsei_hurt_fixed)
86
    hurt = 1;
87
if (HeroID == 0 && obj_herokris.hurt > 0)
88
    hurt = 1;
89
if (HeroID == 1 && instance_exists(obj_herosusie) && obj_herosusie.hurt > 0)
90
    hurt = 1;
91
if (HeroID == 2 && instance_exists(obj_heroralsei) && obj_heroralsei.hurt > 0)
92
    hurt = 1;
93
back.x = x;
94
back.y = y + 8;
95
if (userealsprite == 0)
96
    draw_sprite_ext(sprite_index, image_index, x + 20 + xx, (y - (sprite_get_height(sprite_index) * a)) + yy + 8, image_xscale, image_yscale, 0, c_white, image_alpha);
97
if (hurt == 0)
98
    draw_sprite_ext(spr_coaster_hero, HeroID, x, y + 8, image_xscale, image_yscale, 0, c_white, image_alpha);
99
if (hurt == 1)
100
    draw_sprite_ext(spr_coaster_hero_hurt, HeroID, x, y + 8, image_xscale, image_yscale, 0, c_white, image_alpha);
101
if (hspeed < 0 || disabled == 1)
102
{
103
    if (userealsprite == 0)
104
        draw_sprite_ext(sprite_index, image_index, x + 20 + xx, (y - (sprite_get_height(sprite_index) * a)) + yy + 8, image_xscale, image_yscale, 0, c_black, 0.4);
105
    if (hurt == 0)
106
        draw_sprite_ext(spr_coaster_hero, HeroID, x, y + 8, image_xscale, image_yscale, 0, c_black, 0.4);
107
    if (hurt == 1)
108
        draw_sprite_ext(spr_coaster_hero_hurt, HeroID, x, y + 8, image_xscale, image_yscale, 0, c_black, 0.4);
109
}