diff --git a/ALttPRandomizer/Azure/AzureStorage.cs b/ALttPRandomizer/Azure/AzureStorage.cs index 31ba8af..9906f83 100644 --- a/ALttPRandomizer/Azure/AzureStorage.cs +++ b/ALttPRandomizer/Azure/AzureStorage.cs @@ -1,5 +1,6 @@ namespace ALttPRandomizer.Azure { using global::Azure.Storage.Blobs; + using global::Azure.Storage.Blobs.Models; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -62,5 +63,11 @@ return data; } + + public async Task GetFileCreation(string filename) { + var blob = this.BlobClient.GetBlobClient(filename); + var blobProperties = await blob.GetPropertiesAsync(); + return blobProperties.Value.CreatedOn; + } } } diff --git a/ALttPRandomizer/Model/SeedSettings.cs b/ALttPRandomizer/Model/SeedSettings.cs index ffe4ae4..4971151 100644 --- a/ALttPRandomizer/Model/SeedSettings.cs +++ b/ALttPRandomizer/Model/SeedSettings.cs @@ -33,6 +33,11 @@ [NoSettingName([Apr2025])] public EntryRequirement CrystalsGT { get; set; } = EntryRequirement.Crystals7; + [SettingName("ganon_item")] + [RequiredSetting([Apr2025], GanonItem.Silver)] + [NoSettingName([Apr2025])] + public GanonItem GanonItem { get; set; } = GanonItem.Silver; + [SettingName("shuffle")] [ForbiddenSetting([Apr2025], EntranceShuffle.Swapped)] public EntranceShuffle EntranceShuffle { get; set; } = EntranceShuffle.Vanilla; @@ -57,6 +62,11 @@ [NoSettingName([Apr2025])] public EnemyShuffle EnemyShuffle { get; set; } = EnemyShuffle.Vanilla; + [SettingName("shuffle_damage_table")] + [RequiredSetting([Apr2025], DamageTableShuffle.Vanilla)] + [NoSettingName([Apr2025])] + public DamageTableShuffle DamageTableShuffle { get; set; } = DamageTableShuffle.Vanilla; + [SettingName("keyshuffle")] [RequiredSetting([Apr2025], KeyLocations.Dungeon, KeyLocations.Wild)] [NoSettingName([Apr2025])] @@ -135,6 +145,10 @@ [RequiredSetting([Apr2025], FollowerShuffle.Vanilla)] public FollowerShuffle FollowerShuffle { get; set; } = FollowerShuffle.Vanilla; + [SettingName("damage_challenge")] + [NoSettingName([Apr2025])] + public DamageChallengeMode DamageChallenge { get; set; } = DamageChallengeMode.Normal; + [NoSettingName] public Hints Hints { get; set; } = Hints.Off; } @@ -186,6 +200,24 @@ Random, } + public enum GanonItem { + Silver, + Boomerang, + Hookshot, + Powder, + [SettingName("fire_rod")] FireRod, + [SettingName("ice_rod")] IceRod, + Bombos, + Ether, + Quake, + Hammer, + Bee, + Somaria, + Byrna, + Random, + None, + } + public enum EntranceShuffle { Vanilla, Full, @@ -221,6 +253,11 @@ Mimics, } + public enum DamageTableShuffle { + Vanilla, + Randomized, + } + public enum KeyLocations { [SettingName("none")] Dungeon, [AdditionalSetting([Apr2025], "--keysanity")] Wild, @@ -325,6 +362,12 @@ [AdditionalSetting("--shuffle_followers")] Shuffled, } + public enum DamageChallengeMode { + Normal, + OHKO, + Gloom, + } + public enum Hints { Off, [AdditionalSetting("--hints")] On, diff --git a/ALttPRandomizer/Service/SeedService.cs b/ALttPRandomizer/Service/SeedService.cs index 406a801..7cd32d9 100644 --- a/ALttPRandomizer/Service/SeedService.cs +++ b/ALttPRandomizer/Service/SeedService.cs @@ -1,4 +1,5 @@ namespace ALttPRandomizer.Service { + using global::Azure; using ALttPRandomizer.Azure; using ALttPRandomizer.Model; using Microsoft.Extensions.Logging; @@ -49,6 +50,13 @@ } result["patch"] = Convert.ToBase64String(patchData.ToArray()); + try { + var creationTime = await this.AzureStorage.GetFileCreation($"{seedId}/patch.bps"); + result["created"] = creationTime.ToUnixTimeSeconds(); + } catch (RequestFailedException e) { + this.Logger.LogError(e, "Failed to get creation timestamp for seed {seedId}", seedId); + } + if (files.TryGetValue("meta.json", out var metaData)) { var json = JsonDocument.Parse(metaData.ToString()); result["meta"] = json; diff --git a/BaseRandomizer b/BaseRandomizer index 0427099..94fe047 160000 --- a/BaseRandomizer +++ b/BaseRandomizer @@ -1 +1 @@ -Subproject commit 04270990cbd9f51d8785e6a5d15f32bdeb173b55 +Subproject commit 94fe0475b9746960c35d57747d46b621fdbc25db