Add forest visualization and update miracle requirements

This commit is contained in:
2025-08-23 03:16:28 +02:00
parent 18312671d7
commit d198aed01f
9 changed files with 5381 additions and 4 deletions

View File

@@ -30,12 +30,15 @@ public class GameLogic
public bool TryToPerformMiracle(GameState state, MiracleDefinition miracle)
{
if (state.Get(Stat.Faith) < miracle.FaithCost || state.Get(Stat.Followers) < miracle.FollowersRequired)
if (state.Get(Stat.Faith) < miracle.FaithCost ||
state.Get(Stat.Followers) < miracle.FollowersRequired ||
state.Get(Stat.Production) < miracle.ProductionRequired)
{
return false;
}
state.Modify(Stat.Faith, -miracle.FaithCost);
state.Modify(Stat.Production, -miracle.ProductionRequired);
if (miracle.Effects != null)
{

View File

@@ -21,8 +21,8 @@ public class GameState
Set(Stat.Faith, 50);
Set(Stat.Followers, 40);
Set(Stat.FaithPerFollower, 0.5);
Set(Stat.ProductionPerSecond, 1.0);
Set(Stat.CorruptionPerSecond, 0.1);
Set(Stat.ProductionPerSecond, 0.0);
Set(Stat.CorruptionPerSecond, 0.01);
}
public double Get(Stat stat) => _stats[stat].Value;

View File

@@ -13,6 +13,7 @@ public partial class MiracleDefinition : Resource
[Export] public string Name { get; set; }
[Export] public double FaithCost { get; set; }
[Export] public long FollowersRequired { get; set; }
[Export] public double ProductionRequired { get; set; }
[Export] public Array<Effect> Effects { get; set; }
}

View File

@@ -32,6 +32,7 @@ public class MiracleDto
public string Name { get; set; }
public double FaithCost { get; set; }
public long FollowersRequired { get; set; }
public double ProductionRequired { get; set; }
public bool UnlockedByDefault { get; set; }
public List<EffectDto> Effects { get; set; }
}

View File

@@ -69,6 +69,7 @@ public static class MiracleLoader
Name = miracleDto.Name,
FaithCost = miracleDto.FaithCost,
FollowersRequired = miracleDto.FollowersRequired,
ProductionRequired = miracleDto.ProductionRequired,
Effects = []
};