Core: move multiple Item properties into a single Flag (#638)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import typing
|
||||
|
||||
from BaseClasses import Item
|
||||
from BaseClasses import Item, ItemClassification
|
||||
from .Names import ItemName
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ class ItemData(typing.NamedTuple):
|
||||
class SA2BItem(Item):
|
||||
game: str = "Sonic Adventure 2: Battle"
|
||||
|
||||
def __init__(self, name, advancement: bool = False, code: int = None, player: int = None):
|
||||
super(SA2BItem, self).__init__(name, advancement, code, player)
|
||||
def __init__(self, name, classification: ItemClassification, code: int = None, player: int = None):
|
||||
super(SA2BItem, self).__init__(name, classification, code, player)
|
||||
|
||||
if self.name == ItemName.sonic_light_shoes or self.name == ItemName.shadow_air_shoes:
|
||||
self.pedestal_credit_text = "and the Soap Shoes"
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import os
|
||||
import typing
|
||||
import math
|
||||
|
||||
from BaseClasses import Item, MultiWorld, Tutorial
|
||||
from BaseClasses import Item, MultiWorld, Tutorial, ItemClassification
|
||||
from .Items import SA2BItem, ItemData, item_table, upgrades_table
|
||||
from .Locations import SA2BLocation, all_locations, setup_locations
|
||||
from .Options import sa2b_options
|
||||
@@ -11,7 +10,6 @@ from .Regions import create_regions, shuffleable_regions, connect_regions, Level
|
||||
from .Rules import set_rules
|
||||
from .Names import ItemName, LocationName
|
||||
from ..AutoWorld import WebWorld, World
|
||||
import Patch
|
||||
|
||||
|
||||
class SA2BWeb(WebWorld):
|
||||
@@ -205,11 +203,18 @@ class SA2BWorld(World):
|
||||
|
||||
def create_item(self, name: str, force_non_progression=False) -> Item:
|
||||
data = item_table[name]
|
||||
created_item = SA2BItem(name, data.progression, data.code, self.player)
|
||||
|
||||
if name == ItemName.emblem:
|
||||
created_item.skip_in_prog_balancing = True
|
||||
if force_non_progression:
|
||||
created_item.advancement = False
|
||||
classification = ItemClassification.progression_skip_balancing
|
||||
elif force_non_progression:
|
||||
classification = ItemClassification.filler
|
||||
elif data.progression:
|
||||
classification = ItemClassification.progression
|
||||
else:
|
||||
classification = ItemClassification.filler
|
||||
|
||||
created_item = SA2BItem(name, classification, data.code, self.player)
|
||||
|
||||
return created_item
|
||||
|
||||
def set_rules(self):
|
||||
|
||||
Reference in New Issue
Block a user