Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_aqua_enemy_Create_0

(view raw script w/o annotations or w/e)
1
scr_enemy_object_init
scr_enemy_object_init

function
scr_enemy_object_init()
{ becomeflash = 0; flash = 0; turnt = 0; turns = 0; talktimer = 0; state = 0; siner = 0; fsiner = 0; talked = 0; attacked = 0; hurt = 0; hurttimer = 0; hurtshake = 0; shakex = 0; mywriter = 343249823; acttimer = 0; con = 0; dodgetimer = 0; fatal = 0; candodge = 0; mytarget = 0; ambushed = 0; firststrike = 0; damage = -1; grazepoints = -1; timepoints = -1; inv = -1; target = -1; grazed = -1; grazetimer = -1; element = "none"; acting = 0; actcon = 0; actingsus = 0; actingnoe = 0; actingral = 0; actconsus = 0; actconral = 0; actconnoe = 0; simulorderkri = -1; simulordersus = -1; simulorderral = -1; simulordernoe = -1; simultotal = 0; simulboss = -1; talkmax = 90; mercymod = 0; maxmercy = 100; recruitable = 1; freezable = 1; recruitcount = 1; sactionboxx = 0; sactionboxy = 0; hurtspriteoffx = 0; hurtspriteoffy = 0; image_xscale = 2; image_yscale = 2; image_speed = 0.2; idlesprite = spr_diamond_knight_overworld; hurtsprite = spr_diamond_knight_hurt; sparedsprite = spr_diamond_knight_spared; custombody = 0; setbattlemsg = false; for (i = 0; i < 10; i++) _charactsprite[i] = 382938298329; depth = 90 - ((y - cameray()) / 50); }
();
2
recruitcount = 5;
3
talkmax = 90;
4
custom_draw_example = 0;
5
turn = 0;
6
image_speed = 0.16666666666666666;
7
idlesprite = spr_enemy_aqua_idle;
8
hurtsprite = spr_enemy_aqua_hurt;
9
sparedsprite = spr_enemy_aqua_idle;
10
myattackchoice = -1;
11
rr = 0;
12
damaged = false;
13
rtimer = 0;
14
fight_type = "solo";
15
last_act = 0;
16
boredom = 0;
17
bored_switch = false;
18
act_list = ds_list_create();
19
flattery_id = 4;
20
omega_switch = false;
21
already_checked = false;
22
friend_mentioned = false;
23
phase = "intro";
24
phasehit = false;
25
previous_attack = -1;
26
seth_counter = 0;
27
violence_end = false;
28
state_string = "";
29
attack_chain_hits = 0;
30
attack_fan_hits = 0;
31
attack_petal_hits = 0;
32
attack_omega_hits = 0;
33
34
aqua_is_BORED = function()
35
{
36
    boredom = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(boredom, 3, 1);
37
    bored_switch = true;
38
    switch (boredom)
39
    {
40
        case 1:
41
            msgsetloc(1, 
* ... but the enemy was not amused.Wait for inputClose Message
"* ... but the enemy was not amused./%", "obj_aqua_enemy_slash_Create_0_gml_54_0"
);
42
            break;
43
        case 2:
44
            msgsetloc(1, 
* ... but the enemy seemed bored.Wait for inputClose Message
"* ... but the enemy seemed bored./%", "obj_aqua_enemy_slash_Create_0_gml_58_0"
);
45
            break;
46
        case 3:
47
            msgsetloc(1, 
* ... but the enemy seemed very bored.Wait for inputClose Message
"* ... but the enemy seemed very bored./%", "obj_aqua_enemy_slash_Create_0_gml_62_0"
);
48
            omega_switch = true;
49
            break;
50
    }
51
};
52
53
evaluate = function()
54
{
55
    if (attack_omega_hits == 0 && attack_fan_hits == 0 && attack_chain_hits == 0 && attack_petal_hits == 0)
56
        exit;
57
    if (attack_omega_hits >= attack_fan_hits && attack_omega_hits >= attack_chain_hits && attack_omega_hits >= attack_petal_hits)
58
        global.flag[1313] = 4;
59
    else if (attack_chain_hits >= attack_fan_hits && attack_chain_hits >= attack_petal_hits)
60
        global.flag[1313] = 1;
61
    else if (attack_fan_hits >= attack_petal_hits)
62
        global.flag[1313] = 2;
63
    else
64
        global.flag[1313] = 3;
65
};
66
67
callback_on_damage = function(arg0 = -1)
68
{
69
    if (fight_type == "solo")
70
    {
71
        if (!damaged)
72
        {
73
            damaged++;
74
            
scr_mercyadd
scr_mercyadd

function
scr_mercyadd(arg0, arg1)
{ global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; if (global.mercymod[arg0] >= 100) global.mercymod[arg0] = 100; var _playsound = 1; if (arg1 <= 0) _playsound = 0; with (obj_dmgwriter) { if (type == 5 && mercytimer < 8) _playsound = 0; } if (_playsound) { var _pitch = 0.8; if (arg1 < 99) _pitch = 1; if (arg1 <= 50) _pitch = 1.2; if (arg1 <= 25) _pitch = 1.4; snd_play_x(snd_mercyadd, 0.8, _pitch); } __mercydmgwriter = instance_create(global.monsterx[arg0], (global.monstery[arg0] + 20) - (global.hittarget[arg0] * 20), obj_dmgwriter); __mercydmgwriter.damage = arg1; __mercydmgwriter.type = 5; global.hittarget[arg0]++; return __mercydmgwriter; }
(myself, 20);
75
            idlesprite = spr_enemy_aqua_hurt;
76
            sparedsprite = spr_enemy_aqua_hurt;
77
        }
78
    }
79
    var _maxhp = global.monstermaxhp[global.chartarget[arg0.myself]];
80
    var _hp = global.monsterhp[global.chartarget[arg0.myself]];
81
    if (_hp <= (_maxhp * 0.1))
82
    {
83
        global.monsterhp[global.chartarget[arg0.myself]] = _maxhp * 0.1;
84
        violence_end = true;
85
        if (fight_type == "seth")
86
            aqua_sprite(4551, 0, 0);
87
    }
88
};
89
90
aqua_balloon = function(arg0 = x - 20, arg1 = y + 25)
91
{
92
    if (i_ex(obj_balloon_queue))
93
    {
94
        msgset_fromqueue();
95
    }
96
    else
97
    {
98
        global.typer = 50;
99
        
scr_enemyblcon
scr_enemyblcon

function
scr_enemyblcon(arg0, arg1, arg2)
{ if (arg2 == 0) { mywriter = instance_create(arg0, arg1, obj_writer); return mywriter; } if (arg2 == 1) { myblcon = instance_create(arg0, arg1, obj_battleblcon); return myblcon; } if (arg2 == 2) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_v; return myblcon; } if (arg2 == 3) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long; return myblcon; } if (arg2 == 4) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long; myblcon.image_index = 0; myblcon.image_speed = 0; return myblcon; } if (arg2 == 5) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long; myblcon.image_index = 1; myblcon.image_speed = 0; return myblcon; } if (arg2 == 6) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_clubs; myblcon.image_index = 2; myblcon.image_speed = 0; return myblcon; } if (arg2 == 7) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long_r; myblcon.image_index = 2; myblcon.image_speed = 0; return myblcon; } if (arg2 == 8) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long_tall; return myblcon; } if (arg2 == 10) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long; myblcon.auto_length = 1; return myblcon; } if (arg2 == 11) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_v2_left; return myblcon; } if (arg2 == 12) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_v2_right; return myblcon; } if (arg2 == 13) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long; myblcon.auto_length = 1; myblcon.side = 2; return myblcon; } if (arg2 == 14) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long; myblcon.auto_length = 1; myblcon.side = -1; return myblcon; } if (arg2 == 15) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long; ...
(arg0, arg1, 10);
100
        talktimer = 0;
101
        rtimer = 0;
102
    }
103
};
104
105
aqua_balloon_control = function()
106
{
107
    if ((button3_p() && talktimer > 15) || !instance_exists(obj_writer))
108
    {
109
        with (obj_writer)
110
            instance_destroy();
111
        if (i_ex(obj_balloon_queue))
112
            msgset_fromqueue();
113
    }
114
};
115
116
aqua_sprite = function(arg0 = 2001, arg1 = siner, arg2 = image_speed)
117
{
118
    idlesprite = arg0;
119
    sparesprite = arg0;
120
    siner = arg1;
121
    image_speed = arg2;
122
};
123
124
aqua_actflash = function()
125
{
126
    with (
scr_oflash
scr_oflash

function
scr_oflash()
{ _oflash = instance_create(x, y, obj_oflash); _oflash.image_xscale = image_xscale; _oflash.image_speed = 0; _oflash.image_angle = image_angle; _oflash.image_index = image_index; _oflash.image_yscale = image_yscale; _oflash.sprite_index = sprite_index; _oflash.depth = depth - 1; _oflash.target = id; return _oflash; }
())
127
    {
128
        sprite_index = other.idlesprite;
129
        image_index = other.siner;
130
    }
131
    with (
scr_afterimage
scr_afterimage

function
scr_afterimage()
{ afterimage = instance_create(x, y, obj_afterimage); 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; }
())
132
    {
133
        sprite_index = other.idlesprite;
134
        image_index = other.siner;
135
        hspeed = -2.5;
136
        depth = other.depth + 1;
137
    }
138
    with (
scr_afterimage
scr_afterimage

function
scr_afterimage()
{ afterimage = instance_create(x, y, obj_afterimage); 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; }
())
139
    {
140
        sprite_index = other.idlesprite;
141
        image_index = other.siner;
142
        image_alpha = 0.6;
143
        hspeed = -5;
144
        depth = other.depth + 2;
145
    }
146
};