diff --git a/Resources/Effects/Add_1000_Followers.tres b/Resources/Effects/Add_1000_Followers.tres deleted file mode 100644 index b132a13..0000000 --- a/Resources/Effects/Add_1000_Followers.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="Resource" script_class="AddResourceEffect" load_steps=2 format=3 uid="uid://bs5iwc5lsdu0r"] - -[ext_resource type="Script" uid="uid://flyhl4i86han" path="res://Scripts/Core/Effects/AddResourceEffect.cs" id="1_2o4it"] - -[resource] -script = ExtResource("1_2o4it") -TargetResource = 1 -Value = 10000.0 -metadata/_custom_type_script = "uid://flyhl4i86han" diff --git a/Resources/Effects/Add_10_Followers.tres b/Resources/Effects/Add_10_Followers.tres deleted file mode 100644 index 059db1d..0000000 --- a/Resources/Effects/Add_10_Followers.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="Resource" script_class="AddResourceEffect" load_steps=2 format=3 uid="uid://dxiaxhggfqcyb"] - -[ext_resource type="Script" uid="uid://flyhl4i86han" path="res://Scripts/Core/Effects/AddResourceEffect.cs" id="1_2xs1x"] - -[resource] -script = ExtResource("1_2xs1x") -TargetResource = 1 -Value = 100.0 -metadata/_custom_type_script = "uid://flyhl4i86han" diff --git a/Resources/Effects/Add_5_Corruption.tres b/Resources/Effects/Add_5_Corruption.tres deleted file mode 100644 index 39d0d47..0000000 --- a/Resources/Effects/Add_5_Corruption.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="Resource" script_class="AddResourceEffect" load_steps=2 format=3 uid="uid://dd17hc8jju5ek"] - -[ext_resource type="Script" uid="uid://flyhl4i86han" path="res://Scripts/Core/Effects/AddResourceEffect.cs" id="1_pce0a"] - -[resource] -script = ExtResource("1_pce0a") -TargetResource = 2 -Value = 5.0 -metadata/_custom_type_script = "uid://flyhl4i86han" diff --git a/Resources/Miracles/Fertility Blessing.tres b/Resources/Miracles/Fertility Blessing.tres deleted file mode 100644 index d609c95..0000000 --- a/Resources/Miracles/Fertility Blessing.tres +++ /dev/null @@ -1,13 +0,0 @@ -[gd_resource type="Resource" script_class="MiracleDefinition" load_steps=4 format=3 uid="uid://df3cq0eb82x0i"] - -[ext_resource type="Resource" uid="uid://dd17hc8jju5ek" path="res://Resources/Effects/Add_5_Corruption.tres" id="1_jmmaa"] -[ext_resource type="Script" uid="uid://cfn3mx12xism5" path="res://Scripts/Core/MiracleDefinition.cs" id="1_oh2pa"] -[ext_resource type="Resource" uid="uid://dxiaxhggfqcyb" path="res://Resources/Effects/Add_10_Followers.tres" id="2_lg4lk"] - -[resource] -script = ExtResource("1_oh2pa") -Name = "Fertility Blessing" -FaithCost = 100.0 -FollowersRequired = 0 -Effects = Array[Resource]([ExtResource("2_lg4lk"), ExtResource("1_jmmaa")]) -metadata/_custom_type_script = "uid://cfn3mx12xism5" diff --git a/Resources/Miracles/God power.tres b/Resources/Miracles/God power.tres deleted file mode 100644 index 8a4f919..0000000 --- a/Resources/Miracles/God power.tres +++ /dev/null @@ -1,12 +0,0 @@ -[gd_resource type="Resource" script_class="MiracleDefinition" load_steps=3 format=3 uid="uid://ckdc32ptfjhx6"] - -[ext_resource type="Resource" uid="uid://bs5iwc5lsdu0r" path="res://Resources/Effects/Add_1000_Followers.tres" id="1_bkpio"] -[ext_resource type="Script" uid="uid://cfn3mx12xism5" path="res://Scripts/Core/MiracleDefinition.cs" id="3_oqu5j"] - -[resource] -script = ExtResource("3_oqu5j") -Name = "GOD POWER" -FaithCost = 1.0 -FollowersRequired = 0 -Effects = Array[Resource]([ExtResource("1_bkpio")]) -metadata/_custom_type_script = "uid://cfn3mx12xism5" diff --git a/Scenes/Main/Main.tscn b/Scenes/Main/Main.tscn index dfe8192..6718bd2 100644 --- a/Scenes/Main/Main.tscn +++ b/Scenes/Main/Main.tscn @@ -1,13 +1,15 @@ -[gd_scene load_steps=23 format=3 uid="uid://bfil8sd154327"] +[gd_scene load_steps=25 format=3 uid="uid://bfil8sd154327"] [ext_resource type="Script" uid="uid://t71ewkpa5uqs" path="res://Scenes/Main/Main.cs" id="1_p8rbg"] [ext_resource type="Script" uid="uid://b77vh831r1e3c" path="res://Scenes/Main/MiraclePanel.cs" id="2_hcu3t"] -[ext_resource type="PackedScene" uid="uid://rj1fsdlhju5y" path="res://Scenes/Main/miracle_button.tscn" id="3_qdkat"] +[ext_resource type="PackedScene" uid="uid://rj1fsdlhju5y" path="res://Scenes/UI/miracle_button.tscn" id="3_qdkat"] [ext_resource type="Texture2D" uid="uid://dg6ac3jb1366r" path="res://Sprites/globe.svg" id="4_i3fi7"] -[ext_resource type="Script" uid="uid://ddshg236tlltt" path="res://Scripts/ActiveBuffsManager.cs" id="4_xggvw"] -[ext_resource type="PackedScene" uid="uid://b417dl07c13uc" path="res://Scenes/Main/buff_button.tscn" id="5_xd21n"] +[ext_resource type="Script" uid="uid://ddshg236tlltt" path="res://Scripts/Components/ActiveBuffsManager.cs" id="4_xggvw"] +[ext_resource type="PackedScene" uid="uid://b417dl07c13uc" path="res://Scenes/UI/buff_button.tscn" id="5_xd21n"] [ext_resource type="PackedScene" uid="uid://be5d0d3aweg0l" path="res://Scenes/Huts/HutMarker.tscn" id="6_cv8e0"] -[ext_resource type="Script" uid="uid://dj2wyrq07gfp2" path="res://Scripts/PopulationVisualizer.cs" id="8_cv8e0"] +[ext_resource type="Script" uid="uid://c6uh5h3sdlg7n" path="res://Scripts/Components/NotificationManager.cs" id="6_iwp64"] +[ext_resource type="PackedScene" uid="uid://crpf0llofg0sc" path="res://Scenes/UI/notification_label.tscn" id="7_4etfk"] +[ext_resource type="Script" uid="uid://dj2wyrq07gfp2" path="res://Scripts/Components/PopulationVisualizer.cs" id="8_cv8e0"] [ext_resource type="PackedScene" uid="uid://8w7tvsgkev1y" path="res://Scenes/tree.tscn" id="8_hcu3t"] [ext_resource type="Resource" uid="uid://8ooxfo2wdbhu" path="res://Resources/Tiers/Followers/follower_tier_1.tres" id="9_hkvnm"] [ext_resource type="Shader" uid="uid://bf8nk145fjkgh" path="res://Shaders/corruption_shader.gdshader" id="9_wgovn"] @@ -19,8 +21,8 @@ [ext_resource type="Resource" uid="uid://bbkbssvptkyvh" path="res://Resources/Tiers/Huts/hut_tier_1.tres" id="14_18xdc"] [ext_resource type="Resource" uid="uid://co2sdpwpajjqi" path="res://Resources/Tiers/Huts/hut_tier_2.tres" id="15_epx8f"] [ext_resource type="Resource" uid="uid://b8k30qsd434dp" path="res://Resources/Tiers/Huts/hut_tier_3.tres" id="16_hcu3t"] -[ext_resource type="Script" uid="uid://furbvcmw31bx" path="res://Scripts/ForestVisualizer.cs" id="18_qdkat"] -[ext_resource type="Script" uid="uid://cw8gpeaq3yfjn" path="res://Scripts/RoadManager.cs" id="19_qdkat"] +[ext_resource type="Script" uid="uid://furbvcmw31bx" path="res://Scripts/Components/ForestVisualizer.cs" id="18_qdkat"] +[ext_resource type="Script" uid="uid://cw8gpeaq3yfjn" path="res://Scripts/Components/RoadManager.cs" id="19_qdkat"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_cv8e0"] shader = ExtResource("9_wgovn") @@ -117,6 +119,11 @@ size_flags_vertical = 3 script = ExtResource("4_xggvw") _activeBuffScene = ExtResource("5_xd21n") +[node name="Notification Layer" type="CanvasLayer" parent="."] +layer = 3 +script = ExtResource("6_iwp64") +_notificationLabelScene = ExtResource("7_4etfk") + [node name="Camera2D" type="Camera2D" parent="."] [node name="World Sprite" type="Sprite2D" parent="."] @@ -5534,6 +5541,7 @@ position = Vector2(243.12, -124.88) [node name="FollowerPopulationVisualizer" type="Node" parent="." node_paths=PackedStringArray("_markersContainer")] script = ExtResource("8_cv8e0") _markersContainer = NodePath("../Followers Markers") +_unitsPerMarker = 1 _tiers = Array[Object]([ExtResource("9_hkvnm"), ExtResource("10_5ci8a"), ExtResource("11_18xdc"), ExtResource("12_epx8f"), ExtResource("13_hcu3t")]) metadata/_custom_type_script = "uid://dj2wyrq07gfp2" diff --git a/Scenes/Main/buff_button.tscn b/Scenes/UI/buff_button.tscn similarity index 100% rename from Scenes/Main/buff_button.tscn rename to Scenes/UI/buff_button.tscn diff --git a/Scenes/Main/miracle_button.tscn b/Scenes/UI/miracle_button.tscn similarity index 100% rename from Scenes/Main/miracle_button.tscn rename to Scenes/UI/miracle_button.tscn diff --git a/Scenes/UI/notification_label.tscn b/Scenes/UI/notification_label.tscn new file mode 100644 index 0000000..50680da --- /dev/null +++ b/Scenes/UI/notification_label.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://crpf0llofg0sc"] + +[ext_resource type="Script" uid="uid://drx8lqcjq5khj" path="res://Scripts/NotificationLabel.cs" id="1_x4sn4"] + +[node name="NotificationLabel" type="Label"] +offset_right = 40.0 +offset_bottom = 23.0 +horizontal_alignment = 1 +vertical_alignment = 1 +script = ExtResource("1_x4sn4") diff --git a/Scripts/ActiveBuffsManager.cs b/Scripts/Components/ActiveBuffsManager.cs similarity index 94% rename from Scripts/ActiveBuffsManager.cs rename to Scripts/Components/ActiveBuffsManager.cs index bce1eb8..805ad34 100644 --- a/Scripts/ActiveBuffsManager.cs +++ b/Scripts/Components/ActiveBuffsManager.cs @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; using Godot; -using ParasiticGod.Scripts.Core; +using ParasiticGod.Scripts; using ParasiticGod.Scripts.Core.Effects; using ParasiticGod.Scripts.Singletons; -namespace ParasiticGod.Scripts; +namespace ParasiticGod.Scripts.Components; [GlobalClass] public partial class ActiveBuffsManager : Node diff --git a/Scripts/ActiveBuffsManager.cs.uid b/Scripts/Components/ActiveBuffsManager.cs.uid similarity index 100% rename from Scripts/ActiveBuffsManager.cs.uid rename to Scripts/Components/ActiveBuffsManager.cs.uid diff --git a/Scripts/ForestVisualizer.cs b/Scripts/Components/ForestVisualizer.cs similarity index 97% rename from Scripts/ForestVisualizer.cs rename to Scripts/Components/ForestVisualizer.cs index ddd6443..b8b5629 100644 --- a/Scripts/ForestVisualizer.cs +++ b/Scripts/Components/ForestVisualizer.cs @@ -5,7 +5,7 @@ using Godot; using ParasiticGod.Scripts.Core; using ParasiticGod.Scripts.Singletons; -namespace ParasiticGod.Scripts; +namespace ParasiticGod.Scripts.Components; [GlobalClass] public partial class ForestVisualizer : Node diff --git a/Scripts/ForestVisualizer.cs.uid b/Scripts/Components/ForestVisualizer.cs.uid similarity index 100% rename from Scripts/ForestVisualizer.cs.uid rename to Scripts/Components/ForestVisualizer.cs.uid diff --git a/Scripts/Components/NotificationManager.cs b/Scripts/Components/NotificationManager.cs new file mode 100644 index 0000000..3e615b2 --- /dev/null +++ b/Scripts/Components/NotificationManager.cs @@ -0,0 +1,31 @@ +using Godot; +using ParasiticGod.Scripts; +using ParasiticGod.Scripts.Singletons; + +namespace ParasiticGod.Scripts.Components; + +[GlobalClass] +public partial class NotificationManager : CanvasLayer +{ + [Export] private PackedScene _notificationLabelScene; + + public override void _Ready() + { + GameBus.Instance.AgeAdvanced += OnAgeAdvanced; + } + + public override void _ExitTree() + { + if (GameBus.Instance != null) + { + GameBus.Instance.AgeAdvanced -= OnAgeAdvanced; + } + } + + private void OnAgeAdvanced(string ageName) + { + var notification = _notificationLabelScene.Instantiate(); + AddChild(notification); + notification.ShowNotification($"You have entered\n{ageName}!"); + } +} \ No newline at end of file diff --git a/Scripts/Components/NotificationManager.cs.uid b/Scripts/Components/NotificationManager.cs.uid new file mode 100644 index 0000000..e3df24e --- /dev/null +++ b/Scripts/Components/NotificationManager.cs.uid @@ -0,0 +1 @@ +uid://c6uh5h3sdlg7n diff --git a/Scripts/PopulationVisualizer.cs b/Scripts/Components/PopulationVisualizer.cs similarity index 98% rename from Scripts/PopulationVisualizer.cs rename to Scripts/Components/PopulationVisualizer.cs index aebc7e3..afa9ff7 100644 --- a/Scripts/PopulationVisualizer.cs +++ b/Scripts/Components/PopulationVisualizer.cs @@ -4,7 +4,7 @@ using Godot.Collections; using ParasiticGod.Scripts.Core; using ParasiticGod.Scripts.Singletons; -namespace ParasiticGod.Scripts; +namespace ParasiticGod.Scripts.Components; [GlobalClass] public partial class PopulationVisualizer : Node diff --git a/Scripts/PopulationVisualizer.cs.uid b/Scripts/Components/PopulationVisualizer.cs.uid similarity index 100% rename from Scripts/PopulationVisualizer.cs.uid rename to Scripts/Components/PopulationVisualizer.cs.uid diff --git a/Scripts/Components/ProgressiveVisualizer.cs.uid b/Scripts/Components/ProgressiveVisualizer.cs.uid new file mode 100644 index 0000000..bac0167 --- /dev/null +++ b/Scripts/Components/ProgressiveVisualizer.cs.uid @@ -0,0 +1 @@ +uid://m3qqshwpk16h diff --git a/Scripts/RoadManager.cs b/Scripts/Components/RoadManager.cs similarity index 97% rename from Scripts/RoadManager.cs rename to Scripts/Components/RoadManager.cs index 7225cdb..7214849 100644 --- a/Scripts/RoadManager.cs +++ b/Scripts/Components/RoadManager.cs @@ -1,11 +1,9 @@ -using System; using System.Collections.Generic; using System.Linq; using Godot; -using ParasiticGod.Scripts.Core; using ParasiticGod.Scripts.Singletons; -namespace ParasiticGod.Scripts; +namespace ParasiticGod.Scripts.Components; [GlobalClass] public partial class RoadManager : Node2D diff --git a/Scripts/RoadManager.cs.uid b/Scripts/Components/RoadManager.cs.uid similarity index 100% rename from Scripts/RoadManager.cs.uid rename to Scripts/Components/RoadManager.cs.uid diff --git a/Scripts/Core/MiracleDefinition.cs b/Scripts/Core/MiracleDefinition.cs index 33e3fa3..66e5a19 100644 --- a/Scripts/Core/MiracleDefinition.cs +++ b/Scripts/Core/MiracleDefinition.cs @@ -14,6 +14,7 @@ public partial class MiracleDefinition : Resource [Export] public double FaithCost { get; set; } [Export] public long FollowersRequired { get; set; } [Export] public double ProductionRequired { get; set; } + public string AdvancesToAge { get; set; } [Export] public Array Effects { get; set; } } \ No newline at end of file diff --git a/Scripts/Core/MiracleDto.cs b/Scripts/Core/MiracleDto.cs index 48c9f63..698c0a9 100644 --- a/Scripts/Core/MiracleDto.cs +++ b/Scripts/Core/MiracleDto.cs @@ -6,6 +6,7 @@ namespace ParasiticGod.Scripts.Core; public class EffectDto { public string Type { get; set; } + // --- For "AddResource" Effect --- public Stat TargetResource { get; set; } public double Value { get; set; } @@ -19,11 +20,11 @@ public class EffectDto public double FromAmount { get; set; } public Stat ToResource { get; set; } public double ToAmount { get; set; } - + // --- For "ModifyStat" Effect --- public Stat TargetStat { get; set; } public ModifyStatEffect.Operation Op { get; set; } - + public List MiraclesToUnlock { get; set; } } @@ -34,5 +35,6 @@ public class MiracleDto public long FollowersRequired { get; set; } public double ProductionRequired { get; set; } public bool UnlockedByDefault { get; set; } + public string AdvancesToAge { get; set; } public List Effects { get; set; } } \ No newline at end of file diff --git a/Scripts/Core/MiracleLoader.cs b/Scripts/Core/MiracleLoader.cs index 6589b10..f7ed72c 100644 --- a/Scripts/Core/MiracleLoader.cs +++ b/Scripts/Core/MiracleLoader.cs @@ -70,6 +70,7 @@ public static class MiracleLoader FaithCost = miracleDto.FaithCost, FollowersRequired = miracleDto.FollowersRequired, ProductionRequired = miracleDto.ProductionRequired, + AdvancesToAge = miracleDto.AdvancesToAge, Effects = [] }; diff --git a/Scripts/NotificationLabel.cs b/Scripts/NotificationLabel.cs new file mode 100644 index 0000000..bbcd509 --- /dev/null +++ b/Scripts/NotificationLabel.cs @@ -0,0 +1,20 @@ +using Godot; + +namespace ParasiticGod.Scripts; + +[GlobalClass] +public partial class NotificationLabel : Label +{ + public void ShowNotification(string text) + { + Text = text; + PivotOffset = Size / 2; + GlobalPosition = GetViewportRect().Size / 2; + + var tween = CreateTween(); + tween.TweenProperty(this, "modulate:a", 1.0f, 0.5f).From(0.0f); + tween.TweenInterval(2.5f); + tween.TweenProperty(this, "modulate:a", 0.0f, 1.0f); + tween.Finished += QueueFree; + } +} \ No newline at end of file diff --git a/Scripts/NotificationLabel.cs.uid b/Scripts/NotificationLabel.cs.uid new file mode 100644 index 0000000..dc15d4d --- /dev/null +++ b/Scripts/NotificationLabel.cs.uid @@ -0,0 +1 @@ +uid://drx8lqcjq5khj diff --git a/Scripts/Singletons/GameBus.cs b/Scripts/Singletons/GameBus.cs index 0737dc9..5a362b1 100644 --- a/Scripts/Singletons/GameBus.cs +++ b/Scripts/Singletons/GameBus.cs @@ -21,6 +21,7 @@ public partial class GameBus : Node public event Action BuffAdded; public event Action BuffRemoved; public event Action PopulationVisualsUpdated; + public event Action AgeAdvanced; public override void _EnterTree() { @@ -74,6 +75,11 @@ public partial class GameBus : Node { MiraclesUnlocked?.Invoke(miraclesToUnlock); } + + if (!string.IsNullOrEmpty(miracle.AdvancesToAge)) + { + AgeAdvanced?.Invoke(miracle.AdvancesToAge); + } } }