private void Awake() { Characters = new List <Character>(); for (int i = 0; i < NumofCharacters; i++) { Character character = GenerateRandomCharacter.GenerateCharacter(); AddCharacter(character); } }
private void Awake() { SpareCharacterPool = new List <Character>(); if (GenerateRandomClanMembers) { for (int i = 0; i < 20; i++) { var character = GenerateRandomCharacter.GenerateCharacter(); SpareCharacterPool.Add(character); } } }
//Gerenate characters to be bought private void Awake() { _partyInventory = FindObjectOfType <PartyInventory>(); RandomCharacterPool = new List <Character>(); if (RandomCharacter) { for (int i = 0; i < 4; i++) { var character = GenerateRandomCharacter.GenerateCharacter(); RandomCharacterPool.Add(character); Prices.Add(Random.Range(15, 21)); } } }
static void Main(string[] args) { Console.WriteLine("Any letter other than y exits."); bool loop = true; do { string r = Console.ReadLine(); if (r == "y") { string skills = string.Empty; CharacterModel characterModel = new GenerateRandomCharacter().CharacterModel; Console.WriteLine($"{characterModel.PlayerName}'s character: {characterModel.CharacterName}"); Console.WriteLine($"Strenght: {characterModel.Strength} - {characterModel.StrenghtModifier}"); Console.WriteLine($"Dexterity: {characterModel.Dexterity} - {characterModel.DexterityModifier}"); Console.WriteLine($"Constitution: {characterModel.Constitution} - {characterModel.ConstitutionModifier}"); Console.WriteLine($"Intellegence: {characterModel.Intellegence} - {characterModel.IntellegenceModifier}"); Console.WriteLine($"Wisdom: {characterModel.Wisdom} - {characterModel.WisdomModifier}"); Console.WriteLine($"Charisma: {characterModel.Charisma} - {characterModel.CharismaModifier}"); Console.WriteLine($"Experience: {characterModel.ExperiencePoints}"); Console.WriteLine($"Proficiency: {characterModel.ProficiencyBonus}"); Console.WriteLine($"Total Level: {characterModel.TotalLevels}"); foreach (var str in characterModel.Skills) { if (skills == string.Empty) { skills = $"{str.SkillName}"; } else { skills += $",{str.SkillName}"; } } Console.WriteLine($"Total Skills: {skills}"); Console.WriteLine("\nGo again?"); } else { loop = false; } } while (loop); }
// Buy Character, remove character from barracks add character to party if party is full // add character to clan public void BuyCharacter(int index) { if (_partyInventory.Gold - Prices[index] >= 0) { if (FindObjectOfType <PlayerManager>().Characters.Count < 4) { AddToParty(RandomCharacterPool[index]); } else { AddToClan(RandomCharacterPool[index]); } _partyInventory.Gold -= Prices[index]; //generate new character to replace the old one RandomCharacterPool[index] = GenerateRandomCharacter.GenerateCharacter(); Prices[index] = Random.Range(15, 21); } }