mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Timespinner: many new stuffs (#1433)
* Timespinner: added RisingTides and DadPercent flags * Implemented logic for DadPercent and RisingTides * Fixed TODO's * Logic fixes * Fixed + removed LogicMixins * Fixes * More Fixes * Added UnchainedKeys flag * Fixed available items in pool with UnchainedKeys * Fixed typing callable * Fixed generation failures * More refactorings * Implemented traps * Fixed more typo * Fixed copy paste bug * Fixed teleporter logic * Fixed traps from pool * Fixed pyramid gates bug that causes a crash on connecting * Fixed seed reproduceability * Fixed logic eye for eye spy Now consider warp beacons as starter progression items * Attempt to add tracker icons using table * Replaced table layout with css grid * Fixed tracker + added Timespinner was apworld capatible * Updated archipelago items description * updated URL * Cleared up text * Fixed based on self review of PR * Fixed unit tests * Fixed seed reproduceability when the traps yaml option is not provided * Fixed logic for flooded basement * Implemented Beserkers review result I am not sure why, i guess this is just to make adding future games less conflicting? Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com> * Added two new options (thanks to WeffJebster) * Apply suggestions from code review Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com> * Addition review results --------- Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com> Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from typing import Dict, Union
|
||||
from typing import Dict, Union, List
|
||||
from BaseClasses import MultiWorld
|
||||
from Options import Toggle, DefaultOnToggle, DeathLink, Choice, Range, Option, OptionDict
|
||||
from Options import Toggle, DefaultOnToggle, DeathLink, Choice, Range, Option, OptionDict, OptionList
|
||||
from schema import Schema, And, Optional
|
||||
|
||||
|
||||
@@ -191,6 +191,22 @@ class HpCap(Range):
|
||||
default = 999
|
||||
|
||||
|
||||
class LevelCap(Range):
|
||||
"""Sets the max level Lunais can achieve."""
|
||||
display_name = "Level Cap"
|
||||
range_start = 1
|
||||
range_end = 99
|
||||
default = 99
|
||||
|
||||
|
||||
class ExtraEarringsXP(Range):
|
||||
"""Adds additional XP granted by Galaxy Earrings."""
|
||||
display_name = "Extra Earrings XP"
|
||||
range_start = 0
|
||||
range_end = 24
|
||||
default = 0
|
||||
|
||||
|
||||
class BossHealing(DefaultOnToggle):
|
||||
"Enables/disables healing after boss fights. NOTE: Currently only applicable when Boss Rando is enabled."
|
||||
display_name = "Heal After Bosses"
|
||||
@@ -282,6 +298,94 @@ class EnterSandman(Toggle):
|
||||
display_name = "Enter Sandman"
|
||||
|
||||
|
||||
class DadPercent(Toggle):
|
||||
"""The win condition is beating the boss of Emperor's Tower"""
|
||||
display_name = "Dad Percent"
|
||||
|
||||
|
||||
class RisingTides(Toggle):
|
||||
"""Random areas are flooded or drained, can be further specified with RisingTidesOverrides"""
|
||||
display_name = "Rising Tides"
|
||||
|
||||
|
||||
class RisingTidesOverrides(OptionDict):
|
||||
"""Odds for specific areas to be flooded or drained, only has effect when RisingTides is on.
|
||||
Areas that are not specified will roll with the default 33% chance of getting flooded or drained"""
|
||||
schema = Schema({
|
||||
Optional("Xarion"): {
|
||||
"Dry": And(int, lambda n: n >= 0),
|
||||
"Flooded": And(int, lambda n: n >= 0)
|
||||
},
|
||||
Optional("Maw"): {
|
||||
"Dry": And(int, lambda n: n >= 0),
|
||||
"Flooded": And(int, lambda n: n >= 0)
|
||||
},
|
||||
Optional("AncientPyramidShaft"): {
|
||||
"Dry": And(int, lambda n: n >= 0),
|
||||
"Flooded": And(int, lambda n: n >= 0)
|
||||
},
|
||||
Optional("Sandman"): {
|
||||
"Dry": And(int, lambda n: n >= 0),
|
||||
"Flooded": And(int, lambda n: n >= 0)
|
||||
},
|
||||
Optional("CastleMoat"): {
|
||||
"Dry": And(int, lambda n: n >= 0),
|
||||
"Flooded": And(int, lambda n: n >= 0)
|
||||
},
|
||||
Optional("CastleBasement"): {
|
||||
"Dry": And(int, lambda n: n >= 0),
|
||||
"FloodedWithSavePointAvailable": And(int, lambda n: n >= 0),
|
||||
"Flooded": And(int, lambda n: n >= 0)
|
||||
},
|
||||
Optional("CastleCourtyard"): {
|
||||
"Dry": And(int, lambda n: n >= 0),
|
||||
"Flooded": And(int, lambda n: n >= 0)
|
||||
},
|
||||
Optional("LakeDesolation"): {
|
||||
"Dry": And(int, lambda n: n >= 0),
|
||||
"Flooded": And(int, lambda n: n >= 0)
|
||||
},
|
||||
Optional("LakeSerene"): {
|
||||
"Dry": And(int, lambda n: n >= 0),
|
||||
"Flooded": And(int, lambda n: n >= 0)
|
||||
}
|
||||
})
|
||||
display_name = "Rising Tides Overrides"
|
||||
default = {
|
||||
"Xarion": { "Dry": 67, "Flooded": 33 },
|
||||
"Maw": { "Dry": 67, "Flooded": 33 },
|
||||
"AncientPyramidShaft": { "Dry": 67, "Flooded": 33 },
|
||||
"Sandman": { "Dry": 67, "Flooded": 33 },
|
||||
"CastleMoat": { "Dry": 67, "Flooded": 33 },
|
||||
"CastleBasement": { "Dry": 66, "Flooded": 17, "FloodedWithSavePointAvailable": 17 },
|
||||
"CastleCourtyard": { "Dry": 67, "Flooded": 33 },
|
||||
"LakeDesolation": { "Dry": 67, "Flooded": 33 },
|
||||
"LakeSerene": { "Dry": 67, "Flooded": 33 },
|
||||
}
|
||||
|
||||
|
||||
class UnchainedKeys(Toggle):
|
||||
"""Start with Twin Pyramid Key, which does not give free warp;
|
||||
warp items for Past, Present, (and ??? with Enter Sandman) can be found."""
|
||||
display_name = "Unchained Keys"
|
||||
|
||||
|
||||
class TrapChance(Range):
|
||||
"""Chance of traps in the item pool.
|
||||
Traps will only replace filler items such as potions, vials and antidotes"""
|
||||
display_name = "Trap Chance"
|
||||
range_start = 0
|
||||
range_end = 100
|
||||
default = 10
|
||||
|
||||
|
||||
class Traps(OptionList):
|
||||
"""List of traps that may be in the item pool to find"""
|
||||
display_name = "Traps Types"
|
||||
valid_keys = { "Meteor Sparrow Trap", "Poison Trap", "Chaos Trap", "Neurotoxin Trap", "Bee Trap" }
|
||||
default = [ "Meteor Sparrow Trap", "Poison Trap", "Chaos Trap", "Neurotoxin Trap", "Bee Trap" ]
|
||||
|
||||
|
||||
# Some options that are available in the timespinner randomizer arent currently implemented
|
||||
timespinner_options: Dict[str, Option] = {
|
||||
"StartWithJewelryBox": StartWithJewelryBox,
|
||||
@@ -299,6 +403,8 @@ timespinner_options: Dict[str, Option] = {
|
||||
"DamageRando": DamageRando,
|
||||
"DamageRandoOverrides": DamageRandoOverrides,
|
||||
"HpCap": HpCap,
|
||||
"LevelCap": LevelCap,
|
||||
"ExtraEarringsXP": ExtraEarringsXP,
|
||||
"BossHealing": BossHealing,
|
||||
"ShopFill": ShopFill,
|
||||
"ShopWarpShards": ShopWarpShards,
|
||||
@@ -310,6 +416,12 @@ timespinner_options: Dict[str, Option] = {
|
||||
"ShowBestiary": ShowBestiary,
|
||||
"ShowDrops": ShowDrops,
|
||||
"EnterSandman": EnterSandman,
|
||||
"DadPercent": DadPercent,
|
||||
"RisingTides": RisingTides,
|
||||
"RisingTidesOverrides": RisingTidesOverrides,
|
||||
"UnchainedKeys": UnchainedKeys,
|
||||
"TrapChance": TrapChance,
|
||||
"Traps": Traps,
|
||||
"DeathLink": DeathLink,
|
||||
}
|
||||
|
||||
@@ -318,7 +430,7 @@ def is_option_enabled(world: MultiWorld, player: int, name: str) -> bool:
|
||||
return get_option_value(world, player, name) > 0
|
||||
|
||||
|
||||
def get_option_value(world: MultiWorld, player: int, name: str) -> Union[int, dict]:
|
||||
def get_option_value(world: MultiWorld, player: int, name: str) -> Union[int, Dict, List]:
|
||||
option = getattr(world, name, None)
|
||||
if option == None:
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user