public static bool ApplyIntrinsic(Player player, Item intrinsicItem, bool isEnabled, bool forceApply = false) { bool canApply = forceApply || IntrinsicsLogic.ItemHasIntrinsics(intrinsicItem); if (canApply) { var myplayer = TmlHelpers.SafelyGetModPlayer <IntrinsicsPlayer>(player); myplayer.ApplyIntrinsic(ItemID.GetUniqueKey(intrinsicItem), isEnabled); //TODO GetProperUniqueId } return(canApply); }
private void LoadIntrinsicItemInternal(Item item, bool itemState) { switch (IntrinsicsLogic.GetItemIntrinsicType(item)) { case IntrinsicType.Armor: this.IntrinsicArmItem[item.type] = item; break; case IntrinsicType.Accessory: this.IntrinsicAccItem[item.type] = item; break; case IntrinsicType.Buff: this.IntrinsicBuffItem[item.type] = item; break; } this.IntrinsicToggle[item.type] = itemState; }
//////////////// public static bool CanApplyIntrinsic(Item intrinsicItem) { return(IntrinsicsLogic.ItemHasIntrinsics(intrinsicItem)); }