From 14ac139d0374f13a08bff836250dd89ec182137f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 13 Mar 2022 04:04:12 -0400 Subject: [PATCH] Added world for ArchipIDLE --- worlds/archipidle/Items.py | 127 ++++++++++++++++++++++++++++++++++ worlds/archipidle/Rules.py | 33 +++++++++ worlds/archipidle/__init__.py | 73 +++++++++++++++++++ 3 files changed, 233 insertions(+) create mode 100644 worlds/archipidle/Items.py create mode 100644 worlds/archipidle/Rules.py create mode 100644 worlds/archipidle/__init__.py diff --git a/worlds/archipidle/Items.py b/worlds/archipidle/Items.py new file mode 100644 index 00000000..e7498c66 --- /dev/null +++ b/worlds/archipidle/Items.py @@ -0,0 +1,127 @@ +item_table = ( + 'Staples Easy Button', + 'One Million Dollars', + 'Replica Master Sword', + 'VHS Copy of Jurassic Park', + '32GB USB Drive', + 'Pocket Protector', + 'Leftover Parts from IKEA Furniture', + 'Half-Empty Ink Cartridge for a Printer', + 'Watch Battery', + 'Towel', + 'Scarf', + '2012 Magic the Gathering Core Set Starter Box', + 'Pokemon Booster Pack', + 'USB Speakers', + 'Plastic Spork', + 'Cheeseburger', + 'Brand New Car', + 'Hunting Knife', + 'Zippo Lighter', + 'Red Shirt', + 'One-Up Mushroom', + 'Nokia N-GAGE', + '2-Liter of Sprite', + 'Free trial of the critically acclaimed MMORPG Final Fantasy XIV, including the entirety of A Realm Reborn and the award winning Heavenasward expansion up to level 60 for free with no restrictions on playtime!', + 'Can of Compressed Air', + 'Striped Kitten', + 'USB Power Adapter', + 'Fortune Cookie', + 'Nintendo Power Glove', + 'The Lampshade of No Real Significance', + 'Kneepads of Allure', + 'Get-Out-Of-Jail-Free Card', + 'Box Set of Stargate SG-1 Season 4', + 'The Missing Left Sock', + 'Poster Tube', + 'Electronic Picture Frame', + 'Bottle of Shampoo', + 'Your Mission, Should You Choose To Accept It', + 'Fanny Pack', + 'Robocop T-Shirt', + 'Suspiciously Small Monocle', + 'Table Saw', + 'Cookies and Cream Milkshake', + 'Deflated Accordion', + 'Grandma\'s Homemade Pie', + 'Invisible Lego on the Floor', + 'Pitfall Trap', + 'Flathead Screwdriver', + 'Leftover Pizza', + 'Voodoo Doll that Looks Like You', + 'Pink Shoelaces', + 'Half a Bottle of Scotch', + 'Reminder Not to Forget Aginah', + 'Medicine Ball', + 'Yoga Mat', + 'Chocolate Orange', + 'Old Concert Tickets', + 'The Pick of Destiny', + 'McGuffin', + 'Just a Regular McMuffin', + '34 Tacos', + 'Duct Tape', + 'Copy of Untitled Goose Game', + 'Partially Used Bed Bath & Beyond Gift Card', + 'Mostly Popped Bubble Wrap', + 'Expired Driver\'s License', + 'The Look, You Know the One', + 'Transformers Lunch Box', + 'MP3 Player', + 'Dry Sharpie', + 'Chalkboard Eraser', + 'Overhead Projector', + 'Physical Copy of the Japanese 1.0 Link to the Past', + 'Collectable Action Figure', + 'Box Set of The Lord of the Rings Books', + 'Lite-Bright', + 'Stories from the Good-Old-Days', + 'Un-Reproducable Bug Reports', + 'Autographed Copy of Shaq-Fu', + 'Game-Winning Baseball', + 'Portable Battery Bank', + 'Blockbuster Membership Card', + 'Offensive Bumper Sticker', + 'Last Sunday\'s Crossword Puzzle', + 'Rubik\'s Cube', + 'Your First Grey Hair', + 'Embarrassing Childhood Photo', + 'Abandoned Sphere One Check', + 'The Internet', + 'Late-Night Cartoons', + 'The Correct Usage of a Semicolon', + 'Microsoft Windows 95 Resource Kit', + 'Car-Phone', + 'Walkman Radio', + 'Relevant XKCD Comic', + 'Razor Scooter', + 'Set of Beyblades', + 'Box of Pogs', + 'Beanie-Baby Collection', + 'Laser Tag Gun', + 'Radio Controlled Car', + 'Boogie Board', + 'Air Jordans', + 'Rubber Duckie', + 'The Last Cookie in the Cookie Jar', + 'Tin-Foil Hat', + 'Button-Up Shirt', + 'Designer Brand Bag', + 'Trapper Keeper', + 'Fake Moustache', + 'Colored Pencils', + 'Pair of 3D Glasses', + 'Pair of Movie Tickets', + 'Refrigerator Magnets', + 'NASCAR Dinner Plates', + 'The Final Boss', + 'Unskippable Cutscenes', + '24 Rolls of Toilet Paper', + 'Canned Soup', + 'Warm Blanket', + '3D Printer', + 'Jetpack', + 'Hoverboard', + 'Joycons with No Drift', + 'Double Rainbow', +) diff --git a/worlds/archipidle/Rules.py b/worlds/archipidle/Rules.py new file mode 100644 index 00000000..640a8f3c --- /dev/null +++ b/worlds/archipidle/Rules.py @@ -0,0 +1,33 @@ +from BaseClasses import MultiWorld +from ..AutoWorld import LogicMixin +from ..generic.Rules import set_rule + + +class ArchipIDLELogic(LogicMixin): + def _archipidle_location_is_accessible(self, player_id, items_required): + items_received = 0 + for item in self.prog_items: + if item[1] == player_id: + items_received += 1 + + return items_received >= items_required + + +def set_rules(world: MultiWorld, player: int): + for i in range(1, 11): + set_rule( + world.get_location(f"Location {i}", player), + lambda state: state._archipidle_location_is_accessible(player, 0) + ) + + for i in range(11, 31): + set_rule( + world.get_location(f"Location {i}", player), + lambda state: state._archipidle_location_is_accessible(player, 4) + ) + + for i in range(31, 51): + set_rule( + world.get_location(f"Location {i}", player), + lambda state: state._archipidle_location_is_accessible(player, 20) + ) diff --git a/worlds/archipidle/__init__.py b/worlds/archipidle/__init__.py new file mode 100644 index 00000000..1da7e148 --- /dev/null +++ b/worlds/archipidle/__init__.py @@ -0,0 +1,73 @@ +from BaseClasses import Item, MultiWorld, Region, Location, Entrance +from .Items import item_table +from .Rules import set_rules +from ..AutoWorld import World + + +class ArchipIDLEWorld(World): + game = "ArchipIDLE" + topology_present = False + data_version = 1 + + item_name_to_id = {} + start_id = 9000 + for item in item_table: + item_name_to_id[item] = start_id + start_id += 1 + + location_name_to_id = {} + start_id = 9000 + for i in range(1, 51): + location_name_to_id[f"Location {i}"] = start_id + start_id += 1 + + def generate_basic(self): + item_table_copy = list(item_table) + self.world.random.shuffle(item_table_copy) + + item_pool = [] + for i in range(50): + item = Item(item_table[i], True, self.item_name_to_id[item_table[i]], self.player) + item.game = 'ArchipIDLE' + item_pool.append(item) + + self.world.itempool = item_pool + + def set_rules(self): + set_rules(self.world, self.player) + + def create_item(self, name: str) -> Item: + item_data = item_table[name] + return Item(name, item_data.progression, item_data.code, self.player) + + def create_regions(self): + self.world.regions += [ + create_region(self.world, self.player, 'Menu', None, ['Entrance to IDLE Zone']), + create_region(self.world, self.player, 'IDLE Zone', self.location_name_to_id) + ] + + # link up our region with the entrance we just made + self.world.get_entrance('Entrance to IDLE Zone', self.player)\ + .connect(self.world.get_region('IDLE Zone', self.player)) + + +def create_region(world: MultiWorld, player: int, name: str, locations=None, exits=None): + region = Region(name, None, name, player) + region.world = world + if locations: + for location_name in locations.keys(): + location = ArchipIDLELocation(player, location_name, locations[location_name], region) + region.locations.append(location) + + if exits: + for _exit in exits: + region.exits.append(Entrance(player, _exit, region)) + + return region + + +class ArchipIDLELocation(Location): + game: str = "ArchipIDLE" + + def __init__(self, player: int, name: str, address=None, parent=None): + super(ArchipIDLELocation, self).__init__(player, name, address, parent)