feat(): 大量更新
This commit is contained in:
16
Assets/Script/Gameplay/Card/CardEffect/CardContext.cs
Normal file
16
Assets/Script/Gameplay/Card/CardEffect/CardContext.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
using Share;
|
||||
namespace Gameplay
|
||||
{
|
||||
public class CardContext
|
||||
{
|
||||
public ICharacter Owner;
|
||||
public ICharacter Enemy;
|
||||
|
||||
public CardContext(ICharacter owner,ICharacter enemy)
|
||||
{
|
||||
Owner = owner;
|
||||
Enemy = enemy;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7279b5677f724ab4b93bd1028542d110
|
||||
timeCreated: 1760420712
|
26
Assets/Script/Gameplay/Card/CardEffect/EffectData.cs
Normal file
26
Assets/Script/Gameplay/Card/CardEffect/EffectData.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Gameplay
|
||||
{
|
||||
[System.Serializable]
|
||||
public class EffectData
|
||||
{
|
||||
public EffectType type; // 效果类型,例如攻击、治疗、抽卡
|
||||
public int value; // 参数值
|
||||
public TargetType target; // 可选参数:目标类型("self", "enemy", "all")
|
||||
}
|
||||
|
||||
public enum TargetType
|
||||
{
|
||||
Self,
|
||||
Enemy,
|
||||
All,
|
||||
None
|
||||
}
|
||||
|
||||
public enum EffectType
|
||||
{
|
||||
Damage,
|
||||
Heal,
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5790e0b2fbce41c99a775bbacca0e2bc
|
||||
timeCreated: 1760420527
|
24
Assets/Script/Gameplay/Card/CardEffect/EffectHandler.cs
Normal file
24
Assets/Script/Gameplay/Card/CardEffect/EffectHandler.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Gameplay
|
||||
{
|
||||
public static class EffectHandler
|
||||
{
|
||||
public static void Execute(EffectData effect, CardContext context)
|
||||
{
|
||||
switch (effect.type)
|
||||
{
|
||||
case EffectType.Damage:
|
||||
context.Enemy.TakeDamage(effect.value);
|
||||
break;
|
||||
|
||||
case EffectType.Heal:
|
||||
context.Enemy.Heal(effect.value);
|
||||
break;
|
||||
default:
|
||||
Debug.Log($"未知效果类型: {effect.type}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 032e368e3d5846d78caf5f3239de979f
|
||||
timeCreated: 1760420695
|
Reference in New Issue
Block a user