From 9da3b02a46dca712fbe116be3bc35d2ad51c4e9c Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Sat, 23 Aug 2025 16:10:57 +0200 Subject: [PATCH] Update resource values and unlock new miracles; refactor tier loading logic --- Mods/Miracles/bountiful_harvest.json | 4 +- Mods/Miracles/divine_frenzy.json | 14 ------ Mods/Miracles/divine_sacrifice.json | 15 ------ Mods/Miracles/purge_sins.json | 15 ------ Mods/Miracles/refined_dogma.json | 14 ------ Mods/Miracles/ritual_of_cleansing.json | 14 ++++++ Mods/Miracles/sustainable_practices.json | 18 +++++++ Mods/Miracles/unlock_advanced_worship.json | 13 ------ Mods/Miracles/unlock_settlement.json | 2 +- Mods/Tiers/Followers/follower_tier_1.png | Bin 0 -> 5669 bytes .../follower_tier_1.png.import} | 8 ++-- Mods/Tiers/follower_tiers.json | 15 ++++-- Mods/Tiers/hut_tier_2.png.import | 34 -------------- Mods/Tiers/hut_tiers.json | 8 ++-- Scripts/Core/MiracleLoader.cs | 31 ++++++++---- Scripts/Core/TierLoader.cs | 34 +++++++++++--- Scripts/Singletons/GameBus.cs | 6 +-- export_presets.cfg | 44 ++++++++++++++++++ 18 files changed, 149 insertions(+), 140 deletions(-) delete mode 100644 Mods/Miracles/divine_frenzy.json delete mode 100644 Mods/Miracles/divine_sacrifice.json delete mode 100644 Mods/Miracles/purge_sins.json delete mode 100644 Mods/Miracles/refined_dogma.json create mode 100644 Mods/Miracles/ritual_of_cleansing.json create mode 100644 Mods/Miracles/sustainable_practices.json delete mode 100644 Mods/Miracles/unlock_advanced_worship.json create mode 100644 Mods/Tiers/Followers/follower_tier_1.png rename Mods/Tiers/{hut_tier_1.png.import => Followers/follower_tier_1.png.import} (66%) delete mode 100644 Mods/Tiers/hut_tier_2.png.import create mode 100644 export_presets.cfg diff --git a/Mods/Miracles/bountiful_harvest.json b/Mods/Miracles/bountiful_harvest.json index 57f4448..b6acc64 100644 --- a/Mods/Miracles/bountiful_harvest.json +++ b/Mods/Miracles/bountiful_harvest.json @@ -7,12 +7,12 @@ { "type": "AddResource", "targetResource": "Followers", - "value": 100 + "value": 10 }, { "type": "AddResource", "targetResource": "Corruption", - "value": 0.02 + "value": 0.5 } ] } diff --git a/Mods/Miracles/divine_frenzy.json b/Mods/Miracles/divine_frenzy.json deleted file mode 100644 index d00b3d4..0000000 --- a/Mods/Miracles/divine_frenzy.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "Divine Frenzy", - "faithCost": 200, - "followersRequired": 50, - "unlockedByDefault": true, - "effects": [ - { - "type": "ApplyBuff", - "targetBuffStat": "FaithPerFollower", - "multiplier": 2.0, - "duration": 30 - } - ] -} diff --git a/Mods/Miracles/divine_sacrifice.json b/Mods/Miracles/divine_sacrifice.json deleted file mode 100644 index 843d41f..0000000 --- a/Mods/Miracles/divine_sacrifice.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "Divine Sacrifice", - "faithCost": 250, - "unlockedByDefault": false, - "followersRequired": 100, - "effects": [ - { - "type": "ConvertResource", - "fromResource": "Followers", - "fromAmount": 50, - "toResource": "Faith", - "toAmount": 1000 - } - ] -} diff --git a/Mods/Miracles/purge_sins.json b/Mods/Miracles/purge_sins.json deleted file mode 100644 index 632907a..0000000 --- a/Mods/Miracles/purge_sins.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "Purge Sins", - "faithCost": 100, - "followersRequired": 20, - "unlockedByDefault": true, - "effects": [ - { - "type": "ConvertResource", - "fromResource": "Followers", - "fromAmount": 20, - "toResource": "Corruption", - "toAmount": -5 - } - ] -} diff --git a/Mods/Miracles/refined_dogma.json b/Mods/Miracles/refined_dogma.json deleted file mode 100644 index a2423a2..0000000 --- a/Mods/Miracles/refined_dogma.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "Refined Dogma", - "faithCost": 1000, - "followersRequired": 250, - "unlockedByDefault": true, - "effects": [ - { - "type": "ModifyStat", - "targetStat": "FaithPerFollower", - "op": "Add", - "value": 0.1 - } - ] -} diff --git a/Mods/Miracles/ritual_of_cleansing.json b/Mods/Miracles/ritual_of_cleansing.json new file mode 100644 index 0000000..fc19203 --- /dev/null +++ b/Mods/Miracles/ritual_of_cleansing.json @@ -0,0 +1,14 @@ +{ + "name": "Ritual of Cleansing", + "faithCost": 1000, + "followersRequired": 200, + "productionRequired": 100, + "unlockedByDefault": false, + "effects": [ + { + "type": "AddResource", + "targetResource": "Corruption", + "value": -10 + } + ] +} diff --git a/Mods/Miracles/sustainable_practices.json b/Mods/Miracles/sustainable_practices.json new file mode 100644 index 0000000..7ab1eb6 --- /dev/null +++ b/Mods/Miracles/sustainable_practices.json @@ -0,0 +1,18 @@ +{ + "name": "Sustainable Practices", + "faithCost": 1200, + "followersRequired": 300, + "productionRequired": 150, + "unlockedByDefault": false, + "effects": [ + { + "type": "ModifyStat", + "targetStat": "CorruptionPerSecond", + "op": "Add", + "value": -0.1 + }, + { + "type": "DestroySelf" + } + ] +} diff --git a/Mods/Miracles/unlock_advanced_worship.json b/Mods/Miracles/unlock_advanced_worship.json deleted file mode 100644 index 0631916..0000000 --- a/Mods/Miracles/unlock_advanced_worship.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "Advanced Worship", - "faithCost": 500, - "unlockedByDefault": true, - "followersRequired": 100, - "effects": [ - { - "type": "UnlockMiracle", - "miraclesToUnlock": [ "divine_sacrifice" ] - }, - { "type": "DestroySelf" } - ] -} diff --git a/Mods/Miracles/unlock_settlement.json b/Mods/Miracles/unlock_settlement.json index 7152950..5f40ec4 100644 --- a/Mods/Miracles/unlock_settlement.json +++ b/Mods/Miracles/unlock_settlement.json @@ -6,7 +6,7 @@ "effects": [ { "type": "UnlockMiracle", - "miraclesToUnlock": [ "erect_shrine", "communal_effort" ] + "miraclesToUnlock": [ "erect_shrine", "communal_effort", "sustainable_practices", "ritual_of_cleansing" ] }, { "type": "DestroySelf" } ], diff --git a/Mods/Tiers/Followers/follower_tier_1.png b/Mods/Tiers/Followers/follower_tier_1.png new file mode 100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>4~2DqcbH%@HkNyJC-#sko~&N)N83 z&p|uWUPXnu2=Z3OBd@y{BKLcYGP;pX&m4h6x8ulU;g#;GgM9MYwKp>#9PBH1dp|(A z8EOvf_X?^;12-;itW)rk�SI|7v@NFH=T}J|uZhdZUKw#6L>|yP_d49xsVY{#ZiJ zI_BB9CvND7*lqE+fyI5yQ&^e6u+5fy ztfVME LoadMiraclesFromDirectory(string path) + + public static System.Collections.Generic.Dictionary LoadAllMiracles() { var loadedMiracles = new System.Collections.Generic.Dictionary(); - using var dir = DirAccess.Open(path); - if (dir == null) return loadedMiracles; + + LoadMiraclesFromPath("res://Mods/Miracles", loadedMiracles); + LoadMiraclesFromPath("user://Mods/Miracles", loadedMiracles); + GD.Print($"Finished loading. Total unique miracles: {loadedMiracles.Count}"); + return loadedMiracles; + } + + private static void LoadMiraclesFromPath(string path, System.Collections.Generic.Dictionary miracles) + { + if (!DirAccess.DirExistsAbsolute(path)) + { + GD.Print($"Mod directory not found, skipping: {path}"); + return; + } + + using var dir = DirAccess.Open(path); dir.ListDirBegin(); var fileName = dir.GetNext(); while (!string.IsNullOrEmpty(fileName)) @@ -33,17 +46,15 @@ public static class MiracleLoader { var filePath = path.PathJoin(fileName); var fileNameNoExt = fileName.GetBaseName(); - var miracle = LoadMiracleFromFile(filePath, fileNameNoExt); // Pass the ID + var miracle = LoadMiracleFromFile(filePath, fileNameNoExt); if (miracle != null) { - loadedMiracles.Add(fileNameNoExt, miracle); + // Add or overwrite the miracle in the dictionary. + miracles[fileNameNoExt] = miracle; } } fileName = dir.GetNext(); } - - GD.Print($"Loaded {loadedMiracles.Count} miracles from {path}"); - return loadedMiracles; } private static MiracleDefinition LoadMiracleFromFile(string filePath, string miracleId) diff --git a/Scripts/Core/TierLoader.cs b/Scripts/Core/TierLoader.cs index 4f3e89d..b134f1b 100644 --- a/Scripts/Core/TierLoader.cs +++ b/Scripts/Core/TierLoader.cs @@ -7,7 +7,21 @@ namespace ParasiticGod.Scripts.Core; public static class TierLoader { - public static List LoadTiersFromFile(string filePath) + public static List LoadTiers(string baseFilePath, string userFilePath) + { + // Prioritize the user's file. If it exists, load it. + if (FileAccess.FileExists(userFilePath)) + { + GD.Print($"Loading user tier file: {userFilePath}"); + return LoadTierListFromFile(userFilePath); + } + + // Otherwise, fall back to the base game's file. + GD.Print($"Loading base tier file: {baseFilePath}"); + return LoadTierListFromFile(baseFilePath); + } + + private static List LoadTierListFromFile(string filePath) { var loadedTiers = new List(); @@ -27,17 +41,25 @@ public static class TierLoader foreach (var dto in tierListDto.Tiers) { - var image = Image.LoadFromFile(dto.ImagePath); - if (image == null) + Texture2D texture = null; + if (dto.ImagePath.StartsWith("res://")) { - GD.PushError($"Failed to load image at path: {dto.ImagePath}"); - continue; + texture = GD.Load(dto.ImagePath); } + else if (dto.ImagePath.StartsWith("user://")) + { + var image = Image.LoadFromFile(dto.ImagePath); + if (image != null) + { + texture = ImageTexture.CreateFromImage(image); + } + } + var tierDef = new TierDefinition { Threshold = dto.Threshold, TierEnum = dto.TierEnum, - Texture = ImageTexture.CreateFromImage(image), + Texture = texture, Scale = new Vector2(dto.Scale.X, dto.Scale.Y) }; loadedTiers.Add(tierDef); diff --git a/Scripts/Singletons/GameBus.cs b/Scripts/Singletons/GameBus.cs index f2772c7..0dcd4d4 100644 --- a/Scripts/Singletons/GameBus.cs +++ b/Scripts/Singletons/GameBus.cs @@ -28,9 +28,9 @@ public partial class GameBus : Node public override void _EnterTree() { Instance = this; - AllMiracles = MiracleLoader.LoadMiraclesFromDirectory("user://Mods/Miracles"); - FollowerTiers = TierLoader.LoadTiersFromFile("user://Mods/Tiers/follower_tiers.json"); - HutTiers = TierLoader.LoadTiersFromFile("user://Mods/Tiers/hut_tiers.json"); + AllMiracles = MiracleLoader.LoadAllMiracles(); + FollowerTiers = TierLoader.LoadTiers("res://Mods/Tiers/follower_tiers.json", "user://Mods/Tiers/follower_tiers.json"); + HutTiers = TierLoader.LoadTiers("res://Mods/Tiers/hut_tiers.json","user://Mods/Tiers/hut_tiers.json"); } public override void _ExitTree() diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..a9d1376 --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,44 @@ +[preset.0] + +name="Linux" +platform="Linux" +runnable=true +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="Builds/parasitic-god.x86_64" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=0 +binary_format/embed_pck=true +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false +binary_format/architecture="x86_64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" +dotnet/include_scripts_content=false +dotnet/include_debug_symbols=false +dotnet/embed_build_outputs=false