修复击杀钩子,添加技能

This commit is contained in:
xianyi
2025-09-02 16:20:42 +08:00
parent 1386d7d431
commit 88006275ca
53 changed files with 1023 additions and 27 deletions

View File

@@ -35,6 +35,32 @@ namespace TcgEngine
int target_hp_before = target != null ? target.GetHP() : 0;
bool will_kill = target != null && target_hp_before <= damage;
// 无敌状态
if (target.HasStatus(StatusType.Invincibility))
{
will_kill = false;
}
// 免疫伤害
if (target.HasStatus(StatusType.Shell))
{
Debug.Log("目标处于贝壳状态,免疫本次伤害");
will_kill = false;
}
int armor_reduction = 0;
int damageBeforeArmor = 0;
// 护甲状态
if (target.HasStatus(StatusType.Armor))
{
armor_reduction = target.GetStatusValue(StatusType.Armor);
damageBeforeArmor = Mathf.Max(0, damage - armor_reduction);
if (damageBeforeArmor > 0)
{
will_kill = false;
}
}
// 造成伤害
logic.DamageCard(caster, target, damage, true);