예제 #1
0
        private TGCVector3 RandomWaterSpawnLocation()
        {
            TGCVector3 spawnLocation = RandomSpawnLocation();

            spawnLocation.Y = MathExtended.GetRandomNumberBetween((int)gameInstance.FloorLevelToWorldHeight(gameInstance.SueloDelMar.YMax), (int)gameInstance.WaterLevelToWorldHeight(-100));
            return(spawnLocation);
        }
예제 #2
0
        private TGCVector3 RandomSpawnLocation()
        {
            Random     random        = new Random();
            TGCVector3 spawnLocation = TGCVector3.Empty;

            spawnLocation.X = MathExtended.GetRandomNumberBetween(-gameInstance.BoundariesRadius, gameInstance.BoundariesRadius);
            spawnLocation.Y = MathExtended.GetRandomNumberBetween(-gameInstance.BoundariesRadius, gameInstance.BoundariesRadius);
            spawnLocation.Z = MathExtended.GetRandomNumberBetween(-gameInstance.BoundariesRadius, gameInstance.BoundariesRadius);

            return(spawnLocation);
        }
예제 #3
0
        public void Craft(Player crafter)
        {
            if (CanCraft(crafter))
            {
                Item craftedItem = ItemDatabase.Instance.Generate(ProductId);
                RemoveRequirementsFrom(crafter);
                crafter.CollectItem(craftedItem);

                var craftingSounds = crafter.GameInstance.CraftingSounds;
                craftingSounds[MathExtended.GetRandomNumberBetween(0, craftingSounds.Count)].play();
            }
            else
            {
                crafter.GameInstance.CraftingFailSound.play();
            }
        }