feat(Card): 卡牌基本框架,尚未测试
This commit is contained in:
33
Assets/Script/Card/CardEffect/EffectHandler.cs
Normal file
33
Assets/Script/Card/CardEffect/EffectHandler.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Card
|
||||
{
|
||||
public static class EffectHandler
|
||||
{
|
||||
public static void Execute(EffectData effect, CardContext context)
|
||||
{
|
||||
switch (effect.type)
|
||||
{
|
||||
case EffectType.Damage:
|
||||
context.Target.TakeDamage(effect.value);
|
||||
break;
|
||||
|
||||
case EffectType.Heal:
|
||||
context.Target.Heal(effect.value);
|
||||
break;
|
||||
|
||||
case EffectType.DrawCard:
|
||||
context.Player.Draw(effect.value);
|
||||
break;
|
||||
|
||||
case EffectType.AddBuff:
|
||||
//TODO:context.Target.AddBuff(effect.value);
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug.LogWarning($"未知效果类型: {effect.type}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user