Skip to content

Commit c144333

Browse files
committed
ice traps
1 parent 49a5000 commit c144333

File tree

5 files changed

+397
-2
lines changed

5 files changed

+397
-2
lines changed

ClientYAM2RP/Code/Objects/oControl/gml_Object_oControl_Create_0.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,4 +577,4 @@ global.warptoship = 0;
577577
global.lastDamageIndex = 0;
578578
global.opmwcasesensitive = 0;
579579
global.freeForAll = 0;
580-
global.clearWrongWarps = 0;
580+
global.clearWrongWarps = 0;
Lines changed: 362 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,362 @@
1+
if (fadedone >= 1 && room != rm_transition && room != rm_subscreen && room != itemroom && room != rm_death)
2+
{
3+
global.transitiontype = 0;
4+
event_user(4);
5+
}
6+
7+
if (!init)
8+
{
9+
if (os_type == os_linux)
10+
linux_keys();
11+
else if (os_type == os_android)
12+
touch_keys();
13+
else
14+
check_keys();
15+
16+
if (room != rm_transition && !global.CONSOLE && (global.playerFreeze == 0 || !instance_exists(oCharacter)))
17+
global_control();
18+
19+
if (kExit && global.opexitkeyenable)
20+
game_end();
21+
22+
if (kStart && kStartPushedSteps == 0)
23+
event_user(0);
24+
}
25+
26+
if (global.ingame == 1)
27+
{
28+
if (malpha > -1)
29+
malpha -= 0.02;
30+
31+
if (malpha <= 0)
32+
malpha = 1;
33+
34+
markfr += 0.25;
35+
36+
if (markfr > 4)
37+
markfr = 0;
38+
39+
global.roomtime += 1;
40+
hpalarm = 0;
41+
42+
if (global.maxhealth < 100)
43+
{
44+
if (global.playerhealth < 30)
45+
hpalarm = 2;
46+
47+
if (global.playerhealth < 10)
48+
hpalarm = 3;
49+
}
50+
else if (global.maxhealth < 500)
51+
{
52+
if (global.playerhealth < 50)
53+
hpalarm = 1;
54+
55+
if (global.playerhealth < 30)
56+
hpalarm = 2;
57+
58+
if (global.playerhealth < 10)
59+
hpalarm = 3;
60+
}
61+
else
62+
{
63+
if (global.playerhealth < 100)
64+
hpalarm = 1;
65+
66+
if (global.playerhealth < 50)
67+
hpalarm = 2;
68+
69+
if (global.playerhealth < 25)
70+
hpalarm = 3;
71+
}
72+
73+
if (hudflash > 0)
74+
{
75+
hudflash -= 1;
76+
77+
if (hudflashfx > 0)
78+
hudflashfx -= 1;
79+
else
80+
hudflashfx = 4;
81+
}
82+
}
83+
84+
view_wport[0] = 320;
85+
view_wview[0] = 320;
86+
view_hport[0] = 240;
87+
view_hview[0] = 240;
88+
89+
if (window_get_fullscreen())
90+
{
91+
if (global.opscale == 0)
92+
{
93+
if (!widescreen)
94+
{
95+
if (display_get_height() < display_get_width())
96+
display_scale = display_get_height() / 240;
97+
else
98+
display_scale = display_get_width() / 320;
99+
}
100+
else if (((display_get_width() / (320 + widescreen_space)) * 240) <= display_get_height())
101+
{
102+
display_scale = display_get_width() / (320 + widescreen_space);
103+
}
104+
else
105+
{
106+
display_scale = display_get_height() / 240;
107+
}
108+
}
109+
else
110+
{
111+
display_scale = global.opscale;
112+
}
113+
114+
displayx = (display_get_width() / 2) - (((320 + widescreen_space) * display_scale) / 2);
115+
displayy = (display_get_height() / 2) - ((240 * display_scale) / 2);
116+
}
117+
else
118+
{
119+
if (window_get_height() < window_get_width())
120+
display_scale = window_get_height() / 240;
121+
else
122+
display_scale = window_get_width() / (320 + widescreen_space);
123+
124+
displayx = (window_get_width() / 2) - (((320 + widescreen_space) * display_scale) / 2);
125+
displayy = (window_get_height() / 2) - ((240 * display_scale) / 2);
126+
}
127+
128+
if (surface_exists(gui_surface))
129+
{
130+
if (surface_get_width(gui_surface) != (320 + widescreen_space))
131+
surface_free(gui_surface);
132+
}
133+
134+
if (!surface_exists(gui_surface))
135+
gui_surface = surface_create(320 + widescreen_space, 240);
136+
137+
if (surface_exists(gui_surface))
138+
{
139+
surface_set_target(gui_surface);
140+
draw_clear_alpha(c_black, 0);
141+
142+
if (global.ingame && displaygui && instance_exists(oCharacter))
143+
draw_gui();
144+
145+
surface_reset_target();
146+
}
147+
148+
if (debug > 0)
149+
{
150+
global.playerhealth = global.maxhealth;
151+
global.missiles = 99;
152+
global.smissiles = 99;
153+
global.pbombs = 99;
154+
}
155+
156+
if (black > 0)
157+
black -= 1;
158+
159+
if (os_is_paused())
160+
keyboard_clear(vk_alt);
161+
162+
if (instance_exists(oCharacter) && mod_IGT && !instance_exists(oIGT))
163+
instance_create(0, 0, oIGT);
164+
165+
switch (palette)
166+
{
167+
case 0:
168+
if (MultitroidPalette != MultitroidPaletteDefault)
169+
MultitroidPalette = MultitroidPaletteDefault;
170+
171+
if (MultitroidPaletteFusion != MultitroidPaletteFusionDefault)
172+
MultitroidPaletteFusion = MultitroidPaletteFusionDefault;
173+
174+
if (SpiderballPalette != SpiderballPaletteDefault)
175+
SpiderballPalette = SpiderballPaletteDefault;
176+
177+
if (MultitroidBabyPalette != MultitroidBabyPaletteDefault)
178+
MultitroidBabyPalette = MultitroidBabyPaletteDefault;
179+
180+
if (MultitroidIcon != MultitroidIconDefault)
181+
MultitroidIcon = MultitroidIconDefault;
182+
183+
if (MultitroidIconDark != MultitroidIconDarkDefault)
184+
MultitroidIconDark = MultitroidIconDarkDefault;
185+
186+
if (MultitroidMapIcon != MultitroidMapIconDefault)
187+
MultitroidMapIcon = MultitroidMapIconDefault;
188+
189+
break;
190+
191+
case 1:
192+
if (MultitroidPalette != MultitroidPaletteColor)
193+
MultitroidPalette = MultitroidPaletteColor;
194+
195+
if (MultitroidPaletteFusion != MultitroidPaletteFusionColor)
196+
MultitroidPaletteFusion = MultitroidPaletteFusionColor;
197+
198+
if (SpiderballPalette != SpiderballPaletteColor)
199+
SpiderballPalette = SpiderballPaletteColor;
200+
201+
if (MultitroidBabyPalette != MultitroidBabyPaletteColor)
202+
MultitroidBabyPalette = MultitroidBabyPaletteColor;
203+
204+
if (MultitroidIcon != MultitroidIconColor)
205+
MultitroidIcon = MultitroidIconColor;
206+
207+
if (MultitroidIconDark != MultitroidIconDarkColor)
208+
MultitroidIconDark = MultitroidIconDarkColor;
209+
210+
if (MultitroidMapIcon != MultitroidMapIconColor)
211+
MultitroidMapIcon = MultitroidMapIconColor;
212+
213+
break;
214+
215+
case 2:
216+
if (MultitroidPalette != MultitroidPaletteCustom)
217+
MultitroidPalette = MultitroidPaletteCustom;
218+
219+
if (MultitroidPaletteFusion != MultitroidPaletteFusionCustom)
220+
MultitroidPaletteFusion = MultitroidPaletteFusionCustom;
221+
222+
if (SpiderballPalette != SpiderballPaletteCustom)
223+
SpiderballPalette = SpiderballPaletteCustom;
224+
225+
if (MultitroidBabyPalette != MultitroidBabyPaletteCustom)
226+
MultitroidBabyPalette = MultitroidBabyPaletteCustom;
227+
228+
if (MultitroidIcon != MultitroidIconCustom)
229+
MultitroidIcon = MultitroidIconCustom;
230+
231+
if (MultitroidIconDark != MultitroidIconDarkCustom)
232+
MultitroidIconDark = MultitroidIconDarkCustom;
233+
234+
if (MultitroidMapIcon != MultitroidMapIconCustom)
235+
MultitroidMapIcon = MultitroidMapIconCustom;
236+
237+
break;
238+
239+
case 3:
240+
if (MultitroidPalette != 66)
241+
MultitroidPalette = 66;
242+
243+
if (MultitroidPaletteFusion != 66)
244+
MultitroidPaletteFusion = 66;
245+
246+
if (SpiderballPalette != 66)
247+
SpiderballPalette = 66;
248+
249+
if (MultitroidBabyPalette != 66)
250+
MultitroidBabyPalette = 66;
251+
252+
break;
253+
}
254+
255+
global.scannerSpeed--;
256+
257+
if (global.scannerSpeed <= 0)
258+
{
259+
global.scannerSpeed = global.scannerSpeedMax;
260+
global.scannerIndex++;
261+
262+
switch (global.scannerSprite)
263+
{
264+
case 1882:
265+
if (global.scannerIndex > 3)
266+
global.scannerIndex = 0;
267+
268+
break;
269+
270+
default:
271+
if (global.scannerIndex > 4)
272+
global.scannerIndex = 0;
273+
274+
break;
275+
}
276+
}
277+
278+
if (global.showHealthIndicatorsTimer == 1)
279+
global.saveStationCooldown = 1200;
280+
281+
if (global.showHealthIndicatorsTimer > 0)
282+
{
283+
global.showHealthIndicatorsTimer--;
284+
global.showHealthIndicators = 1;
285+
}
286+
else
287+
{
288+
global.showHealthIndicators = 0;
289+
}
290+
291+
if (global.escapeTimer > 0)
292+
global.escapeTimer--;
293+
294+
if (global.pbombCooldown < 600)
295+
global.pbombCooldown++;
296+
297+
if (global.item[0] == 1 || (global.showHealthIndicators && global.saxmode))
298+
global.pbombCooldownMax = 600;
299+
else
300+
global.pbombCooldownMax = 300;
301+
302+
var setIFrames = 0;
303+
304+
if (global.playerFreeze == 1)
305+
setIFrames = 1;
306+
307+
if (global.playerFreeze > 0)
308+
global.playerFreeze--;
309+
310+
if (global.playerFreeze == 0)
311+
{
312+
global.frozenNormally = 0;
313+
global.frozenByRollback = 0;
314+
}
315+
316+
if (setIFrames)
317+
{
318+
if (instance_exists(oCharacter))
319+
oCharacter.invincible = 180;
320+
}
321+
322+
if (global.fxtimer < 5)
323+
global.fxtimer += 1;
324+
else
325+
global.fxtimer = 0;
326+
327+
if (global.saxmode && !global.sax)
328+
global.icemissiles = 1;
329+
else
330+
global.icemissiles = 0;
331+
332+
if (global.saxmode)
333+
global.event[176] = 1;
334+
335+
if (global.reformTimer > 0 && global.spectator && global.sax)
336+
global.reformTimer--;
337+
338+
if (!global.spectator)
339+
global.reformTimer = 1200;
340+
341+
if (global.playerMapPosTimer == 1)
342+
global.mapmarker = 0;
343+
344+
if (global.playerMapPosTimer > 0)
345+
global.playerMapPosTimer--;
346+
347+
if (global.warpPipeCooldown > 0)
348+
global.warpPipeCooldown--;
349+
350+
if (global.saveStationCooldown > 0)
351+
global.saveStationCooldown--;
352+
353+
if (!instance_exists(oClient))
354+
global.shortcuts = 0;
355+
356+
if (!global.lobbyLocked)
357+
global.countdowncontrol = 180;
358+
else
359+
global.countdowncontrol = max(global.countdowncontrol - 1, -60);
360+
361+
if (global.countdowncontrol == 0)
362+
sfx_play(417);

ClientYAM2RP/Code/Objects/oMWConnector/gml_Object_oMWConnector_Alarm_0.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ global.emptraptimer = 0;
66
global.ohkotraptimer = 0;
77
global.touhoutraptimer = 0;
88
global.warpsleft = 0;
9+
global.playerFreeze = 0;

0 commit comments

Comments
 (0)