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
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
lorom

org $a2aaa5
JSL check_goal

org $92ef00
check_goal:
PHX
PHY
PHP
REP #$30

LDA $A17B74 : AND #$0007 : CMP #$0007 : BNE .refuel ; require all pendants
LDA $A17B7A : AND #$007F : CMP #$007F : BNE .refuel ; require all crystals
LDA $7ED832 : AND #$000F : CMP #$000F : BNE .refuel ; required all boss tokens
LDA $A17BC5 : CMP #$0003 : BCC .refuel ; require post-aga world state
LDA $A17ADB : AND #$0020 : CMP #$0020 : BNE .refuel ; require aga2 defeated (pyramid hole open)

BRA .liftoff

.refuel
PLP
PLY
PLX
CLC
RTL

.liftoff
PLP
PLY
PLX
SEC
RTL
18 changes: 18 additions & 0 deletions src/TrackerCouncil.Smz3.Abstractions/AutoTrackerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public abstract class AutoTrackerBase : IDisposable
/// </summary>
public event EventHandler? GameChanged;

/// <summary>
/// Occurs when the tracker detects that the pyramid has been opened
/// </summary>
public event EventHandler? OpenPyramidChanged;

/// <summary>
/// The action to run when the player asks Tracker to look at the game
/// </summary>
Expand Down Expand Up @@ -99,6 +104,11 @@ public abstract class AutoTrackerBase : IDisposable
/// </summary>
public bool PlayerHasFairy { get; set; }

/// <summary>
/// If the pyramid has been opened
/// </summary>
public bool OpenPyramid { get; set; }

/// <summary>
/// If the user is activately in an SMZ3 rom
/// </summary>
Expand Down Expand Up @@ -169,5 +179,13 @@ protected virtual void OnGameChanged()
GameChanged?.Invoke(this, EventArgs.Empty);
}

/// <summary>
/// Invokes the OpenPyramidChanged event
/// </summary>
public virtual void OnOpenPyramidChanged()
{
OpenPyramidChanged?.Invoke(this, EventArgs.Empty);
}

public abstract void Dispose();
}
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
using TrackerCouncil.Smz3.Data.GeneratedData;
using TrackerCouncil.Smz3.Data.Options;
using TrackerCouncil.Smz3.Data.ParsedRom;
using TrackerCouncil.Smz3.Data.ViewModels;
using TrackerCouncil.Smz3.Data.WorldData;
using TrackerCouncil.Smz3.Shared.Enums;
using TrackerCouncil.Smz3.Shared.Models;

namespace TrackerCouncil.Smz3.Abstractions;

public abstract class AltGameModeBase
public abstract class GameModeBase
{
public abstract bool IsComplete(World world);

public virtual void UpdateWorld(World world, int seed, GameModeOptions gameModeOptions) {}
public abstract void UpdateWorld(World world, Random rng, GameModeOptions gameModeOptions);

public virtual void UpdateInitialTrackerState(GameModeOptions gameModeOptions, TrackerState trackerState) {}
public abstract void UpdateInitialTrackerState(GameModeOptions gameModeOptions, TrackerState trackerState, ParsedRomDetails? parsedRomDetails);

public virtual void InitializeTracker(TrackerBase tracker) {}

public virtual AltGameModeInGameText? GetInGameText(World world)
{
return null;
}
public abstract GameModeInGameText GetInGameText(World world);

public virtual string? GetGameStartText(World world)
{
return null;
}

public virtual bool IsKnowinglyComplete(World world)
{
return false;
}
public abstract bool IsKnowinglyComplete(World world);


public virtual bool OnViewingPyramidText(World world)
{
Expand All @@ -42,13 +38,9 @@ public virtual bool OnViewingPyramidText(World world)
return null;
}

public virtual List<GoalUiDetails>? GetGoalUiDetails(World world)
{
return null;
}
public abstract List<GoalUiDetails> GetGoalUiDetails(World world, Progression progression);

public virtual string GetSpoilerText(GameModeOptions gameModeOptions)
{
return string.Empty;
}
public abstract string GetSpoilerText(GameModeOptions gameModeOptions);

public abstract Stream GetLiftOffOnGoalCompletionIpsPatch();
}
17 changes: 0 additions & 17 deletions src/TrackerCouncil.Smz3.Abstractions/ITrackerAltGameModeService.cs

This file was deleted.

59 changes: 59 additions & 0 deletions src/TrackerCouncil.Smz3.Abstractions/ITrackerGameModeService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using TrackerCouncil.Smz3.Data.ViewModels;
using TrackerCouncil.Smz3.Shared.Enums;

namespace TrackerCouncil.Smz3.Abstractions;

/// <summary>
/// Tracker service for various events that need to interact with the game mode
/// </summary>
public interface ITrackerGameModeService
{
/// <summary>
/// The current game mode type
/// </summary>
public GameModeType GameModeType { get; }

/// <summary>
/// If this is a game mode not handled by the base assembly code
/// </summary>
public bool HasAltGameMode { get; }

/// <summary>
/// If the game mode has been completed
/// </summary>
public bool IsGameModeComplete { get; }

/// <summary>
/// Event called when the goal progress has changed
/// </summary>
public event EventHandler? GoalStateChanged;

/// <summary>
/// Marks the game mode as complete
/// </summary>
public void MarkGameModeAsComplete();

/// <summary>
/// If the game mode is complete and the player should be aware of it
/// as they know the required amounts to be considered complete
/// </summary>
/// <returns></returns>
public bool IsGameModeKnowinglyComplete();

/// <summary>
/// Informs the game mode that the player has viewed the pyramid so
/// that any unknown values are populated
/// </summary>
public void OnViewingPyramidText();

/// <summary>
/// Notifies all listeners that the progress of the game mode has changed
/// </summary>
public void NotifyOfGoalStateChange();

/// <summary>
/// Retrieve the UI to show the progress of the goals
/// </summary>
/// <returns>A list of goal details to show in the tracker UI</returns>
public List<GoalUiDetails> GetGoalUiDetails();
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ public interface ITrackerGameStateService
/// </summary>
public bool HasBeatenGame { get; }

/// <summary>
/// Gets if the local player has finished the goal
/// </summary>
public bool HasFinishedGoal { get; set; }

/// <summary>
/// The last viewed hint tile or set of locations
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/TrackerCouncil.Smz3.Abstractions/ITrackerRewardService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ namespace TrackerCouncil.Smz3.Abstractions;

public interface ITrackerRewardService
{
/// <summary>
/// Event called when rewards have been added or removed
/// </summary>
public event EventHandler? RewardsChanged;

/// <summary>
/// Sets the dungeon's reward to the specific pendant or crystal.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/TrackerCouncil.Smz3.Abstractions/TrackerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public abstract class TrackerBase : IDisposable

public ITrackerSpoilerService SpoilerService { get; protected set; } = null!;

public ITrackerAltGameModeService AltGameModeService { get; protected set; } = null!;
public ITrackerGameModeService GameModeService { get; protected set; } = null!;

/// <summary>
/// Gets the world for the currently tracked playthrough.
Expand Down
12 changes: 6 additions & 6 deletions src/TrackerCouncil.Smz3.Data.SchemaGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static class Program
(typeof(RoomConfig), "rooms.json"),
(typeof(UIConfig), "ui.json"),
(typeof(MetadataConfig), "metadata.json"),
(typeof(AltGameModesConfig), "alt_game_modes.json"),
(typeof(GameModesConfig), "game_modes.json"),
};

private static IServiceProvider? _services;
Expand Down Expand Up @@ -221,11 +221,11 @@ private static void CreateTemplates(string outputPath)
var exampleMetadataConfig = MetadataConfig.Example();
WriteTemplate(templatePath, "metadata", templateMetadataConfig, exampleMetadataConfig);

// Alt Game Modes Template
var altGameModeConfig = new AltGameModesConfig();
PopulateExample(altGameModeConfig, true);
var exampleAltGameModeConfig = AltGameModesConfig.Example();
WriteTemplate(templatePath, "alt_game_modes", altGameModeConfig, exampleAltGameModeConfig);
// Game Modes Template
var gameModeConfig = new GameModesConfig();
PopulateExample(gameModeConfig, true);
var exampleGameModeConfig = GameModesConfig.Example();
WriteTemplate(templatePath, "game_modes", gameModeConfig, exampleGameModeConfig);
}

private static void WriteTemplate(string templatePath, string type, object data, object? example)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ namespace TrackerCouncil.Smz3.Data.Configuration.ConfigFiles;

[Description("Config file for various tracker lines and in game text for alt game modes.\r\n" +
"Note that all lines in game need to be no more than 19 characters.")]
public class AltGameModesConfig : IMergeable<AltGameModesConfig>, IConfigFile<AltGameModesConfig>
public class GameModesConfig : IMergeable<GameModesConfig>, IConfigFile<GameModesConfig>
{
public static AltGameModesConfig Default()
public static GameModesConfig Default()
{
return new AltGameModesConfig();
return new GameModesConfig();
}

/// <summary>
Expand All @@ -35,11 +35,32 @@ public static AltGameModesConfig Default()
/// </summary>
public SchrodingersString? SpazerHuntGameStarted { get; set; }

/// <summary>
/// In game text for the intro to the Ganon battle for All Dungeons mode
/// </summary>
public SchrodingersString? AllDungeonsGanonIntro { get; set; }

/// <summary>
/// In game text for the intro to the Ganon battle when you have not met the requirements for All Dungeons mode
/// </summary>
public SchrodingersString? AllDungeonsGanonIntroGoalsNotMet { get; set; }

/// <summary>
/// In game text for the sign on Ganon's pyramid to explain the goal for All Dungeons mode
/// </summary>
public SchrodingersString? AllDungeonsGanonGoalSign { get; set; }

/// <summary>
/// Tracker line for when starting a new game in All Dungeons mode
/// </summary>
public SchrodingersString? AllDungeonsGameStarted { get; set; }

public static object Example()
{
return new Dictionary<string, object>()
{
{ "SpazerHuntGanonIntro", new SchrodingersString("In game text with\neach line being\n19 characters\nor less", new SchrodingersString.Possibility("Another example\nof in game text", 0.1)) }
{ "SpazerHuntGanonIntro", new SchrodingersString("In game text with\neach line being\n19 characters\nor less", new SchrodingersString.Possibility("Another example\nof in game text", 0.1)) },
{ "AllDungeonsGanonIntro", new SchrodingersString("In game text with\neach line being\n19 characters\nor less", new SchrodingersString.Possibility("Another example\nof in game text", 0.1)) }
};
}
}
6 changes: 3 additions & 3 deletions src/TrackerCouncil.Smz3.Data/Configuration/ConfigProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,13 @@ public virtual MetadataConfig GetMetadataConfig(IReadOnlyCollection<string> prof
LoadYamlConfigs<MetadataConfig, MetadataConfig>("metadata.yml", profiles, mood);

/// <summary>
/// Returns the configs with alt game mode text
/// Returns the configs with game mode text
/// </summary>
/// <param name="profiles">The selected tracker profile(s) to load</param>
/// <param name="mood">The current tracker mood to pick the specific mood file</param>
/// <returns></returns>
public virtual AltGameModesConfig GetAltGameModesConfig(IReadOnlyCollection<string> profiles, string? mood) =>
LoadYamlConfigs<AltGameModesConfig, AltGameModesConfig>("alt_game_modes.yml", profiles, mood);
public virtual GameModesConfig GetGameModesConfig(IReadOnlyCollection<string> profiles, string? mood) =>
LoadYamlConfigs<GameModesConfig, GameModesConfig>("game_modes.yml", profiles, mood);

/// <summary>
/// Returns a collection of all possible config profiles to
Expand Down

This file was deleted.

10 changes: 10 additions & 0 deletions src/TrackerCouncil.Smz3.Data/GeneratedData/GameModeInGameText.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using TrackerCouncil.Smz3.Data.Configuration.ConfigTypes;

namespace TrackerCouncil.Smz3.Data.GeneratedData;

public class GameModeInGameText
{
public required string? GanonIntro { get; set; }
public required string? GanonIntroGoalsNotMet { get; set; }
public required string? GanonGoalSign { get; set; }
}
Loading
Loading