Exemple #1
0
        private static bool OnRemove(Consumable __instance, InventorySystem.Items.Pickups.ItemPickupBase pickup)
        {
            try
            {
                if (__instance.ActivationReady && UsableUsingCompletePatch.ExecuteFinalizingEvent(__instance))
                {
                    __instance.ActivateEffects();
                }

                if (__instance._alreadyActivated && pickup != null)
                {
                    pickup.DestroySelf();
                }

                if (NetworkServer.active)
                {
                    UsableItemsController.GetHandler(__instance.Owner).CurrentUsable = CurrentlyUsedItem.None;
                }

                return(false);
            }
            catch (Exception ex)
            {
                Logger.Get.Error($"Synapse-Event: PlayerItemUseEvent Finalizing Remove failed!!\n{ex}");
                return(true);
            }
        }
Exemple #2
0
 private static bool OnEquip(Consumable __instance)
 {
     try
     {
         if (__instance.ActivationReady)
         {
             if (UsableUsingCompletePatch.ExecuteFinalizingEvent(__instance))
             {
                 __instance.ActivateEffects();
             }
         }
         return(false);
     }
     catch (Exception ex)
     {
         Logger.Get.Error($"Synapse-Event: PlayerItemUseEvent Finalizing Equip failed!!\n{ex}");
         return(true);
     }
 }