private TGCVector3 RandomWaterSpawnLocation() { TGCVector3 spawnLocation = RandomSpawnLocation(); spawnLocation.Y = MathExtended.GetRandomNumberBetween((int)gameInstance.FloorLevelToWorldHeight(gameInstance.SueloDelMar.YMax), (int)gameInstance.WaterLevelToWorldHeight(-100)); return(spawnLocation); }
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); }
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(); } }