NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Buff/Impl/BuffBulletDamage11.cs

33 lines
997 B
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using Gameplay.Skill;
using UnityEngine;
namespace Gameplay.Buff
{
public class BuffBulletDamage11 : BaseBuff
{
protected override void _OnTrigger()
{
base._OnTrigger();
// [基础值攻击力系数每击杀一个单位CD降低多少百分比]
var fixValue = _TryGetIntParam(0);
var attackPercent = _TryGetFloatParam(1);
var cdReducePercent = _TryGetFloatParam(2);
var damageValue = Mathf.RoundToInt(fixValue + creator.fightData.attack * attackPercent);
owner.TakeNormalDamage(damageValue, creator, false);
if (owner.aliveData.currentHp <= 0)
{
var skillManager = SkillManager.instance.GetUnitSkillManager(creator);
if (skillManager != null)
{
skillManager.ReduceSkillCdPercent(cdReducePercent);
}
}
}
}
}