Ejemplo n.º 1
0
        public void handleBottleAdditions()
        {
            if (!hasAddedPotionsToHarvestDictionary)
            {
                ItemDropper dropTreasuresRarely = new ItemDropper();
                dropTreasuresRarely.registerNewDrop(new Item_Rope(0), null, 1, .01f);
                dropTreasuresRarely.registerNewDrop(new Item_Bottle_Type_0(0), null, 1, .01f);
                dropTreasuresRarely.registerNewDrop(new Item_Bottle_Type_1(0), null, 1, .01f);
                dropTreasuresRarely.registerNewDrop(new Item_Bottle_Type_2(0), null, 1, .01f);
                dropTreasuresRarely.registerNewDrop(new Item_Bottle_Type_3(0), null, 1, .01f);
                dropTreasuresRarely.registerNewDrop(new Item_Meat(0), null, 1, .01f);
                HarvestDictionary.registerNewHarvest(TileTypeReferencer.POT, new ItemDropper[] { dropTreasuresRarely });

                hasAddedPotionsToHarvestDictionary = true;
            }
        }
Ejemplo n.º 2
0
        public ShrubManager(ChunkDecorator decorator)
        {
            if (decorator.worldGenSubtype != World.WorldGenSubtype.CENOTE)
            {
                //build grass and bushes
                grass              = generateGrass(decorator);
                bush               = generateBush(decorator);
                bush.harvestTicks += getRandValuePlusOrMinus(decorator.rand, Math.Max(decorator.metaDifficulty, 1) * 8);

                grass2              = generateGrass(decorator);
                bush2               = generateBush(decorator);
                bush2.harvestTicks += getRandValuePlusOrMinus(decorator.rand, Math.Max(decorator.metaDifficulty, 1) * 8);

                TileType.replaceTileInDictionary(TileTypeReferencer.REACTIVE_GRASS.TILEID, grass);
                TileType.replaceTileInDictionary(TileTypeReferencer.REACTIVE_BUSH_0.TILEID, bush);
                TileType.replaceTileInDictionary(TileTypeReferencer.REACTIVE_BUSH_1.TILEID, bush2);

                ItemDropper bushDrops = new ItemDropper();
                bushDrops.registerNewDrop(new Item_Grass(0), null, 1, 1f);
                ItemDropper bushDrops2 = new ItemDropper();
                bushDrops2.registerNewDrop(new Item_Grass(0), null, 1, 1f);

                if (decorator.world is World)
                {
                    if (decorator.rand.NextDouble() < .15)//chance to give the bush an interesting drop.
                    {
                        Item_Berry bushBerry = UniverseProperties.availableBerries[decorator.rand.Next(3)];

                        bushDrops.registerNewDrop(bushBerry, null, 1 + decorator.rand.Next(4), (float)(.05 + decorator.rand.NextDouble() * .3));
                    }
                    if (decorator.rand.NextDouble() < .15)//chance to give the bush an interesting drop.
                    {
                        Item_Berry bushBerry = UniverseProperties.availableBerries[decorator.rand.Next(3)];

                        bushDrops2.registerNewDrop(bushBerry, null, 1 + decorator.rand.Next(4), (float)(.05 + decorator.rand.NextDouble() * .3));
                    }
                }



                HarvestDictionary.registerNewHarvest(bush, new ItemDropper[] { bushDrops });
                HarvestDictionary.registerNewHarvest(bush2, new ItemDropper[] { bushDrops2 });

                for (int i = 0; i < 7 + decorator.rand.Next(7); i++)
                {
                    decorator.foliage.Add(new Decoration(new Point(0, 0), new TileType[, ] {
                        { bush },
                    }));
                    decorator.foliageBiome2.Add(new Decoration(new Point(0, 0), new TileType[, ] {
                        { bush2 },
                    }));
                }
            }
            else
            {
                for (int i = 0; i < 7 + decorator.rand.Next(7); i++)
                {
                    decorator.foliage.Add(new Decoration(new Point(0, 0), new TileType[, ] {
                        { TileTypeReferencer.STALAGMITE_TINY },
                    }));
                    decorator.foliageBiome2.Add(new Decoration(new Point(0, 0), new TileType[, ] {
                        { TileTypeReferencer.STALAGMITE_TINY },
                    }));
                }
            }

            //
        }