修复击杀钩子,添加技能
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user