Refactor game state management to use a unified Stat system and update UI labels for production and corruption

This commit is contained in:
2025-08-23 02:44:54 +02:00
parent 2998e4c02a
commit 18312671d7
23 changed files with 298 additions and 109 deletions

View File

@@ -6,24 +6,16 @@ namespace ParasiticGod.Scripts.Core.Effects;
[GlobalClass]
public partial class AddResourceEffect : Effect
{
[Export] public ResourceType TargetResource { get; set; }
[Export] public Stat TargetResource { get; set; }
[Export] public double Value { get; set; }
public override void Execute(GameState state)
{
switch (TargetResource)
{
case ResourceType.Faith:
state.Faith += Value;
break;
case ResourceType.Followers:
state.Followers += (long)Value;
break;
case ResourceType.Corruption:
state.Corruption += Value;
break;
default:
throw new ArgumentOutOfRangeException();
}
state.Modify(TargetResource, Value);
}
public override string ToString()
{
return $"Add {Value} to {TargetResource}";
}
}