50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
/*
|
|
* @Author: 白哉
|
|
* @Description:
|
|
* @Date: 2025年04月23日 星期三 21:04:18
|
|
* @Modify:
|
|
*/
|
|
|
|
|
|
using RuntimeData;
|
|
using System;
|
|
using UnityEngine;
|
|
using MemoryPack;
|
|
using TH1Renderer;
|
|
|
|
|
|
namespace Logic.Skill
|
|
{
|
|
public partial class ScarletMistRealTimeVampireSkill : SkillBase
|
|
{
|
|
public ScarletMistRealTimeVampireSkill()
|
|
{
|
|
IsPermanent = true;
|
|
TurnsLimit = 0;
|
|
}
|
|
|
|
public override SkillType GetSkillType()
|
|
{
|
|
return SkillType.ScarletMistRealTimeVampire;
|
|
}
|
|
|
|
public override void OnDamageOther(MapData mapData, SettlementInfo info)
|
|
{
|
|
//主动攻击或者反击(反击限定为斯卡雷特帝国的成员)
|
|
if (info.DamageType == DamageType.ActiveAttack ||
|
|
(info.DamageType == DamageType.CounterAttack && info.DamageOrigin.GetSkill(SkillType.RemiliaEgyptianEmpireKill,out var _)))
|
|
{
|
|
info.DamageOrigin.Health += (int)Math.Round(info.DamageValue * 0.2f);
|
|
if (info.DamageOrigin.Health > info.DamageOrigin.GetMaxHealth())
|
|
info.DamageOrigin.Health = info.DamageOrigin.GetMaxHealth();
|
|
if (mapData.GetGridDataByUnitId(info.DamageOrigin.Id, out var grid))
|
|
grid.Renderer(mapData)?.PlayVFX(new GridVFXParams(GridVFXType.Heal));
|
|
|
|
info.DamageOrigin.Renderer(mapData)?.InstantUpdateUnit(false);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
} |