Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_plat_enm_book_simple_Create_0

related scripts: Alarm_0Collision_obj_plat_playerCreate_0 Destroy_0Step_0

(view raw script w/o annotations or w/e)
1
plat_name = stringsetloc(
Litebuster
"Litebuster", "obj_plat_enm_book_simple_slash_Create_0_gml_4_0"
);
2
plat_desc = stringsetloc(
This'll deal some damage.
"This'll deal some damage.", "obj_plat_enm_book_simple_slash_Create_0_gml_5_0"
);
3
event_inherited();
4
state = 0;
5
sprite_index = spr_enemy_book_flyup;
6
timer = 0;
7
hit = 0;
8
timer = 0;
9
hp = 1;
10
aim = 0;
11
fallspeed = 0;
12
flapcall = -1;
13
dist = 0;
14
alive = true;
15
coindrops = 3;
16
substate = 0;
17
h_knockback = image_xscale * -8;
18
v_knockback = -6;
19
damage = 30;
20
kb_strength = 12;
21
spawn_effect = false;
22
knockback_on_death = true;
23
deathmarker_lifetime = 10;
24
deathmarker_spin = 0;
25
windimmune = true;
26
init = false;
27
homex = 0;
28
homey = 0;
29
petal_color = 16711935;
30
31
state_set = function(arg0)
32
{
33
    timer = 0;
34
    state = arg0;
35
    substate = 0;
36
};
37
38
get_hurt = function(arg0)
39
{
40
    if (!instance_exists(obj_plat_player))
41
        exit;
42
    if (paused || custom_paused)
43
        exit;
44
    if (state >= 1 && alive)
45
    {
46
        spawn_death_coins();
47
        with (arg0)
48
        {
49
            if (!hit_check(other.id))
50
                exit;
51
        }
52
        hp--;
53
        hit = 1;
54
        spawn_hit_petals(3, point_direction(arg0.x, arg0.y, x, y), 1);
55
        with (arg0)
56
            do_hbx_hit(-4, -1, 1.5 - ((0.5 * other.hp) / other.__max_hp));
57
        state = 10;
58
        alive = false;
59
        blocked = true;
60
        sprite_index = spr_enemy_book_flyup;
61
        alarm[2] = obj_plat_game.hitstop;
62
        var _px = obj_plat_player.x - (sign(obj_plat_player.image_xscale) * 10);
63
        var _py = obj_plat_player.y + 20;
64
        _dir = point_direction(_px, _py, x, y);
65
        h_knockback = lengthdir_x(20, _dir);
66
        v_knockback = lengthdir_y(20, _dir);
67
        deathmarker_spin = sign(-h_knockback) * 40;
68
    }
69
};