Skip to content

Commit f5855ae

Browse files
authored
Merge pull request #261 from latzio/dev
2.5.1 Softlaunch with Free Canal.
2 parents eae4271 + b3950b4 commit f5855ae

16 files changed

Lines changed: 58 additions & 7 deletions

FF1Lib/FF1Rom.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace FF1Lib
1313
// ReSharper disable once InconsistentNaming
1414
public partial class FF1Rom : NesRom
1515
{
16-
public const string Version = "2.5.0";
16+
public const string Version = "2.5.1";
1717

1818
public const int RngOffset = 0x7F100;
1919
public const int BattleRngOffset = 0x7FCF1;
@@ -362,6 +362,11 @@ public void Randomize(Blob seed, Flags flags)
362362
EnableFreeOrbs();
363363
}
364364

365+
if (flags.FreeCanal)
366+
{
367+
EnableFreeCanal();
368+
}
369+
365370
if (flags.NoPartyShuffle)
366371
{
367372
DisablePartyShuffle();

FF1Lib/Flags.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ public class Flags : IIncentiveFlags, IMapEditFlags, IScaleFlags, IFloorShuffleF
201201
public bool FreeOrbs { get; set; }
202202
[FlagString(Character = FILTHY_CASUALS, FlagBit = 8)]
203203
public bool EnableCritNumberDisplay { get; set; }
204+
[FlagString(Character = FILTHY_CASUALS, FlagBit = 16)]
205+
public bool FreeCanal { get; set; }
204206
[FlagString(Character = FILTHY_CASUALS, FlagBit = 32)]
205207
public bool EasyMode { get; set; }
206208

@@ -391,7 +393,7 @@ public class Flags : IIncentiveFlags, IMapEditFlags, IScaleFlags, IFloorShuffleF
391393
public bool IncentivizeCrystal => IncentivizeFetchItems;
392394
public bool IncentivizeHerb => IncentivizeFetchItems;
393395
public bool IncentivizeKey => true;
394-
public bool IncentivizeCanal => !NPCItems || IncentivizeFetchItems; // If Canoe is unshuffled then Canal is Required
396+
public bool IncentivizeCanal => !FreeCanal && (!NPCItems || IncentivizeFetchItems); // If Canoe is unshuffled then Canal is Required
395397
public bool IncentivizeChime => true;
396398
public bool IncentivizeOxyale => true;
397399
public bool IncentivizeXcalber => false;

FF1Lib/Interfaces.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public interface IItemPlacementFlags : IItemShuffleFlags, IVictoryConditionFlags
7171
{
7272
bool FreeBridge { get; }
7373
bool FreeAirship { get; }
74+
bool FreeCanal { get; }
7475
bool MapCanalBridge { get; }
7576
bool MapConeriaDwarves { get; }
7677
bool MapVolcanoIceRiver { get; }
@@ -109,5 +110,8 @@ public interface IVictoryConditionFlags
109110
bool OnlyRequireGameIsBeatable { get; }
110111
bool ShardHunt { get; }
111112
bool ShortToFR { get; }
113+
bool FreeBridge { get; }
114+
bool FreeAirship { get; }
115+
bool FreeCanal { get; }
112116
}
113117
}

FF1Lib/ItemPlacement.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
using System;
1+
using RomUtilities;
2+
using System;
23
using System.Collections.Generic;
34
using System.Collections.ObjectModel;
45
using System.Diagnostics;
56
using System.Linq;
6-
using RomUtilities;
77

88
namespace FF1Lib
99
{
@@ -296,6 +296,18 @@ public static bool CheckSanity(List<IRewardSource> treasurePlacements,
296296
}
297297

298298
var currentMapChanges = MapChange.None;
299+
if (victoryConditions.FreeBridge)
300+
{
301+
currentMapChanges |= MapChange.Bridge;
302+
}
303+
if (victoryConditions.FreeAirship)
304+
{
305+
currentMapChanges |= MapChange.Airship;
306+
}
307+
if (victoryConditions.FreeCanal)
308+
{
309+
currentMapChanges |= MapChange.Canal;
310+
}
299311

300312
IEnumerable<MapLocation> currentMapLocations()
301313
{

FF1Lib/OverworldMap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public void ShuffleEntrancesAndFloors(MT19337 rng, IFloorShuffleFlags flags)
303303
};
304304

305305
// Disable the Princess Warp back to Castle Coneria
306-
_rom.Put(0x392CA, Blob.FromHex("EAEAEA"));
306+
if (flags.Entrances || flags.Floors) _rom.Put(0x392CA, Blob.FromHex("EAEAEA"));
307307

308308
// Since we're going to move all the entrances around, we're going to change the requirements
309309
// for just about everything. Most interestingly the Titan's Tunnel is going to connect totally

FF1Lib/Treasure.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ public List<IRewardSource> ShuffleTreasures(MT19337 rng,
7575
{
7676
placedItems = placedItems.Select(x => x.Item != Item.Floater ? x : ItemPlacement.NewItemPlacement(x, ReplacementItem)).ToList();
7777
}
78+
if (flags.FreeCanal)
79+
{
80+
placedItems = placedItems.Select(x => x.Item != Item.Canal ? x : ItemPlacement.NewItemPlacement(x, ReplacementItem)).ToList();
81+
}
7882
if (flags.ShortToFR)
7983
{
8084
placedItems = placedItems.Select(x => x.Item != Item.Lute ? x : ItemPlacement.NewItemPlacement(x, ReplacementItem)).ToList();

FF1Lib/ViewModelFlags.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,15 @@ public bool FreeOrbs
716716
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("FreeOrbs"));
717717
}
718718
}
719+
public bool FreeCanal
720+
{
721+
get => Flags.FreeCanal;
722+
set
723+
{
724+
Flags.FreeCanal = value;
725+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("FreeCanal"));
726+
}
727+
}
719728

720729
public bool FreeOrbsEnabled => !ShardHunt;
721730

FF1Lib/presets/beginner.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989

9090
"FreeBridge": true,
9191
"FreeAirship": false,
92+
"FreeCanal": false,
9293
"FreeOrbs": false,
9394
"StartingGold": false,
9495
"WrapStatOverflow": false,

FF1Lib/presets/debug.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989

9090
"FreeBridge": false,
9191
"FreeAirship": false,
92+
"FreeCanal": false,
9293
"FreeOrbs": false,
9394
"StartingGold": false,
9495
"WrapStatOverflow": false,

FF1Lib/presets/default.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989

9090
"FreeBridge": false,
9191
"FreeAirship": false,
92+
"FreeCanal": false,
9293
"FreeOrbs": false,
9394
"StartingGold": false,
9495
"WrapStatOverflow": false,

0 commit comments

Comments
 (0)