Add forest visualization and update miracle requirements
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
@@ -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;
|
||||
|
@@ -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; }
|
||||
}
|
@@ -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; }
|
||||
}
|
@@ -69,6 +69,7 @@ public static class MiracleLoader
|
||||
Name = miracleDto.Name,
|
||||
FaithCost = miracleDto.FaithCost,
|
||||
FollowersRequired = miracleDto.FollowersRequired,
|
||||
ProductionRequired = miracleDto.ProductionRequired,
|
||||
Effects = []
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user