IEnumerator SpawnNPC() { yield return(new WaitForSeconds(Random.Range(minSecondsBetweenSpawn, maxSecondsBetweenSpawn))); var npc = Instantiate(NPC); npc.GetComponent <NPC>().PlayerName = RandomName.Generate(); StartCoroutine(SpawnNPC()); }
public static Person GetRandom() { Person peep = new Person(); peep.Age = Global.RandomGenerator.Next(100); peep.Name = m_nameGen.Generate(Sex.Male); peep.State = Global.RandomState(); peep.FriendsNames = m_nameGen.RandomNames(100, 2); return(peep); }
public Ghost GenerateGhost(Board board) { Ghost ghost = Object.Instantiate(PrefabRegistry.I.ghost).GetComponent <Ghost>(); ghost.Init(0); ghost.nameSet = RandomName.Generate(); ghost.summonRoom = RandomRoom(board); ghost.summonPosition = FindSummonPosition(ghost.summonRoom); InstallRandomPersonality(ghost); return(ghost); }
public static Worker GenerateRandomWorker() { Random rand = new Random(); RandomName nameGen = new RandomName(rand); var worker = new Worker() { Name = nameGen.Generate((Sex)rand.Next(0, 2), rand.Next(0, 2)), Cost = 2000 }; var weights = new Dictionary <int, int>() { { 1, 40 }, { 2, 40 }, { 3, 15 }, { 4, 4 }, { 5, 1 }, }; worker.Efficiency = WeightedRandomizer.From(weights).TakeOne(); return(worker); }
public PlayerState() { this.MoneyPercentageSkillLevel = 1; this.EfficiencyPercentageSkillLevel = 1; Random rand = new Random(); RandomName nameGen = new RandomName(rand); Workers = new List <Worker.Worker> { new Worker.Worker() { Efficiency = 2, Name = nameGen.Generate((Sex)rand.Next(0, 2), rand.Next(0, 2)), Cost = 2000 }, }; Customers = new List <Customer>(); UnlockedDrinks = new List <Drink> { new Drink() { name = "Cappuccino", price = 7 }, new Drink() { name = "coffee", price = 3 }, new Drink() { name = "flat white", price = 2 } }; for (var i = 0; i < 100; i++) { Customers.Add(new Customer() { FavoriteDrink = UnlockedDrinks[0], Name = $"Customer{i}", Satisfaction = 20 }); } }
public Customer() { name = RandomName.Generate(2); patience = Random.Range(30, 60); order = new Order(); }