|
|
public override bool Take(bool play_sound = true)
{
if (this.m_Hallucination)
{
base.Disappear(true);
return false;
}
int num = ((this.m_Info.m_ID == ItemID.Liane_ToHoldHarvest) ? 50 : 1);
Item item = null;
for (int i = 0; i < num; i++)
{
item = ItemsManager.Get().CreateItem(this.m_ReplaceInfoName, false);
if (InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true) != InsertResult.Ok)
{
global::UnityEngine.Object.Destroy(item.gameObject);
return false;
}
}
this.UpdateChildrenItems();
EventsManager.OnEvent(global::Enums.Event.TakeItem, num, (int)item.m_Info.m_ID, false);
if (base.m_CurrentSlot)
{
base.m_CurrentSlot.RemoveItem();
}
Player.Get().GetComponent<PlayerAudioModule>().PlayItemSound(item.m_Info);
base.AddItemsCountMessage(item);
if (item.m_Info != null && item.m_Info.IsHeavyObject())
{
PlayerAudioModule.Get().PlayHOPickupSound();
}
if (!this.m_IsThisUnlimited)
{
global::UnityEngine.Object.Destroy(base.gameObject);
}
if (this.m_Info.m_ID == ItemID.Liane_ToHoldHarvest)
{
LianasReplicator.Get().OnTakeLiane(base.gameObject);
}
return true;
}
}
|
|