예제 #1
0
 public void Load(BaseNetworkable.LoadInfo info)
 {
     if (info.msg.growableEntity != null)
     {
         GrowableGeneEncoding.DecodeIntToGenes(info.msg.growableEntity.genes, this);
         GrowableGeneEncoding.DecodeIntToPreviousGenes(info.msg.growableEntity.previousGenes, this);
     }
 }
예제 #2
0
    public void TakeClones(BasePlayer player)
    {
        if (player == null || !CanClone() || Interface.CallHook("CanTakeCutting", player, this) != null)
        {
            return;
        }
        int num = Properties.BaseCloneCount + Genes.GetGeneTypeCount(GrowableGenetics.GeneType.Yield) / 2;

        if (num > 0)
        {
            Item item = ItemManager.Create(Properties.CloneItem, num, 0uL);
            GrowableGeneEncoding.EncodeGenesToItem(this, item);
            player.GiveItem(item, GiveItemReason.PickedUp);
            if (Properties.pickEffect.isValid)
            {
                Effect.server.Run(Properties.pickEffect.resourcePath, base.transform.position, Vector3.up);
            }
            Die();
        }
    }
예제 #3
0
 public void ReceiveInstanceData(ProtoBuf.Item.InstanceData data)
 {
     GrowableGeneEncoding.DecodeIntToGenes(data.dataInt, Genes);
     GrowableGeneEncoding.DecodeIntToPreviousGenes(data.dataInt, Genes);
 }
예제 #4
0
 public void Save(BaseNetworkable.SaveInfo info)
 {
     info.msg.growableEntity.genes         = GrowableGeneEncoding.EncodeGenesToInt(this);
     info.msg.growableEntity.previousGenes = GrowableGeneEncoding.EncodePreviousGenesToInt(this);
 }