From 170a6e856cd8a186fd3499d6bdce89d1cd71741f Mon Sep 17 00:00:00 2001 From: JeffGainsNGames Date: Tue, 10 Oct 2023 08:28:36 -0400 Subject: [PATCH] YAMS: Flightlight/Blindfold update (#98) * YAMS: Flightlight/Blindfold update - Added: Blindfold to darken rooms - TODO: better flashlight sprites * Simplify and revert flashlightLevel * Remove unnecessary brackets and fix flashlightLevel starting quantity with Blindfolds --- YAMS-LIB/Program.cs | 20 +++- YAMS-LIB/SeedObject.cs | 102 +++++++++--------- .../items/blindfold/sItemBlindfold_1.png | Bin 0 -> 242 bytes .../items/blindfold/sItemBlindfold_2.png | Bin 0 -> 242 bytes .../items/blindfold/sItemBlindfold_3.png | Bin 0 -> 242 bytes .../items/flashlight/sItemFlashlight_1.png | Bin 212 -> 204 bytes .../items/flashlight/sItemFlashlight_2.png | Bin 210 -> 230 bytes 7 files changed, 71 insertions(+), 51 deletions(-) create mode 100644 YAMS-LIB/sprites/items/blindfold/sItemBlindfold_1.png create mode 100644 YAMS-LIB/sprites/items/blindfold/sItemBlindfold_2.png create mode 100644 YAMS-LIB/sprites/items/blindfold/sItemBlindfold_3.png diff --git a/YAMS-LIB/Program.cs b/YAMS-LIB/Program.cs index 9612944..1fe3777 100644 --- a/YAMS-LIB/Program.cs +++ b/YAMS-LIB/Program.cs @@ -362,6 +362,20 @@ void AddAllSpritesFromDir(string dirPath) { new UndertaleSprite.TextureEntry() {Texture = gmData.TexturePageItems[nameToPageItemDict["sItemFlashlight_1"]] }, new UndertaleSprite.TextureEntry() {Texture = gmData.TexturePageItems[nameToPageItemDict["sItemFlashlight_2"]] }, + new UndertaleSprite.TextureEntry() {Texture = gmData.TexturePageItems[nameToPageItemDict["sItemFlashlight_1"]] }, + new UndertaleSprite.TextureEntry() {Texture = gmData.TexturePageItems[nameToPageItemDict["sItemFlashlight_2"]] }, + new UndertaleSprite.TextureEntry() {Texture = gmData.TexturePageItems[nameToPageItemDict["sItemFlashlight_1"]] }, + } + }); + gmData.Sprites.Add(new UndertaleSprite() + { + Name = gmData.Strings.MakeString("sItemBlindfold"), Height = 16, Width = 16, MarginRight = 15, MarginBottom = 15, OriginX = 0, OriginY = 16, + Textures = + { + new UndertaleSprite.TextureEntry() {Texture = gmData.TexturePageItems[nameToPageItemDict["sItemBlindfold_1"]] }, + new UndertaleSprite.TextureEntry() {Texture = gmData.TexturePageItems[nameToPageItemDict["sItemBlindfold_2"]] }, + new UndertaleSprite.TextureEntry() {Texture = gmData.TexturePageItems[nameToPageItemDict["sItemBlindfold_3"]] }, + new UndertaleSprite.TextureEntry() {Texture = gmData.TexturePageItems[nameToPageItemDict["sItemBlindfold_2"]] }, } }); @@ -2038,7 +2052,7 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te ds_list_add(list, global.speedBoosterFramesReduction) comment = "gives me some leeway in case i need to add more" - repeat (14) + repeat (16) { ds_list_add(list, 0) i += 1 @@ -2282,6 +2296,9 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te case ItemEnum.Flashlight: ReplaceGMLInCode(characterVarsCode, "global.flashlightLevel = 0", $"global.flashlightLevel = {quantity};"); break; + case ItemEnum.Blindfold: + ReplaceGMLInCode(characterVarsCode, "global.flashlightLevel = 0", $"global.flashlightLevel = -{quantity};"); + break; case ItemEnum.SpeedBoosterUpgrade: ReplaceGMLInCode(characterVarsCode, "global.speedBoosterFramesReduction = 0", $"global.speedBoosterFramesReduction = {quantity}"); break; @@ -2624,6 +2641,7 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te ItemEnum.SuperMissileDrop => $"event_inherited(); if (active) {{ global.smissiles += {pickup.Quantity}; if (global.smissiles > global.maxsmissiles) global.smissiles = global.maxsmissiles }}", ItemEnum.PBombDrop => $"event_inherited(); if (active) {{ global.pbombs += {pickup.Quantity}; if (global.pbombs > global.maxpbombs) global.pbombs = global.maxpbombs }}", ItemEnum.Flashlight => $"event_inherited(); if (active) {{ global.flashlightLevel += {pickup.Quantity}; with (oLightEngine) instance_destroy(); with (oFlashlight64) instance_destroy(); ApplyLightPreset() }}", + ItemEnum.Blindfold => $"event_inherited(); if (active) {{ global.flashlightLevel -= {pickup.Quantity}; with (oLightEngine) instance_destroy(); with (oFlashlight64) instance_destroy(); ApplyLightPreset() }}", ItemEnum.SpeedBoosterUpgrade => $"event_inherited(); if (active) {{ global.speedBoosterFramesReduction += {pickup.Quantity}; }}", ItemEnum.Nothing => "event_inherited();", _ => throw new NotSupportedException("Unsupported item! " + pickup.ItemEffect) diff --git a/YAMS-LIB/SeedObject.cs b/YAMS-LIB/SeedObject.cs index 1937654..4a24afb 100644 --- a/YAMS-LIB/SeedObject.cs +++ b/YAMS-LIB/SeedObject.cs @@ -11,22 +11,22 @@ public class SeedObject [JsonInclude] [JsonPropertyName("configuration_identifier")] public ConfigurationIdentifier Identifier; - + [JsonInclude] [JsonPropertyName("game_patches")] public GamePatches Patches; [JsonInclude] [JsonPropertyName("door_locks")] public Dictionary DoorLocks; - + [JsonInclude] [JsonPropertyName("pickups")] public Dictionary PickupObjects = new Dictionary(); - + [JsonInclude] [JsonPropertyName("rooms")] public Dictionary RoomObjects = new Dictionary(); - + [JsonInclude] [JsonPropertyName("pipes")] public Dictionary PipeObjects = new Dictionary(); @@ -38,11 +38,11 @@ [JsonInclude] [JsonPropertyName("door_locks")] [JsonInclude] [JsonPropertyName("starting_location")] public StartingLocationObject StartingLocation; - + [JsonInclude] [JsonPropertyName("hints")] public Dictionary Hints = new Dictionary(); - + [JsonInclude] [JsonPropertyName("cosmetics")] public GameCosmetics Cosmetics; @@ -163,27 +163,27 @@ public class GameCosmetics [JsonInclude] [JsonPropertyName("show_unexplored_map")] public bool ShowUnexploredMap; - + [JsonInclude] [JsonPropertyName("unveiled_blocks")] public bool UnveilBlocks; - + [JsonInclude] [JsonPropertyName("health_hud_rotation")] public int HealthHUDRotation; - + [JsonInclude] [JsonPropertyName("etank_hud_rotation")] public int EtankHUDRotation; - + [JsonInclude] [JsonPropertyName("dna_hud_rotation")] public int DNAHUDRotation; - + [JsonInclude] [JsonPropertyName("room_names_on_hud")] public RoomNameHudEnum RoomNameHud; - + [JsonInclude] [JsonPropertyName("music_shuffle")] public Dictionary MusicShuffleDict = new Dictionary(); @@ -194,82 +194,82 @@ public class GamePatches [JsonInclude] [JsonPropertyName("septogg_helpers")] public bool SeptoggHelpers; - + [JsonInclude] [JsonPropertyName("change_level_design")] public bool ChangeLevelDesign; [JsonInclude] [JsonPropertyName("grave_grotto_blocks")] public bool GraveGrottoBlocks; - + [JsonInclude] [JsonPropertyName("respawn_bomb_blocks")] public bool RespawnBombBlocks; - + [JsonInclude] [JsonPropertyName("skip_cutscenes")] public bool SkipCutscenes; - + [JsonInclude] [JsonPropertyName("skip_save_cutscene")] public bool SkipSaveCutscene; - + [JsonInclude] [JsonPropertyName("skip_item_cutscenes")] public bool SkipItemFanfares; - + [JsonInclude] [JsonPropertyName("energy_per_tank")] public int EnergyPerTank; - + [JsonInclude] [JsonPropertyName("require_missile_launcher")] public bool RequireMissileLauncher; - + [JsonInclude] [JsonPropertyName("require_super_launcher")] public bool RequireSuperLauncher; - + [JsonInclude] [JsonPropertyName("require_pb_launcher")] public bool RequirePBLauncher; - + [JsonInclude] [JsonPropertyName("fusion_mode")] public bool FusionMode; - [JsonInclude] + [JsonInclude] [JsonPropertyName("supers_on_missile_doors")] public bool CanUseSupersOnMissileDoors = true; - + [JsonInclude] [JsonPropertyName("nest_pipes")] public bool NestPipes; - + [JsonInclude] [JsonPropertyName("softlock_prevention_blocks")] public bool SoftlockPrevention; - + [JsonInclude] [JsonPropertyName("a3_entrance_blocks")] public bool A3EntranceBlocks; - + [JsonInclude] [JsonPropertyName("screw_blocks")] public bool ScrewPipeBlocks; - + [JsonInclude] [JsonPropertyName("sabre_designed_skippy")] public bool SabreSkippy; - + [JsonInclude] [JsonPropertyName("locked_missile_text")] public TextDetails LockedMissileText; - + [JsonInclude] [JsonPropertyName("locked_super_text")] public TextDetails LockedSuperText; - + [JsonInclude] [JsonPropertyName("locked_pb_text")] public TextDetails LockedPBombText; @@ -280,15 +280,15 @@ public class ConfigurationIdentifier [JsonInclude] [JsonPropertyName("hash")] public string Hash = "Quack"; - + [JsonInclude] [JsonPropertyName("word_hash")] public string WordHash = "Have fun"; - + [JsonInclude] [JsonPropertyName("randovania_version")] public string RDVVersion = "Randovania"; - + [JsonInclude] [JsonPropertyName("patcher_version")] public string PatcherVersion = "YAMS"; @@ -398,7 +398,7 @@ public enum ItemEnum DNA45, [EnumMember(Value = "Metroid DNA 46")] DNA46, - + [EnumMember(Value = "Missile Expansion")] MissileExpansion, [EnumMember(Value = "Super Missile Expansion")] @@ -407,7 +407,7 @@ public enum ItemEnum PBombExpansion, [EnumMember(Value = "Energy Tank")] EnergyTank, - + [EnumMember(Value = "Missiles")] Missile, [EnumMember(Value = "Locked Missiles")] @@ -420,14 +420,14 @@ public enum ItemEnum PBomb, [EnumMember(Value = "Locked Power Bombs")] LockedPBomb, - + [EnumMember(Value = "Missile Launcher")] MissileLauncher, [EnumMember(Value = "Super Missile Launcher")] SuperMissileLauncher, [EnumMember(Value = "Power Bomb Launcher")] PBombLauncher, - + [EnumMember(Value = "Bombs")] Bombs, [EnumMember(Value = "Power Grip")] @@ -480,6 +480,8 @@ public enum ItemEnum PBombDrop, [EnumMember(Value = "Flashlight")] Flashlight, + [EnumMember(Value = "Blindfold")] + Blindfold, [EnumMember(Value = "Speed Booster Upgrade")] SpeedBoosterUpgrade, } @@ -499,7 +501,7 @@ public class PickupObject [JsonPropertyName("quantity")] public int Quantity; - [JsonInclude] + [JsonInclude] [JsonPropertyName("text")] public TextDetails Text; @@ -517,11 +519,11 @@ public class SpriteDetails public class TextDetails { - [JsonInclude] + [JsonInclude] [JsonPropertyName("header")] public string Header = "INVALID TEXT"; - - [JsonInclude] + + [JsonInclude] [JsonPropertyName("description")] public string Description = "INVALID DESCRIPTION"; } @@ -531,11 +533,11 @@ public class RoomObject [JsonInclude] [JsonPropertyName("display_name")] public string DisplayName = ""; - + [JsonInclude] [JsonPropertyName("region_name")] public string RegionName = ""; - + [JsonInclude] [JsonPropertyName("minimap_data")] public List MinimapData = new List(); @@ -543,26 +545,26 @@ public class RoomObject public class PipeObject { - [JsonInclude] + [JsonInclude] [JsonPropertyName("dest_x")] public int XPosition; - [JsonInclude] + [JsonInclude] [JsonPropertyName("dest_y")] public int YPosition; - - [JsonInclude] + + [JsonInclude] [JsonPropertyName("dest_room")] public string Room = ""; } public struct Coordinate { - [JsonInclude] + [JsonInclude] [JsonPropertyName("x")] public int X; - [JsonInclude] + [JsonInclude] [JsonPropertyName("y")] public int Y; } diff --git a/YAMS-LIB/sprites/items/blindfold/sItemBlindfold_1.png b/YAMS-LIB/sprites/items/blindfold/sItemBlindfold_1.png new file mode 100644 index 0000000000000000000000000000000000000000..092931a7c886ab8f44477ce9af89160a4013c0ba GIT binary patch literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|>0G|+7ApQUU|AvMJAfxL_Y88-TDGBlm1`0AbXs!GL4nJ@ErzW z#^d=bQhZ?`ev~xAcUj&Ni9eg2P`{82vU}^4^W-`8D%ZO{aZ>JzYKWY!WVr6hwBv`6TYK>&|no b(|7qV-)5}7z3xXE&?*K`S3j3^P6@Vl literal 0 HcmV?d00001 diff --git a/YAMS-LIB/sprites/items/blindfold/sItemBlindfold_2.png b/YAMS-LIB/sprites/items/blindfold/sItemBlindfold_2.png new file mode 100644 index 0000000000000000000000000000000000000000..48fcb73e39d6677510679c6243a936894ed2f6de GIT binary patch literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|>0G|+7V`Jn0|NqaNITI+bUtC)jq^=~$FBmAu;Gnhg3y{xQ;1OBOz`%DH zgc*NS%G|>0G|-ow6wJU|Nn2^ycsC4{!+>jkh+o}zhIysgM-$}FF-zLfk$L90|Vb- z5N14{zaj-F81L!g7@`sE+Q-S);K0LF{pbIAqYGf7snqyepB@O1TaS?83{1OOb8R+|6- literal 0 HcmV?d00001 diff --git a/YAMS-LIB/sprites/items/flashlight/sItemFlashlight_1.png b/YAMS-LIB/sprites/items/flashlight/sItemFlashlight_1.png index 402ff0b8b64485c880100e9e9b7d86cb00854072..d75f71dec7b95058d142dfcdfbf06d5e1e0f13b7 100644 GIT binary patch delta 125 zcmV-@0D}M20n7oAR(4@YL_t(IPh%Jbv<3g67%yOg(pW)5Lj#DyYY1KgK!A`TxD5Eu zp!Of88LuIXP#PJ4HN(Lz6eZZyqX3X*kZuG`0w7B>%t_dsP0+a@08&J@W)MJ)1rjwQ f1ET$m3K$pwd@3i8{qp>Q00000NkvXXu0mjfznU)I delta 133 zcmV;00DAw-0n`DIR(@$oL_t(IPvwxo4Zt7>MX>{PCPrtbE}(*t7)=m*>7noP;qdTB z_z6#is-v*(M`j@{GbX)~JFZ+bJxna~k-H4nJ%ETJ5RvSi$b$ows~t&^k=IHr=_u8Y nl`qYWh|FvaG@1B^eF#7UTPH2irm;%z00000NkvXXu0mjfnQ%IZ diff --git a/YAMS-LIB/sprites/items/flashlight/sItemFlashlight_2.png b/YAMS-LIB/sprites/items/flashlight/sItemFlashlight_2.png index 30ad63781b91b56a78f609bd2c62e34ef8fe4b44..bd31fd89ceb847fffe2f25d5b02ba2637a8e6f02 100644 GIT binary patch delta 185 zcmcb__>6IaBnLAC1A~SxfAB;_g?ga?pAgsI|BZkAHwJ>4GiMqH{s&6WF^eq(Qfwtb ze!>4ifMN6gCHsLQoCO|{#S9F5hd`K7RKu$QDCq6!;uxY49DBx*i9wNr=|Iuf|M7hy zr>0HzdB)*(nAMLr%f>*nyxGZMGKbwsM$g8|Q+`c5cR%c5c&`@6%V;Az;djo7A75MU deV=|$Sxk(Ng>^y3mjs}>44$rjF6*2UngC-*LmmJC delta 165 zcmV;W09ya%0n!1G83+ad001BJ|6!3KAb$yPNLh0L01m?d01m?e$8V@)0001INkl@EF_(cknT=jmo?q8HKbgxb#bIY~^CP z!^JWlc}sV<2M|#OBGSDPd9Y(L`;inGd9EaqjavO!`LSGx$imXVQiy-p%>Y#WoDwb3 T_HDdG00000NkvXXu0mjfc|$~5