|
|
|
|
@@ -7,41 +7,25 @@ from . import Options
|
|
|
|
|
from .Items import DLCQuestItem
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_event(player, event: str):
|
|
|
|
|
def create_event(player, event: str) -> DLCQuestItem:
|
|
|
|
|
return DLCQuestItem(event, ItemClassification.progression, None, player)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def has_enough_coin(player: int, coin: int):
|
|
|
|
|
return lambda state: state.prog_items[" coins", player] >= coin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def has_enough_coin_freemium(player: int, coin: int):
|
|
|
|
|
return lambda state: state.prog_items[" coins freemium", player] >= coin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_rules(world, player, World_Options: Options.DLCQuestOptions):
|
|
|
|
|
def has_enough_coin(player: int, coin: int):
|
|
|
|
|
def has_coin(state, player: int, coins: int):
|
|
|
|
|
coin_possessed = 0
|
|
|
|
|
for i in [4, 7, 9, 10, 46, 50, 60, 76, 89, 100, 171, 203]:
|
|
|
|
|
name_coin = f"{i} coins"
|
|
|
|
|
if state.has(name_coin, player):
|
|
|
|
|
coin_possessed += i
|
|
|
|
|
|
|
|
|
|
return coin_possessed >= coins
|
|
|
|
|
|
|
|
|
|
return lambda state: has_coin(state, player, coin)
|
|
|
|
|
|
|
|
|
|
def has_enough_coin_freemium(player: int, coin: int):
|
|
|
|
|
def has_coin(state, player: int, coins: int):
|
|
|
|
|
coin_possessed = 0
|
|
|
|
|
for i in [20, 50, 90, 95, 130, 150, 154, 200]:
|
|
|
|
|
name_coin = f"{i} coins freemium"
|
|
|
|
|
if state.has(name_coin, player):
|
|
|
|
|
coin_possessed += i
|
|
|
|
|
|
|
|
|
|
return coin_possessed >= coins
|
|
|
|
|
|
|
|
|
|
return lambda state: has_coin(state, player, coin)
|
|
|
|
|
|
|
|
|
|
set_basic_rules(World_Options, has_enough_coin, player, world)
|
|
|
|
|
set_lfod_rules(World_Options, has_enough_coin_freemium, player, world)
|
|
|
|
|
set_basic_rules(World_Options, player, world)
|
|
|
|
|
set_lfod_rules(World_Options, player, world)
|
|
|
|
|
set_completion_condition(World_Options, player, world)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_basic_rules(World_Options, has_enough_coin, player, world):
|
|
|
|
|
def set_basic_rules(World_Options, player, world):
|
|
|
|
|
if World_Options.campaign == Options.Campaign.option_live_freemium_or_die:
|
|
|
|
|
return
|
|
|
|
|
set_basic_entrance_rules(player, world)
|
|
|
|
|
@@ -49,8 +33,8 @@ def set_basic_rules(World_Options, has_enough_coin, player, world):
|
|
|
|
|
set_basic_shuffled_items_rules(World_Options, player, world)
|
|
|
|
|
set_double_jump_glitchless_rules(World_Options, player, world)
|
|
|
|
|
set_easy_double_jump_glitch_rules(World_Options, player, world)
|
|
|
|
|
self_basic_coinsanity_funded_purchase_rules(World_Options, has_enough_coin, player, world)
|
|
|
|
|
set_basic_self_funded_purchase_rules(World_Options, has_enough_coin, player, world)
|
|
|
|
|
self_basic_coinsanity_funded_purchase_rules(World_Options, player, world)
|
|
|
|
|
set_basic_self_funded_purchase_rules(World_Options, player, world)
|
|
|
|
|
self_basic_win_condition(World_Options, player, world)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -131,7 +115,7 @@ def set_easy_double_jump_glitch_rules(World_Options, player, world):
|
|
|
|
|
lambda state: state.has("Double Jump Pack", player))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def self_basic_coinsanity_funded_purchase_rules(World_Options, has_enough_coin, player, world):
|
|
|
|
|
def self_basic_coinsanity_funded_purchase_rules(World_Options, player, world):
|
|
|
|
|
if World_Options.coinsanity != Options.CoinSanity.option_coin:
|
|
|
|
|
return
|
|
|
|
|
number_of_bundle = math.floor(825 / World_Options.coinbundlequantity)
|
|
|
|
|
@@ -194,7 +178,7 @@ def self_basic_coinsanity_funded_purchase_rules(World_Options, has_enough_coin,
|
|
|
|
|
math.ceil(5 / World_Options.coinbundlequantity)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_basic_self_funded_purchase_rules(World_Options, has_enough_coin, player, world):
|
|
|
|
|
def set_basic_self_funded_purchase_rules(World_Options, player, world):
|
|
|
|
|
if World_Options.coinsanity != Options.CoinSanity.option_none:
|
|
|
|
|
return
|
|
|
|
|
set_rule(world.get_location("Movement Pack", player),
|
|
|
|
|
@@ -241,14 +225,14 @@ def self_basic_win_condition(World_Options, player, world):
|
|
|
|
|
player))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_lfod_rules(World_Options, has_enough_coin_freemium, player, world):
|
|
|
|
|
def set_lfod_rules(World_Options, player, world):
|
|
|
|
|
if World_Options.campaign == Options.Campaign.option_basic:
|
|
|
|
|
return
|
|
|
|
|
set_lfod_entrance_rules(player, world)
|
|
|
|
|
set_boss_door_requirements_rules(player, world)
|
|
|
|
|
set_lfod_self_obtained_items_rules(World_Options, player, world)
|
|
|
|
|
set_lfod_shuffled_items_rules(World_Options, player, world)
|
|
|
|
|
self_lfod_coinsanity_funded_purchase_rules(World_Options, has_enough_coin_freemium, player, world)
|
|
|
|
|
self_lfod_coinsanity_funded_purchase_rules(World_Options, player, world)
|
|
|
|
|
set_lfod_self_funded_purchase_rules(World_Options, has_enough_coin_freemium, player, world)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -327,7 +311,7 @@ def set_lfod_shuffled_items_rules(World_Options, player, world):
|
|
|
|
|
lambda state: state.can_reach("Cut Content", 'region', player))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def self_lfod_coinsanity_funded_purchase_rules(World_Options, has_enough_coin_freemium, player, world):
|
|
|
|
|
def self_lfod_coinsanity_funded_purchase_rules(World_Options, player, world):
|
|
|
|
|
if World_Options.coinsanity != Options.CoinSanity.option_coin:
|
|
|
|
|
return
|
|
|
|
|
number_of_bundle = math.floor(889 / World_Options.coinbundlequantity)
|
|
|
|
|
|