Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_rouxls_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; acting = 0; actcon = 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; 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; for (i = 0; i < 10; i++) _charactsprite[i] = 382938298329; depth = 90 - ((y - cameray()) / 50); }
();
2
var tensionbonus = (global.flag[458 houses_hit] / 7) * global.maxtension * 0.3;
3
scr_tensionheal
scr_tensionheal

function scr_tensionheal(arg0) { global.tension += arg0; if (global.tension > global.maxtension) global.tension = global.maxtension; }
(tensionbonus);
4
global.temptension[0] = tensionbonus;
5
talkmax = 90;
6
image_speed = 0.16666666666666666;
7
idlesprite = spr_rurus_pirate;
8
hurtsprite = spr_rurus_pirate;
9
sabersprite = spr_rurus_pirate_saber;
10
sparedsprite = spr_rurus_pirate;
11
custom_draw_example = 1;
12
depth = -10;
13
thrash = instance_create(x, y, obj_thrashmachine);
14
thrash.xx = x + 34;
15
thrash.yy = y + 108;
16
thrash.depth = depth + 5;
17
thrash.drawfeet = 0;
18
drawsiner = 0;
19
thrashmode = 0;
20
thrashcon = 0;
21
thrashbody = 0;
22
thrashtimer = 0;
23
remx = x;
24
remy = y;
25
movey = 0;
26
bulletoverride = -1;
27
chosenattack = 0;
28
advancespeed = 8;
29
returnspeed = 6;
30
aimtime = irandom(15) + 10;
31
floatheight = 0;
32
returnease = 0;
33
headattack = 0;
34
puddle = instance_create(x, y, obj_marker);
35
puddle.sprite_index = spr_rouxls_puddle;
36
puddle.image_xscale = 2;
37
puddle.image_yscale = 2;
38
puddle.image_speed = 0;
39
puddle.image_index = (thrash.part[0] == 2) ? 2 : 0;
40
var turretbody = thrash.part[0] == 2;
41
puddle.x = remx + (turretbody ? 18 : 34);
42
puddle.y = remy + 173 + ((thrash.s * cos((thrash.wsiner + thrash.wsinerrate) / 3)) / 4);
43
puddle.image_index = turretbody ? 2 : 0;
44
submerged = 1;
45
keytestmode = 0;
46
saberanim = 0;
47
head_difficulty = 0;
48
wheel_difficulty = 0;
49
buildedblocks = 0;
50
buildedblockstimer = 0;
51
did_kris_win_simcity = 0;
52
HouseCount = 1;
53
if (room != room_dw_mansion_acid_tunnel_loop_rouxls)
54
{
55
    tile6 = instance_create(camerax() + 0, cameray() + 80, obj_simtown_acidmaker);
56
    tile6.image_xscale = 16;
57
    tile6.image_yscale = 6;
58
    tile1 = instance_create(camerax() + 160, cameray() + 80, obj_simtown_landmaker);
59
    tile1.image_xscale = 8;
60
    tile2 = instance_create(camerax() + 160, cameray() + 120, obj_simtown_landmaker);
61
    tile2.image_xscale = 8;
62
    tile3 = instance_create(camerax() + 240, cameray() + 160, obj_simtown_landmaker);
63
    tile3.image_xscale = 3;
64
    tile4 = instance_create(camerax() + 280, cameray() + 200, obj_simtown_landmaker);
65
    tile4.image_xscale = 3;
66
    tile5 = instance_create(camerax() + 160, cameray() + 240, obj_simtown_landmaker);
67
    tile5.image_xscale = 8;
68
    tile6 = instance_create(camerax() + 160, cameray() + 280, obj_simtown_landmaker);
69
    tile6.image_xscale = 8;
70
}
71
if (!scr_debug
scr_debug

function scr_debug() { return 0; }
() || room == room_dw_mansion_acid_tunnel_loop_rouxls)
72
{
73
    with (obj_simtown_landmaker)
74
        visible = 0;
75
    with (obj_simtown_acidmaker)
76
        visible = 0;
77
}
78
if (!i_ex(obj_rouxls_simtown))
79
    simcity = instance_create(x, y, obj_rouxls_simtown);
80
else
81
    simcity = obj_rouxls_simtown;
82
puddle.depth = simcity.depth + 1;
83
depthChange = 0;
84
simcity.maker = id;
85
endbattle = 0;
86
actresult = "tie";
87
target_multiplier = 0;
88
with (obj_battleback)
89
    instance_destroy();
90
ballooncount = 0;
91
ballooncon = 0;
92
talkedcon = 0;
93
talktimer = 0;
94
hasplayerplacedhouses = 0;
95
ralseitalks = 0;
96
attackorder = 0;
97
zone[0] = stringsetloc(
Residential
"Residential", "obj_rouxls_enemy_slash_Create_0_gml_116_0"
);
98
zone[1] = stringsetloc(
Commercial
"Commercial", "obj_rouxls_enemy_slash_Create_0_gml_117_0"
);
99
zone[2] = stringsetloc(
Industrial
"Industrial", "obj_rouxls_enemy_slash_Create_0_gml_118_0"
);
100
city[0] = stringsetloc(
Parks
"Parks", "obj_rouxls_enemy_slash_Create_0_gml_120_0"
);
101
city[1] = stringsetloc(
Crime
"Crime", "obj_rouxls_enemy_slash_Create_0_gml_121_0"
);
102
city[2] = stringsetloc(
Public Transport
"Public Transport", "obj_rouxls_enemy_slash_Create_0_gml_122_0"
);
103
duckmode = global.flag[220 thrash_machine_head] == 3 && global.flag[221 thrash_machine_body] == 3 && global.flag[222 thrash_machine_shoe] == 3;
104
stat1[0][0] = 5;
105
stat2[0][0] = 4;
106
stat1[0][1] = 1;
107
stat2[0][1] = 0;
108
stat1[0][2] = 2;
109
stat2[0][2] = 3;
110
stat1[0][3] = 6;
111
stat2[0][3] = 6;
112
stat1[1][0] = 0;
113
stat2[1][0] = 2;
114
stat1[1][1] = 4;
115
stat2[1][1] = 1;
116
stat1[1][2] = 3;
117
stat2[1][2] = 5;
118
stat1[1][3] = 6;
119
stat2[1][3] = 6;
120
stat1[2][0] = 1;
121
stat2[2][0] = 2;
122
stat1[2][1] = 3;
123
stat2[2][1] = 4;
124
stat1[2][2] = 0;
125
stat2[2][2] = 5;
126
stat1[2][3] = 6;
127
stat2[2][3] = 6;
128
for (i = 0; i < 6; i += 1)
129
    stat[i] = 0;
130
for (i = 0; i < 3; i += 1)
131
{
132
    if (global.flag[220 + i] >= 0)
133
    {
134
        var addstat1 = stat1[i][global.flag[220 + i]];
135
        var addstat2 = stat2[i][global.flag[220 + i]];
136
        if (addstat1 < 6)
137
            stat[addstat1] += 1;
138
        if (addstat2 < 6)
139
            stat[addstat2] += 1;
140
    }
141
}
142
type = -1;
143
topstat = -1;
144
topstatlevel = 0;
145
for (i = 0; i < 6; i += 1)
146
{
147
    if (stat[i] == topstatlevel && topstatlevel >= 2)
148
        type = 7;
149
    if (stat[i] > topstatlevel)
150
    {
151
        topstat = i;
152
        topstatlevel = stat[i];
153
    }
154
}
155
type = topstat;
156
if (type == 7)
157
    type = -1;
158
if (topstatlevel == 0)
159
    type = 6;