27 lines
933 B
C#
27 lines
933 B
C#
using System;
|
|
using Cielonos.MainGame.Characters;
|
|
using SLSUtilities.General;
|
|
using UnityEngine;
|
|
|
|
namespace Cielonos.MainGame.Inventory.Collections
|
|
{
|
|
public partial class VipersFang : PassiveEquipmentBase
|
|
{
|
|
public override void OnObtained()
|
|
{
|
|
base.OnObtained();
|
|
Action<AttackAreaBase, CharacterBase> onStartAttack = OnStartAttack;
|
|
player.eventSm.onStartAttack.Add("VipersFang", onStartAttack.ToPrioritized());
|
|
}
|
|
}
|
|
|
|
public partial class VipersFang
|
|
{
|
|
private void OnStartAttack(AttackAreaBase attackArea, CharacterBase target)
|
|
{
|
|
float targetHealthPercentage = target.attributeSm["Health"] / target.attributeSm["MaximumHealth"];
|
|
float extraDamage = passiveAttributeData.itemAttributes["ExtraDamage"] * (1 - targetHealthPercentage);
|
|
attackArea.attackSm.attackValue.damage += extraDamage;
|
|
}
|
|
}
|
|
} |