[RL] Specify list of available classes (#262)
This commit is contained in:
parent
43113c7844
commit
689183edc0
|
@ -1,6 +1,6 @@
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
from Options import Choice, Range, Option, Toggle, DeathLink, DefaultOnToggle, OptionList
|
from Options import Choice, Range, Option, Toggle, DeathLink, DefaultOnToggle, OptionList, OptionSet
|
||||||
|
|
||||||
|
|
||||||
class StartingGender(Choice):
|
class StartingGender(Choice):
|
||||||
|
@ -195,7 +195,7 @@ class CastleScaling(Range):
|
||||||
Adjusts the scaling factor for how big a castle can be. Larger castles scale enemies quicker and also take longer
|
Adjusts the scaling factor for how big a castle can be. Larger castles scale enemies quicker and also take longer
|
||||||
to generate. 100 means normal castle size.
|
to generate. 100 means normal castle size.
|
||||||
"""
|
"""
|
||||||
displayname = "Castle Size Scaling Percentage"
|
display_name = "Castle Size Scaling Percentage"
|
||||||
range_start = 50
|
range_start = 50
|
||||||
range_end = 300
|
range_end = 300
|
||||||
default = 100
|
default = 100
|
||||||
|
@ -205,7 +205,7 @@ class ChallengeBossKhidr(Choice):
|
||||||
"""
|
"""
|
||||||
Determines if Neo Khidr replaces Khidr in their boss room.
|
Determines if Neo Khidr replaces Khidr in their boss room.
|
||||||
"""
|
"""
|
||||||
displayname = "Khidr"
|
display_name = "Khidr"
|
||||||
option_vanilla = 0
|
option_vanilla = 0
|
||||||
option_challenge = 1
|
option_challenge = 1
|
||||||
default = 0
|
default = 0
|
||||||
|
@ -215,7 +215,7 @@ class ChallengeBossAlexander(Choice):
|
||||||
"""
|
"""
|
||||||
Determines if Alexander the IV replaces Alexander in their boss room.
|
Determines if Alexander the IV replaces Alexander in their boss room.
|
||||||
"""
|
"""
|
||||||
displayname = "Alexander"
|
display_name = "Alexander"
|
||||||
option_vanilla = 0
|
option_vanilla = 0
|
||||||
option_challenge = 1
|
option_challenge = 1
|
||||||
default = 0
|
default = 0
|
||||||
|
@ -225,7 +225,7 @@ class ChallengeBossLeon(Choice):
|
||||||
"""
|
"""
|
||||||
Determines if Ponce de Freon replaces Ponce de Leon in their boss room.
|
Determines if Ponce de Freon replaces Ponce de Leon in their boss room.
|
||||||
"""
|
"""
|
||||||
displayname = "Ponce de Leon"
|
display_name = "Ponce de Leon"
|
||||||
option_vanilla = 0
|
option_vanilla = 0
|
||||||
option_challenge = 1
|
option_challenge = 1
|
||||||
default = 0
|
default = 0
|
||||||
|
@ -235,7 +235,7 @@ class ChallengeBossHerodotus(Choice):
|
||||||
"""
|
"""
|
||||||
Determines if Astrodotus replaces Herodotus in their boss room.
|
Determines if Astrodotus replaces Herodotus in their boss room.
|
||||||
"""
|
"""
|
||||||
displayname = "Herodotus"
|
display_name = "Herodotus"
|
||||||
option_vanilla = 0
|
option_vanilla = 0
|
||||||
option_challenge = 1
|
option_challenge = 1
|
||||||
default = 0
|
default = 0
|
||||||
|
@ -245,7 +245,7 @@ class HealthUpPool(Range):
|
||||||
"""
|
"""
|
||||||
Determines the number of Health Ups in the item pool.
|
Determines the number of Health Ups in the item pool.
|
||||||
"""
|
"""
|
||||||
displayname = "Health Up Pool"
|
display_name = "Health Up Pool"
|
||||||
range_start = 0
|
range_start = 0
|
||||||
range_end = 15
|
range_end = 15
|
||||||
default = 15
|
default = 15
|
||||||
|
@ -255,7 +255,7 @@ class ManaUpPool(Range):
|
||||||
"""
|
"""
|
||||||
Determines the number of Mana Ups in the item pool.
|
Determines the number of Mana Ups in the item pool.
|
||||||
"""
|
"""
|
||||||
displayname = "Mana Up Pool"
|
display_name = "Mana Up Pool"
|
||||||
range_start = 0
|
range_start = 0
|
||||||
range_end = 15
|
range_end = 15
|
||||||
default = 15
|
default = 15
|
||||||
|
@ -265,7 +265,7 @@ class AttackUpPool(Range):
|
||||||
"""
|
"""
|
||||||
Determines the number of Attack Ups in the item pool.
|
Determines the number of Attack Ups in the item pool.
|
||||||
"""
|
"""
|
||||||
displayname = "Attack Up Pool"
|
display_name = "Attack Up Pool"
|
||||||
range_start = 0
|
range_start = 0
|
||||||
range_end = 15
|
range_end = 15
|
||||||
default = 15
|
default = 15
|
||||||
|
@ -275,7 +275,7 @@ class MagicDamageUpPool(Range):
|
||||||
"""
|
"""
|
||||||
Determines the number of Magic Damage Ups in the item pool.
|
Determines the number of Magic Damage Ups in the item pool.
|
||||||
"""
|
"""
|
||||||
displayname = "Magic Damage Up Pool"
|
display_name = "Magic Damage Up Pool"
|
||||||
range_start = 0
|
range_start = 0
|
||||||
range_end = 15
|
range_end = 15
|
||||||
default = 15
|
default = 15
|
||||||
|
@ -285,7 +285,7 @@ class ArmorUpPool(Range):
|
||||||
"""
|
"""
|
||||||
Determines the number of Armor Ups in the item pool.
|
Determines the number of Armor Ups in the item pool.
|
||||||
"""
|
"""
|
||||||
displayname = "Armor Up Pool"
|
display_name = "Armor Up Pool"
|
||||||
range_start = 0
|
range_start = 0
|
||||||
range_end = 10
|
range_end = 10
|
||||||
default = 10
|
default = 10
|
||||||
|
@ -295,7 +295,7 @@ class EquipUpPool(Range):
|
||||||
"""
|
"""
|
||||||
Determines the number of Equip Ups in the item pool.
|
Determines the number of Equip Ups in the item pool.
|
||||||
"""
|
"""
|
||||||
displayname = "Equip Up Pool"
|
display_name = "Equip Up Pool"
|
||||||
range_start = 0
|
range_start = 0
|
||||||
range_end = 10
|
range_end = 10
|
||||||
default = 10
|
default = 10
|
||||||
|
@ -305,7 +305,7 @@ class CritChanceUpPool(Range):
|
||||||
"""
|
"""
|
||||||
Determines the number of Crit Chance Ups in the item pool.
|
Determines the number of Crit Chance Ups in the item pool.
|
||||||
"""
|
"""
|
||||||
displayname = "Crit Chance Up Pool"
|
display_name = "Crit Chance Up Pool"
|
||||||
range_start = 0
|
range_start = 0
|
||||||
range_end = 5
|
range_end = 5
|
||||||
default = 5
|
default = 5
|
||||||
|
@ -315,7 +315,7 @@ class CritDamageUpPool(Range):
|
||||||
"""
|
"""
|
||||||
Determines the number of Crit Damage Ups in the item pool.
|
Determines the number of Crit Damage Ups in the item pool.
|
||||||
"""
|
"""
|
||||||
displayname = "Crit Damage Up Pool"
|
display_name = "Crit Damage Up Pool"
|
||||||
range_start = 0
|
range_start = 0
|
||||||
range_end = 5
|
range_end = 5
|
||||||
default = 5
|
default = 5
|
||||||
|
@ -325,12 +325,22 @@ class FreeDiaryOnGeneration(DefaultOnToggle):
|
||||||
"""
|
"""
|
||||||
Allows the player to get a free diary check every time they regenerate the castle in the starting room.
|
Allows the player to get a free diary check every time they regenerate the castle in the starting room.
|
||||||
"""
|
"""
|
||||||
displayname = "Free Diary On Generation"
|
display_name = "Free Diary On Generation"
|
||||||
|
|
||||||
|
|
||||||
|
class AvailableClasses(OptionSet):
|
||||||
|
"""
|
||||||
|
List of classes that will be in the item pool to find. The upgraded form of the class will be added with it.
|
||||||
|
The upgraded form of your starting class will be available regardless.
|
||||||
|
"""
|
||||||
|
display_name = "Available Classes"
|
||||||
|
default = {"Knight", "Mage", "Barbarian", "Knave", "Shinobi", "Miner", "Spellthief", "Lich", "Dragon", "Traitor"}
|
||||||
|
valid_keys = {"Knight", "Mage", "Barbarian", "Knave", "Shinobi", "Miner", "Spellthief", "Lich", "Dragon", "Traitor"}
|
||||||
|
|
||||||
legacy_options: typing.Dict[str, type(Option)] = {
|
legacy_options: typing.Dict[str, type(Option)] = {
|
||||||
"starting_gender": StartingGender,
|
"starting_gender": StartingGender,
|
||||||
"starting_class": StartingClass,
|
"starting_class": StartingClass,
|
||||||
|
"available_classes": AvailableClasses,
|
||||||
"new_game_plus": NewGamePlus,
|
"new_game_plus": NewGamePlus,
|
||||||
"fairy_chests_per_zone": FairyChestsPerZone,
|
"fairy_chests_per_zone": FairyChestsPerZone,
|
||||||
"chests_per_zone": ChestsPerZone,
|
"chests_per_zone": ChestsPerZone,
|
||||||
|
|
|
@ -93,37 +93,43 @@ class LegacyWorld(World):
|
||||||
itempool += [self.create_item(ItemName.crit_chance)] * int(self.world.crit_chance_pool[self.player])
|
itempool += [self.create_item(ItemName.crit_chance)] * int(self.world.crit_chance_pool[self.player])
|
||||||
itempool += [self.create_item(ItemName.crit_damage)] * int(self.world.crit_damage_pool[self.player])
|
itempool += [self.create_item(ItemName.crit_damage)] * int(self.world.crit_damage_pool[self.player])
|
||||||
|
|
||||||
# Add specific classes into the pool. Eventually, will be able to shuffle the starting ones, but until then...
|
classes = self.world.available_classes[self.player]
|
||||||
itempool += [
|
if "Dragon" in classes:
|
||||||
self.create_item(ItemName.dragon),
|
itempool.append(self.create_item(ItemName.dragon))
|
||||||
self.create_item(ItemName.traitor),
|
if "Traitor" in classes:
|
||||||
*self._create_items(ItemName.progressive_knight),
|
itempool.append(self.create_item(ItemName.traitor))
|
||||||
*self._create_items(ItemName.progressive_mage),
|
|
||||||
*self._create_items(ItemName.progressive_barbarian),
|
|
||||||
*self._create_items(ItemName.progressive_knave),
|
|
||||||
*self._create_items(ItemName.progressive_shinobi),
|
|
||||||
*self._create_items(ItemName.progressive_miner),
|
|
||||||
*self._create_items(ItemName.progressive_lich),
|
|
||||||
*self._create_items(ItemName.progressive_spellthief),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Remove one of our starting classes from the item pool.
|
|
||||||
if self.world.starting_class[self.player] == "knight":
|
if self.world.starting_class[self.player] == "knight":
|
||||||
itempool.remove(self.create_item(ItemName.progressive_knight))
|
itempool.append(self.create_item(ItemName.progressive_knight))
|
||||||
elif self.world.starting_class[self.player] == "mage":
|
elif "Knight" in classes:
|
||||||
itempool.remove(self.create_item(ItemName.progressive_mage))
|
itempool.extend(self._create_items(ItemName.progressive_knight))
|
||||||
elif self.world.starting_class[self.player] == "barbarian":
|
if self.world.starting_class[self.player] == "mage":
|
||||||
itempool.remove(self.create_item(ItemName.progressive_barbarian))
|
itempool.append(self.create_item(ItemName.progressive_mage))
|
||||||
elif self.world.starting_class[self.player] == "knave":
|
elif "Mage" in classes:
|
||||||
itempool.remove(self.create_item(ItemName.progressive_knave))
|
itempool.extend(self._create_items(ItemName.progressive_mage))
|
||||||
elif self.world.starting_class[self.player] == "miner":
|
if self.world.starting_class[self.player] == "barbarian":
|
||||||
itempool.remove(self.create_item(ItemName.progressive_miner))
|
itempool.append(self.create_item(ItemName.progressive_barbarian))
|
||||||
elif self.world.starting_class[self.player] == "shinobi":
|
elif "Barbarian" in classes:
|
||||||
itempool.remove(self.create_item(ItemName.progressive_shinobi))
|
itempool.extend(self._create_items(ItemName.progressive_barbarian))
|
||||||
elif self.world.starting_class[self.player] == "lich":
|
if self.world.starting_class[self.player] == "knave":
|
||||||
itempool.remove(self.create_item(ItemName.progressive_lich))
|
itempool.append(self.create_item(ItemName.progressive_knave))
|
||||||
elif self.world.starting_class[self.player] == "spellthief":
|
elif "Knave" in classes:
|
||||||
itempool.remove(self.create_item(ItemName.progressive_spellthief))
|
itempool.extend(self._create_items(ItemName.progressive_knave))
|
||||||
|
if self.world.starting_class[self.player] == "shinobi":
|
||||||
|
itempool.append(self.create_item(ItemName.progressive_shinobi))
|
||||||
|
elif "Shinobi" in classes:
|
||||||
|
itempool.extend(self._create_items(ItemName.progressive_shinobi))
|
||||||
|
if self.world.starting_class[self.player] == "miner":
|
||||||
|
itempool.append(self.create_item(ItemName.progressive_miner))
|
||||||
|
elif "Miner" in classes:
|
||||||
|
itempool.extend(self._create_items(ItemName.progressive_miner))
|
||||||
|
if self.world.starting_class[self.player] == "lich":
|
||||||
|
itempool.append(self.create_item(ItemName.progressive_lich))
|
||||||
|
elif "Lich" in classes:
|
||||||
|
itempool.extend(self._create_items(ItemName.progressive_lich))
|
||||||
|
if self.world.starting_class[self.player] == "spellthief":
|
||||||
|
itempool.append(self.create_item(ItemName.progressive_spellthief))
|
||||||
|
elif "Spellthief" in classes:
|
||||||
|
itempool.extend(self._create_items(ItemName.progressive_spellthief))
|
||||||
|
|
||||||
# Check if we need to start with these vendors or put them in the pool.
|
# Check if we need to start with these vendors or put them in the pool.
|
||||||
if self.world.vendors[self.player] == "start_unlocked":
|
if self.world.vendors[self.player] == "start_unlocked":
|
||||||
|
|
Loading…
Reference in New Issue