37 lines
1.6 KiB
C#
Executable File
37 lines
1.6 KiB
C#
Executable File
using Cal;
|
|
namespace ET
|
|
{
|
|
public class SkillOptionLogic_改变释放次数 : SkillOptionLogicBase
|
|
{
|
|
public override SkillOptionType skillOptionType => SkillOptionType.改变释放次数;
|
|
public override SkillOptionBase skillOptionBase { get; set; }
|
|
|
|
SkillOption_改变释放次数 skillOption;
|
|
public override void HandleEvent(ISkillSender skillSender)
|
|
{
|
|
skillOption = skillOptionBase.As<SkillOption_改变释放次数>();
|
|
SelectTargetHelper.GetTarget(skillOption.selectTarget, skillSender, Action);
|
|
}
|
|
|
|
private async ETTask Action(Unit target, ISkillSender skillSender)
|
|
{
|
|
if (!SkillHelper.GetParam(this.skillOption.param, skillSender.skillConfigId, out float value))
|
|
return;
|
|
if (!(skillSender is ModifierSkillSender modifierSkillSender))
|
|
{
|
|
Log.Error($"skillSender = {skillSender} is not ModifierSkillSender");
|
|
return;
|
|
}
|
|
|
|
AttackComponent attackComponent = target.GetComponent<AttackComponent>();
|
|
// ModifierContainerComponent modifierContainerComponent = target.GetComponent<ModifierContainerComponent>();
|
|
// ModifierLogic modifierLogic =modifierContainerComponent.GetModifierLogic(modifierSkillSender.modifierId);
|
|
ModifierLogic modifierLogic = modifierSkillSender.modifierLogic;
|
|
if (modifierLogic == null)
|
|
return;
|
|
int valueInt = (int) value;
|
|
modifierLogic.playAmount = valueInt - attackComponent.playAmount;
|
|
attackComponent.playAmount = valueInt;
|
|
}
|
|
}
|
|
} |