sm64ex: Add Course Randomizer and Progressive Keys (#256)
This commit is contained in:
committed by
GitHub
parent
ee5ea09cbc
commit
3d17f0d588
@@ -1,4 +1,4 @@
|
||||
import string
|
||||
import typing
|
||||
from .Items import item_table, SM64Item
|
||||
from .Locations import location_table, SM64Location
|
||||
from .Options import sm64_options
|
||||
@@ -21,17 +21,22 @@ class SM64World(World):
|
||||
item_name_to_id = item_table
|
||||
location_name_to_id = location_table
|
||||
|
||||
data_version = 4
|
||||
data_version = 5
|
||||
forced_auto_forfeit = False
|
||||
|
||||
area_connections: typing.Dict[int, int]
|
||||
|
||||
options = sm64_options
|
||||
|
||||
def generate_early(self):
|
||||
self.topology_present = self.world.AreaRandomizer[self.player].value
|
||||
|
||||
def create_regions(self):
|
||||
create_regions(self.world,self.player)
|
||||
|
||||
|
||||
def set_rules(self):
|
||||
set_rules(self.world,self.player)
|
||||
self.area_connections = {}
|
||||
set_rules(self.world, self.player, self.area_connections)
|
||||
|
||||
def create_item(self, name: str) -> Item:
|
||||
item_id = item_table[name]
|
||||
@@ -40,16 +45,20 @@ class SM64World(World):
|
||||
|
||||
def generate_basic(self):
|
||||
staritem = self.create_item("Power Star")
|
||||
starcount = self.world.StarsToFinish[self.player].value + self.world.ExtraStars[self.player].value
|
||||
if (self.world.EnableCoinStars[self.player].value and (starcount-15) >= self.world.StarsToFinish[self.player].value):
|
||||
starcount -= 15
|
||||
starcount = min(self.world.StarsToFinish[self.player].value + self.world.ExtraStars[self.player].value,120)
|
||||
if (not self.world.EnableCoinStars[self.player].value):
|
||||
starcount = max(starcount - 15,self.world.StarsToFinish[self.player].value)
|
||||
self.world.itempool += [staritem for i in range(0,starcount)]
|
||||
mushroomitem = self.create_item("1Up Mushroom")
|
||||
self.world.itempool += [mushroomitem for i in range(starcount,120)]
|
||||
self.world.itempool += [mushroomitem for i in range(starcount,120 - (15 if not self.world.EnableCoinStars[self.player].value else 0))]
|
||||
|
||||
key1 = self.create_item("Basement Key")
|
||||
key2 = self.create_item("Second Floor Key")
|
||||
self.world.itempool += [key1,key2]
|
||||
if (not self.world.ProgressiveKeys[self.player].value):
|
||||
key1 = self.create_item("Basement Key")
|
||||
key2 = self.create_item("Second Floor Key")
|
||||
self.world.itempool += [key1,key2]
|
||||
else:
|
||||
key = self.create_item("Progressive Key")
|
||||
self.world.itempool += [key,key]
|
||||
|
||||
wingcap = self.create_item("Wing Cap")
|
||||
metalcap = self.create_item("Metal Cap")
|
||||
@@ -58,5 +67,6 @@ class SM64World(World):
|
||||
|
||||
def fill_slot_data(self):
|
||||
return {
|
||||
"AreaRando": self.area_connections,
|
||||
"StarsToFinish": self.world.StarsToFinish[self.player].value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user