Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions constants/maps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@


id_name = {
0x123 : "Guardian Room", # 291
0x14e : "Poltergeist Room", # 334
0x162 : "Goddess Room", # 354
0x163 : "Doom Room", # 355
0x19a : "Inferno Room", # 410
0x19b : "KT Final Switch Room" # 411
}

name_id = {v: k for k, v in id_name.items()}
3 changes: 2 additions & 1 deletion constants/objectives/condition_bits.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
NameBit("Suplex A Train", event_bit.SUPLEXED_TRAIN),
NameBit("Win An Auction", event_bit.WON_AN_AUCTION),
NameBit("Win A Coliseum Match", event_bit.WON_A_COLISEUM_MATCH),
NameBit("Reunite Gau and Father", event_bit.GAU_FATHER_REUNION),
NameBit("Reunite Gau and Father", event_bit.GAU_FATHER_REUNION), # 10
NameBit("Complete the KT Gauntlet", event_bit.COMPLETED_KT_GAUNTLET) # 11
]

boss_bit = []
Expand Down
2 changes: 2 additions & 0 deletions constants/objectives/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
category_types["Command"].append(ResultType(59, "Magitek Upgrade", "Magitek Upgrade", None))
category_types["Item"].append(ResultType(60, "Sprint Shoes", "Sprint Shoes", None))
category_types["Kefka's Tower"] += [ResultType(61, "Unlock Perma KT Skip", "Unlock Perma KT Skip", None)]
category_types["Kefka's Tower"] += [ResultType(62, "Unlock KT Gauntlet", "Unlock KT Gauntlet", None)]


categories = list(category_types.keys())

Expand Down
5 changes: 5 additions & 0 deletions constants/songs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id_name = {
0x33 : "FierceBattle", # "Battle to the Death" - Atma/Statue battle theme
}

name_id = {v: k for k, v in id_name.items()}
11 changes: 11 additions & 0 deletions constants/sound_effects.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@


id_name = {
0x9a : "Ground Breaking", # 154
0xa6 : "Chest/Switch", # 166
0xa9 : "Umaro Body Slam", # 169
0xb5 : "Landing On Floor", # 181
0xba : "Falling", # 186
}

name_id = {v: k for k, v in id_name.items()}
10 changes: 8 additions & 2 deletions data/dialogs/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ def read_multi_line_battle_dialogs(self):
self.multi_line_battle_dialogs.append(dialog)

def free(self):
import data.dialogs.free as free
from data.dialogs.free import multi_line_battle_dialogs

self.free_multi_line_battle_dialogs = []
for dialog_id in free.multi_line_battle_dialogs:
for dialog_id in multi_line_battle_dialogs:
self.multi_line_battle_dialogs[dialog_id].text = ""
self.free_multi_line_battle_dialogs.append(dialog_id)

Expand Down Expand Up @@ -179,6 +179,12 @@ def objectives_mod(self):
mlid = self.allocate_multi_line_battle(line1 + "<line>" + line2 + "<wait for key><end>")
self.multi_line_battle_objectives.append(mlid)

def create_dialog(self, text):
from data.dialogs.free import dialogs
id = dialogs.pop()
self.set_text(id, text)
return id

def mod(self):
self.move_battle_messages()
self.objectives_mod()
Expand Down
6 changes: 6 additions & 0 deletions data/dialogs/free.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@

dialogs = []
dialogs += range(515, 528) # kefka assaulting thamasa
dialogs += range(550, 598) # sabin scenario, cyan kefka doma event
dialogs +=range(1767, 1878) # BANQUET

multi_line_battle_dialogs = [
0, # WEDGE:<line>Hey! What's the matter?<wait for key><line>Do you know something we<line>don't……? ...
1, # GIRL:<line>……<wait for key><end>
Expand Down
12 changes: 12 additions & 0 deletions data/enemy_packs.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,18 @@ def randomize_packs(self, packs, boss_percent, no_phunbaba3 = False):
if self.args.dragon_boss_location != bosses.BossLocations.MIX:
exclude_bosses += self.formations.ALL_DRAGONS

# We only want statues and dragons to show up when they are intentionally
# mixed into the general boss pool
# Statues are currently seen as normal bosses in regards to scaling,
# but the long-term goal is to add their own scaling option so it
# makes most sense to begin treating these similarly to dragons.
if self.args.statue_boss_location != bosses.BossLocations.MIX:
exclude_bosses += self.formations.ALL_STATUES

# This is more futureproofing in the event we consolidate dragons in the future
if self.args.dragon_boss_location != bosses.BossLocations.MIX:
exclude_bosses += self.formations.ALL_DRAGONS

import random
for pack_id in packs:
if random.random() < boss_percent:
Expand Down
3 changes: 3 additions & 0 deletions data/event_bit.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@
# 3 bits 0x1c7-0x1c9 Unused
# 3 bits 0x2c1-0x2c3 Unused
UNLOCKED_PERMA_KT_SKIP = 0x2c1
UNLOCKED_KT_GAUNTLET = 0x2c2
COMPLETED_KT_GAUNTLET = 0x2c3
# 8 bits 0x1e6-0x1ed Unused, as the SNES versions feature 20 rare item slots rather than 30
GAUNTLET_IN_PROGRESS = 0x1e6

from constants.objectives import MAX_OBJECTIVES
for index in range(MAX_OBJECTIVES):
Expand Down
2 changes: 2 additions & 0 deletions data/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ def add_receive_dialog(self, item_id):

self.dialogs.set_text(dialog_id, '<line>< >Received “' + item_name + '”!<end>')

return dialog_id

def print(self):
for item in self.items:
item.print()
15 changes: 14 additions & 1 deletion data/map_property.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

ENABLE_WARP = 0x02
ENABLE_RANDOM_ENCOUNTER = 0x80

class MapProperty:
DATA_SIZE = 33
DATA_START = 0x2d8f00
Expand All @@ -16,12 +20,21 @@ def read(self):
self.data = self.rom.get_bytes(self.data_start, self.DATA_SIZE)

self.name_index = self.data[0]
self.enable_random_encounters = (self.data[5] & 0x80) >> 7
self.enable_warp = (self.data[1] & ENABLE_WARP) >> 1
self.enable_random_encounters = (self.data[5] & ENABLE_RANDOM_ENCOUNTER) >> 7
self.song = self.data[28]

def write(self):
self.data[1] &= self.enable_warp << 1
self.data[5] &= self.enable_random_encounters << 7
self.data[28] = self.song
self.rom.set_bytes(self.data_start, self.data)

def set_warp(self, value):
self.enable_warp = 1 if value else 0

def set_random_encounters(self, value):
self.enable_random_encounters = 1 if value else 0

def print(self):
print(f"{self.id}: {self.enable_random_encounters}")
10 changes: 10 additions & 0 deletions data/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ def get_chest_count(self, map_id):
def set_chest_item(self, map_id, x, y, item_id):
self.chests.set_item(map_id, x, y, item_id)

def get_chests(self, map_id):
return self.chests.map_chests[map_id]

def get_event_count(self, map_id):
return (self.maps[map_id + 1]["events_ptr"] - self.maps[map_id]["events_ptr"]) // MapEvent.DATA_SIZE

Expand Down Expand Up @@ -158,6 +161,12 @@ def print_long_exits(self, map_id):
first_exit_id = (self.maps[map_id]["long_exits_ptr"] - self.maps[0]["long_exits_ptr"]) // LongMapExit.DATA_SIZE
self.exits.print_long_exit_range(first_exit_id, self.get_long_exit_count(map_id))

def disable_random_encounter(self, map_id):
self.properties[map_id].set_random_encounters(False)

def disable_warp(self, map_id):
self.properties[map_id].set_warp(False)

def _fix_imperial_camp_boxes(self):
# near the northern tent normally accessed by jumping over a wall
# there is a box which can be walked into but not out of which causes the game to lock
Expand Down Expand Up @@ -235,3 +244,4 @@ def write(self):
npcs_ptr[0] = cur_map["npcs_ptr"] & 0xff
npcs_ptr[1] = (cur_map["npcs_ptr"] & 0xff00) >> 8
self.rom.set_bytes(npcs_ptr_address, npcs_ptr)

4 changes: 2 additions & 2 deletions data/npc_bit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NOTE: (address - 1e80) * 0x8 + bit
# e.g. (1eb7 - 1e80) * 0x8 + 0x1 = 1b9 (airship visible)
# e.g. (1eb7 - 1e80) * 0x8 + 0x1 = 1b9 (airship visible)
# (1f43 - 1e80) * 0x8 + 0x3 = 61b (characters on narshe battlefield)

SOLDIER_DOORWAY_ARVIS_HOUSE = 0x688
Expand Down Expand Up @@ -145,7 +145,7 @@

DOOM_STATUE_KEFKA_TOWER = 0x6b0
GODDESS_STATUE_KEFKA_TOWER = 0x6b1
POLTRGEIST_STATUE_KEFKA_TOWER = 0x6b2
POLTERGEIST_STATUE_KEFKA_TOWER = 0x6b2

def byte(npc_bit):
return npc_bit // 8
Expand Down
1 change: 1 addition & 0 deletions event/airship.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from data.npc import NPC
from event.event import *

class Airship(Event):
Expand Down
Loading