Skip to content

Commit 4491c68

Browse files
committed
Ice trap text
1 parent 95cc93e commit 4491c68

5 files changed

Lines changed: 25 additions & 2 deletions

File tree

TODO.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Randomizer
22
- ~~Title screen version info~~
33
- Draw hash on file select
4-
- Add pointers to data needed by patcher
4+
- ~~Add pointers to data needed by patcher~~
55
- ~~Palettes~~
66
- ~~Room data~~
77
- ~~Door data (DLR)~~
@@ -36,6 +36,7 @@
3636
- Replace Chozo statue graphics
3737
- ~~Fix ending percent calculation~~
3838
- Include bug fixes for bugs that don't help speedrunners
39+
- Increase enemy drop rates for power bombs
3940

4041
## Room Changes
4142
- Remove duplicate rooms near Ruins Test?

include/constants/text.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ MAKE_ENUM(u8, MessageId) {
6060
MESSAGE_UNKNOWN_ITEM,
6161
MESSAGE_ZIPLINES,
6262
MESSAGE_INFANT_METROID,
63+
MESSAGE_ICE_TRAP,
6364
#endif // RANDOMIZER
6465

6566
MESSAGE_COUNT,

src/data/text_data.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ const u16 sEnglishText_Message_EasySleepPrompt[] = INCTEXT("{GAP(101)}Yes\n{GAP(
380380
const u16 sEnglishText_Message_UnknownItem[] = INCTEXT("{GAP(74)}{COLOR(5)}Unknown Item\n{GAP(110)}");
381381
const u16 sEnglishText_Message_Ziplines[] = INCTEXT("{GAP(74)}{COLOR(5)}Ziplines Activated\n{GAP(110)}");
382382
const u16 sEnglishText_Message_InfantMetroid[] = INCTEXT("{GAP(74)}{COLOR(5)}Infant Metroid\n{GAP(110)}");
383+
const u16 sEnglishText_Message_IceTrap[] = INCTEXT("{GAP(74)}You are a FOOL!\n{GAP(110)}");
383384
#endif // RANDOMIZER
384385
#endif // REGION_EU
385386

@@ -427,6 +428,7 @@ static const u16* sEnglishTextPointers_Message[MESSAGE_COUNT] = {
427428
[MESSAGE_UNKNOWN_ITEM] = sEnglishText_Message_UnknownItem,
428429
[MESSAGE_ZIPLINES] = sEnglishText_Message_Ziplines,
429430
[MESSAGE_INFANT_METROID] = sEnglishText_Message_InfantMetroid,
431+
[MESSAGE_ICE_TRAP] = sEnglishText_Message_IceTrap,
430432
#endif // RANDOMIZER
431433
};
432434

src/randomizer.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
#include "randomizer.h"
22

3+
#include "audio_wrappers.h"
34
#include "event.h"
45
#include "in_game_cutscene.h"
6+
#include "particle.h"
57
#include "projectile_util.h"
8+
#include "samus.h"
69
#include "sprite.h"
710

811
#include "data/randomizer_data.h"
912
#include "data/text_data.h"
1013

14+
#include "constants/audio.h"
1115
#include "constants/event.h"
1216
#include "constants/in_game_cutscene.h"
1317
#include "constants/menus/pause_screen.h"
18+
#include "constants/particle.h"
1419
#include "constants/randomizer.h"
1520
#include "constants/samus.h"
1621
#include "constants/sprite.h"
@@ -86,7 +91,8 @@ const struct MinorLocation* RandoGetMinorLocation(Area area, u8 room, u8 blockX,
8691
}
8792

8893
/**
89-
* @brief TODO
94+
* @brief Handles collecting an item, including updating equipment, spawning
95+
* a message banner, and updating events
9096
*/
9197
static void RandoCollectItem(RandoItemType item, u8 hintedBy)
9298
{
@@ -236,6 +242,17 @@ static void RandoCollectItem(RandoItemType item, u8 hintedBy)
236242
message = MESSAGE_ZIPLINES;
237243
EventFunction(EVENT_ACTION_SETTING, EVENT_ZIPLINES_ACTIVATED);
238244
break;
245+
246+
case RIT_ICE_TRAP:
247+
message = MESSAGE_ICE_TRAP;
248+
// Play freeze sound
249+
SoundPlayNotAlreadyPlaying(SOUND_FREEZING_SPRITE);
250+
// Add charged ice beam effect
251+
ParticleSet(gSamusData.yPosition + (gSamusPhysics.hitboxTop / 2),
252+
gSamusData.xPosition, PE_FREEZING_SPRITE_WITH_CHARGED_ICE);
253+
// TODO: Freeze Samus
254+
SamusSetPose(SPOSE_KNOCKBACK_REQUEST);
255+
break;
239256
}
240257

241258
// Spawn the message banner

src/sprites_ai/message_banner.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ static void MessageBannerPopUp(void)
202202
case MESSAGE_FULLY_POWERED_SUIT:
203203
case MESSAGE_ZIPLINES:
204204
case MESSAGE_INFANT_METROID:
205+
case MESSAGE_ICE_TRAP:
205206
isItem = TRUE;
206207
break;
207208
}
@@ -218,6 +219,7 @@ static void MessageBannerPopUp(void)
218219
case MESSAGE_MISSILE_TANK_ACQUIRED:
219220
case MESSAGE_SUPER_MISSILE_TANK_ACQUIRED:
220221
case MESSAGE_POWER_BOMB_TANK_ACQUIRED:
222+
case MESSAGE_ICE_TRAP:
221223
gCurrentRandoItem.jingle = RIJ_MINOR;
222224
break;
223225

0 commit comments

Comments
 (0)