Refactor game state management to use a unified Stat system and update UI labels for production and corruption
This commit is contained in:
@@ -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}";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user