Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding random groups to plandomizer #1776

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
220 changes: 220 additions & 0 deletions randomizer/Enums/Plandomizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,122 @@ class PlandoItems(IntEnum):
TinyBlueprint = auto()
ChunkyBlueprint = auto()

# Group items to represent random selections from a specific group.
RandomKong = auto()
RandomMove = auto()
RandomKongMove = auto()
RandomSharedMove = auto()
RandomKey = auto()
RandomItem = auto()


PlandoGroupMap = {
PlandoItems.RandomKong: [
PlandoItems.Donkey,
PlandoItems.Diddy,
PlandoItems.Lanky,
PlandoItems.Tiny,
PlandoItems.Chunky,
],
PlandoItems.RandomMove: [
PlandoItems.Vines,
PlandoItems.Swim,
PlandoItems.Oranges,
PlandoItems.Barrels,
PlandoItems.ProgressiveSlam,
PlandoItems.BaboonBlast,
PlandoItems.StrongKong,
PlandoItems.GorillaGrab,
PlandoItems.ChimpyCharge,
PlandoItems.RocketbarrelBoost,
PlandoItems.SimianSpring,
PlandoItems.Orangstand,
PlandoItems.BaboonBalloon,
PlandoItems.OrangstandSprint,
PlandoItems.MiniMonkey,
PlandoItems.PonyTailTwirl,
PlandoItems.Monkeyport,
PlandoItems.HunkyChunky,
PlandoItems.PrimatePunch,
PlandoItems.GorillaGone,
PlandoItems.Coconut,
PlandoItems.Peanut,
PlandoItems.Grape,
PlandoItems.Feather,
PlandoItems.Pineapple,
PlandoItems.HomingAmmo,
PlandoItems.SniperSight,
PlandoItems.ProgressiveAmmoBelt,
PlandoItems.Bongos,
PlandoItems.Guitar,
PlandoItems.Trombone,
PlandoItems.Saxophone,
PlandoItems.Triangle,
PlandoItems.ProgressiveInstrumentUpgrade,
PlandoItems.Camera,
PlandoItems.Shockwave,
],
PlandoItems.RandomKongMove: [
PlandoItems.BaboonBlast,
PlandoItems.StrongKong,
PlandoItems.GorillaGrab,
PlandoItems.ChimpyCharge,
PlandoItems.RocketbarrelBoost,
PlandoItems.SimianSpring,
PlandoItems.Orangstand,
PlandoItems.BaboonBalloon,
PlandoItems.OrangstandSprint,
PlandoItems.MiniMonkey,
PlandoItems.PonyTailTwirl,
PlandoItems.Monkeyport,
PlandoItems.HunkyChunky,
PlandoItems.PrimatePunch,
PlandoItems.GorillaGone,
PlandoItems.Coconut,
PlandoItems.Peanut,
PlandoItems.Grape,
PlandoItems.Feather,
PlandoItems.Pineapple,
PlandoItems.Bongos,
PlandoItems.Guitar,
PlandoItems.Trombone,
PlandoItems.Saxophone,
PlandoItems.Triangle,
],
PlandoItems.RandomSharedMove: [
PlandoItems.Vines,
PlandoItems.Swim,
PlandoItems.Oranges,
PlandoItems.Barrels,
PlandoItems.ProgressiveSlam,
PlandoItems.HomingAmmo,
PlandoItems.SniperSight,
PlandoItems.ProgressiveAmmoBelt,
PlandoItems.ProgressiveInstrumentUpgrade,
PlandoItems.Camera,
PlandoItems.Shockwave,
],
PlandoItems.RandomKey: [
PlandoItems.JungleJapesKey,
PlandoItems.AngryAztecKey,
PlandoItems.FranticFactoryKey,
PlandoItems.GloomyGalleonKey,
PlandoItems.FungiForestKey,
PlandoItems.CrystalCavesKey,
PlandoItems.CreepyCastleKey,
PlandoItems.HideoutHelmKey,
],
PlandoItems.RandomItem: [
PlandoItems.GoldenBanana,
PlandoItems.BananaFairy,
PlandoItems.BananaMedal,
PlandoItems.BattleCrown,
PlandoItems.Bean,
PlandoItems.Pearl,
PlandoItems.RainbowCoin,
],
}


ItemToPlandoItemMap = {
Items.NoItem: PlandoItems.NoItem,
Expand Down Expand Up @@ -336,6 +452,110 @@ class PlandoItems(IntEnum):
Items.CreepyCastleChunkyBlueprint,
Items.DKIslesChunkyBlueprint,
],
PlandoItems.RandomKong: [
Items.Donkey,
Items.Diddy,
Items.Lanky,
Items.Tiny,
Items.Chunky,
],
PlandoItems.RandomMove: [
Items.Vines,
Items.Swim,
Items.Oranges,
Items.Barrels,
Items.ProgressiveSlam,
Items.BaboonBlast,
Items.StrongKong,
Items.GorillaGrab,
Items.ChimpyCharge,
Items.RocketbarrelBoost,
Items.SimianSpring,
Items.Orangstand,
Items.BaboonBalloon,
Items.OrangstandSprint,
Items.MiniMonkey,
Items.PonyTailTwirl,
Items.Monkeyport,
Items.HunkyChunky,
Items.PrimatePunch,
Items.GorillaGone,
Items.Coconut,
Items.Peanut,
Items.Grape,
Items.Feather,
Items.Pineapple,
Items.HomingAmmo,
Items.SniperSight,
Items.ProgressiveAmmoBelt,
Items.Bongos,
Items.Guitar,
Items.Trombone,
Items.Saxophone,
Items.Triangle,
Items.ProgressiveInstrumentUpgrade,
Items.Camera,
Items.Shockwave,
],
PlandoItems.RandomKongMove: [
Items.BaboonBlast,
Items.StrongKong,
Items.GorillaGrab,
Items.ChimpyCharge,
Items.RocketbarrelBoost,
Items.SimianSpring,
Items.Orangstand,
Items.BaboonBalloon,
Items.OrangstandSprint,
Items.MiniMonkey,
Items.PonyTailTwirl,
Items.Monkeyport,
Items.HunkyChunky,
Items.PrimatePunch,
Items.GorillaGone,
Items.Coconut,
Items.Peanut,
Items.Grape,
Items.Feather,
Items.Pineapple,
Items.Bongos,
Items.Guitar,
Items.Trombone,
Items.Saxophone,
Items.Triangle,
],
PlandoItems.RandomSharedMove: [
Items.Vines,
Items.Swim,
Items.Oranges,
Items.Barrels,
Items.ProgressiveSlam,
Items.HomingAmmo,
Items.SniperSight,
Items.ProgressiveAmmoBelt,
Items.ProgressiveInstrumentUpgrade,
Items.Camera,
Items.Shockwave,
],
PlandoItems.RandomKey: [
Items.JungleJapesKey,
Items.AngryAztecKey,
Items.FranticFactoryKey,
Items.GloomyGalleonKey,
Items.FungiForestKey,
Items.CrystalCavesKey,
Items.CreepyCastleKey,
Items.HideoutHelmKey,
],
PlandoItems.RandomItem: [
Items.GoldenBanana,
Items.BananaFairy,
Items.BananaMedal,
Items.BattleCrown,
Items.Bean,
Items.Pearl,
Items.RainbowCoin,
],
}


Expand Down
17 changes: 17 additions & 0 deletions randomizer/Lists/Plandomizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ def isMinigameLocation(locationEnum: Locations) -> bool:
PlannableItems.append({"name": "Blueprint (Tiny)", "value": "TinyBlueprint"})
PlannableItems.append({"name": "Blueprint (Chunky)", "value": "ChunkyBlueprint"})
PlannableItems.append({"name": "Junk Item", "value": "JunkItem"})
PlannableItems.append({"name": "Random Kong", "value": "RandomKong"})
PlannableItems.append({"name": "Random Move", "value": "RandomMove"})
PlannableItems.append({"name": "Random Kong Move", "value": "RandomKongMove"})
PlannableItems.append({"name": "Random Shared Move", "value": "RandomSharedMove"})
PlannableItems.append({"name": "Random Key", "value": "RandomKey"})
PlannableItems.append({"name": "Random Collectible", "value": "RandomItem"})

# The maximum amount of each item that the user is allowed to place.
# If a plando item is not here, that item has no limit.
Expand Down Expand Up @@ -357,6 +363,17 @@ def isMinigameLocation(locationEnum: Locations) -> bool:
PlandoItems.ChunkyBlueprint: 8,
}

# The maximum amount of items from each group that the user is allowed to
# place. This includes the individual items as well as the "random" item.
PlannableGroupLimits = {
PlandoItems.RandomKong: 5,
PlandoItems.RandomMove: 41,
PlandoItems.RandomKongMove: 25,
PlandoItems.RandomSharedMove: 16,
PlandoItems.RandomKey: 8,
PlandoItems.RandomItem: 293,
}

#############
# MINIGAMES #
#############
Expand Down
13 changes: 13 additions & 0 deletions randomizer/PlandoUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@
PlandoItems.TinyBlueprint: "Blueprint (Tiny)",
PlandoItems.ChunkyBlueprint: "Blueprint (Chunky)",
PlandoItems.JunkItem: "Junk Item",
PlandoItems.RandomKong: "Random Kong",
PlandoItems.RandomMove: "Random Move",
PlandoItems.RandomKongMove: "Random Kong Move",
PlandoItems.RandomSharedMove: "Random Shared Move",
PlandoItems.RandomKey: "Random Key",
PlandoItems.RandomItem: "Random Collectible",
}


Expand Down Expand Up @@ -234,6 +240,11 @@ def GetNameFromPlandoItem(plandoItem: PlandoItems) -> str:
PlandoItems.LankyBlueprint.name,
PlandoItems.TinyBlueprint.name,
PlandoItems.ChunkyBlueprint.name,
PlandoItems.RandomMove.name,
PlandoItems.RandomKongMove.name,
PlandoItems.RandomSharedMove.name,
PlandoItems.RandomKey.name,
PlandoItems.RandomItem.name,
}

kongLocationList = [Locations.DiddyKong.name, Locations.TinyKong.name, Locations.LankyKong.name, Locations.ChunkyKong.name]
Expand Down Expand Up @@ -278,6 +289,7 @@ def GetNameFromPlandoItem(plandoItem: PlandoItems) -> str:
PlandoItems.Trombone.name,
PlandoItems.Saxophone.name,
PlandoItems.Triangle.name,
PlandoItems.RandomKongMove.name,
}

# Kong-specific shops have a handful of banned items.
Expand Down Expand Up @@ -338,6 +350,7 @@ def GetNameFromPlandoItem(plandoItem: PlandoItems) -> str:

# This one rock can't have Kongs as a reward.
ItemRestrictionsPerLocation[Locations.IslesDonkeyJapesRock.name].update(KongSet)
ItemRestrictionsPerLocation[Locations.IslesDonkeyJapesRock.name].add(PlandoItems.RandomKong.name)

# These specific locations cannot have fake items on them.
badFakeItemLocationList = [
Expand Down
2 changes: 2 additions & 0 deletions ui/plando_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
lock_key_8_in_helm,
populate_plando_options,
reset_plando_options_no_prompt,
validate_group_limits,
validate_helm_order_no_duplicates,
validate_hint_count,
validate_hint_text,
Expand Down Expand Up @@ -124,6 +125,7 @@ async def import_plando_options(jsonString):
plando_hide_krool_options(None)
lock_key_8_in_helm(None)
validate_item_limits(None)
validate_group_limits(None)
validate_hint_count(None)
validate_smaller_shops_no_conflict(None)
validate_shuffle_shops_no_conflict(None)
Expand Down
Loading
Loading