Skip to content

Commit 7f1ee12

Browse files
committed
2 parents eb30a11 + 918f124 commit 7f1ee12

File tree

27 files changed

+684
-591
lines changed

27 files changed

+684
-591
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[bumpversion]
22
commit = True
33
tag = False
4-
current_version = 5.7.53
4+
current_version = 5.7.55
55

66
[bumpversion:file:version.py]
77
search = version = "{current_version}"

archipelago/Logic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ def CanAccessKRool(self):
17101710
Events.CastleKeyTurnedIn,
17111711
Events.HelmKeyTurnedIn,
17121712
]
1713-
if self.settings.k_rool_vanilla_requirement:
1713+
if self.settings.win_condition_item == WinConditionComplex.get_keys_3_and_8:
17141714
required_base_keys = [
17151715
Events.FactoryKeyTurnedIn,
17161716
Events.HelmKeyTurnedIn,

archipelago/Options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Goal(Choice):
3737
- pearls: Find a certain number of Pearls to win. See goal_quantity option for more info.
3838
- bosses: Defeat a certain number of bosses to win. See goal_quantity option for more info.
3939
- bonuses: Complete a certain number of Bonus Barrels to win. Automatically disables auto_complete_bonus_barrels if set. See goal_quantity option for more info.
40-
- treasure_hurry: Run down the timer by collecting treasure! You win when the timer reaches 0.
40+
- treasure_hurry: Run down the timer by collecting treasure! You win when the timer reaches 0. If you beat Helm, the wincon automatically changes to beating K. Rool.
4141
- krools_challenge: K. Rool's ship does not spawn until you collect All keys, Defeat All bosses, Play all Bonus Barrels, and collect All Blueprints.
4242
- kill_the_rabbit: Kill the rabbit in Chunky's igloo in Caves. Turn it to Ash. Simple as that.
4343
"""
105 KB
Loading

base-hack/include/global.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ extern void checkSeedVictory(void);
236236
extern void checkVictory_flaghook(int flag);
237237
extern void winRabbitSeed(int song, float volume);
238238
extern void safeguardRabbitReward(void);
239-
extern int canAccessKroolsChallenge(void);
240239
extern int canAccessWinCondition(void);
241240
extern void FileProgressInitSub(int file, int shuffle);
242241
extern void handleFileSelectSprites(void* paad, void* sprite, int x, int y, float scale, int unk0, int control);
@@ -389,6 +388,9 @@ extern void HelmLobbyGoneCode(behaviour_data* behaviour_pointer, int index);
389388
extern void setObjectOpacity(behaviour_data* behaviour_pointer, int opacity);
390389
extern int standingOnM2Object(int index);
391390

391+
extern void renderSparkles(float scale);
392+
extern void renderBoulderSparkles(actorData *actor);
393+
392394
extern int getItemCountReq(requirement_item item);
393395
extern int isItemRequirementSatisfied(ItemRequirement* req);
394396

base-hack/include/variable_space_structs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ typedef struct varspace {
138138
/* 0x1C6 */ RandomSwitchesSetting switchsanity; // Size 0x15
139139
/* 0x1DB */ unsigned char fungi_time_of_day_setting; // See fungi_time enum
140140
/* 0x1DC */ unsigned char galleon_water_raised;
141-
/* 0x1DD */ unsigned char krool_requirements; // K Rool bitfield 8765 4321
141+
/* 0x1DD */ unsigned char unk_1dd;
142142
/* 0x1DE */ RemovedBarriers removed_barriers; // Size: 2
143143
/* 0x1E0 */ FasterChecks faster_checks; // Size: 1
144144
/* 0x1E1 */ char big_head_mode; // 0 = off, 1 = on, 2 = small head

base-hack/src/instances/instances.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -495,19 +495,15 @@ int change_object_scripts(behaviour_data* behaviour_pointer, int id, int index,
495495
}
496496
} else if (param2 == K_ROOL_SHIP) {
497497
// Check access requirements based on ship spawn method
498-
if (Rando.win_condition_spawns_ship == 1) {
498+
if (Rando.win_condition_spawns_ship) {
499499
// Win condition-based access
500500
if (!canAccessWinCondition()) {
501501
return 0;
502502
}
503503
} else {
504504
// Key-based access
505-
for (int i = 0; i < 8; i++) {
506-
if (Rando.krool_requirements & (1 << i)) {
507-
if (!getItemCount_new(REQITEM_KEY, i, 0)) {
508-
return 0;
509-
}
510-
}
505+
if (!getItemCount_new(REQITEM_KEY, -1, 0) < 8) {
506+
return 0;
511507
}
512508
}
513509
return 1;

base-hack/src/item rando/enemy_items.c

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,27 @@ float getRNGWithinRange(float min, float max) {
109109
return min + offset;
110110
}
111111

112+
void renderSparkles(float scale) {
113+
*(char*)(0x807FDB18) = 1; // Adjust Z-Indexing
114+
*(short*)(0x807FDB36) = 4; // Fix rendering
115+
float x_offset = getRNGWithinRange(-20.f, 20.0f);
116+
float y_offset = getRNGWithinRange(5.0f, 25.0f);
117+
float z_offset = getRNGWithinRange(-20.f, 20.0f);
118+
x_offset *= scale;
119+
y_offset *= scale;
120+
z_offset *= scale;
121+
int sprite = 0x5E;
122+
if (getRNGLower31() & 1) {
123+
sprite = 0x69;
124+
}
125+
displaySpriteAtXYZ(
126+
sprite_table[sprite],
127+
0.6f,
128+
CurrentActorPointer_0->xPos + x_offset,
129+
CurrentActorPointer_0->yPos + y_offset,
130+
CurrentActorPointer_0->zPos + z_offset);
131+
}
132+
112133
void indicateCollectionStatus(void) {
113134
*(char*)(0x807F94AE) = 0;
114135
*(char*)(0x807F94AF) = 0;
@@ -125,21 +146,7 @@ void indicateCollectionStatus(void) {
125146
if (!canSpawnEnemyReward()) {
126147
return;
127148
}
128-
*(char*)(0x807FDB18) = 1; // Adjust Z-Indexing
129-
*(short*)(0x807FDB36) = 4; // Fix rendering
130-
float x_offset = getRNGWithinRange(-20.f, 20.0f);
131-
float y_offset = getRNGWithinRange(5.0f, 25.0f);
132-
float z_offset = getRNGWithinRange(-20.f, 20.0f);
133-
int sprite = 0x5E;
134-
if (getRNGLower31() & 1) {
135-
sprite = 0x69;
136-
}
137-
displaySpriteAtXYZ(
138-
sprite_table[sprite],
139-
0.6f,
140-
CurrentActorPointer_0->xPos + x_offset,
141-
CurrentActorPointer_0->yPos + y_offset,
142-
CurrentActorPointer_0->zPos + z_offset);
149+
renderSparkles(1.0f);
143150
}
144151

145152

base-hack/src/item rando/spawning.c

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -300,23 +300,28 @@ void* updateKegIDs(int actor, float x, float y, float z) {
300300
return spawnActorAtXYZ(actor, x, y, z);
301301
}
302302

303-
void spawnBoulderObject(actorData *actor) {
304-
int index = getBoulderIndex();
303+
int isValidBoulderObject(int index) {
305304
if (index < 0) {
306-
return;
305+
return 0;
307306
}
308307
if (HoldableSpawnBitfield & (1 << index)) {
309-
return;
308+
return 0;
310309
}
311310
int flag = FLAG_GRABBABLES_DESTROYED + index;
312311
if (checkFlag(flag, FLAGTYPE_PERMANENT)) {
313-
return;
312+
return 0;
314313
}
315314
int item = getBoulderItem(index);
316-
if (!item) {
317-
return;
318-
}
319315
if (item == NEWACTOR_NULL) {
316+
return 0;
317+
}
318+
return item;
319+
}
320+
321+
void spawnBoulderObject(actorData *actor) {
322+
int index = getBoulderIndex();
323+
int item = isValidBoulderObject(index);
324+
if (!item) {
320325
return;
321326
}
322327
int cutscene = 1;
@@ -328,8 +333,26 @@ void spawnBoulderObject(actorData *actor) {
328333
actor->yPos,
329334
actor->zPos,
330335
0, cutscene,
331-
flag, 0,
336+
FLAG_GRABBABLES_DESTROYED + index, 0,
332337
boulder_item_table[index].level,
333338
boulder_item_table[index].kong);
334339
HoldableSpawnBitfield |= (1 << index);
340+
}
341+
342+
void renderBoulderSparkles(actorData *actor) {
343+
unkBonusFunction(actor);
344+
int index = getBoulderIndex();
345+
int item = isValidBoulderObject(index);
346+
if (!item) {
347+
return;
348+
}
349+
int timer = ObjectModel2Timer + (index * 5);
350+
if (timer % 10) {
351+
return;
352+
}
353+
float scale = 1.0f;
354+
if (index == GRABBABLE_CAVES_LARGE) {
355+
scale = 3.0f;
356+
}
357+
renderSparkles(scale);
335358
}

base-hack/src/misc/music_text.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,17 @@ void SpeedUpMusic(void) {
6262
return;
6363
}
6464
win_conditions win_con = Rando.win_condition;
65-
if (win_con == GOAL_KROOLS_CHALLENGE) {
66-
if (!canAccessKroolsChallenge()) {
65+
if (Rando.win_condition_spawns_ship) {
66+
if (!canAccessWinCondition()) {
6767
return;
6868
}
69-
} else {
70-
requirement_item win_con_item = Rando.win_condition_extra.item;
69+
} else if (win_con == GOAL_CUSTOMITEM) {
7170
int win_con_count = Rando.win_condition_extra.count;
72-
// Checking items
73-
if (win_con == GOAL_KROOL) {
74-
win_con_item = REQITEM_KEY;
75-
win_con_count = 9; // Triggers upon picking up the 8th key
76-
} else if (win_con != GOAL_CUSTOMITEM) {
77-
// Goal is ineligible for speed up
78-
return;
79-
}
8071
if (win_con_count < 2) {
8172
// Doesn't work for 1-item win conditions
8273
return;
8374
}
84-
int item_count = getItemCountReq(win_con_item);
75+
int item_count = getItemCountReq(Rando.win_condition_extra.item);
8576
if (item_count != (win_con_count - 1)) {
8677
return;
8778
}

0 commit comments

Comments
 (0)