r2mods/ilspy_dump/ror2_csproj/RoR2.Skills/LunarSecondaryReplacementSk...

33 lines
909 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
namespace RoR2.Skills;
public class LunarSecondaryReplacementSkill : SkillDef
{
private class InstanceData : BaseSkillInstanceData
{
public GenericSkill skillSlot;
public void OnInventoryChanged()
{
skillSlot.RecalculateValues();
}
}
public override BaseSkillInstanceData OnAssigned(GenericSkill skillSlot)
{
InstanceData instanceData = new InstanceData();
instanceData.skillSlot = skillSlot;
skillSlot.characterBody.onInventoryChanged += instanceData.OnInventoryChanged;
return instanceData;
}
public override void OnUnassigned(GenericSkill skillSlot)
{
skillSlot.characterBody.onInventoryChanged -= ((InstanceData)skillSlot.skillInstanceData).OnInventoryChanged;
}
public override float GetRechargeInterval(GenericSkill skillSlot)
{
return (float)skillSlot.characterBody.inventory.GetItemCount(RoR2Content.Items.LunarSecondaryReplacement) * baseRechargeInterval;
}
}