Skip to content

Commit

Permalink
Clique: Force priority location for "final location" and other minor …
Browse files Browse the repository at this point in the history
…tweaks. (ArchipelagoMW#1583)

* Clique: The greatest game of all time

* Fix failing test

* Increment data_version for backwards compat

* Clique: Tweaked names and forced progression for "The Button"

* Clique: Just location/item definitions to class

* Clique: More tweaks.

* Clique: Fix derp moment.

* Clique: Fix derp moment, part dos.

* Clique: Suggested changes.

* Clique: Update domain

* Clique: Create derived classes for Item and Location

* Clique: simplify line
  • Loading branch information
ThePhar authored Apr 8, 2023
1 parent 8e6ec85 commit 67a22b8
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 52 deletions.
2 changes: 1 addition & 1 deletion worlds/clique/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class HardMode(Toggle):
"""Only for masochists: requires 2 presses!"""
"""Only for the most masochistically inclined... Requires button activation!"""
display_name = "Hard Mode"


Expand Down
84 changes: 36 additions & 48 deletions worlds/clique/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
from worlds.generic.Rules import set_rule
from .Options import clique_options

item_table = {
"The feeling of satisfaction.": 69696969,
"Button Key": 69696968,
}

location_table = {
"The Button": 69696969,
"The Desk": 69696968,
}
class CliqueItem(Item):
game = "Clique"


class CliqueLocation(Location):
game = "Clique"


class CliqueWebWorld(WebWorld):
Expand All @@ -32,78 +30,68 @@ class CliqueWorld(World):
"""The greatest game ever designed. Full of exciting gameplay!"""

game = "Clique"
topology_present = False
data_version = 1
data_version = 2
web = CliqueWebWorld()
option_definitions = clique_options

location_name_to_id = location_table
item_name_to_id = item_table
# Yes, I'm like 12 for this.
location_name_to_id = {
"The Big Red Button": 69696969,
"The Item on the Desk": 69696968,
}

def create_item(self, name: str) -> "Item":
return Item(name, ItemClassification.progression, self.item_name_to_id[name], self.player)
item_name_to_id = {
"Feeling of Satisfaction": 69696969,
"Button Activation": 69696968,
}

def get_setting(self, name: str):
return getattr(self.multiworld, name)[self.player]
def create_item(self, name: str) -> CliqueItem:
return CliqueItem(name, ItemClassification.progression, self.item_name_to_id[name], self.player)

def fill_slot_data(self) -> dict:
return {option_name: self.get_setting(option_name).value for option_name in self.option_definitions}

def generate_basic(self) -> None:
self.multiworld.itempool.append(self.create_item("The feeling of satisfaction."))
def create_items(self) -> None:
self.multiworld.itempool.append(self.create_item("Feeling of Satisfaction"))
self.multiworld.priority_locations[self.player].value.add("The Big Red Button")

if self.multiworld.hard_mode[self.player]:
self.multiworld.itempool.append(self.create_item("Button Key"))
self.multiworld.itempool.append(self.create_item("Button Activation"))

def create_regions(self) -> None:
if self.multiworld.hard_mode[self.player]:
self.multiworld.regions += [
create_region(self.multiworld, self.player, "Menu", None, ["Entrance to THE BUTTON"]),
create_region(self.multiworld, self.player, "THE BUTTON", self.location_name_to_id)
create_region(self.multiworld, self.player, "Menu", None, ["The entrance to the button."]),
create_region(self.multiworld, self.player, "The realm of the button.", self.location_name_to_id)
]
else:
self.multiworld.regions += [
create_region(self.multiworld, self.player, "Menu", None, ["Entrance to THE BUTTON"]),
create_region(self.multiworld, self.player, "THE BUTTON", {"The Button": 69696969})
]
create_region(self.multiworld, self.player, "Menu", None, ["The entrance to the button."]),
create_region(self.multiworld, self.player, "The realm of the button.", {
"The Big Red Button": 69696969
})]

self.multiworld.get_entrance("Entrance to THE BUTTON", self.player)\
.connect(self.multiworld.get_region("THE BUTTON", self.player))
self.multiworld.get_entrance("The entrance to the button.", self.player) \
.connect(self.multiworld.get_region("The realm of the button.", self.player))

def get_filler_item_name(self) -> str:
return self.multiworld.random.choice(item_table)
return self.multiworld.random.choice(self.item_name_to_id)

def set_rules(self) -> None:
if self.multiworld.hard_mode[self.player]:
set_rule(
self.multiworld.get_location("The Button", self.player),
lambda state: state.has("Button Key", self.player)
)
self.multiworld.get_location("The Big Red Button", self.player),
lambda state: state.has("Button Activation", self.player))

self.multiworld.completion_condition[self.player] = lambda state: \
state.has("Button Key", self.player)
else:
self.multiworld.completion_condition[self.player] = lambda state: \
state.has("The feeling of satisfaction.", self.player)
self.multiworld.completion_condition[self.player] = lambda state: \
state.has("Feeling of Satisfaction", self.player)


def create_region(world: MultiWorld, player: int, name: str, locations=None, exits=None):
region = Region(name, player, world)
if locations:
for location_name in locations.keys():
location = CliqueLocation(player, location_name, locations[location_name], region)
region.locations.append(location)
region.locations.append(CliqueLocation(player, location_name, locations[location_name], region))

if exits:
for _exit in exits:
region.exits.append(Entrance(player, _exit, region))

return region


class CliqueItem(Item):
game = "Clique"


class CliqueLocation(Location):
game: str = "Clique"
3 changes: 1 addition & 2 deletions worlds/clique/docs/en_Clique.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

## What is this game?

Even I don't know.
Yes.

## Where is the settings page?

The [player settings page for this game](../player-settings) contains all the options you need to configure
and export a config file.

2 changes: 1 addition & 1 deletion worlds/clique/docs/guide_en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Clique Start Guide

Go to the [Clique Game](http://clique.darkshare.site.nfoservers.com/) and enter the hostname:ip address,
Go to the [Clique Game](http://clique.pharware.com/) and enter the hostname:ip address,
then your slot name.

Enjoy.

0 comments on commit 67a22b8

Please sign in to comment.