static void Main(string[] args) { setReaction_Index(); //Move to game for (int i = 0; i < 15; i++) { Console.WriteLine(reaction_id.ElementAt(i)); } //Game g = new Game(); //Encounter_Card ec; //g.set_Encounter_Stack(); //ec = g.pick_Encounter_Card(); //Console.WriteLine(ec.getName()); //Console.WriteLine(ec.getType()); //ec = g.pick_Encounter_Card(); //Console.WriteLine(ec.getName()); //Console.WriteLine(ec.getType()); //ec = g.pick_Encounter_Card(); //Console.WriteLine(ec.getName()); //Console.WriteLine(ec.getType()); //ec = g.pick_Encounter_Card(); //Console.WriteLine(ec.getName()); //Console.WriteLine(ec.getType()); /* Adjective and Reaction Matrix test */ //Console.WriteLine(Adjective_Matrix.Instance.getAdjectiveID('A', "Disguised")); //Console.WriteLine(Adjective_Matrix.Instance.getAdjectiveID(0, "Disguised")); //Console.WriteLine(Adjective_Matrix.Instance.getAdjectiveText('A', 2)); //Console.WriteLine(Adjective_Matrix.Instance.getAdjectiveText(0, 2)); //Console.WriteLine(Reaction_Matrix.Instance.getReactionID('G', "Wait for help")); //Console.WriteLine(Reaction_Matrix.Instance.getReactionID(6, "Wait for help")); //Console.WriteLine(Reaction_Matrix.Instance.getReactionText('G',1)); //Console.WriteLine(Reaction_Matrix.Instance.getReactionText(6,1)); /* Encounter Matrix test */ Encounter_Matrix em = Encounter_Matrix.Instance; Adjective_Matrix am = Adjective_Matrix.Instance; int rt = em.getEncounter(56, 5).getReactionTable(); int adj = em.getEncounter(56, 5).getAdjective(); Console.WriteLine(rt); //Should be 5 Console.WriteLine(getReactionLetter(rt)); //Should be F Console.WriteLine(adj); //Should be 3 Console.WriteLine(am.getAdjectiveText(getAdjectiveText(rt, adj))); //Should be House Console.WriteLine(em.getEncounter(56, 5).getName()); //Should be Fire /*Card + Position test*/ Encounter_Card ec = new Terrain_Encounter("Dendan", new int[] { 42, 44, -1, 7, 46, 45 }, 'N'); Spaces s = new Spaces("", 4, Spaces.TYPE_MOUNTAINS); Console.WriteLine(ec.getEncounterTable(s)); //should be 42 /*Same as before, plus Encounter*/ int dicerole = 3; //Need Randomizer Encounter e = em.getEncounter(ec.getEncounterTable(s), s.getValue() + dicerole); //eventually add depending of the player points Console.WriteLine(e.getReactionTable()); // should be 5 Console.WriteLine(getReactionLetter(e.getReactionTable())); // should be F Console.WriteLine(e.getName()); // should be River Console.WriteLine(e.getAdjective()); // should be 7 Console.WriteLine(am.getAdjectiveText(e.getAdjective())); // should be Mysterious //42;F;7;Mysterious;River /*Same as before, plus Tales*/ int reaction; //Need ask Console.ReadKey(); }
/* * * Set the Encounter Deck content * */ public void set_Encounter_Stack() { encounter_stack = new Stack <Encounter_Card>(); string[] line_content; string[] lines = System.IO.File.ReadAllLines("Encounter_Card.txt"); Encounter_Card current_Card = new Terrain_Encounter("ERROR", new int[] { 0 }); string card_name; int[] values; string card_type; for (int i = 0; i < lines.Length; i++) { line_content = lines[i].Split(';'); card_name = line_content[1]; card_type = line_content[0]; if (card_type == "City") { City_Card_Reward[] rewards; rewards = new City_Card_Reward[6]; values = new int[1]; values[0] = Int32.Parse(line_content[2]); for (int j = 0; j < 6; j++) { String[] reward_content = line_content[j + 3].Split(','); rewards[j] = new City_Card_Reward(); String type = reward_content[0]; switch (type) { case "E": rewards[j].Type = City_Card_Reward.TYPE_ENCOUNTER; rewards[j].EncounterName = reward_content[1]; //CHECK FOR TABLE IF IT'S NUMBER (I think its all the same table for the choice in the table) rewards[j].EncounterTable = reward_content[2]; break; case "S": rewards[j].Type = City_Card_Reward.TYPE_SKILL; rewards[j].SkillStatusID = Int32.Parse(reward_content[1]); break; case "T": rewards[j].Type = City_Card_Reward.TYPE_TREASURE; rewards[j].Amount = Int32.Parse(reward_content[1]); break; case "D": rewards[j].Type = City_Card_Reward.TYPE_DESTINY; rewards[j].Amount = Int32.Parse(reward_content[1]); break; case "H": rewards[j].Type = City_Card_Reward.TYPE_STORY; rewards[j].Amount = Int32.Parse(reward_content[1]); break; case "W": rewards[j].Type = City_Card_Reward.TYPE_WEALTH; rewards[j].Amount = Int32.Parse(reward_content[1]); rewards[j].WealthID = new Wealth(Int32.Parse(reward_content[2])); break; case "LS": rewards[j].Type = City_Card_Reward.TYPE_LOSE_STATUS; break; case "GS": rewards[j].Type = City_Card_Reward.TYPE_GAIN_STATUS; rewards[j].SkillStatusID = Int32.Parse(reward_content[1]); break; case "US": rewards[j].Type = City_Card_Reward.TYPE_UPGRADE_SKILL; //TRIGGER CHOICE rewards[j].SkillLevel = true; break; case "SE": rewards[j].Type = City_Card_Reward.TYPE_SKILL_ENCOUNTER; rewards[j].SkillStatusID = Int32.Parse(reward_content[1]); rewards[j].EncounterName = reward_content[2]; rewards[j].EncounterTable = reward_content[3]; break; } } current_Card = new City_Encounter(card_name, values, rewards); } else { values = new int[line_content.Length - 2]; for (int j = 0; j < values.Length; j++) { values[j] = Int32.Parse(line_content[j + 2]); } if (card_type == "Character") { current_Card = new Character_Encounter(card_name, values); } else if (card_type == "Terrain") { current_Card = new Terrain_Encounter(card_name, values); } } encounter_stack.Push(current_Card); } //Then we need to shuffle it while (encounter_stack.Count > 0) { discarded_encounter_stack.Add(encounter_stack.Pop()); } shuffle_Encounter_Deck(); }