Add Initial Hotel Ticket Support (#693)

Adds initial support for Hotel Tickets to get it up and running - needs cleanup.
This commit is contained in:
Josh (vector_cmdr) 2026-01-17 03:01:24 +11:00 committed by GitHub
parent d276527404
commit bbc5c6eefc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 702 additions and 679 deletions

View File

@ -66,6 +66,12 @@ public EncryptedInt32 TotalNookMiles
set => value.Write(Data[Offsets.TotalPoint..]);
}
public EncryptedInt32 Tickets
{
get => EncryptedInt32.ReadVerify(Data, Offsets.Tickets);
set => value.Write(Data[Offsets.Tickets..]);
}
public IReadOnlyList<Item> Bag // Slots 21-40
{
get => Item.GetArray(Data.Slice(Offsets.Pockets1, Offsets.Pockets1Count * Item.SIZE));

View File

@ -13,6 +13,7 @@ public abstract class PersonalOffsets
public abstract int Wallet { get; }
public abstract int NowPoint { get; }
public abstract int TotalPoint { get; }
public abstract int Tickets { get; }
public abstract int Birthday { get; }
public abstract int ProfileMain { get; }

View File

@ -33,6 +33,7 @@ public sealed class PersonalOffsets10 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x4;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x180;
public override int ItemCollectBit => PlayerOther + 0xA04C;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7A0;

View File

@ -33,6 +33,7 @@ public sealed class PersonalOffsets11 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;

View File

@ -34,6 +34,7 @@ public sealed class PersonalOffsets110 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;

View File

@ -34,6 +34,7 @@ public sealed class PersonalOffsets111 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;

View File

@ -33,6 +33,7 @@ public sealed class PersonalOffsets12 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;

View File

@ -33,6 +33,7 @@ public sealed class PersonalOffsets13 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;

View File

@ -33,6 +33,7 @@ public sealed class PersonalOffsets14 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;

View File

@ -33,6 +33,7 @@ public sealed class PersonalOffsets15 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;

View File

@ -33,6 +33,7 @@ public sealed class PersonalOffsets16 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;

View File

@ -33,6 +33,7 @@ public sealed class PersonalOffsets17 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;

View File

@ -34,6 +34,7 @@ public sealed class PersonalOffsets18 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;

View File

@ -34,6 +34,7 @@ public sealed class PersonalOffsets19 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;

View File

@ -33,6 +33,7 @@ public sealed class PersonalOffsets20 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => 0; // Does not exist in saves older than Offsets30 (31)
public override int ItemChest => PlayerOther + 0x18C;
public override int ItemCollectBit => PlayerOther + 0xA058;
public override int ItemRemakeCollectBit => PlayerOther + 0xA7AC;

View File

@ -36,6 +36,7 @@ public sealed class PersonalOffsets30 : PersonalOffsets
public override int Pockets1 => PlayerOther + 0x10;
public override int Pockets2 => Pockets1 + (8 * Pockets1Count) + 0x18;
public override int Wallet => Pockets2 + (8 * Pockets2Count) + 0x18;
public override int Tickets => PlayerOther + 0x3c6d0; //0x742b0;
public override int ItemChest => PlayerOther + 0x18C;
// chest increased in size! 9C44 => 11944

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,15 @@
using System;
using NHSE.Core;
using NHSE.Injection;
using NHSE.Sprites;
using NHSE.WinForms.Properties;
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using NHSE.Core;
using NHSE.Injection;
using NHSE.Sprites;
using NHSE.WinForms.Properties;
namespace NHSE.WinForms;
@ -302,6 +303,15 @@ private void LoadPlayer(int index)
NUD_PocketCount2.Value = Math.Min(int.MaxValue, pers.BagCount);
NUD_StorageCount.Value = Math.Min(int.MaxValue, pers.ItemChestCount);
if (SAV.Main.Info.GetKnownRevisionIndex() >= 31)
{
NUD_HotelTickets.Value = Math.Min(int.MaxValue, pers.Tickets.Value);
}
else
{
L_HotelTickets.Visible = NUD_HotelTickets.Visible = false;
}
if (player.WhereAreN is not null)
{
NUD_Poki.Value = Math.Min(int.MaxValue, player.WhereAreN.Poki.Value);
@ -369,6 +379,13 @@ private void SavePlayer(int index)
pers.ItemChestCount = (uint)NUD_StorageCount.Value;
if (SAV.Main.Info.GetKnownRevisionIndex() >= 31)
{
var tickets = pers.Tickets;
tickets.Value = (uint)NUD_HotelTickets.Value;
pers.Tickets = tickets;
}
if (player.WhereAreN is { } x)
{
var poki = x.Poki;

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->