Skip to content

Commit 6c69f8c

Browse files
authored
Merge pull request #2956 from Lrauq/no-consumable-upgrades
No consumable upgrades
2 parents 0933382 + ab9c02a commit 6c69f8c

File tree

10 files changed

+55
-18
lines changed

10 files changed

+55
-18
lines changed

archipelago/FillSettings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ def get_default_settings() -> dict:
234234
MiscChangesSelected.move_spring_cabin_rocketbarrel,
235235
],
236236
"more_cutscene_skips": ExtraCutsceneSkips.auto,
237+
"no_consumable_upgrades": False,
237238
"no_healing": False,
238239
"no_melons": False,
239240
"open_lobbies": False,

randomizer/Enums/Settings.jsonc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,8 @@
14181418
"kong_model_mode": 291,
14191419
"win_condition_spawns_ship": 292,
14201420
"ice_trap_model": 293,
1421-
"krool_in_boss_pool_v2": 294
1421+
"krool_in_boss_pool_v2": 294,
1422+
"no_consumable_upgrades": 295
14221423
},
14231424
/*
14241425
SettingsStringDataType:
@@ -2109,6 +2110,7 @@
21092110
"SettingsStringEnum.shops_dont_cost": { "obj": "SettingsStringDataType.bool" },
21102111
"SettingsStringEnum.alt_minecart_mayhem": { "obj": "SettingsStringDataType.bool" },
21112112
"SettingsStringEnum.less_fragile_boulders": { "obj": "SettingsStringDataType.bool" },
2113+
"SettingsStringEnum.no_consumable_upgrades": { "obj": "SettingsStringDataType.bool" },
21122114
"SettingsStringEnum.prog_slam_level_1": { "obj": "SlamRequirement" },
21132115
"SettingsStringEnum.prog_slam_level_2": { "obj": "SlamRequirement" },
21142116
"SettingsStringEnum.prog_slam_level_3": { "obj": "SlamRequirement" },

randomizer/Fill.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,7 +2289,8 @@ def Fill(spoiler: Spoiler) -> None:
22892289
bigListOfItemsToPlace = []
22902290
if Types.Shop in spoiler.settings.shuffled_location_types:
22912291
bigListOfItemsToPlace.extend(ItemPool.ImportantSharedMoves.copy())
2292-
bigListOfItemsToPlace.extend(ItemPool.JunkSharedMoves.copy())
2292+
if not spoiler.settings.no_consumable_upgrades:
2293+
bigListOfItemsToPlace.extend(ItemPool.JunkSharedMoves.copy())
22932294
bigListOfItemsToPlace.extend(ItemPool.DonkeyMoves)
22942295
bigListOfItemsToPlace.extend(ItemPool.DiddyMoves)
22952296
bigListOfItemsToPlace.extend(ItemPool.LankyMoves)
@@ -2822,19 +2823,20 @@ def ShuffleSharedMoves(spoiler: Spoiler, placedMoves: List[Items], placedTypes:
28222823
)
28232824
if importantSharedUnplaced > 0:
28242825
raise Ex.ItemPlacementException("Unable to find enough locations to place " + str(importantSharedUnplaced) + " shared important items.")
2825-
junkSharedToPlace = ItemPool.JunkSharedMoves.copy()
2826-
for item in placedMoves:
2827-
if item in junkSharedToPlace:
2828-
junkSharedToPlace.remove(item)
2829-
placedMoves.extend(junkSharedToPlace)
2830-
junkSharedUnplaced = PlaceItems(
2831-
spoiler,
2832-
FillAlgorithm.random,
2833-
junkSharedToPlace,
2834-
[x for x in ItemPool.GetItemsNeedingToBeAssumed(spoiler.settings, placedTypes) if x not in junkSharedToPlace],
2835-
)
2836-
if junkSharedUnplaced > 0:
2837-
raise Ex.ItemPlacementException("Unable to find enough locations to place " + str(junkSharedUnplaced) + " shared junk items.")
2826+
if not spoiler.settings.no_consumable_upgrades:
2827+
junkSharedToPlace = ItemPool.JunkSharedMoves.copy()
2828+
for item in placedMoves:
2829+
if item in junkSharedToPlace:
2830+
junkSharedToPlace.remove(item)
2831+
placedMoves.extend(junkSharedToPlace)
2832+
junkSharedUnplaced = PlaceItems(
2833+
spoiler,
2834+
FillAlgorithm.random,
2835+
junkSharedToPlace,
2836+
[x for x in ItemPool.GetItemsNeedingToBeAssumed(spoiler.settings, placedTypes) if x not in junkSharedToPlace],
2837+
)
2838+
if junkSharedUnplaced > 0:
2839+
raise Ex.ItemPlacementException("Unable to find enough locations to place " + str(junkSharedUnplaced) + " shared junk items.")
28382840

28392841

28402842
def GeneratePlaythrough(spoiler: Spoiler) -> None:
@@ -4254,6 +4256,8 @@ def CheckForIncompatibleSettings(settings: Settings) -> None:
42544256
if IsDDMSSelected(settings.hard_mode_selected, HardModeSelected.water_is_lava):
42554257
if settings.no_healing:
42564258
found_incompatibilities += "Cannot turn on 'Water is Lava' whilst disabling healing. "
4259+
if settings.no_consumable_upgrades and not settings.start_with_3rd_melon:
4260+
found_incompatibilities += "Cannot turn on 'Water is Lava' without access to 3 Melons of health. "
42574261
if IsDDMSSelected(settings.hard_mode_selected, HardModeSelected.angry_caves):
42584262
if settings.perma_death or settings.wipe_file_on_death:
42594263
if settings.damage_amount == DamageAmount.quad or settings.damage_amount == DamageAmount.ohko:

randomizer/Settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,7 @@ def generate_misc(self):
950950
self.holiday_setting_offseason = False
951951
self.remove_wrinkly_puzzles = False
952952
self.smaller_shops = False
953+
self.no_consumable_upgrades = False
953954
self.alter_switch_allocation = False
954955
self.prog_slam_level_1 = SlamRequirement.green
955956
self.prog_slam_level_2 = SlamRequirement.green
@@ -1088,6 +1089,11 @@ def resolve_settings(self):
10881089
self.climbing_status = ClimbingStatus.normal
10891090
else:
10901091
self.climbing_status = ClimbingStatus.shuffled
1092+
# If you start with two copies of Progressive Instrument Upgrade, you start with 3 melons of health
1093+
if guaranteed_starting_moves.count(Items.ProgressiveInstrumentUpgrade) == 2:
1094+
self.start_with_3rd_melon = True
1095+
else:
1096+
self.start_with_3rd_melon = False
10911097

10921098
# Switchsanity handling
10931099
ShufflableExits[Transitions.AztecMainToLlama].entryKongs = {

static/presets/weights/weight_files_raw.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,15 @@
12911291
},
12921292
"qol_uses_hard": true
12931293
},
1294+
"no_consumable_upgrades": {
1295+
"setting_type": "bool",
1296+
"options": {
1297+
"easy": 0,
1298+
"standard": 25,
1299+
"difficult": 50
1300+
},
1301+
"qol_uses_hard": true
1302+
},
12941303
"open_lobbies": {
12951304
"setting_type": "bool",
12961305
"options": {

templates/items.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ <h3 class="modal-title title" id="starting_moves_ModalLabel">CUSTOMIZE STARTING
745745
if (allow_splitting) {
746746
let bk_copy_largest_to_smallest = temp_bk.slice();
747747
bk_copy_largest_to_smallest.sort((a, b) => b.size - a.size);
748-
console.log(bk_copy_largest_to_smallest);
748+
//console.log(bk_copy_largest_to_smallest);
749749
/*
750750
Rule 4:
751751
For all remaining buckets, check the pools which need the checks the most

templates/overworld.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,18 @@ <h2 class="title">DIFFICULTY</h2>
352352
</label>
353353
{{ properties_selector(helm_hurry_items, "helmhurry_list", "HELM HURRY SELECTOR", "This will open a popup that will let you customize what how much time each item will give you.") }}
354354
{# Remove end </div> as it's included in the macro for formatting #}
355-
<div class="spacer"></div>
355+
<div class="form-check form-switch item-switch">
356+
<label data-toggle="tooltip"
357+
title="Prevents consumable upgrades (Ammo Belts, Instrument Upgrades) from being placed in the game. You can still start with them.">
358+
<input class="form-check-input"
359+
type="checkbox"
360+
name="no_consumable_upgrades"
361+
id="no_consumable_upgrades"
362+
display_name="No Consumable Upgrades"
363+
value="True"/>
364+
No Consumable Upgrades
365+
</label>
366+
</div>
356367
</div>
357368
<div class="flex-container">
358369
{{ dropdown_multiselector(hard_mode, "hard_mode", "Hard Mode", "This will open a dropdown that will let you customize what hard mode Options are active.", 10) }}

tests/test_spoiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class TestSpoiler(unittest.TestCase):
3636
def test_settings_string(self):
3737
"""Confirm that settings strings decryption is working and generate a spoiler log with it."""
3838
# The settings string is defined either here or in the string above, pick your poison
39-
self.settings_string = "Px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MU0gQ6HxCmpJeixC2L1ToVELAITMKIBIkdqqqygYyw5Mk7xFAcryBWODzyWMDIAAFUzxDdBCEAAtCgAWhgAJQ4AEogAB1aAA6JAAVFAAGiwAHRgACo0AA1cABZPhLfgqoMVgtj2Z4sgwRwwDOZJYF2BwpioWhjisDQViGIo1hcJIQn8SxBkiXReEQIBIKBYNBwQCISCgVCwYDIaDgdDwgEIiEYkEomE4oFIsFouF4wGq+BgYKxiNC+rGABlwul5hAYqGQzYgAdgB+gIpwJDEZDpWx6dDxI0VniavN7w6R4wCHdcQZaxCC9fP4Bs8fDCaOd3Ur2VmZxTZ1bF8KcKAeEQyGQlS2Nc+ET+ALIAgoG1CiPBEMhTHQlS2Nc+EZTpW18Z1vnfPIHUivmnose4KrHLVg8w8IOFIx6lxphY8Uol8CgLclcD7qbK6KBxZpAlw1r0AHyAPUAfQA9gB9gA"
4040
settings_dict = decrypt_settings_string_enum(self.settings_string)
4141
settings_dict["seed"] = random.randint(0, 100000000) # Can be fixed if you want to test a specific seed repeatedly
4242

typings/randomizer/Enums/Settings.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,7 @@ export enum SettingsStringEnum {
954954
win_condition_spawns_ship = 292,
955955
ice_trap_model = 293,
956956
krool_in_boss_pool_v2 = 294,
957+
no_consumable_upgrades = 295,
957958
}
958959

959960
export enum SettingsStringDataType {
@@ -1342,6 +1343,7 @@ export const SettingsStringTypeMap = {
13421343
SettingsStringEnum.shops_dont_cost: SettingsStringDataType.bool,
13431344
SettingsStringEnum.alt_minecart_mayhem: SettingsStringDataType.bool,
13441345
SettingsStringEnum.less_fragile_boulders: SettingsStringDataType.bool,
1346+
SettingsStringEnum.no_consumable_upgrades: SettingsStringDataType.bool,
13451347
SettingsStringEnum.prog_slam_level_1: SlamRequirement,
13461348
SettingsStringEnum.prog_slam_level_2: SlamRequirement,
13471349
SettingsStringEnum.prog_slam_level_3: SlamRequirement,

typings/randomizer/Enums/Settings.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,7 @@ class SettingsStringEnum(IntEnum):
888888
win_condition_spawns_ship = 292
889889
ice_trap_model = 293
890890
krool_in_boss_pool_v2 = 294
891+
no_consumable_upgrades = 295
891892

892893
class SettingsStringDataType(IntEnum):
893894
bool = 1
@@ -1274,6 +1275,7 @@ SettingsStringTypeMap: dict = {
12741275
SettingsStringEnum.shops_dont_cost: SettingsStringDataType.bool,
12751276
SettingsStringEnum.alt_minecart_mayhem: SettingsStringDataType.bool,
12761277
SettingsStringEnum.less_fragile_boulders: SettingsStringDataType.bool,
1278+
SettingsStringEnum.no_consumable_upgrades: SettingsStringDataType.bool,
12771279
SettingsStringEnum.prog_slam_level_1: SlamRequirement,
12781280
SettingsStringEnum.prog_slam_level_2: SlamRequirement,
12791281
SettingsStringEnum.prog_slam_level_3: SlamRequirement,

0 commit comments

Comments
 (0)