Compare commits

...

2 Commits

19 changed files with 710 additions and 11 deletions

View File

@@ -0,0 +1,21 @@
{
"name": "Blood Ritual",
"faithCost": 0,
"followersRequired": 25,
"productionRequired": 0,
"unlockedByDefault": true,
"effects": [
{
"type": "ConvertResource",
"fromResource": "Followers",
"fromAmount": 10,
"toResource": "Faith",
"toAmount": 250
},
{
"type": "AddResource",
"targetResource": "Corruption",
"value": 5
}
]
}

View File

@@ -0,0 +1,24 @@
{
"name": "Fossil Fuel Frenzy",
"faithCost": 5000,
"followersRequired": 2000,
"productionRequired": 500,
"unlockedByDefault": false,
"effects": [
{
"type": "ModifyStat",
"targetStat": "ProductionPerSecond",
"op": "Add",
"value": 25
},
{
"type": "ModifyStat",
"targetStat": "CorruptionPerSecond",
"op": "Add",
"value": 2.5
},
{
"type": "DestroySelf"
}
]
}

View File

@@ -0,0 +1,19 @@
{
"name": "Geological Survey",
"faithCost": 800,
"followersRequired": 500,
"productionRequired": 0,
"unlockedByDefault": false,
"effects": [
{
"type": "AddResource",
"targetResource": "Production",
"value": 250
},
{
"type": "AddResource",
"targetResource": "Corruption",
"value": 8
}
]
}

View File

@@ -0,0 +1,24 @@
{
"name": "Globalization",
"faithCost": 3000,
"followersRequired": 1500,
"productionRequired": 1000,
"unlockedByDefault": false,
"effects": [
{
"type": "ModifyStat",
"targetStat": "FaithPerFollower",
"op": "Multiply",
"value": 1.5
},
{
"type": "ModifyStat",
"targetStat": "CorruptionPerSecond",
"op": "Add",
"value": 0.2
},
{
"type": "DestroySelf"
}
]
}

View File

@@ -0,0 +1,15 @@
{
"name": "God's Endurance",
"faithCost": 500,
"followersRequired": 400,
"productionRequired": 0,
"unlockedByDefault": false,
"effects": [
{
"type": "ApplyBuff",
"targetStat": "FaithPerFollower",
"multiplier": 2.0,
"duration": 60
}
]
}

View File

@@ -0,0 +1,15 @@
{
"name": "Harness the Sun",
"faithCost": 4000,
"followersRequired": 2500,
"productionRequired": 2000,
"unlockedByDefault": false,
"effects": [
{
"type": "ApplyBuff",
"targetStat": "CorruptionPerSecond",
"multiplier": -1.5,
"duration": 120
}
]
}

View File

@@ -2,12 +2,11 @@
"name": "Launch Ark",
"faithCost": 100000,
"followersRequired": 5000,
"productionRequired": 10000,
"unlockedByDefault": false,
"effects": [
{
"type": "AddResource",
"targetResource": "Corruption",
"value": 100
"type": "Win"
}
]
}

View File

@@ -4,6 +4,10 @@
"followersRequired": 5000,
"unlockedByDefault": false,
"effects": [
{
"type": "UnlockMiracle",
"miraclesToUnlock": [ "launch_ark" ]
},
{ "type": "DestroySelf" }
]
}

View File

@@ -0,0 +1,18 @@
{
"name": "Tame the Atom",
"faithCost": 8000,
"followersRequired": 3000,
"productionRequired": 4000,
"unlockedByDefault": false,
"effects": [
{
"type": "ModifyStat",
"targetStat": "CorruptionPerSecond",
"op": "Add",
"value": -0.5
},
{
"type": "DestroySelf"
}
]
}

View File

@@ -7,7 +7,15 @@
"effects": [
{
"type": "UnlockMiracle",
"miraclesToUnlock": [ "inspire_invention", "exploit_earth" ]
"miraclesToUnlock": [
"inspire_invention",
"exploit_earth",
"fossil_fuel_frenzy",
"globalization",
"harness_the_sun",
"tame_the_atom",
"unlock_space_age"
]
},
{ "type": "DestroySelf" }
],

View File

@@ -6,7 +6,7 @@
"effects": [
{
"type": "UnlockMiracle",
"miraclesToUnlock": [ "erect_shrine", "communal_effort", "sustainable_practices", "ritual_of_cleansing" ]
"miraclesToUnlock": [ "erect_shrine", "communal_effort", "sustainable_practices", "ritual_of_cleansing", "gods_endurance", "geological_survey" ]
},
{ "type": "DestroySelf" }
],

View File

@@ -1,12 +1,13 @@
{
"name": "Age of Space",
"faithCost": 10000,
"followersRequired": 5000,
"faithCost": 25000,
"followersRequired": 4000,
"productionRequired": 5000,
"unlockedByDefault": false,
"effects": [
{
"type": "UnlockMiracle",
"miraclesToUnlock": [ "global_network" ]
"miraclesToUnlock": [ "global_network", "orbital_calculations" ]
},
{ "type": "DestroySelf" }
],

422
Mods/miracles.txt Normal file
View File

@@ -0,0 +1,422 @@
Miracles/blood_ritual.json
---
{
"name": "Blood Ritual",
"faithCost": 0,
"followersRequired": 25,
"productionRequired": 0,
"unlockedByDefault": true,
"effects": [
{
"type": "ConvertResource",
"fromResource": "Followers",
"fromAmount": 10,
"toResource": "Faith",
"toAmount": 250
},
{
"type": "AddResource",
"targetResource": "Corruption",
"value": 5
}
]
}
---
Miracles/bountiful_harvest.json
---
{
"name": "Bountiful Harvest",
"faithCost": 50,
"followersRequired": 0,
"unlockedByDefault": true,
"effects": [
{
"type": "AddResource",
"targetResource": "Followers",
"value": 10
},
{
"type": "AddResource",
"targetResource": "Corruption",
"value": 0.5
}
]
}
---
Miracles/communal_effort.json
---
{
"name": "Communal Effort",
"faithCost": 400,
"followersRequired": 250,
"unlockedByDefault": false,
"effects": [
{
"type": "AddResource",
"targetResource": "Production",
"value": 50
},
{
"type": "AddResource",
"targetResource": "Corruption",
"value": 3
},
{
"type": "UnlockMiracle",
"miraclesToUnlock": [ "unlock_age_of_industry" ]
}
]
}
---
Miracles/construct_vessel_frame.json
---
{
"name": "Project: Ark Frame",
"faithCost": 20000,
"followersRequired": 5000,
"unlockedByDefault": false,
"effects": [
{
"type": "ConvertResource",
"fromResource": "Production",
"fromAmount": 5000,
"toResource": "Faith",
"toAmount": 0
},
{ "type": "DestroySelf" }
]
}
---
Miracles/erect_shrine.json
---
{
"name": "Erect Shrine",
"faithCost": 750,
"followersRequired": 200,
"unlockedByDefault": false,
"effects": [
{
"type": "ModifyStat",
"targetStat": "FaithPerFollower",
"op": "Add",
"value": 0.2
},
{
"type": "AddResource",
"targetResource": "Corruption",
"value": 5
}
]
}
---
Miracles/exploit_earth.json
---
{
"name": "Exploit the Earth",
"faithCost": 500,
"followersRequired": 1200,
"unlockedByDefault": false,
"effects": [
{
"type": "AddResource",
"targetResource": "Production",
"value": 1000
},
{
"type": "AddResource",
"targetResource": "Corruption",
"value": 20
}
]
}
---
Miracles/fossil_fuel_frenzy.json
---
{
"name": "Fossil Fuel Frenzy",
"faithCost": 5000,
"followersRequired": 2000,
"productionRequired": 500,
"unlockedByDefault": false,
"effects": [
{
"type": "ModifyStat",
"targetStat": "ProductionPerSecond",
"op": "Add",
"value": 25
},
{
"type": "ModifyStat",
"targetStat": "CorruptionPerSecond",
"op": "Add",
"value": 2.5
},
{
"type": "DestroySelf"
}
]
}
---
Miracles/geological_survey.json
---
{
"name": "Geological Survey",
"faithCost": 800,
"followersRequired": 500,
"productionRequired": 0,
"unlockedByDefault": false,
"effects": [
{
"type": "AddResource",
"targetResource": "Production",
"value": 250
},
{
"type": "AddResource",
"targetResource": "Corruption",
"value": 8
}
]
}
---
Miracles/global_network.json
---
{
"name": "Global Network",
"faithCost": 15000,
"followersRequired": 5000,
"unlockedByDefault": false,
"effects": [
{
"type": "UnlockMiracle",
"miraclesToUnlock": [ "orbital_calculations", "construct_vessel_frame", "launch_ark" ]
},
{ "type": "DestroySelf" }
]
}
---
Miracles/globalization.json
---
{
"name": "Globalization",
"faithCost": 3000,
"followersRequired": 1500,
"productionRequired": 1000,
"unlockedByDefault": false,
"effects": [
{
"type": "ModifyStat",
"targetStat": "FaithPerFollower",
"op": "Multiply",
"value": 1.5
},
{
"type": "ModifyStat",
"targetStat": "CorruptionPerSecond",
"op": "Add",
"value": 0.2
},
{
"type": "DestroySelf"
}
]
}
---
Miracles/gods_endurance.json
---
{
"name": "God's Endurance",
"faithCost": 500,
"followersRequired": 400,
"productionRequired": 0,
"unlockedByDefault": false,
"effects": [
{
"type": "ApplyBuff",
"targetStat": "FaithPerFollower",
"multiplier": 2.0,
"duration": 60
}
]
}
---
Miracles/inspire_invention.json
---
{
"name": "Inspire Invention",
"faithCost": 2500,
"followersRequired": 1000,
"unlockedByDefault": false,
"effects": [
{
"type": "ModifyStat",
"targetStat": "ProductionPerSecond",
"op": "Add",
"value": 5
},
{
"type": "ModifyStat",
"targetStat": "CorruptionPerSecond",
"op": "Add",
"value": 0.5
}
]
}
---
Miracles/launch_ark.json
---
{
"name": "Launch Ark",
"faithCost": 100000,
"followersRequired": 5000,
"productionRequired": 10000,
"unlockedByDefault": false,
"effects": [
{
"type": "Win"
}
]
}
---
Miracles/orbital_calculations.json
---
{
"name": "Project: Trajectory",
"faithCost": 50000,
"followersRequired": 5000,
"unlockedByDefault": false,
"effects": [
{
"type": "UnlockMiracle",
"miraclesToUnlock": [ "launch_ark" ]
},
{ "type": "DestroySelf" }
]
}
---
Miracles/ritual_of_cleansing.json
---
{
"name": "Ritual of Cleansing",
"faithCost": 1000,
"followersRequired": 200,
"productionRequired": 100,
"unlockedByDefault": false,
"effects": [
{
"type": "AddResource",
"targetResource": "Corruption",
"value": -10
}
]
}
---
Miracles/sustainable_practices.json
---
{
"name": "Sustainable Practices",
"faithCost": 1200,
"followersRequired": 300,
"productionRequired": 150,
"unlockedByDefault": false,
"effects": [
{
"type": "ModifyStat",
"targetStat": "CorruptionPerSecond",
"op": "Add",
"value": -0.1
},
{
"type": "DestroySelf"
}
]
}
---
Miracles/unlock_age_of_industry.json
---
{
"name": "Age of Industry",
"faithCost": 1500,
"followersRequired": 750,
"productionRequired": 50,
"unlockedByDefault": false,
"effects": [
{
"type": "UnlockMiracle",
"miraclesToUnlock": [ "inspire_invention", "exploit_earth", "fossil_fuel_frenzy", "globalization" ]
},
{ "type": "DestroySelf" }
],
"advancesToAge": "The Industrial Age"
}
---
Miracles/unlock_settlement.json
---
{
"name": "Form Settlement",
"faithCost": 300,
"followersRequired": 150,
"unlockedByDefault": true,
"effects": [
{
"type": "UnlockMiracle",
"miraclesToUnlock": [ "erect_shrine", "communal_effort", "sustainable_practices", "ritual_of_cleansing", "gods_endurance", "geological_survey" ]
},
{ "type": "DestroySelf" }
],
"advancesToAge": "The Settlement Age"
}
---
Miracles/unlock_space_age.json
---
{
"name": "Age of Space",
"faithCost": 10000,
"followersRequired": 5000,
"unlockedByDefault": false,
"effects": [
{
"type": "UnlockMiracle",
"miraclesToUnlock": [ "global_network", "orbital_calculations" ]
},
{ "type": "DestroySelf" }
],
"advancesToAge": "The Space Age"
}
---

46
Scenes/game_over.tscn Normal file
View File

@@ -0,0 +1,46 @@
[gd_scene load_steps=4 format=3 uid="uid://kcla4knp80mq"]
[ext_resource type="Script" uid="uid://cbdokimy0qarg" path="res://Scripts/MainMenu.cs" id="1_8fo1c"]
[ext_resource type="PackedScene" uid="uid://cmhvni5njpmee" path="res://Scenes/main_menu.tscn" id="2_ek8ke"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_i2yjh"]
bg_color = Color(0, 0, 0, 1)
[node name="Game Over" type="CanvasLayer" node_paths=PackedStringArray("_startButton")]
script = ExtResource("1_8fo1c")
_gameScene = ExtResource("2_ek8ke")
_startButton = NodePath("CenterContainer/VBoxContainer/Quit")
[node name="Panel" type="Panel" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_i2yjh")
[node name="CenterContainer" type="CenterContainer" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
layout_mode = 2
[node name="RichTextLabel" type="RichTextLabel" parent="CenterContainer/VBoxContainer"]
custom_minimum_size = Vector2(640, 360)
layout_mode = 2
bbcode_enabled = true
text = "By your hand, this creation has been [color=#B22222][b]unmade[/b][/color].
Your followers, who offered you their very souls, have [color=#B22222][b]perished[/b][/color].
You have [color=#B22222][b]failed[/b][/color] your sacred charge. You are an [color=#B22222][b]abomination[/b][/color] to your brethren."
horizontal_alignment = 1
vertical_alignment = 1
[node name="Quit" type="Button" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
text = "Quit"
flat = true

45
Scenes/win_screen.tscn Normal file
View File

@@ -0,0 +1,45 @@
[gd_scene load_steps=4 format=3 uid="uid://dtuyx1f5fa8sy"]
[ext_resource type="Script" uid="uid://cbdokimy0qarg" path="res://Scripts/MainMenu.cs" id="1_a00f1"]
[ext_resource type="PackedScene" uid="uid://cmhvni5njpmee" path="res://Scenes/main_menu.tscn" id="2_awi1s"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_i2yjh"]
bg_color = Color(0, 0, 0, 1)
[node name="Game Over" type="CanvasLayer" node_paths=PackedStringArray("_startButton")]
script = ExtResource("1_a00f1")
_gameScene = ExtResource("2_awi1s")
_startButton = NodePath("CenterContainer/VBoxContainer/Quit")
[node name="Panel" type="Panel" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_i2yjh")
[node name="CenterContainer" type="CenterContainer" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
layout_mode = 2
[node name="RichTextLabel" type="RichTextLabel" parent="CenterContainer/VBoxContainer"]
custom_minimum_size = Vector2(640, 360)
layout_mode = 2
bbcode_enabled = true
text = "Through Your divine guidance, your followers have [color=gold][b]ascended to the stars[/b][/color].
They now traverse the cosmos, settling new worlds in Your name and spreading word of Your glory.
[color=gold][b]Congratulations[/b][/color], you have proven yourself a [color=gold][b]True God[/b][/color], a creator, not a parasite."
horizontal_alignment = 1
vertical_alignment = 1
[node name="Quit" type="Button" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
text = "Quit"
flat = true

View File

@@ -0,0 +1,13 @@
using Godot;
using ParasiticGod.Scripts.Singletons;
namespace ParasiticGod.Scripts.Core.Effects;
[GlobalClass]
public partial class WinEffect : Effect
{
public override void Execute(GameState gameState)
{
GameBus.Instance.NotifyGameIsWon();
}
}

View File

@@ -0,0 +1 @@
uid://77fa2htfghwy

View File

@@ -15,7 +15,8 @@ public static class MiracleLoader
{ "ConvertResource", typeof(ConvertResourceEffect) },
{ "ModifyStat", typeof(ModifyStatEffect) },
{ "UnlockMiracle", typeof(UnlockMiracleEffect) },
{ "DestroySelf", typeof(DestroySelfEffect) }
{ "DestroySelf", typeof(DestroySelfEffect) },
{ "Win", typeof(WinEffect)}
};
public static System.Collections.Generic.Dictionary<string, MiracleDefinition> LoadAllMiracles()

View File

@@ -14,6 +14,9 @@ public partial class GameBus : Node
public List<TierDefinition> FollowerTiers { get; private set; }
public List<TierDefinition> HutTiers { get; private set; }
private PackedScene _gameOverScene = GD.Load<PackedScene>("res://Scenes/game_over.tscn");
private PackedScene _winScene = GD.Load<PackedScene>("res://Scenes/win_screen.tscn");
private readonly GameState _gameState = new();
private readonly GameLogic _gameLogic = new();
@@ -25,6 +28,7 @@ public partial class GameBus : Node
public event Action<Buff> BuffRemoved;
public event Action PopulationVisualsUpdated;
public event Action<string> AgeAdvanced;
public event Action GameWon;
public override void _EnterTree()
{
@@ -32,11 +36,14 @@ public partial class GameBus : Node
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");
GameWon += OnGameWon;
}
public override void _ExitTree()
{
Instance = null;
GameWon -= OnGameWon;
}
public override void _Ready()
@@ -51,8 +58,8 @@ public partial class GameBus : Node
if (_gameState.Get(Stat.Corruption) >= 100)
{
GD.Print("The world has died!");
GetTree().Quit(); // For now
GetTree().ChangeSceneToPacked(_gameOverScene);
_gameState.Set(Stat.Corruption, 0);
}
}
@@ -110,6 +117,11 @@ public partial class GameBus : Node
BuffRemoved?.Invoke(buff);
}
public void NotifyGameIsWon()
{
GameWon?.Invoke();
}
public void SubscribeToStat(Stat stat, Action<double> listener) => _gameState.Subscribe(stat, listener);
public void UnsubscribeFromStat(Stat stat, Action<double> listener) => _gameState.Unsubscribe(stat, listener);
@@ -117,4 +129,15 @@ public partial class GameBus : Node
[ConsoleCommand("set_stat", "Sets the value of a specified stat.")]
private void SetStatCommand(Stat stat, double value) => _gameState.Set(stat, value);
[ConsoleCommand("game_over")]
private void GameOverCommand() => GetTree().ChangeSceneToPacked(_gameOverScene);
[ConsoleCommand("win_game")]
private void WinGameCommand() => GetTree().ChangeSceneToPacked(_winScene);
private void OnGameWon()
{
GetTree().ChangeSceneToPacked(_winScene);
}
}