Add initial implementation of game mechanics and resources management
This commit is contained in:
29
Scripts/Core/Effects/AddResourceEffect.cs
Normal file
29
Scripts/Core/Effects/AddResourceEffect.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using Godot;
|
||||
|
||||
namespace ParasiticGod.Scripts.Core.Effects;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class AddResourceEffect : Effect
|
||||
{
|
||||
[Export] public ResourceType 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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user