2022-05-14 05:52:35 -04:00
from typing import Dict , Union
2021-09-24 04:07:32 +02:00
from BaseClasses import MultiWorld
2022-05-14 05:52:35 -04:00
from Options import Toggle , DefaultOnToggle , DeathLink , Choice , Range , Option , OptionDict
2022-05-15 23:39:38 +02:00
from schema import Schema , And , Optional
2021-09-24 04:07:32 +02:00
2022-09-16 00:32:30 +02:00
2021-09-24 04:07:32 +02:00
class StartWithJewelryBox ( Toggle ) :
" Start with Jewelry Box unlocked "
display_name = " Start with Jewelry Box "
2022-09-16 00:32:30 +02:00
2021-09-24 04:07:32 +02:00
#class ProgressiveVerticalMovement(Toggle):
# "Always find vertical movement in the following order Succubus Hairpin -> Light Wall -> Celestial Sash"
# display_name = "Progressive vertical movement"
2022-09-16 00:32:30 +02:00
2021-09-24 04:07:32 +02:00
#class ProgressiveKeycards(Toggle):
# "Always find Security Keycard's in the following order D -> C -> B -> A"
# display_name = "Progressive keycards"
2022-09-16 00:32:30 +02:00
2022-02-04 21:53:47 +01:00
class DownloadableItems ( DefaultOnToggle ) :
2021-09-24 04:07:32 +02:00
" With the tablet you will be able to download items at terminals "
display_name = " Downloadable items "
2022-09-16 00:32:30 +02:00
2022-07-03 08:05:44 -07:00
class EyeSpy ( Toggle ) :
" Requires Oculus Ring in inventory to be able to break hidden walls. "
display_name = " Eye Spy "
2021-09-24 04:07:32 +02:00
2022-09-16 00:32:30 +02:00
2021-09-24 04:07:32 +02:00
class StartWithMeyef ( Toggle ) :
" Start with Meyef, ideal for when you want to play multiplayer. "
display_name = " Start with Meyef "
2022-09-16 00:32:30 +02:00
2021-09-24 04:07:32 +02:00
class QuickSeed ( Toggle ) :
" Start with Talaria Attachment, Nyoom! "
display_name = " Quick seed "
2022-09-16 00:32:30 +02:00
2021-09-24 04:07:32 +02:00
class SpecificKeycards ( Toggle ) :
" Keycards can only open corresponding doors "
display_name = " Specific Keycards "
2022-09-16 00:32:30 +02:00
2021-09-24 04:07:32 +02:00
class Inverted ( Toggle ) :
" Start in the past "
display_name = " Inverted "
2022-09-16 00:32:30 +02:00
2021-09-24 04:07:32 +02:00
#class StinkyMaw(Toggle):
2021-10-15 17:51:18 -05:00
# "Require gasmask for Maw"
2021-09-24 04:07:32 +02:00
# display_name = "Stinky Maw"
2022-09-16 00:32:30 +02:00
2021-11-28 22:59:34 +01:00
class GyreArchives ( Toggle ) :
" Gyre locations are in logic. New warps are gated by Merchant Crow and Kobo "
display_name = " Gyre Archives "
2022-09-16 00:32:30 +02:00
2021-11-28 22:59:34 +01:00
class Cantoran ( Toggle ) :
" Cantoran ' s fight and check are available upon revisiting his room "
display_name = " Cantoran "
2022-09-16 00:32:30 +02:00
2022-01-01 13:44:45 -06:00
class LoreChecks ( Toggle ) :
" Memories and journal entries contain items. "
display_name = " Lore Checks "
2022-09-16 00:32:30 +02:00
2022-06-09 16:07:47 -07:00
class BossRando ( Toggle ) :
" Shuffles the positions of all bosses. "
display_name = " Boss Randomization "
2022-09-16 00:32:30 +02:00
2022-06-09 16:07:47 -07:00
class BossScaling ( DefaultOnToggle ) :
" When Boss Rando is enabled, scales the bosses ' HP, XP, and ATK to the stats of the location they replace (Reccomended) "
display_name = " Scale Random Boss Stats "
2022-09-16 00:32:30 +02:00
2022-05-14 05:52:35 -04:00
class DamageRando ( Choice ) :
" Randomly nerfs and buffs some orbs and their associated spells as well as some associated rings. "
2021-12-20 14:26:16 +01:00
display_name = " Damage Rando "
2022-05-14 05:52:35 -04:00
option_off = 0
option_allnerfs = 1
option_mostlynerfs = 2
option_balanced = 3
option_mostlybuffs = 4
option_allbuffs = 5
option_manual = 6
2022-05-15 23:39:38 +02:00
alias_true = 2
2022-05-14 05:52:35 -04:00
2022-09-16 00:32:30 +02:00
2022-05-14 05:52:35 -04:00
class DamageRandoOverrides ( OptionDict ) :
2022-05-15 23:39:38 +02:00
" Manual +/-/normal odds for an orb. Put 0 if you don ' t want a certain nerf or buff to be a possibility. Orbs that you don ' t specify will roll with 1/1/1 as odds "
2022-05-14 05:52:35 -04:00
schema = Schema ( {
2022-05-15 23:39:38 +02:00
Optional ( " Blue " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Blade " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Fire " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Plasma " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Iron " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Ice " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Wind " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Gun " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Umbra " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Empire " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Eye " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Blood " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " ForbiddenTome " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Shattered " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Nether " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
2022-05-15 23:39:38 +02:00
Optional ( " Radiant " ) : {
2022-05-14 05:52:35 -04:00
" MinusOdds " : And ( int , lambda n : n > = 0 ) ,
" NormalOdds " : And ( int , lambda n : n > = 0 ) ,
" PlusOdds " : And ( int , lambda n : n > = 0 )
} ,
} )
display_name = " Damage Rando Overrides "
default = {
" Blue " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Blade " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Fire " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Plasma " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Iron " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Ice " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Wind " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Gun " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Umbra " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Empire " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Eye " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Blood " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" ForbiddenTome " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Shattered " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Nether " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
" Radiant " : { " MinusOdds " : 1 , " NormalOdds " : 1 , " PlusOdds " : 1 } ,
}
2021-12-20 14:26:16 +01:00
2022-09-16 00:32:30 +02:00
2022-05-18 23:25:08 -04:00
class HpCap ( Range ) :
" Sets the number that Lunais ' s HP maxes out at. "
display_name = " HP Cap "
range_start = 1
range_end = 999
default = 999
2022-09-16 00:32:30 +02:00
2022-06-09 16:07:47 -07:00
class BossHealing ( DefaultOnToggle ) :
" Enables/disables healing after boss fights. NOTE: Currently only applicable when Boss Rando is enabled. "
display_name = " Heal After Bosses "
2022-09-16 00:32:30 +02:00
2022-02-04 21:53:47 +01:00
class ShopFill ( Choice ) :
""" Sets the items for sale in Merchant Crow ' s shops.
Default : No sunglasses or trendy jacket , but sand vials for sale .
Randomized : Up to 4 random items in each shop .
Vanilla : Keep shops the same as the base game .
Empty : Sell no items at the shop . """
display_name = " Shop Inventory "
option_default = 0
option_randomized = 1
option_vanilla = 2
option_empty = 3
2022-09-16 00:32:30 +02:00
2022-02-04 21:53:47 +01:00
class ShopWarpShards ( DefaultOnToggle ) :
" Shops always sell warp shards (when keys possessed), ignoring inventory setting. "
display_name = " Always Sell Warp Shards "
2022-09-16 00:32:30 +02:00
2022-02-04 21:53:47 +01:00
class ShopMultiplier ( Range ) :
" Multiplier for the cost of items in the shop. Set to 0 for free shops. "
display_name = " Shop Price Multiplier "
range_start = 0
range_end = 10
default = 1
2022-09-16 00:32:30 +02:00
2022-04-23 17:02:53 -07:00
class LootPool ( Choice ) :
""" Sets the items that drop from enemies (does not apply to boss reward checks)
Vanilla : Drops are the same as the base game
Randomized : Each slot of every enemy ' s drop table is given a random use item or piece of equipment.
Empty : Enemies drop nothing . """
2022-04-24 12:37:08 +02:00
display_name = " Loot Pool "
2022-04-23 17:02:53 -07:00
option_vanilla = 0
option_randomized = 1
option_empty = 2
2022-09-16 00:32:30 +02:00
2022-07-03 08:05:44 -07:00
class DropRateCategory ( Choice ) :
""" Sets the drop rate when ' Loot Pool ' is set to ' Random '
Tiered : Based on item rarity / value
Vanilla : Based on bestiary slot the item is placed into
Random : Assigned a random tier / drop rate
Fixed : Set by the ' Fixed Drop Rate ' setting
"""
display_name = " Drop Rate Category "
option_tiered = 0
option_vanilla = 1
option_randomized = 2
option_fixed = 3
2022-09-16 00:32:30 +02:00
2022-07-03 08:05:44 -07:00
class FixedDropRate ( Range ) :
" Base drop rate percentage when ' Drop Rate Category ' is set to ' Fixed ' "
display_name = " Fixed Drop Rate "
range_start = 0
range_end = 100
default = 5
2022-09-16 00:32:30 +02:00
2022-07-03 08:05:44 -07:00
class LootTierDistro ( Choice ) :
""" Sets how often items of each rarity tier are placed when ' Loot Pool ' is set to ' Random '
Default Weight : Rarer items will be assigned to enemy drop slots less frequently than common items
Full Random : Any item has an equal chance of being placed in an enemy ' s drop slot
Inverted Weight : Rarest items show up the most frequently , while common items are the rarest
"""
display_name = " Loot Tier Distrubution "
option_default_weight = 0
option_full_random = 1
option_inverted_weight = 2
2022-09-16 00:32:30 +02:00
2022-04-23 17:02:53 -07:00
class ShowBestiary ( Toggle ) :
" All entries in the bestiary are visible, without needing to kill one of a given enemy first "
display_name = " Show Bestiary Entries "
2022-09-16 00:32:30 +02:00
2022-05-18 18:04:06 -07:00
class ShowDrops ( Toggle ) :
" All item drops in the bestiary are visible, without needing an enemy to drop one of a given item first "
display_name = " Show Bestiary Item Drops "
2022-09-16 00:32:30 +02:00
2021-09-24 04:07:32 +02:00
# Some options that are available in the timespinner randomizer arent currently implemented
2022-02-04 21:53:47 +01:00
timespinner_options : Dict [ str , Option ] = {
2021-09-24 04:07:32 +02:00
" StartWithJewelryBox " : StartWithJewelryBox ,
#"ProgressiveVerticalMovement": ProgressiveVerticalMovement,
#"ProgressiveKeycards": ProgressiveKeycards,
" DownloadableItems " : DownloadableItems ,
2022-07-03 08:05:44 -07:00
" EyeSpy " : EyeSpy ,
2021-09-24 04:07:32 +02:00
" StartWithMeyef " : StartWithMeyef ,
" QuickSeed " : QuickSeed ,
" SpecificKeycards " : SpecificKeycards ,
" Inverted " : Inverted ,
2021-11-06 01:12:11 +01:00
#"StinkyMaw": StinkyMaw,
2021-11-28 22:59:34 +01:00
" GyreArchives " : GyreArchives ,
" Cantoran " : Cantoran ,
2022-01-01 13:44:45 -06:00
" LoreChecks " : LoreChecks ,
2022-06-09 16:07:47 -07:00
" BossRando " : BossRando ,
" BossScaling " : BossScaling ,
2021-12-20 14:26:16 +01:00
" DamageRando " : DamageRando ,
2022-05-14 05:52:35 -04:00
" DamageRandoOverrides " : DamageRandoOverrides ,
2022-05-18 23:25:08 -04:00
" HpCap " : HpCap ,
2022-06-09 16:07:47 -07:00
" BossHealing " : BossHealing ,
2022-02-04 21:53:47 +01:00
" ShopFill " : ShopFill ,
" ShopWarpShards " : ShopWarpShards ,
" ShopMultiplier " : ShopMultiplier ,
2022-04-23 17:09:11 -07:00
" LootPool " : LootPool ,
2022-07-03 08:05:44 -07:00
" DropRateCategory " : DropRateCategory ,
" FixedDropRate " : FixedDropRate ,
" LootTierDistro " : LootTierDistro ,
2022-04-23 17:09:11 -07:00
" ShowBestiary " : ShowBestiary ,
2022-05-18 18:04:06 -07:00
" ShowDrops " : ShowDrops ,
2021-11-06 01:12:11 +01:00
" DeathLink " : DeathLink ,
2021-09-24 04:07:32 +02:00
}
2022-09-16 00:32:30 +02:00
2021-09-24 04:07:32 +02:00
def is_option_enabled ( world : MultiWorld , player : int , name : str ) - > bool :
2022-02-04 21:53:47 +01:00
return get_option_value ( world , player , name ) > 0
2022-09-16 00:32:30 +02:00
2022-05-14 05:52:35 -04:00
def get_option_value ( world : MultiWorld , player : int , name : str ) - > Union [ int , dict ] :
2021-09-24 04:07:32 +02:00
option = getattr ( world , name , None )
if option == None :
2022-02-04 21:53:47 +01:00
return 0
2021-09-24 04:07:32 +02:00
2022-05-18 18:04:06 -07:00
return option [ player ] . value