Final Fantasy Mystic Quest: Implement new game (#1909)
FFMQR by @wildham0 Uses an API created by wildham for Map Shuffle, Crest Shuffle and Battlefield Reward Shuffle, using a similar method of obtaining data from an external website to Super Metroid's Varia Preset option. Generates a .apmq file which the user must bring to the FFMQR website https://www.ffmqrando.net/Archipelago to patch their rom. It is not an actual patch file but contains item placement and options data for the FFMQR website to generate a patched rom with for AP. Some of the AP options may seem unusual, using Choice instead of Range where it may seem more appropriate, but these are options that are passed to FFMQR and I can only be as flexible as it is. @wildham0 deserves the bulk of the credit for not only creating FFMQR in the first place but all the ASM work on the rom needed to make this possible, work on FFMQR to allow patching with the .apmq files, and creating the API that meant I did not have to recreate his map shuffle from scratch.
This commit is contained in:
parent
65f47be511
commit
f54f8622bb
|
@ -57,6 +57,7 @@ Currently, the following games are supported:
|
|||
* Shivers
|
||||
* Heretic
|
||||
* Landstalker: The Treasures of King Nole
|
||||
* Final Fantasy Mystic Quest
|
||||
|
||||
For setup and instructions check out our [tutorials page](https://archipelago.gg/tutorial/).
|
||||
Downloads can be found at [Releases](https://github.com/ArchipelagoMW/Archipelago/releases), including compiled
|
||||
|
|
|
@ -90,6 +90,8 @@ def download_slot_file(room_id, player_id: int):
|
|||
fname = f"AP_{app.jinja_env.filters['suuid'](room_id)}.json"
|
||||
elif slot_data.game == "Kingdom Hearts 2":
|
||||
fname = f"AP_{app.jinja_env.filters['suuid'](room_id)}_P{slot_data.player_id}_{slot_data.player_name}.zip"
|
||||
elif slot_data.game == "Final Fantasy Mystic Quest":
|
||||
fname = f"AP+{app.jinja_env.filters['suuid'](room_id)}_P{slot_data.player_id}_{slot_data.player_name}.apmq"
|
||||
else:
|
||||
return "Game download not supported."
|
||||
return send_file(io.BytesIO(slot_data.data), as_attachment=True, download_name=fname)
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
{% elif patch.game == "Dark Souls III" %}
|
||||
<a href="{{ url_for("download_slot_file", room_id=room.id, player_id=patch.player_id) }}" download>
|
||||
Download JSON File...</a>
|
||||
{% elif patch.game == "Final Fantasy Mystic Quest" %}
|
||||
<a href="{{ url_for("download_slot_file", room_id=room.id, player_id=patch.player_id) }}" download>
|
||||
Download APMQ File...</a>
|
||||
{% else %}
|
||||
No file to download for this game.
|
||||
{% endif %}
|
||||
|
|
|
@ -55,6 +55,9 @@
|
|||
# Final Fantasy
|
||||
/worlds/ff1/ @jtoyoda
|
||||
|
||||
# Final Fantasy Mystic Quest
|
||||
/worlds/ffmq/ @Alchav @wildham0
|
||||
|
||||
# Heretic
|
||||
/worlds/heretic/ @Daivuk
|
||||
|
||||
|
|
|
@ -0,0 +1,119 @@
|
|||
|
||||
from NetUtils import ClientStatus, color
|
||||
from worlds.AutoSNIClient import SNIClient
|
||||
from .Regions import offset
|
||||
import logging
|
||||
|
||||
snes_logger = logging.getLogger("SNES")
|
||||
|
||||
ROM_NAME = (0x7FC0, 0x7FD4 + 1 - 0x7FC0)
|
||||
|
||||
READ_DATA_START = 0xF50EA8
|
||||
READ_DATA_END = 0xF50FE7 + 1
|
||||
|
||||
GAME_FLAGS = (0xF50EA8, 64)
|
||||
COMPLETED_GAME = (0xF50F22, 1)
|
||||
BATTLEFIELD_DATA = (0xF50FD4, 20)
|
||||
|
||||
RECEIVED_DATA = (0xE01FF0, 3)
|
||||
|
||||
ITEM_CODE_START = 0x420000
|
||||
|
||||
IN_GAME_FLAG = (4 * 8) + 2
|
||||
|
||||
NPC_CHECKS = {
|
||||
4325676: ((6 * 8) + 4, False), # Old Man Level Forest
|
||||
4325677: ((3 * 8) + 6, True), # Kaeli Level Forest
|
||||
4325678: ((25 * 8) + 1, True), # Tristam
|
||||
4325680: ((26 * 8) + 0, True), # Aquaria Vendor Girl
|
||||
4325681: ((29 * 8) + 2, True), # Phoebe Wintry Cave
|
||||
4325682: ((25 * 8) + 6, False), # Mysterious Man (Life Temple)
|
||||
4325683: ((29 * 8) + 3, True), # Reuben Mine
|
||||
4325684: ((29 * 8) + 7, True), # Spencer
|
||||
4325685: ((29 * 8) + 6, False), # Venus Chest
|
||||
4325686: ((29 * 8) + 1, True), # Fireburg Tristam
|
||||
4325687: ((26 * 8) + 1, True), # Fireburg Vendor Girl
|
||||
4325688: ((14 * 8) + 4, True), # MegaGrenade Dude
|
||||
4325689: ((29 * 8) + 5, False), # Tristam's Chest
|
||||
4325690: ((29 * 8) + 4, True), # Arion
|
||||
4325691: ((29 * 8) + 0, True), # Windia Kaeli
|
||||
4325692: ((26 * 8) + 2, True), # Windia Vendor Girl
|
||||
|
||||
}
|
||||
|
||||
|
||||
def get_flag(data, flag):
|
||||
byte = int(flag / 8)
|
||||
bit = int(0x80 / (2 ** (flag % 8)))
|
||||
return (data[byte] & bit) > 0
|
||||
|
||||
|
||||
class FFMQClient(SNIClient):
|
||||
game = "Final Fantasy Mystic Quest"
|
||||
|
||||
async def validate_rom(self, ctx):
|
||||
from SNIClient import snes_read
|
||||
rom_name = await snes_read(ctx, *ROM_NAME)
|
||||
if rom_name is None:
|
||||
return False
|
||||
if rom_name[:2] != b"MQ":
|
||||
return False
|
||||
|
||||
ctx.rom = rom_name
|
||||
ctx.game = self.game
|
||||
ctx.items_handling = 0b001
|
||||
return True
|
||||
|
||||
async def game_watcher(self, ctx):
|
||||
from SNIClient import snes_buffered_write, snes_flush_writes, snes_read
|
||||
|
||||
check_1 = await snes_read(ctx, 0xF53749, 1)
|
||||
received = await snes_read(ctx, RECEIVED_DATA[0], RECEIVED_DATA[1])
|
||||
data = await snes_read(ctx, READ_DATA_START, READ_DATA_END - READ_DATA_START)
|
||||
check_2 = await snes_read(ctx, 0xF53749, 1)
|
||||
if check_1 == b'\x00' or check_2 == b'\x00':
|
||||
return
|
||||
|
||||
def get_range(data_range):
|
||||
return data[data_range[0] - READ_DATA_START:data_range[0] + data_range[1] - READ_DATA_START]
|
||||
completed_game = get_range(COMPLETED_GAME)
|
||||
battlefield_data = get_range(BATTLEFIELD_DATA)
|
||||
game_flags = get_range(GAME_FLAGS)
|
||||
|
||||
if game_flags is None:
|
||||
return
|
||||
if not get_flag(game_flags, IN_GAME_FLAG):
|
||||
return
|
||||
|
||||
if not ctx.finished_game:
|
||||
if completed_game[0] & 0x80 and game_flags[30] & 0x18:
|
||||
await ctx.send_msgs([{"cmd": "StatusUpdate", "status": ClientStatus.CLIENT_GOAL}])
|
||||
ctx.finished_game = True
|
||||
|
||||
old_locations_checked = ctx.locations_checked.copy()
|
||||
|
||||
for container in range(256):
|
||||
if get_flag(game_flags, (0x20 * 8) + container):
|
||||
ctx.locations_checked.add(offset["Chest"] + container)
|
||||
|
||||
for location, data in NPC_CHECKS.items():
|
||||
if get_flag(game_flags, data[0]) is data[1]:
|
||||
ctx.locations_checked.add(location)
|
||||
|
||||
for battlefield in range(20):
|
||||
if battlefield_data[battlefield] == 0:
|
||||
ctx.locations_checked.add(offset["BattlefieldItem"] + battlefield + 1)
|
||||
|
||||
if old_locations_checked != ctx.locations_checked:
|
||||
await ctx.send_msgs([{"cmd": 'LocationChecks', "locations": ctx.locations_checked}])
|
||||
|
||||
if received[0] == 0:
|
||||
received_index = int.from_bytes(received[1:], "big")
|
||||
if received_index < len(ctx.items_received):
|
||||
item = ctx.items_received[received_index]
|
||||
received_index += 1
|
||||
code = (item.item - ITEM_CODE_START) + 1
|
||||
if code > 256:
|
||||
code -= 256
|
||||
snes_buffered_write(ctx, RECEIVED_DATA[0], bytes([code, *received_index.to_bytes(2, "big")]))
|
||||
await snes_flush_writes(ctx)
|
|
@ -0,0 +1,297 @@
|
|||
from BaseClasses import ItemClassification, Item
|
||||
|
||||
fillers = {"Cure Potion": 61, "Heal Potion": 52, "Refresher": 17, "Seed": 2, "Bomb Refill": 19,
|
||||
"Projectile Refill": 50}
|
||||
|
||||
|
||||
class ItemData:
|
||||
def __init__(self, item_id, classification, groups=(), data_name=None):
|
||||
self.groups = groups
|
||||
self.classification = classification
|
||||
self.id = None
|
||||
if item_id is not None:
|
||||
self.id = item_id + 0x420000
|
||||
self.data_name = data_name
|
||||
|
||||
|
||||
item_table = {
|
||||
"Elixir": ItemData(0, ItemClassification.progression, ["Key Items"]),
|
||||
"Tree Wither": ItemData(1, ItemClassification.progression, ["Key Items"]),
|
||||
"Wakewater": ItemData(2, ItemClassification.progression, ["Key Items"]),
|
||||
"Venus Key": ItemData(3, ItemClassification.progression, ["Key Items"]),
|
||||
"Multi Key": ItemData(4, ItemClassification.progression, ["Key Items"]),
|
||||
"Mask": ItemData(5, ItemClassification.progression, ["Key Items"]),
|
||||
"Magic Mirror": ItemData(6, ItemClassification.progression, ["Key Items"]),
|
||||
"Thunder Rock": ItemData(7, ItemClassification.progression, ["Key Items"]),
|
||||
"Captain's Cap": ItemData(8, ItemClassification.progression_skip_balancing, ["Key Items"]),
|
||||
"Libra Crest": ItemData(9, ItemClassification.progression, ["Key Items"]),
|
||||
"Gemini Crest": ItemData(10, ItemClassification.progression, ["Key Items"]),
|
||||
"Mobius Crest": ItemData(11, ItemClassification.progression, ["Key Items"]),
|
||||
"Sand Coin": ItemData(12, ItemClassification.progression, ["Key Items", "Coins"]),
|
||||
"River Coin": ItemData(13, ItemClassification.progression, ["Key Items", "Coins"]),
|
||||
"Sun Coin": ItemData(14, ItemClassification.progression, ["Key Items", "Coins"]),
|
||||
"Sky Coin": ItemData(15, ItemClassification.progression_skip_balancing, ["Key Items", "Coins"]),
|
||||
"Sky Fragment": ItemData(15 + 256, ItemClassification.progression_skip_balancing, ["Key Items"]),
|
||||
"Cure Potion": ItemData(16, ItemClassification.filler, ["Consumables"]),
|
||||
"Heal Potion": ItemData(17, ItemClassification.filler, ["Consumables"]),
|
||||
"Seed": ItemData(18, ItemClassification.filler, ["Consumables"]),
|
||||
"Refresher": ItemData(19, ItemClassification.filler, ["Consumables"]),
|
||||
"Exit Book": ItemData(20, ItemClassification.useful, ["Spells"]),
|
||||
"Cure Book": ItemData(21, ItemClassification.useful, ["Spells"]),
|
||||
"Heal Book": ItemData(22, ItemClassification.useful, ["Spells"]),
|
||||
"Life Book": ItemData(23, ItemClassification.useful, ["Spells"]),
|
||||
"Quake Book": ItemData(24, ItemClassification.useful, ["Spells"]),
|
||||
"Blizzard Book": ItemData(25, ItemClassification.useful, ["Spells"]),
|
||||
"Fire Book": ItemData(26, ItemClassification.useful, ["Spells"]),
|
||||
"Aero Book": ItemData(27, ItemClassification.useful, ["Spells"]),
|
||||
"Thunder Seal": ItemData(28, ItemClassification.useful, ["Spells"]),
|
||||
"White Seal": ItemData(29, ItemClassification.useful, ["Spells"]),
|
||||
"Meteor Seal": ItemData(30, ItemClassification.useful, ["Spells"]),
|
||||
"Flare Seal": ItemData(31, ItemClassification.useful, ["Spells"]),
|
||||
"Progressive Sword": ItemData(32 + 256, ItemClassification.progression, ["Weapons", "Swords"]),
|
||||
"Steel Sword": ItemData(32, ItemClassification.progression, ["Weapons", "Swords"]),
|
||||
"Knight Sword": ItemData(33, ItemClassification.progression_skip_balancing, ["Weapons", "Swords"]),
|
||||
"Excalibur": ItemData(34, ItemClassification.progression_skip_balancing, ["Weapons", "Swords"]),
|
||||
"Progressive Axe": ItemData(35 + 256, ItemClassification.progression, ["Weapons", "Axes"]),
|
||||
"Axe": ItemData(35, ItemClassification.progression, ["Weapons", "Axes"]),
|
||||
"Battle Axe": ItemData(36, ItemClassification.progression_skip_balancing, ["Weapons", "Axes"]),
|
||||
"Giant's Axe": ItemData(37, ItemClassification.progression_skip_balancing, ["Weapons", "Axes"]),
|
||||
"Progressive Claw": ItemData(38 + 256, ItemClassification.progression, ["Weapons", "Axes"]),
|
||||
"Cat Claw": ItemData(38, ItemClassification.progression, ["Weapons", "Claws"]),
|
||||
"Charm Claw": ItemData(39, ItemClassification.progression_skip_balancing, ["Weapons", "Claws"]),
|
||||
"Dragon Claw": ItemData(40, ItemClassification.progression, ["Weapons", "Claws"]),
|
||||
"Progressive Bomb": ItemData(41 + 256, ItemClassification.progression, ["Weapons", "Bombs"]),
|
||||
"Bomb": ItemData(41, ItemClassification.progression, ["Weapons", "Bombs"]),
|
||||
"Jumbo Bomb": ItemData(42, ItemClassification.progression_skip_balancing, ["Weapons", "Bombs"]),
|
||||
"Mega Grenade": ItemData(43, ItemClassification.progression, ["Weapons", "Bombs"]),
|
||||
# Ally-only equipment does nothing when received, no reason to put them in the datapackage
|
||||
#"Morning Star": ItemData(44, ItemClassification.progression, ["Weapons"]),
|
||||
#"Bow Of Grace": ItemData(45, ItemClassification.progression, ["Weapons"]),
|
||||
#"Ninja Star": ItemData(46, ItemClassification.progression, ["Weapons"]),
|
||||
|
||||
"Progressive Helm": ItemData(47 + 256, ItemClassification.useful, ["Helms"]),
|
||||
"Steel Helm": ItemData(47, ItemClassification.useful, ["Helms"]),
|
||||
"Moon Helm": ItemData(48, ItemClassification.useful, ["Helms"]),
|
||||
"Apollo Helm": ItemData(49, ItemClassification.useful, ["Helms"]),
|
||||
"Progressive Armor": ItemData(50 + 256, ItemClassification.useful, ["Armors"]),
|
||||
"Steel Armor": ItemData(50, ItemClassification.useful, ["Armors"]),
|
||||
"Noble Armor": ItemData(51, ItemClassification.useful, ["Armors"]),
|
||||
"Gaia's Armor": ItemData(52, ItemClassification.useful, ["Armors"]),
|
||||
#"Replica Armor": ItemData(53, ItemClassification.progression, ["Armors"]),
|
||||
#"Mystic Robes": ItemData(54, ItemClassification.progression, ["Armors"]),
|
||||
#"Flame Armor": ItemData(55, ItemClassification.progression, ["Armors"]),
|
||||
#"Black Robe": ItemData(56, ItemClassification.progression, ["Armors"]),
|
||||
"Progressive Shield": ItemData(57 + 256, ItemClassification.useful, ["Shields"]),
|
||||
"Steel Shield": ItemData(57, ItemClassification.useful, ["Shields"]),
|
||||
"Venus Shield": ItemData(58, ItemClassification.useful, ["Shields"]),
|
||||
"Aegis Shield": ItemData(59, ItemClassification.useful, ["Shields"]),
|
||||
#"Ether Shield": ItemData(60, ItemClassification.progression, ["Shields"]),
|
||||
"Progressive Accessory": ItemData(61 + 256, ItemClassification.useful, ["Accessories"]),
|
||||
"Charm": ItemData(61, ItemClassification.useful, ["Accessories"]),
|
||||
"Magic Ring": ItemData(62, ItemClassification.useful, ["Accessories"]),
|
||||
"Cupid Locket": ItemData(63, ItemClassification.useful, ["Accessories"]),
|
||||
|
||||
# these are understood by FFMQR and I could place these if I want, but it's easier to just let FFMQR
|
||||
# place them. I want an option to make shuffle battlefield rewards NOT color-code the battlefields,
|
||||
# and then I would make the non-item reward battlefields into AP checks and these would be put into those as
|
||||
# the item for AP. But there is no such option right now.
|
||||
# "54 XP": ItemData(96, ItemClassification.filler, data_name="Xp54"),
|
||||
# "99 XP": ItemData(97, ItemClassification.filler, data_name="Xp99"),
|
||||
# "540 XP": ItemData(98, ItemClassification.filler, data_name="Xp540"),
|
||||
# "744 XP": ItemData(99, ItemClassification.filler, data_name="Xp744"),
|
||||
# "816 XP": ItemData(100, ItemClassification.filler, data_name="Xp816"),
|
||||
# "1068 XP": ItemData(101, ItemClassification.filler, data_name="Xp1068"),
|
||||
# "1200 XP": ItemData(102, ItemClassification.filler, data_name="Xp1200"),
|
||||
# "2700 XP": ItemData(103, ItemClassification.filler, data_name="Xp2700"),
|
||||
# "2808 XP": ItemData(104, ItemClassification.filler, data_name="Xp2808"),
|
||||
# "150 Gp": ItemData(105, ItemClassification.filler, data_name="Gp150"),
|
||||
# "300 Gp": ItemData(106, ItemClassification.filler, data_name="Gp300"),
|
||||
# "600 Gp": ItemData(107, ItemClassification.filler, data_name="Gp600"),
|
||||
# "900 Gp": ItemData(108, ItemClassification.filler, data_name="Gp900"),
|
||||
# "1200 Gp": ItemData(109, ItemClassification.filler, data_name="Gp1200"),
|
||||
|
||||
|
||||
"Bomb Refill": ItemData(221, ItemClassification.filler, ["Refills"]),
|
||||
"Projectile Refill": ItemData(222, ItemClassification.filler, ["Refills"]),
|
||||
#"None": ItemData(255, ItemClassification.progression, []),
|
||||
|
||||
"Kaeli 1": ItemData(None, ItemClassification.progression),
|
||||
"Kaeli 2": ItemData(None, ItemClassification.progression),
|
||||
"Tristam": ItemData(None, ItemClassification.progression),
|
||||
"Phoebe 1": ItemData(None, ItemClassification.progression),
|
||||
"Reuben 1": ItemData(None, ItemClassification.progression),
|
||||
"Reuben Dad Saved": ItemData(None, ItemClassification.progression),
|
||||
"Otto": ItemData(None, ItemClassification.progression),
|
||||
"Captain Mac": ItemData(None, ItemClassification.progression),
|
||||
"Ship Steering Wheel": ItemData(None, ItemClassification.progression),
|
||||
"Minotaur": ItemData(None, ItemClassification.progression),
|
||||
"Flamerus Rex": ItemData(None, ItemClassification.progression),
|
||||
"Phanquid": ItemData(None, ItemClassification.progression),
|
||||
"Freezer Crab": ItemData(None, ItemClassification.progression),
|
||||
"Ice Golem": ItemData(None, ItemClassification.progression),
|
||||
"Jinn": ItemData(None, ItemClassification.progression),
|
||||
"Medusa": ItemData(None, ItemClassification.progression),
|
||||
"Dualhead Hydra": ItemData(None, ItemClassification.progression),
|
||||
"Gidrah": ItemData(None, ItemClassification.progression),
|
||||
"Dullahan": ItemData(None, ItemClassification.progression),
|
||||
"Pazuzu": ItemData(None, ItemClassification.progression),
|
||||
"Aquaria Plaza": ItemData(None, ItemClassification.progression),
|
||||
"Summer Aquaria": ItemData(None, ItemClassification.progression),
|
||||
"Reuben Mine": ItemData(None, ItemClassification.progression),
|
||||
"Alive Forest": ItemData(None, ItemClassification.progression),
|
||||
"Rainbow Bridge": ItemData(None, ItemClassification.progression),
|
||||
"Collapse Spencer's Cave": ItemData(None, ItemClassification.progression),
|
||||
"Ship Liberated": ItemData(None, ItemClassification.progression),
|
||||
"Ship Loaned": ItemData(None, ItemClassification.progression),
|
||||
"Ship Dock Access": ItemData(None, ItemClassification.progression),
|
||||
"Stone Golem": ItemData(None, ItemClassification.progression),
|
||||
"Twinhead Wyvern": ItemData(None, ItemClassification.progression),
|
||||
"Zuh": ItemData(None, ItemClassification.progression),
|
||||
|
||||
"Libra Temple Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Life Temple Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Aquaria Vendor Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Fireburg Vendor Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Fireburg Grenademan Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Sealed Temple Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Wintry Temple Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Kaidge Temple Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Light Temple Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Windia Kids Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Windia Dock Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Ship Dock Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Alive Forest Libra Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Alive Forest Gemini Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Alive Forest Mobius Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Wood House Libra Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Wood House Gemini Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Wood House Mobius Crest Tile": ItemData(None, ItemClassification.progression),
|
||||
"Barrel Pushed": ItemData(None, ItemClassification.progression),
|
||||
"Long Spine Bombed": ItemData(None, ItemClassification.progression),
|
||||
"Short Spine Bombed": ItemData(None, ItemClassification.progression),
|
||||
"Skull 1 Bombed": ItemData(None, ItemClassification.progression),
|
||||
"Skull 2 Bombed": ItemData(None, ItemClassification.progression),
|
||||
"Ice Pyramid 1F Statue": ItemData(None, ItemClassification.progression),
|
||||
"Ice Pyramid 3F Statue": ItemData(None, ItemClassification.progression),
|
||||
"Ice Pyramid 4F Statue": ItemData(None, ItemClassification.progression),
|
||||
"Ice Pyramid 5F Statue": ItemData(None, ItemClassification.progression),
|
||||
"Spencer Cave Libra Block Bombed": ItemData(None, ItemClassification.progression),
|
||||
"Lava Dome Plate": ItemData(None, ItemClassification.progression),
|
||||
"Pazuzu 2F Lock": ItemData(None, ItemClassification.progression),
|
||||
"Pazuzu 4F Lock": ItemData(None, ItemClassification.progression),
|
||||
"Pazuzu 6F Lock": ItemData(None, ItemClassification.progression),
|
||||
"Pazuzu 1F": ItemData(None, ItemClassification.progression),
|
||||
"Pazuzu 2F": ItemData(None, ItemClassification.progression),
|
||||
"Pazuzu 3F": ItemData(None, ItemClassification.progression),
|
||||
"Pazuzu 4F": ItemData(None, ItemClassification.progression),
|
||||
"Pazuzu 5F": ItemData(None, ItemClassification.progression),
|
||||
"Pazuzu 6F": ItemData(None, ItemClassification.progression),
|
||||
"Dark King": ItemData(None, ItemClassification.progression),
|
||||
#"Barred": ItemData(None, ItemClassification.progression),
|
||||
|
||||
}
|
||||
|
||||
prog_map = {
|
||||
"Swords": "Progressive Sword",
|
||||
"Axes": "Progressive Axe",
|
||||
"Claws": "Progressive Claw",
|
||||
"Bombs": "Progressive Bomb",
|
||||
"Shields": "Progressive Shield",
|
||||
"Armors": "Progressive Armor",
|
||||
"Helms": "Progressive Helm",
|
||||
"Accessories": "Progressive Accessory",
|
||||
}
|
||||
|
||||
|
||||
def yaml_item(text):
|
||||
if text == "CaptainCap":
|
||||
return "Captain's Cap"
|
||||
elif text == "WakeWater":
|
||||
return "Wakewater"
|
||||
return "".join(
|
||||
[(" " + c if (c.isupper() or c.isnumeric()) and not (text[i - 1].isnumeric() and c == "F") else c) for
|
||||
i, c in enumerate(text)]).strip()
|
||||
|
||||
|
||||
item_groups = {}
|
||||
for item, data in item_table.items():
|
||||
for group in data.groups:
|
||||
item_groups[group] = item_groups.get(group, []) + [item]
|
||||
|
||||
|
||||
def create_items(self) -> None:
|
||||
items = []
|
||||
starting_weapon = self.multiworld.starting_weapon[self.player].current_key.title().replace("_", " ")
|
||||
if self.multiworld.progressive_gear[self.player]:
|
||||
for item_group in prog_map:
|
||||
if starting_weapon in self.item_name_groups[item_group]:
|
||||
starting_weapon = prog_map[item_group]
|
||||
break
|
||||
self.multiworld.push_precollected(self.create_item(starting_weapon))
|
||||
self.multiworld.push_precollected(self.create_item("Steel Armor"))
|
||||
if self.multiworld.sky_coin_mode[self.player] == "start_with":
|
||||
self.multiworld.push_precollected(self.create_item("Sky Coin"))
|
||||
|
||||
precollected_item_names = {item.name for item in self.multiworld.precollected_items[self.player]}
|
||||
|
||||
def add_item(item_name):
|
||||
if item_name in ["Steel Armor", "Sky Fragment"] or "Progressive" in item_name:
|
||||
return
|
||||
if item_name.lower().replace(" ", "_") == self.multiworld.starting_weapon[self.player].current_key:
|
||||
return
|
||||
if self.multiworld.progressive_gear[self.player]:
|
||||
for item_group in prog_map:
|
||||
if item_name in self.item_name_groups[item_group]:
|
||||
item_name = prog_map[item_group]
|
||||
break
|
||||
if item_name == "Sky Coin":
|
||||
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
|
||||
for _ in range(40):
|
||||
items.append(self.create_item("Sky Fragment"))
|
||||
return
|
||||
elif self.multiworld.sky_coin_mode[self.player] == "save_the_crystals":
|
||||
items.append(self.create_filler())
|
||||
return
|
||||
if item_name in precollected_item_names:
|
||||
items.append(self.create_filler())
|
||||
return
|
||||
i = self.create_item(item_name)
|
||||
if self.multiworld.logic[self.player] != "friendly" and item_name in ("Magic Mirror", "Mask"):
|
||||
i.classification = ItemClassification.useful
|
||||
if (self.multiworld.logic[self.player] == "expert" and self.multiworld.map_shuffle[self.player] == "none" and
|
||||
item_name == "Exit Book"):
|
||||
i.classification = ItemClassification.progression
|
||||
items.append(i)
|
||||
|
||||
for item_group in ("Key Items", "Spells", "Armors", "Helms", "Shields", "Accessories", "Weapons"):
|
||||
for item in self.item_name_groups[item_group]:
|
||||
add_item(item)
|
||||
|
||||
if self.multiworld.brown_boxes[self.player] == "include":
|
||||
filler_items = []
|
||||
for item, count in fillers.items():
|
||||
filler_items += [self.create_item(item) for _ in range(count)]
|
||||
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
|
||||
self.multiworld.random.shuffle(filler_items)
|
||||
filler_items = filler_items[39:]
|
||||
items += filler_items
|
||||
|
||||
self.multiworld.itempool += items
|
||||
|
||||
if len(self.multiworld.player_ids) > 1:
|
||||
early_choices = ["Sand Coin", "River Coin"]
|
||||
early_item = self.multiworld.random.choice(early_choices)
|
||||
self.multiworld.early_items[self.player][early_item] = 1
|
||||
|
||||
|
||||
class FFMQItem(Item):
|
||||
game = "Final Fantasy Mystic Quest"
|
||||
type = None
|
||||
|
||||
def __init__(self, name, player: int = None):
|
||||
item_data = item_table[name]
|
||||
super(FFMQItem, self).__init__(
|
||||
name,
|
||||
item_data.classification,
|
||||
item_data.id, player
|
||||
)
|
|
@ -0,0 +1,22 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2023 Alex "Alchav" Avery
|
||||
Copyright (c) 2023 wildham
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1,258 @@
|
|||
from Options import Choice, FreeText, Toggle
|
||||
|
||||
|
||||
class Logic(Choice):
|
||||
"""Placement logic sets the rules that will be applied when placing items. Friendly: Required Items to clear a
|
||||
dungeon will never be placed in that dungeon to avoid the need to revisit it. Also, the Magic Mirror and the Mask
|
||||
will always be available before Ice Pyramid and Volcano, respectively. Note: If Dungeons are shuffled, Friendly
|
||||
logic will only ensure the availability of the Mirror and the Mask. Standard: Items are randomly placed and logic
|
||||
merely verifies that they're all accessible. As for Region access, only the Coins are considered. Expert: Same as
|
||||
Standard, but Items Placement logic also includes other routes than Coins: the Crests Teleporters, the
|
||||
Fireburg-Aquaria Lava bridge and the Sealed Temple Exit trick."""
|
||||
option_friendly = 0
|
||||
option_standard = 1
|
||||
option_expert = 2
|
||||
default = 1
|
||||
display_name = "Logic"
|
||||
|
||||
|
||||
class BrownBoxes(Choice):
|
||||
"""Include the 201 brown box locations from the original game. Brown Boxes are all the boxes that contained a
|
||||
consumable in the original game. If shuffle is chosen, the consumables contained will be shuffled but the brown
|
||||
boxes will not be Archipelago location checks."""
|
||||
option_exclude = 0
|
||||
option_include = 1
|
||||
option_shuffle = 2
|
||||
default = 1
|
||||
display_name = "Brown Boxes"
|
||||
|
||||
|
||||
class SkyCoinMode(Choice):
|
||||
"""Configure how the Sky Coin is acquired. With standard, the Sky Coin will be placed randomly. With Start With, the
|
||||
Sky Coin will be in your inventory at the start of the game. With Save The Crystals, the Sky Coin will be acquired
|
||||
once you save all 4 crystals. With Shattered Sky Coin, the Sky Coin is split in 40 fragments; you can enter Doom
|
||||
Castle once the required amount is found. Shattered Sky Coin will force brown box locations to be included."""
|
||||
option_standard = 0
|
||||
option_start_with = 1
|
||||
option_save_the_crystals = 2
|
||||
option_shattered_sky_coin = 3
|
||||
default = 0
|
||||
display_name = "Sky Coin Mode"
|
||||
|
||||
|
||||
class ShatteredSkyCoinQuantity(Choice):
|
||||
"""Configure the number of the 40 Sky Coin Fragments required to enter the Doom Castle. Only has an effect if
|
||||
Sky Coin Mode is set to shattered. Low: 16. Mid: 24. High: 32. Random Narrow: random between 16 and 32.
|
||||
Random Wide: random between 10 and 38."""
|
||||
option_low_16 = 0
|
||||
option_mid_24 = 1
|
||||
option_high_32 = 2
|
||||
option_random_narrow = 3
|
||||
option_random_wide = 4
|
||||
default = 1
|
||||
display_name = "Shattered Sky Coin"
|
||||
|
||||
|
||||
class StartingWeapon(Choice):
|
||||
"""Choose your starting weapon."""
|
||||
display_name = "Starting Weapon"
|
||||
option_steel_sword = 0
|
||||
option_axe = 1
|
||||
option_cat_claw = 2
|
||||
option_bomb = 3
|
||||
default = "random"
|
||||
|
||||
|
||||
class ProgressiveGear(Toggle):
|
||||
"""Pieces of gear are always acquired from weakest to strongest in a set."""
|
||||
display_name = "Progressive Gear"
|
||||
|
||||
|
||||
class EnemiesDensity(Choice):
|
||||
"""Set how many of the original enemies are on each map."""
|
||||
display_name = "Enemies Density"
|
||||
option_all = 0
|
||||
option_three_quarter = 1
|
||||
option_half = 2
|
||||
option_quarter = 3
|
||||
option_none = 4
|
||||
|
||||
|
||||
class EnemyScaling(Choice):
|
||||
"""Superclass for enemy scaling options."""
|
||||
option_quarter = 0
|
||||
option_half = 1
|
||||
option_three_quarter = 2
|
||||
option_normal = 3
|
||||
option_one_and_quarter = 4
|
||||
option_one_and_half = 5
|
||||
option_double = 6
|
||||
option_double_and_half = 7
|
||||
option_triple = 8
|
||||
|
||||
|
||||
class EnemiesScalingLower(EnemyScaling):
|
||||
"""Randomly adjust enemies stats by the selected range percentage. Include mini-bosses' weaker clones."""
|
||||
display_name = "Enemies Scaling Lower"
|
||||
default = 0
|
||||
|
||||
|
||||
class EnemiesScalingUpper(EnemyScaling):
|
||||
"""Randomly adjust enemies stats by the selected range percentage. Include mini-bosses' weaker clones."""
|
||||
display_name = "Enemies Scaling Upper"
|
||||
default = 4
|
||||
|
||||
|
||||
class BossesScalingLower(EnemyScaling):
|
||||
"""Randomly adjust bosses stats by the selected range percentage. Include Mini-Bosses, Bosses, Bosses' refights and
|
||||
the Dark King."""
|
||||
display_name = "Bosses Scaling Lower"
|
||||
default = 0
|
||||
|
||||
|
||||
class BossesScalingUpper(EnemyScaling):
|
||||
"""Randomly adjust bosses stats by the selected range percentage. Include Mini-Bosses, Bosses, Bosses' refights and
|
||||
the Dark King."""
|
||||
display_name = "Bosses Scaling Upper"
|
||||
default = 4
|
||||
|
||||
|
||||
class EnemizerAttacks(Choice):
|
||||
"""Shuffles enemy attacks. Standard: No shuffle. Safe: Randomize every attack but leave out self-destruct and Dark
|
||||
King attacks. Chaos: Randomize and include self-destruct and Dark King attacks. Self Destruct: Every enemy
|
||||
self-destructs. Simple Shuffle: Instead of randomizing, shuffle one monster's attacks to another. Dark King is left
|
||||
vanilla."""
|
||||
display_name = "Enemizer Attacks"
|
||||
option_normal = 0
|
||||
option_safe = 1
|
||||
option_chaos = 2
|
||||
option_self_destruct = 3
|
||||
option_simple_shuffle = 4
|
||||
default = 0
|
||||
|
||||
|
||||
class ShuffleEnemiesPositions(Toggle):
|
||||
"""Instead of their original position in a given map, enemies are randomly placed."""
|
||||
display_name = "Shuffle Enemies' Positions"
|
||||
default = 1
|
||||
|
||||
|
||||
class ProgressiveFormations(Choice):
|
||||
"""Enemies' formations are selected by regions, with the weakest formations always selected in Foresta and the
|
||||
strongest in Windia. Disabled: Standard formations are used. Regions Strict: Formations will come exclusively
|
||||
from the current region, whatever the map is. Regions Keep Type: Formations will keep the original formation type
|
||||
and match with the nearest power level."""
|
||||
display_name = "Progressive Formations"
|
||||
option_disabled = 0
|
||||
option_regions_strict = 1
|
||||
option_regions_keep_type = 2
|
||||
|
||||
|
||||
class DoomCastle(Choice):
|
||||
"""Configure how you reach the Dark King. With Standard, you need to defeat all four bosses and their floors to
|
||||
reach the Dark King. With Boss Rush, only the bosses are blocking your way in the corridor to the Dark King's room.
|
||||
With Dark King Only, the way to the Dark King is free of any obstacle."""
|
||||
display_name = "Doom Castle"
|
||||
option_standard = 0
|
||||
option_boss_rush = 1
|
||||
option_dark_king_only = 2
|
||||
|
||||
|
||||
class DoomCastleShortcut(Toggle):
|
||||
"""Create a shortcut granting access from the start to Doom Castle at Focus Tower's entrance.
|
||||
Also modify the Desert floor, so it can be navigated without the Mega Grenades and the Dragon Claw."""
|
||||
display_name = "Doom Castle Shortcut"
|
||||
|
||||
|
||||
class TweakFrustratingDungeons(Toggle):
|
||||
"""Make some small changes to a few of the most annoying dungeons. Ice Pyramid: Add 3 shortcuts on the 1st floor.
|
||||
Giant Tree: Add shortcuts on the 1st and 4th floors and curtail mushrooms population.
|
||||
Pazuzu's Tower: Staircases are devoid of enemies (regardless of Enemies Density settings)."""
|
||||
display_name = "Tweak Frustrating Dungeons"
|
||||
|
||||
|
||||
class MapShuffle(Choice):
|
||||
"""None: No shuffle. Overworld: Only shuffle the Overworld locations. Dungeons: Only shuffle the dungeons' floors
|
||||
amongst themselves. Temples and Towns aren't included. Overworld And Dungeons: Shuffle the Overworld and dungeons
|
||||
at the same time. Everything: Shuffle the Overworld, dungeons, temples and towns all amongst each others.
|
||||
When dungeons are shuffled, defeating Pazuzu won't teleport you to the 7th floor, you have to get there normally to
|
||||
save the Crystal and get Pazuzu's Chest."""
|
||||
display_name = "Map Shuffle"
|
||||
option_none = 0
|
||||
option_overworld = 1
|
||||
option_dungeons = 2
|
||||
option_overworld_and_dungeons = 3
|
||||
option_everything = 4
|
||||
default = 0
|
||||
|
||||
|
||||
class CrestShuffle(Toggle):
|
||||
"""Shuffle the Crest tiles amongst themselves."""
|
||||
display_name = "Crest Shuffle"
|
||||
|
||||
|
||||
class MapShuffleSeed(FreeText):
|
||||
"""If this is a number, it will be used as a set seed number for Map, Crest, and Battlefield Reward shuffles.
|
||||
If this is "random" the seed will be chosen randomly. If it is any other text, it will be used as a seed group name.
|
||||
All players using the same seed group name will get the same shuffle results, as long as their Map Shuffle,
|
||||
Crest Shuffle, and Shuffle Battlefield Rewards settings are the same."""
|
||||
display_name = "Map Shuffle Seed"
|
||||
default = "random"
|
||||
|
||||
|
||||
class LevelingCurve(Choice):
|
||||
"""Adjust the level gain rate."""
|
||||
display_name = "Leveling Curve"
|
||||
option_half = 0
|
||||
option_normal = 1
|
||||
option_one_and_half = 2
|
||||
option_double = 3
|
||||
option_double_and_half = 4
|
||||
option_triple = 5
|
||||
option_quadruple = 6
|
||||
default = 4
|
||||
|
||||
|
||||
class ShuffleBattlefieldRewards(Toggle):
|
||||
"""Shuffle the type of reward (Item, XP, GP) given by battlefields and color code them by reward type.
|
||||
Blue: Give an item. Grey: Give XP. Green: Give GP."""
|
||||
display_name = "Shuffle Battlefield Rewards"
|
||||
|
||||
|
||||
class BattlefieldsBattlesQuantities(Choice):
|
||||
"""Adjust the number of battles that need to be fought to get a battlefield's reward."""
|
||||
display_name = "Battlefields Battles Quantity"
|
||||
option_ten = 0
|
||||
option_seven = 1
|
||||
option_five = 2
|
||||
option_three = 3
|
||||
option_one = 4
|
||||
option_random_one_through_five = 5
|
||||
option_random_one_through_ten = 6
|
||||
|
||||
|
||||
option_definitions = {
|
||||
"logic": Logic,
|
||||
"brown_boxes": BrownBoxes,
|
||||
"sky_coin_mode": SkyCoinMode,
|
||||
"shattered_sky_coin_quantity": ShatteredSkyCoinQuantity,
|
||||
"starting_weapon": StartingWeapon,
|
||||
"progressive_gear": ProgressiveGear,
|
||||
"enemies_density": EnemiesDensity,
|
||||
"enemies_scaling_lower": EnemiesScalingLower,
|
||||
"enemies_scaling_upper": EnemiesScalingUpper,
|
||||
"bosses_scaling_lower": BossesScalingLower,
|
||||
"bosses_scaling_upper": BossesScalingUpper,
|
||||
"enemizer_attacks": EnemizerAttacks,
|
||||
"shuffle_enemies_position": ShuffleEnemiesPositions,
|
||||
"progressive_formations": ProgressiveFormations,
|
||||
"doom_castle_mode": DoomCastle,
|
||||
"doom_castle_shortcut": DoomCastleShortcut,
|
||||
"tweak_frustrating_dungeons": TweakFrustratingDungeons,
|
||||
"map_shuffle": MapShuffle,
|
||||
"crest_shuffle": CrestShuffle,
|
||||
"shuffle_battlefield_rewards": ShuffleBattlefieldRewards,
|
||||
"map_shuffle_seed": MapShuffleSeed,
|
||||
"leveling_curve": LevelingCurve,
|
||||
"battlefields_battles_quantities": BattlefieldsBattlesQuantities,
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
import yaml
|
||||
import os
|
||||
import zipfile
|
||||
from copy import deepcopy
|
||||
from .Regions import object_id_table
|
||||
from Main import __version__
|
||||
from worlds.Files import APContainer
|
||||
import pkgutil
|
||||
|
||||
settings_template = yaml.load(pkgutil.get_data(__name__, "data/settings.yaml"), yaml.Loader)
|
||||
|
||||
|
||||
def generate_output(self, output_directory):
|
||||
def output_item_name(item):
|
||||
if item.player == self.player:
|
||||
if item.code > 0x420000 + 256:
|
||||
item_name = self.item_id_to_name[item.code - 256]
|
||||
else:
|
||||
item_name = item.name
|
||||
item_name = "".join(item_name.split("'"))
|
||||
item_name = "".join(item_name.split(" "))
|
||||
else:
|
||||
if item.advancement or item.useful or (item.trap and
|
||||
self.multiworld.per_slot_randoms[self.player].randint(0, 1)):
|
||||
item_name = "APItem"
|
||||
else:
|
||||
item_name = "APItemFiller"
|
||||
return item_name
|
||||
|
||||
item_placement = []
|
||||
for location in self.multiworld.get_locations(self.player):
|
||||
if location.type != "Trigger":
|
||||
item_placement.append({"object_id": object_id_table[location.name], "type": location.type, "content":
|
||||
output_item_name(location.item), "player": self.multiworld.player_name[location.item.player],
|
||||
"item_name": location.item.name})
|
||||
|
||||
def cc(option):
|
||||
return option.current_key.title().replace("_", "").replace("OverworldAndDungeons", "OverworldDungeons")
|
||||
|
||||
def tf(option):
|
||||
return True if option else False
|
||||
|
||||
options = deepcopy(settings_template)
|
||||
options["name"] = self.multiworld.player_name[self.player]
|
||||
|
||||
option_writes = {
|
||||
"enemies_density": cc(self.multiworld.enemies_density[self.player]),
|
||||
"chests_shuffle": "Include",
|
||||
"shuffle_boxes_content": self.multiworld.brown_boxes[self.player] == "shuffle",
|
||||
"npcs_shuffle": "Include",
|
||||
"battlefields_shuffle": "Include",
|
||||
"logic_options": cc(self.multiworld.logic[self.player]),
|
||||
"shuffle_enemies_position": tf(self.multiworld.shuffle_enemies_position[self.player]),
|
||||
"enemies_scaling_lower": cc(self.multiworld.enemies_scaling_lower[self.player]),
|
||||
"enemies_scaling_upper": cc(self.multiworld.enemies_scaling_upper[self.player]),
|
||||
"bosses_scaling_lower": cc(self.multiworld.bosses_scaling_lower[self.player]),
|
||||
"bosses_scaling_upper": cc(self.multiworld.bosses_scaling_upper[self.player]),
|
||||
"enemizer_attacks": cc(self.multiworld.enemizer_attacks[self.player]),
|
||||
"leveling_curve": cc(self.multiworld.leveling_curve[self.player]),
|
||||
"battles_quantity": cc(self.multiworld.battlefields_battles_quantities[self.player]) if
|
||||
self.multiworld.battlefields_battles_quantities[self.player].value < 5 else
|
||||
"RandomLow" if
|
||||
self.multiworld.battlefields_battles_quantities[self.player].value == 5 else
|
||||
"RandomHigh",
|
||||
"shuffle_battlefield_rewards": tf(self.multiworld.shuffle_battlefield_rewards[self.player]),
|
||||
"random_starting_weapon": True,
|
||||
"progressive_gear": tf(self.multiworld.progressive_gear[self.player]),
|
||||
"tweaked_dungeons": tf(self.multiworld.tweak_frustrating_dungeons[self.player]),
|
||||
"doom_castle_mode": cc(self.multiworld.doom_castle_mode[self.player]),
|
||||
"doom_castle_shortcut": tf(self.multiworld.doom_castle_shortcut[self.player]),
|
||||
"sky_coin_mode": cc(self.multiworld.sky_coin_mode[self.player]),
|
||||
"sky_coin_fragments_qty": cc(self.multiworld.shattered_sky_coin_quantity[self.player]),
|
||||
"enable_spoilers": False,
|
||||
"progressive_formations": cc(self.multiworld.progressive_formations[self.player]),
|
||||
"map_shuffling": cc(self.multiworld.map_shuffle[self.player]),
|
||||
"crest_shuffle": tf(self.multiworld.crest_shuffle[self.player]),
|
||||
}
|
||||
for option, data in option_writes.items():
|
||||
options["Final Fantasy Mystic Quest"][option][data] = 1
|
||||
|
||||
rom_name = f'MQ{__version__.replace(".", "")[0:3]}_{self.player}_{self.multiworld.seed_name:11}'[:21]
|
||||
self.rom_name = bytearray(rom_name,
|
||||
'utf8')
|
||||
self.rom_name_available_event.set()
|
||||
|
||||
setup = {"version": "1.4", "name": self.multiworld.player_name[self.player], "romname": rom_name, "seed":
|
||||
hex(self.multiworld.per_slot_randoms[self.player].randint(0, 0xFFFFFFFF)).split("0x")[1].upper()}
|
||||
|
||||
starting_items = [output_item_name(item) for item in self.multiworld.precollected_items[self.player]]
|
||||
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
|
||||
starting_items.append("SkyCoin")
|
||||
|
||||
file_path = os.path.join(output_directory, f"{self.multiworld.get_out_file_name_base(self.player)}.apmq")
|
||||
|
||||
APMQ = APMQFile(file_path, player=self.player, player_name=self.multiworld.player_name[self.player])
|
||||
with zipfile.ZipFile(file_path, mode="w", compression=zipfile.ZIP_DEFLATED,
|
||||
compresslevel=9) as zf:
|
||||
zf.writestr("itemplacement.yaml", yaml.dump(item_placement))
|
||||
zf.writestr("flagset.yaml", yaml.dump(options))
|
||||
zf.writestr("startingitems.yaml", yaml.dump(starting_items))
|
||||
zf.writestr("setup.yaml", yaml.dump(setup))
|
||||
zf.writestr("rooms.yaml", yaml.dump(self.rooms))
|
||||
|
||||
APMQ.write_contents(zf)
|
||||
|
||||
|
||||
class APMQFile(APContainer):
|
||||
game = "Final Fantasy Mystic Quest"
|
||||
|
||||
def get_manifest(self):
|
||||
manifest = super().get_manifest()
|
||||
manifest["patch_file_ending"] = ".apmq"
|
||||
return manifest
|
|
@ -0,0 +1,251 @@
|
|||
from BaseClasses import Region, MultiWorld, Entrance, Location, LocationProgressType, ItemClassification
|
||||
from worlds.generic.Rules import add_rule
|
||||
from .Items import item_groups, yaml_item
|
||||
import pkgutil
|
||||
import yaml
|
||||
|
||||
rooms = yaml.load(pkgutil.get_data(__name__, "data/rooms.yaml"), yaml.Loader)
|
||||
entrance_names = {entrance["id"]: entrance["name"] for entrance in yaml.load(pkgutil.get_data(__name__, "data/entrances.yaml"), yaml.Loader)}
|
||||
|
||||
object_id_table = {}
|
||||
object_type_table = {}
|
||||
offset = {"Chest": 0x420000, "Box": 0x420000, "NPC": 0x420000 + 300, "BattlefieldItem": 0x420000 + 350}
|
||||
for room in rooms:
|
||||
for object in room["game_objects"]:
|
||||
if "Hero Chest" in object["name"] or object["type"] == "Trigger":
|
||||
continue
|
||||
if object["type"] in ("BattlefieldItem", "BattlefieldXp", "BattlefieldGp"):
|
||||
object_type_table[object["name"]] = "BattlefieldItem"
|
||||
elif object["type"] in ("Chest", "NPC", "Box"):
|
||||
object_type_table[object["name"]] = object["type"]
|
||||
object_id_table[object["name"]] = object["object_id"]
|
||||
|
||||
location_table = {loc_name: offset[object_type_table[loc_name]] + obj_id for loc_name, obj_id in
|
||||
object_id_table.items()}
|
||||
|
||||
weapons = ("Claw", "Bomb", "Sword", "Axe")
|
||||
crest_warps = [51, 52, 53, 76, 96, 108, 158, 171, 175, 191, 275, 276, 277, 308, 334, 336, 396, 397]
|
||||
|
||||
|
||||
def process_rules(spot, access):
|
||||
for weapon in weapons:
|
||||
if weapon in access:
|
||||
add_rule(spot, lambda state, w=weapon: state.has_any(item_groups[w + "s"], spot.player))
|
||||
access = [yaml_item(rule) for rule in access if rule not in weapons]
|
||||
add_rule(spot, lambda state: state.has_all(access, spot.player))
|
||||
|
||||
|
||||
def create_region(world: MultiWorld, player: int, name: str, room_id=None, locations=None, links=None):
|
||||
if links is None:
|
||||
links = []
|
||||
ret = Region(name, player, world)
|
||||
if locations:
|
||||
for location in locations:
|
||||
location.parent_region = ret
|
||||
ret.locations.append(location)
|
||||
ret.links = links
|
||||
ret.id = room_id
|
||||
return ret
|
||||
|
||||
|
||||
def get_entrance_to(entrance_to):
|
||||
for room in rooms:
|
||||
if room["id"] == entrance_to["target_room"]:
|
||||
for link in room["links"]:
|
||||
if link["target_room"] == entrance_to["room"]:
|
||||
return link
|
||||
else:
|
||||
raise Exception(f"Did not find entrance {entrance_to}")
|
||||
|
||||
|
||||
def create_regions(self):
|
||||
|
||||
menu_region = create_region(self.multiworld, self.player, "Menu")
|
||||
self.multiworld.regions.append(menu_region)
|
||||
|
||||
for room in self.rooms:
|
||||
self.multiworld.regions.append(create_region(self.multiworld, self.player, room["name"], room["id"],
|
||||
[FFMQLocation(self.player, object["name"], location_table[object["name"]] if object["name"] in
|
||||
location_table else None, object["type"], object["access"],
|
||||
self.create_item(yaml_item(object["on_trigger"][0])) if object["type"] == "Trigger" else None) for
|
||||
object in room["game_objects"] if "Hero Chest" not in object["name"] and object["type"] not in
|
||||
("BattlefieldGp", "BattlefieldXp") and (object["type"] != "Box" or
|
||||
self.multiworld.brown_boxes[self.player] == "include")], room["links"]))
|
||||
|
||||
dark_king_room = self.multiworld.get_region("Doom Castle Dark King Room", self.player)
|
||||
dark_king = FFMQLocation(self.player, "Dark King", None, "Trigger", [])
|
||||
dark_king.parent_region = dark_king_room
|
||||
dark_king.place_locked_item(self.create_item("Dark King"))
|
||||
dark_king_room.locations.append(dark_king)
|
||||
|
||||
connection = Entrance(self.player, f"Enter Overworld", menu_region)
|
||||
connection.connect(self.multiworld.get_region("Overworld", self.player))
|
||||
menu_region.exits.append(connection)
|
||||
|
||||
for region in self.multiworld.get_regions(self.player):
|
||||
for link in region.links:
|
||||
for connect_room in self.multiworld.get_regions(self.player):
|
||||
if connect_room.id == link["target_room"]:
|
||||
connection = Entrance(self.player, entrance_names[link["entrance"]] if "entrance" in link and
|
||||
link["entrance"] != -1 else f"{region.name} to {connect_room.name}", region)
|
||||
if "entrance" in link and link["entrance"] != -1:
|
||||
spoiler = False
|
||||
if link["entrance"] in crest_warps:
|
||||
if self.multiworld.crest_shuffle[self.player]:
|
||||
spoiler = True
|
||||
elif self.multiworld.map_shuffle[self.player] == "everything":
|
||||
spoiler = True
|
||||
elif "Subregion" in region.name and self.multiworld.map_shuffle[self.player] not in ("dungeons",
|
||||
"none"):
|
||||
spoiler = True
|
||||
elif "Subregion" not in region.name and self.multiworld.map_shuffle[self.player] not in ("none",
|
||||
"overworld"):
|
||||
spoiler = True
|
||||
|
||||
if spoiler:
|
||||
self.multiworld.spoiler.set_entrance(entrance_names[link["entrance"]], connect_room.name,
|
||||
'both', self.player)
|
||||
if link["access"]:
|
||||
process_rules(connection, link["access"])
|
||||
region.exits.append(connection)
|
||||
connection.connect(connect_room)
|
||||
break
|
||||
|
||||
non_dead_end_crest_rooms = [
|
||||
'Libra Temple', 'Aquaria Gemini Room', "GrenadeMan's Mobius Room", 'Fireburg Gemini Room',
|
||||
'Sealed Temple', 'Alive Forest', 'Kaidge Temple Upper Ledge',
|
||||
'Windia Kid House Basement', 'Windia Old People House Basement'
|
||||
]
|
||||
|
||||
non_dead_end_crest_warps = [
|
||||
'Libra Temple - Libra Tile Script', 'Aquaria Gemini Room - Gemini Script',
|
||||
'GrenadeMan Mobius Room - Mobius Teleporter Script', 'Fireburg Gemini Room - Gemini Teleporter Script',
|
||||
'Sealed Temple - Gemini Tile Script', 'Alive Forest - Libra Teleporter Script',
|
||||
'Alive Forest - Gemini Teleporter Script', 'Alive Forest - Mobius Teleporter Script',
|
||||
'Kaidge Temple - Mobius Teleporter Script', 'Windia Kid House Basement - Mobius Teleporter',
|
||||
'Windia Old People House Basement - Mobius Teleporter Script',
|
||||
]
|
||||
|
||||
|
||||
vendor_locations = ["Aquaria - Vendor", "Fireburg - Vendor", "Windia - Vendor"]
|
||||
|
||||
|
||||
def set_rules(self) -> None:
|
||||
self.multiworld.completion_condition[self.player] = lambda state: state.has("Dark King", self.player)
|
||||
|
||||
def hard_boss_logic(state):
|
||||
return state.has_all(["River Coin", "Sand Coin"], self.player)
|
||||
|
||||
add_rule(self.multiworld.get_location("Pazuzu 1F", self.player), hard_boss_logic)
|
||||
add_rule(self.multiworld.get_location("Gidrah", self.player), hard_boss_logic)
|
||||
add_rule(self.multiworld.get_location("Dullahan", self.player), hard_boss_logic)
|
||||
|
||||
if self.multiworld.map_shuffle[self.player]:
|
||||
for boss in ("Freezer Crab", "Ice Golem", "Jinn", "Medusa", "Dualhead Hydra"):
|
||||
loc = self.multiworld.get_location(boss, self.player)
|
||||
checked_regions = {loc.parent_region}
|
||||
|
||||
def check_foresta(region):
|
||||
if region.name == "Subregion Foresta":
|
||||
add_rule(loc, hard_boss_logic)
|
||||
return True
|
||||
elif "Subregion" in region.name:
|
||||
return True
|
||||
for entrance in region.entrances:
|
||||
if entrance.parent_region not in checked_regions:
|
||||
checked_regions.add(entrance.parent_region)
|
||||
if check_foresta(entrance.parent_region):
|
||||
return True
|
||||
check_foresta(loc.parent_region)
|
||||
|
||||
if self.multiworld.logic[self.player] == "friendly":
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Ice Pyramid", self.player),
|
||||
["MagicMirror"])
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Volcano", self.player),
|
||||
["Mask"])
|
||||
if self.multiworld.map_shuffle[self.player] in ("none", "overworld"):
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Bone Dungeon", self.player),
|
||||
["Bomb"])
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Wintry Cave", self.player),
|
||||
["Bomb", "Claw"])
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Ice Pyramid", self.player),
|
||||
["Bomb", "Claw"])
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Mine", self.player),
|
||||
["MegaGrenade", "Claw", "Reuben1"])
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Lava Dome", self.player),
|
||||
["MegaGrenade"])
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Giant Tree", self.player),
|
||||
["DragonClaw", "Axe"])
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Mount Gale", self.player),
|
||||
["DragonClaw"])
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Pazuzu Tower", self.player),
|
||||
["DragonClaw", "Bomb"])
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Mac Ship", self.player),
|
||||
["DragonClaw", "CaptainCap"])
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Mac Ship Doom", self.player),
|
||||
["DragonClaw", "CaptainCap"])
|
||||
|
||||
if self.multiworld.logic[self.player] == "expert":
|
||||
if self.multiworld.map_shuffle[self.player] == "none" and not self.multiworld.crest_shuffle[self.player]:
|
||||
inner_room = self.multiworld.get_region("Wintry Temple Inner Room", self.player)
|
||||
connection = Entrance(self.player, "Sealed Temple Exit Trick", inner_room)
|
||||
connection.connect(self.multiworld.get_region("Wintry Temple Outer Room", self.player))
|
||||
connection.access_rule = lambda state: state.has("Exit Book", self.player)
|
||||
inner_room.exits.append(connection)
|
||||
else:
|
||||
for crest_warp in non_dead_end_crest_warps:
|
||||
entrance = self.multiworld.get_entrance(crest_warp, self.player)
|
||||
if entrance.connected_region.name in non_dead_end_crest_rooms:
|
||||
entrance.access_rule = lambda state: False
|
||||
|
||||
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
|
||||
logic_coins = [16, 24, 32, 32, 38][self.multiworld.shattered_sky_coin_quantity[self.player].value]
|
||||
self.multiworld.get_entrance("Focus Tower 1F - Sky Door", self.player).access_rule = \
|
||||
lambda state: state.has("Sky Fragment", self.player, logic_coins)
|
||||
elif self.multiworld.sky_coin_mode[self.player] == "save_the_crystals":
|
||||
self.multiworld.get_entrance("Focus Tower 1F - Sky Door", self.player).access_rule = \
|
||||
lambda state: state.has_all(["Flamerus Rex", "Dualhead Hydra", "Ice Golem", "Pazuzu"], self.player)
|
||||
elif self.multiworld.sky_coin_mode[self.player] in ("standard", "start_with"):
|
||||
self.multiworld.get_entrance("Focus Tower 1F - Sky Door", self.player).access_rule = \
|
||||
lambda state: state.has("Sky Coin", self.player)
|
||||
|
||||
|
||||
def stage_set_rules(multiworld):
|
||||
# If there's no enemies, there's no repeatable income sources
|
||||
no_enemies_players = [player for player in multiworld.get_game_players("Final Fantasy Mystic Quest")
|
||||
if multiworld.enemies_density[player] == "none"]
|
||||
if (len([item for item in multiworld.itempool if item.classification in (ItemClassification.filler,
|
||||
ItemClassification.trap)]) > len([player for player in no_enemies_players if
|
||||
multiworld.accessibility[player] == "minimal"]) * 3):
|
||||
for player in no_enemies_players:
|
||||
for location in vendor_locations:
|
||||
if multiworld.accessibility[player] == "locations":
|
||||
print("exclude")
|
||||
multiworld.get_location(location, player).progress_type = LocationProgressType.EXCLUDED
|
||||
else:
|
||||
print("unreachable")
|
||||
multiworld.get_location(location, player).access_rule = lambda state: False
|
||||
else:
|
||||
# There are not enough junk items to fill non-minimal players' vendors. Just set an item rule not allowing
|
||||
# advancement items so that useful items can be placed.
|
||||
print("no advancement")
|
||||
for player in no_enemies_players:
|
||||
for location in vendor_locations:
|
||||
multiworld.get_location(location, player).item_rule = lambda item: not item.advancement
|
||||
|
||||
|
||||
|
||||
|
||||
class FFMQLocation(Location):
|
||||
game = "Final Fantasy Mystic Quest"
|
||||
|
||||
def __init__(self, player, name, address, loc_type, access=None, event=None):
|
||||
super(FFMQLocation, self).__init__(
|
||||
player, name,
|
||||
address
|
||||
)
|
||||
self.type = loc_type
|
||||
if access:
|
||||
process_rules(self, access)
|
||||
if event:
|
||||
self.place_locked_item(event)
|
|
@ -0,0 +1,217 @@
|
|||
import Utils
|
||||
import settings
|
||||
import base64
|
||||
import threading
|
||||
import requests
|
||||
import yaml
|
||||
from worlds.AutoWorld import World, WebWorld
|
||||
from BaseClasses import Tutorial
|
||||
from .Regions import create_regions, location_table, set_rules, stage_set_rules, rooms, non_dead_end_crest_rooms,\
|
||||
non_dead_end_crest_warps
|
||||
from .Items import item_table, item_groups, create_items, FFMQItem, fillers
|
||||
from .Output import generate_output
|
||||
from .Options import option_definitions
|
||||
from .Client import FFMQClient
|
||||
|
||||
|
||||
# removed until lists are supported
|
||||
# class FFMQSettings(settings.Group):
|
||||
# class APIUrls(list):
|
||||
# """A list of API URLs to get map shuffle, crest shuffle, and battlefield reward shuffle data from."""
|
||||
# api_urls: APIUrls = [
|
||||
# "https://api.ffmqrando.net/",
|
||||
# "http://ffmqr.jalchavware.com:5271/"
|
||||
# ]
|
||||
|
||||
|
||||
class FFMQWebWorld(WebWorld):
|
||||
tutorials = [Tutorial(
|
||||
"Multiworld Setup Guide",
|
||||
"A guide to playing Final Fantasy Mystic Quest with Archipelago.",
|
||||
"English",
|
||||
"setup_en.md",
|
||||
"setup/en",
|
||||
["Alchav"]
|
||||
)]
|
||||
|
||||
|
||||
class FFMQWorld(World):
|
||||
"""Final Fantasy: Mystic Quest is a simple, humorous RPG for the Super Nintendo. You travel across four continents,
|
||||
linked in the middle of the world by the Focus Tower, which has been locked by four magical coins. Make your way to
|
||||
the bottom of the Focus Tower, then straight up through the top!"""
|
||||
# -Giga Otomia
|
||||
|
||||
game = "Final Fantasy Mystic Quest"
|
||||
|
||||
item_name_to_id = {name: data.id for name, data in item_table.items() if data.id is not None}
|
||||
location_name_to_id = location_table
|
||||
option_definitions = option_definitions
|
||||
|
||||
topology_present = True
|
||||
|
||||
item_name_groups = item_groups
|
||||
|
||||
generate_output = generate_output
|
||||
create_items = create_items
|
||||
create_regions = create_regions
|
||||
set_rules = set_rules
|
||||
stage_set_rules = stage_set_rules
|
||||
|
||||
data_version = 1
|
||||
|
||||
web = FFMQWebWorld()
|
||||
# settings: FFMQSettings
|
||||
|
||||
def __init__(self, world, player: int):
|
||||
self.rom_name_available_event = threading.Event()
|
||||
self.rom_name = None
|
||||
self.rooms = None
|
||||
super().__init__(world, player)
|
||||
|
||||
def generate_early(self):
|
||||
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
|
||||
self.multiworld.brown_boxes[self.player].value = 1
|
||||
if self.multiworld.enemies_scaling_lower[self.player].value > \
|
||||
self.multiworld.enemies_scaling_upper[self.player].value:
|
||||
(self.multiworld.enemies_scaling_lower[self.player].value,
|
||||
self.multiworld.enemies_scaling_upper[self.player].value) =\
|
||||
(self.multiworld.enemies_scaling_upper[self.player].value,
|
||||
self.multiworld.enemies_scaling_lower[self.player].value)
|
||||
if self.multiworld.bosses_scaling_lower[self.player].value > \
|
||||
self.multiworld.bosses_scaling_upper[self.player].value:
|
||||
(self.multiworld.bosses_scaling_lower[self.player].value,
|
||||
self.multiworld.bosses_scaling_upper[self.player].value) =\
|
||||
(self.multiworld.bosses_scaling_upper[self.player].value,
|
||||
self.multiworld.bosses_scaling_lower[self.player].value)
|
||||
|
||||
@classmethod
|
||||
def stage_generate_early(cls, multiworld):
|
||||
|
||||
# api_urls = Utils.get_options()["ffmq_options"].get("api_urls", None)
|
||||
api_urls = [
|
||||
"https://api.ffmqrando.net/",
|
||||
"http://ffmqr.jalchavware.com:5271/"
|
||||
]
|
||||
|
||||
rooms_data = {}
|
||||
|
||||
for world in multiworld.get_game_worlds("Final Fantasy Mystic Quest"):
|
||||
if (world.multiworld.map_shuffle[world.player] or world.multiworld.crest_shuffle[world.player] or
|
||||
world.multiworld.crest_shuffle[world.player]):
|
||||
if world.multiworld.map_shuffle_seed[world.player].value.isdigit():
|
||||
multiworld.random.seed(int(world.multiworld.map_shuffle_seed[world.player].value))
|
||||
elif world.multiworld.map_shuffle_seed[world.player].value != "random":
|
||||
multiworld.random.seed(int(hash(world.multiworld.map_shuffle_seed[world.player].value))
|
||||
+ int(world.multiworld.seed))
|
||||
|
||||
seed = hex(multiworld.random.randint(0, 0xFFFFFFFF)).split("0x")[1].upper()
|
||||
map_shuffle = multiworld.map_shuffle[world.player].value
|
||||
crest_shuffle = multiworld.crest_shuffle[world.player].current_key
|
||||
battlefield_shuffle = multiworld.shuffle_battlefield_rewards[world.player].current_key
|
||||
|
||||
query = f"s={seed}&m={map_shuffle}&c={crest_shuffle}&b={battlefield_shuffle}"
|
||||
|
||||
if query in rooms_data:
|
||||
world.rooms = rooms_data[query]
|
||||
continue
|
||||
|
||||
if not api_urls:
|
||||
raise Exception("No FFMQR API URLs specified in host.yaml")
|
||||
|
||||
errors = []
|
||||
for api_url in api_urls.copy():
|
||||
try:
|
||||
response = requests.get(f"{api_url}GenerateRooms?{query}")
|
||||
except (ConnectionError, requests.exceptions.HTTPError, requests.exceptions.ConnectionError,
|
||||
requests.exceptions.RequestException) as err:
|
||||
api_urls.remove(api_url)
|
||||
errors.append([api_url, err])
|
||||
else:
|
||||
if response.ok:
|
||||
world.rooms = rooms_data[query] = yaml.load(response.text, yaml.Loader)
|
||||
break
|
||||
else:
|
||||
api_urls.remove(api_url)
|
||||
errors.append([api_url, response])
|
||||
else:
|
||||
error_text = f"Failed to fetch map shuffle data for FFMQ player {world.player}"
|
||||
for error in errors:
|
||||
error_text += f"\n{error[0]} - got error {error[1].status_code} {error[1].reason} {error[1].text}"
|
||||
raise Exception(error_text)
|
||||
api_urls.append(api_urls.pop(0))
|
||||
else:
|
||||
world.rooms = rooms
|
||||
|
||||
def create_item(self, name: str):
|
||||
return FFMQItem(name, self.player)
|
||||
|
||||
def collect_item(self, state, item, remove=False):
|
||||
if "Progressive" in item.name:
|
||||
i = item.code - 256
|
||||
if state.has(self.item_id_to_name[i], self.player):
|
||||
if state.has(self.item_id_to_name[i+1], self.player):
|
||||
return self.item_id_to_name[i+2]
|
||||
return self.item_id_to_name[i+1]
|
||||
return self.item_id_to_name[i]
|
||||
return item.name if item.advancement else None
|
||||
|
||||
def modify_multidata(self, multidata):
|
||||
# wait for self.rom_name to be available.
|
||||
self.rom_name_available_event.wait()
|
||||
rom_name = getattr(self, "rom_name", None)
|
||||
# we skip in case of error, so that the original error in the output thread is the one that gets raised
|
||||
if rom_name:
|
||||
new_name = base64.b64encode(bytes(self.rom_name)).decode()
|
||||
payload = multidata["connect_names"][self.multiworld.player_name[self.player]]
|
||||
multidata["connect_names"][new_name] = payload
|
||||
|
||||
def get_filler_item_name(self):
|
||||
r = self.multiworld.random.randint(0, 201)
|
||||
for item, count in fillers.items():
|
||||
r -= count
|
||||
r -= fillers[item]
|
||||
if r <= 0:
|
||||
return item
|
||||
|
||||
def extend_hint_information(self, hint_data):
|
||||
hint_data[self.player] = {}
|
||||
if self.multiworld.map_shuffle[self.player]:
|
||||
single_location_regions = ["Subregion Volcano Battlefield", "Subregion Mac's Ship", "Subregion Doom Castle"]
|
||||
for subregion in ["Subregion Foresta", "Subregion Aquaria", "Subregion Frozen Fields", "Subregion Fireburg",
|
||||
"Subregion Volcano Battlefield", "Subregion Windia", "Subregion Mac's Ship",
|
||||
"Subregion Doom Castle"]:
|
||||
region = self.multiworld.get_region(subregion, self.player)
|
||||
for location in region.locations:
|
||||
if location.address and self.multiworld.map_shuffle[self.player] != "dungeons":
|
||||
hint_data[self.player][location.address] = (subregion.split("Subregion ")[-1]
|
||||
+ (" Region" if subregion not in
|
||||
single_location_regions else ""))
|
||||
for overworld_spot in region.exits:
|
||||
if ("Subregion" in overworld_spot.connected_region.name or
|
||||
overworld_spot.name == "Overworld - Mac Ship Doom" or "Focus Tower" in overworld_spot.name
|
||||
or "Doom Castle" in overworld_spot.name or overworld_spot.name == "Overworld - Giant Tree"):
|
||||
continue
|
||||
exits = list(overworld_spot.connected_region.exits) + [overworld_spot]
|
||||
checked_regions = set()
|
||||
while exits:
|
||||
exit_check = exits.pop()
|
||||
if (exit_check.connected_region not in checked_regions and "Subregion" not in
|
||||
exit_check.connected_region.name):
|
||||
checked_regions.add(exit_check.connected_region)
|
||||
exits.extend(exit_check.connected_region.exits)
|
||||
for location in exit_check.connected_region.locations:
|
||||
if location.address:
|
||||
hint = []
|
||||
if self.multiworld.map_shuffle[self.player] != "dungeons":
|
||||
hint.append((subregion.split("Subregion ")[-1] + (" Region" if subregion not
|
||||
in single_location_regions else "")))
|
||||
if self.multiworld.map_shuffle[self.player] != "overworld" and subregion not in \
|
||||
("Subregion Mac's Ship", "Subregion Doom Castle"):
|
||||
hint.append(overworld_spot.name.split("Overworld - ")[-1].replace("Pazuzu",
|
||||
"Pazuzu's"))
|
||||
hint = " - ".join(hint)
|
||||
if location.address in hint_data[self.player]:
|
||||
hint_data[self.player][location.address] += f"/{hint}"
|
||||
else:
|
||||
hint_data[self.player][location.address] = hint
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,140 @@
|
|||
# YAML Preset file for FFMQR
|
||||
Final Fantasy Mystic Quest:
|
||||
enemies_density:
|
||||
All: 0
|
||||
ThreeQuarter: 0
|
||||
Half: 0
|
||||
Quarter: 0
|
||||
None: 0
|
||||
chests_shuffle:
|
||||
Prioritize: 0
|
||||
Include: 0
|
||||
shuffle_boxes_content:
|
||||
true: 0
|
||||
false: 0
|
||||
npcs_shuffle:
|
||||
Prioritize: 0
|
||||
Include: 0
|
||||
Exclude: 0
|
||||
battlefields_shuffle:
|
||||
Prioritize: 0
|
||||
Include: 0
|
||||
Exclude: 0
|
||||
logic_options:
|
||||
Friendly: 0
|
||||
Standard: 0
|
||||
Expert: 0
|
||||
shuffle_enemies_position:
|
||||
true: 0
|
||||
false: 0
|
||||
enemies_scaling_lower:
|
||||
Quarter: 0
|
||||
Half: 0
|
||||
ThreeQuarter: 0
|
||||
Normal: 0
|
||||
OneAndQuarter: 0
|
||||
OneAndHalf: 0
|
||||
Double: 0
|
||||
DoubleAndHalf: 0
|
||||
Triple: 0
|
||||
enemies_scaling_upper:
|
||||
Quarter: 0
|
||||
Half: 0
|
||||
ThreeQuarter: 0
|
||||
Normal: 0
|
||||
OneAndQuarter: 0
|
||||
OneAndHalf: 0
|
||||
Double: 0
|
||||
DoubleAndHalf: 0
|
||||
Triple: 0
|
||||
bosses_scaling_lower:
|
||||
Quarter: 0
|
||||
Half: 0
|
||||
ThreeQuarter: 0
|
||||
Normal: 0
|
||||
OneAndQuarter: 0
|
||||
OneAndHalf: 0
|
||||
Double: 0
|
||||
DoubleAndHalf: 0
|
||||
Triple: 0
|
||||
bosses_scaling_upper:
|
||||
Quarter: 0
|
||||
Half: 0
|
||||
ThreeQuarter: 0
|
||||
Normal: 0
|
||||
OneAndQuarter: 0
|
||||
OneAndHalf: 0
|
||||
Double: 0
|
||||
DoubleAndHalf: 0
|
||||
Triple: 0
|
||||
enemizer_attacks:
|
||||
Normal: 0
|
||||
Safe: 0
|
||||
Chaos: 0
|
||||
SelfDestruct: 0
|
||||
SimpleShuffle: 0
|
||||
leveling_curve:
|
||||
Half: 0
|
||||
Normal: 0
|
||||
OneAndHalf: 0
|
||||
Double: 0
|
||||
DoubleHalf: 0
|
||||
Triple: 0
|
||||
Quadruple: 0
|
||||
battles_quantity:
|
||||
Ten: 0
|
||||
Seven: 0
|
||||
Five: 0
|
||||
Three: 0
|
||||
One: 0
|
||||
RandomHigh: 0
|
||||
RandomLow: 0
|
||||
shuffle_battlefield_rewards:
|
||||
true: 0
|
||||
false: 0
|
||||
random_starting_weapon:
|
||||
true: 0
|
||||
false: 0
|
||||
progressive_gear:
|
||||
true: 0
|
||||
false: 0
|
||||
tweaked_dungeons:
|
||||
true: 0
|
||||
false: 0
|
||||
doom_castle_mode:
|
||||
Standard: 0
|
||||
BossRush: 0
|
||||
DarkKingOnly: 0
|
||||
doom_castle_shortcut:
|
||||
true: 0
|
||||
false: 0
|
||||
sky_coin_mode:
|
||||
Standard: 0
|
||||
StartWith: 0
|
||||
SaveTheCrystals: 0
|
||||
ShatteredSkyCoin: 0
|
||||
sky_coin_fragments_qty:
|
||||
Low16: 0
|
||||
Mid24: 0
|
||||
High32: 0
|
||||
RandomNarrow: 0
|
||||
RandomWide: 0
|
||||
enable_spoilers:
|
||||
true: 0
|
||||
false: 0
|
||||
progressive_formations:
|
||||
Disabled: 0
|
||||
RegionsStrict: 0
|
||||
RegionsKeepType: 0
|
||||
map_shuffling:
|
||||
None: 0
|
||||
Overworld: 0
|
||||
Dungeons: 0
|
||||
OverworldDungeons: 0
|
||||
Everything: 0
|
||||
crest_shuffle:
|
||||
true: 0
|
||||
false: 0
|
||||
description: Generated by Archipelago
|
||||
game: Final Fantasy Mystic Quest
|
||||
name: Player
|
|
@ -0,0 +1,33 @@
|
|||
# Final Fantasy Mystic Quest
|
||||
|
||||
## 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.
|
||||
|
||||
## What does randomization do to this game?
|
||||
|
||||
Besides items being shuffled, you have multiple options for shuffling maps, crest warps, and battlefield locations.
|
||||
There are a number of other options for tweaking the difficulty of the game.
|
||||
|
||||
## What items and locations get shuffled?
|
||||
|
||||
Items received normally through chests, from NPCs, or battlefields are shuffled. Optionally, you may also include
|
||||
the items from brown boxes.
|
||||
|
||||
## Which items can be in another player's world?
|
||||
|
||||
Any of the items which can be shuffled may also be placed into another player's world.
|
||||
|
||||
## What does another world's item look like in Final Fantasy Mystic Quest?
|
||||
|
||||
For locations that are originally boxes or chests, they will appear as a box if the item in it is categorized as a
|
||||
filler item, and a chest if it contains a useful or advancement item. Trap items may randomly appear as a box or chest.
|
||||
When opening a chest with an item for another player, you will see the Archipelago icon and it will tell you you've
|
||||
found an "Archipelago Item"
|
||||
|
||||
## When the player receives an item, what happens?
|
||||
|
||||
A dialogue box will open to show you the item you've received. You will not receive items while you are in battle,
|
||||
menus, or the overworld (except sometimes when closing the menu).
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
# Final Fantasy Mystic Quest Setup Guide
|
||||
|
||||
## Required Software
|
||||
|
||||
- [Archipelago](https://github.com/ArchipelagoMW/Archipelago/releases). Make sure to check the box for `SNI Client`
|
||||
|
||||
- Hardware or software capable of loading and playing SNES ROM files
|
||||
- An emulator capable of connecting to SNI such as:
|
||||
- snes9x-rr from: [snes9x rr](https://github.com/gocha/snes9x-rr/releases),
|
||||
- BizHawk from: [BizHawk Website](http://tasvideos.org/BizHawk.html)
|
||||
- RetroArch 1.10.1 or newer from: [RetroArch Website](https://retroarch.com?page=platforms). Or,
|
||||
- An SD2SNES, FXPak Pro ([FXPak Pro Store Page](https://krikzz.com/store/home/54-fxpak-pro.html)), or other
|
||||
compatible hardware
|
||||
|
||||
- Your legally obtained Final Fantasy Mystic Quest 1.1 ROM file, probably named `Final Fantasy - Mystic Quest (U) (V1.1).sfc`
|
||||
The Archipelago community cannot supply you with this.
|
||||
|
||||
## Installation Procedures
|
||||
|
||||
### Windows Setup
|
||||
|
||||
1. During the installation of Archipelago, you will have been asked to install the SNI Client. If you did not do this,
|
||||
or you are on an older version, you may run the installer again to install the SNI Client.
|
||||
2. If you are using an emulator, you should assign your Lua capable emulator as your default program for launching ROM
|
||||
files.
|
||||
1. Extract your emulator's folder to your Desktop, or somewhere you will remember.
|
||||
2. Right-click on a ROM file and select **Open with...**
|
||||
3. Check the box next to **Always use this app to open .sfc files**
|
||||
4. Scroll to the bottom of the list and click the grey text **Look for another App on this PC**
|
||||
5. Browse for your emulator's `.exe` file and click **Open**. This file should be located inside the folder you
|
||||
extracted in step one.
|
||||
|
||||
## Create a Config (.yaml) File
|
||||
|
||||
### What is a config file and why do I need one?
|
||||
|
||||
See the guide on setting up a basic YAML at the Archipelago setup
|
||||
guide: [Basic Multiworld Setup Guide](/tutorial/Archipelago/setup/en)
|
||||
|
||||
### Where do I get a config file?
|
||||
|
||||
The Player Settings page on the website allows you to configure your personal settings and export a config file from
|
||||
them. Player settings page: [Final Fantasy Mystic Quest Player Settings Page](/games/Final%20Fantasy%20Mystic%20Quest/player-settings)
|
||||
|
||||
### Verifying your config file
|
||||
|
||||
If you would like to validate your config file to make sure it works, you may do so on the YAML Validator page. YAML
|
||||
validator page: [YAML Validation page](/mysterycheck)
|
||||
|
||||
## Generating a Single-Player Game
|
||||
|
||||
1. Navigate to the Player Settings page, configure your options, and click the "Generate Game" button.
|
||||
- Player Settings page: [Final Fantasy Mystic Quest Player Settings Page](/games/Final%20Fantasy%20Mystic%20Quest/player-settings)
|
||||
2. You will be presented with a "Seed Info" page.
|
||||
3. Click the "Create New Room" link.
|
||||
4. You will be presented with a server page, from which you can download your `.apmq` patch file.
|
||||
5. Go to the [FFMQR website](https://ffmqrando.net/Archipelago) and select your Final Fantasy Mystic Quest 1.1 ROM
|
||||
and the .apmq file you received, choose optional preferences, and click `Generate` to get your patched ROM.
|
||||
7. Since this is a single-player game, you will no longer need the client, so feel free to close it.
|
||||
|
||||
## Joining a MultiWorld Game
|
||||
|
||||
### Obtain your patch file and create your ROM
|
||||
|
||||
When you join a multiworld game, you will be asked to provide your config file to whoever is hosting. Once that is done,
|
||||
the host will provide you with either a link to download your patch file, or with a zip file containing
|
||||
everyone's patch files. Your patch file should have a `.apmq` extension.
|
||||
|
||||
Go to the [FFMQR website](https://ffmqrando.net/Archipelago) and select your Final Fantasy Mystic Quest 1.1 ROM
|
||||
and the .apmq file you received, choose optional preferences, and click `Generate` to get your patched ROM.
|
||||
|
||||
Manually launch the SNI Client, and run the patched ROM in your chosen software or hardware.
|
||||
|
||||
### Connect to the client
|
||||
|
||||
#### With an emulator
|
||||
|
||||
When the client launched automatically, SNI should have also automatically launched in the background. If this is its
|
||||
first time launching, you may be prompted to allow it to communicate through the Windows Firewall.
|
||||
|
||||
##### snes9x-rr
|
||||
|
||||
1. Load your ROM file if it hasn't already been loaded.
|
||||
2. Click on the File menu and hover on **Lua Scripting**
|
||||
3. Click on **New Lua Script Window...**
|
||||
4. In the new window, click **Browse...**
|
||||
5. Select the connector lua file included with your client
|
||||
- Look in the Archipelago folder for `/SNI/lua/x64` or `/SNI/lua/x86` depending on if the
|
||||
emulator is 64-bit or 32-bit.
|
||||
6. If you see an error while loading the script that states `socket.dll missing` or similar, navigate to the folder of
|
||||
the lua you are using in your file explorer and copy the `socket.dll` to the base folder of your snes9x install.
|
||||
|
||||
##### BizHawk
|
||||
|
||||
1. Ensure you have the BSNES core loaded. You may do this by clicking on the Tools menu in BizHawk and following these
|
||||
menu options:
|
||||
`Config --> Cores --> SNES --> BSNES`
|
||||
Once you have changed the loaded core, you must restart BizHawk.
|
||||
2. Load your ROM file if it hasn't already been loaded.
|
||||
3. Click on the Tools menu and click on **Lua Console**
|
||||
4. Click the Open Folder icon that says `Open Script` via the tooltip on mouse hover, or click the Script Menu then `Open Script...`, or press `Ctrl-O`.
|
||||
5. Select the `Connector.lua` file included with your client
|
||||
- Look in the Archipelago folder for `/SNI/lua/x64` or `/SNI/lua/x86` depending on if the
|
||||
emulator is 64-bit or 32-bit. Please note the most recent versions of BizHawk are 64-bit only.
|
||||
|
||||
##### RetroArch 1.10.1 or newer
|
||||
|
||||
You only have to do these steps once. Note, RetroArch 1.9.x will not work as it is older than 1.10.1.
|
||||
|
||||
1. Enter the RetroArch main menu screen.
|
||||
2. Go to Settings --> User Interface. Set "Show Advanced Settings" to ON.
|
||||
3. Go to Settings --> Network. Set "Network Commands" to ON. (It is found below Request Device 16.) Leave the default
|
||||
Network Command Port at 55355.
|
||||
|
||||

|
||||
4. Go to Main Menu --> Online Updater --> Core Downloader. Scroll down and select "Nintendo - SNES / SFC (bsnes-mercury
|
||||
Performance)".
|
||||
|
||||
When loading a ROM, be sure to select a **bsnes-mercury** core. These are the only cores that allow external tools to
|
||||
read ROM data.
|
||||
|
||||
#### With hardware
|
||||
|
||||
This guide assumes you have downloaded the correct firmware for your device. If you have not done so already, please do
|
||||
this now. SD2SNES and FXPak Pro users may download the appropriate firmware on the SD2SNES releases page. SD2SNES
|
||||
releases page: [SD2SNES Releases Page](https://github.com/RedGuyyyy/sd2snes/releases)
|
||||
|
||||
Other hardware may find helpful information on the usb2snes platforms
|
||||
page: [usb2snes Supported Platforms Page](http://usb2snes.com/#supported-platforms)
|
||||
|
||||
1. Close your emulator, which may have auto-launched.
|
||||
2. Power on your device and load the ROM.
|
||||
|
||||
### Connect to the Archipelago Server
|
||||
|
||||
The patch file which launched your client should have automatically connected you to the AP Server. There are a few
|
||||
reasons this may not happen however, including if the game is hosted on the website but was generated elsewhere. If the
|
||||
client window shows "Server Status: Not Connected", simply ask the host for the address of the server, and copy/paste it
|
||||
into the "Server" input field then press enter.
|
||||
|
||||
The client will attempt to reconnect to the new server address, and should momentarily show "Server Status: Connected".
|
||||
|
||||
### Play the game
|
||||
|
||||
When the client shows both SNES Device and Server as connected, you're ready to begin playing. Congratulations on
|
||||
successfully joining a multiworld game!
|
||||
|
||||
## Hosting a MultiWorld game
|
||||
|
||||
The recommended way to host a game is to use our hosting service. The process is relatively simple:
|
||||
|
||||
1. Collect config files from your players.
|
||||
2. Create a zip file containing your players' config files.
|
||||
3. Upload that zip file to the Generate page above.
|
||||
- Generate page: [WebHost Seed Generation Page](/generate)
|
||||
4. Wait a moment while the seed is generated.
|
||||
5. When the seed is generated, you will be redirected to a "Seed Info" page.
|
||||
6. Click "Create New Room". This will take you to the server page. Provide the link to this page to your players, so
|
||||
they may download their patch files from there.
|
||||
7. Note that a link to a MultiWorld Tracker is at the top of the room page. The tracker shows the progress of all
|
||||
players in the game. Any observers may also be given the link to this page.
|
||||
8. Once all players have joined, you may begin playing.
|
Loading…
Reference in New Issue