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 100644 index 0000000..f5912bc Binary files /dev/null and b/Mods/Tiers/Followers/follower_tier_1.png differ diff --git a/Mods/Tiers/hut_tier_1.png.import b/Mods/Tiers/Followers/follower_tier_1.png.import similarity index 66% rename from Mods/Tiers/hut_tier_1.png.import rename to Mods/Tiers/Followers/follower_tier_1.png.import index 4b544b3..e566e64 100644 --- a/Mods/Tiers/hut_tier_1.png.import +++ b/Mods/Tiers/Followers/follower_tier_1.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bxlaf72h3pftt" -path="res://.godot/imported/hut_tier_1.png-4ce775c649cfe5f92a10187bc1930a9b.ctex" +uid="uid://2wsb1jsmtifq" +path="res://.godot/imported/follower_tier_1.png-d66a290ad46b1bb9ea69b54444ab5725.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://Mods/Tiers/hut_tier_1.png" -dest_files=["res://.godot/imported/hut_tier_1.png-4ce775c649cfe5f92a10187bc1930a9b.ctex"] +source_file="res://Mods/Tiers/Followers/follower_tier_1.png" +dest_files=["res://.godot/imported/follower_tier_1.png-d66a290ad46b1bb9ea69b54444ab5725.ctex"] [params] diff --git a/Mods/Tiers/follower_tiers.json b/Mods/Tiers/follower_tiers.json index af40d82..857ec59 100644 --- a/Mods/Tiers/follower_tiers.json +++ b/Mods/Tiers/follower_tiers.json @@ -3,27 +3,32 @@ { "tierEnum": "Tier1", "threshold": 0, - "scenePath": "res://Scenes/Followers/followers_tier_1.tscn" + "imagePath": "res://Sprites/Follower.png", + "scale": {"x": 0.1, "y": 0.1} }, { "tierEnum": "Tier2", "threshold": 200, - "scenePath": "res://Scenes/Followers/followers_tier_2.tscn" + "imagePath": "res://Sprites/Follower.png", + "scale": {"x": 0.1, "y": 0.1} }, { "tierEnum": "Tier3", "threshold": 500, - "scenePath": "res://Scenes/Followers/followers_tier_3.tscn" + "imagePath": "res://Sprites/Follower.png", + "scale": {"x": 0.1, "y": 0.1} }, { "tierEnum": "Tier4", "threshold": 1000, - "scenePath": "res://Scenes/Followers/followers_tier_4.tscn" + "imagePath": "res://Sprites/Follower.png", + "scale": {"x": 0.1, "y": 0.1} }, { "tierEnum": "Tier5", "threshold": 2500, - "scenePath": "res://Scenes/Followers/followers_tier_5.tscn" + "imagePath": "res://Sprites/Follower.png", + "scale": {"x": 0.1, "y": 0.1} } ] } diff --git a/Mods/Tiers/hut_tier_2.png.import b/Mods/Tiers/hut_tier_2.png.import deleted file mode 100644 index 645a95b..0000000 --- a/Mods/Tiers/hut_tier_2.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://cj7bgonxgavdf" -path="res://.godot/imported/hut_tier_2.png-70fb7df6fa976626a267fd1e203d6a0e.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://Mods/Tiers/hut_tier_2.png" -dest_files=["res://.godot/imported/hut_tier_2.png-70fb7df6fa976626a267fd1e203d6a0e.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/Mods/Tiers/hut_tiers.json b/Mods/Tiers/hut_tiers.json index cf44e07..994a584 100644 --- a/Mods/Tiers/hut_tiers.json +++ b/Mods/Tiers/hut_tiers.json @@ -3,14 +3,14 @@ { "tierEnum": "Tier1", "threshold": 150, - "imagePath": "user://Mods/Tiers/Huts/hut_tier_1.png", - "scale": {"x": 0.01, "y": 0.01} + "imagePath": "res://Mods/Tiers/Huts/hut_tier_1.png", + "scale": {"x": 0.05, "y": 0.05} }, { "tierEnum": "Tier2", "threshold": 750, - "imagePath": "user://Mods/Tiers/Huts/hut_tier_2.png", - "scale": {"x": 0.01, "y": 0.01} + "imagePath": "res://Mods/Tiers/Huts/hut_tier_2.png", + "scale": {"x": 0.05, "y": 0.05} } ] } diff --git a/Scripts/Core/MiracleLoader.cs b/Scripts/Core/MiracleLoader.cs index f7ed72c..9579fba 100644 --- a/Scripts/Core/MiracleLoader.cs +++ b/Scripts/Core/MiracleLoader.cs @@ -1,5 +1,4 @@ using System; -using System.Text.Json; using Godot; using Godot.Collections; using Newtonsoft.Json; @@ -18,13 +17,27 @@ public static class MiracleLoader { "UnlockMiracle", typeof(UnlockMiracleEffect) }, { "DestroySelf", typeof(DestroySelfEffect) } }; - - public static System.Collections.Generic.Dictionary 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