/// <summary> /// Add Monsters to the Round /// /// Because Monsters can be duplicated, will add 1, 2, 3 to their name /// /* * Hint: * I don't have crudi monsters yet so will add 6 new ones... * If you have crudi monsters, then pick from the list * Consdier how you will scale the monsters up to be appropriate for the characters to fight * */ /// </summary> /// <returns></returns> public int AddMonstersToRound() { var monsterModel = MonsterIndexViewModel.Instance; Random rnd = new Random(); int TargetLevel = 1; int MaxLevel = 20; if (CharacterList.Count() > 0) { // Get the Min Character Level (linq is soo cool....) TargetLevel = Convert.ToInt32(CharacterList.Min(m => m.Level)); MaxLevel = Convert.ToInt32(CharacterList.Max(m => m.Level)); } /* Hack 31 has been implemented. If the round count is > 100 * then the monster's speed, defense, attack, current health, and max health * are buffed 10x */ for (var i = 0; i < MaxNumberPartyMonsters; i++) { int index = rnd.Next(0, MaxNumberPartyMonsters - 1); var data = monsterModel.Dataset[index]; data.Level = TargetLevel; data.Speed = getAttributeLevel(); data.Defense = getAttributeLevel(); data.Attack = getAttributeLevel(); data.MaxHealth = DiceHelper.RollDice(TargetLevel, 10); data.CurrentHealth = data.MaxHealth; MonsterList.Add(new PlayerInfoModel(data)); } return(MonsterList.Count()); }
// Add Monsters // Scale them to meet Character Strength... public void AddMonstersToRound() { // Check to see if the monster list is full, if so, no need to add more... if (MonsterList.Count() >= GameGlobals.MaxNumberPartyPlayers) { return; } // Make Sure Monster List exists and is loaded... var myMonsterViewModel = MonstersViewModel.Instance; if (myMonsterViewModel.Dataset.Count() > 0) { // Scale monsters to be within the range of the Characters var ScaleLevelMax = 1; var ScaleLevelMin = 1; var ScaleLevelAverage = 1; if (CharacterList.Any()) { ScaleLevelMax = GetMaxCharacterLevel(); ScaleLevelMin = GetMinCharacterLevel(); ScaleLevelAverage = GetAverageCharacterLevel(); } // Get 1 monsters do { //Force Random Roll here. Important for the debug override setting. //Game will not work without a random value here var rnd = HelperEngine.RollDice(1, myMonsterViewModel.Dataset.Count, true); { var monster = new Monster(myMonsterViewModel.Dataset[rnd - 1]); // Help identify which monster it is... monster.Name += " " + (1 + MonsterList.Count()).ToString(); // Scale the monster to be between the average level of the characters+1 var rndScale = HelperEngine.RollDice(1, ScaleLevelAverage + 1); monster.ScaleLevel(rndScale); MonsterList.Add(monster); } } while (MonsterList.Count() < 1); } else { // No monsters in DB, so add 1 new ones... for (var i = 0; i < 1; i++) { var item = new Monster(); // Help identify which monster it is... item.Name += " " + MonsterList.Count() + 1; MonsterList.Add(item); } } }
/// <summary> /// Adds monsters to the round. /// Since monsters may be duplicated, appends a number to the name of each monster. /// </summary> /// <returns></returns> public int AddMonstersToRound(List <MonsterModel> monsters) { for (var i = 0; i < MaxNumberMonsters; i++) { var data = monsters[i]; MonsterList.Add(data); } return(MonsterList.Count()); }
/// <summary> /// Add Monsters to the Round /// /// Because Monsters can be duplicated, will add 1, 2, 3 to their name /// </summary> /// <returns></returns> public int AddMonstersToRound() { for (var i = 0; i < MaxNumberPartyMonsters; i++) { var data = new MonsterModel(); // Help identify which Monster it is data.Name += " " + MonsterList.Count() + 1; MonsterList.Add(new PlayerInfoModel(data)); } return(MonsterList.Count()); }
/// <summary> /// Add Monsters to the Round /// </summary> /// <returns></returns> public int AddMonstersToRound() { foreach (var data in MonsterIndexViewModel.Instance.Dataset) { if (MonsterList.Count() >= MaxNumberPartyMonsters) { break; } //data.Attack += 50; //data.Level = 10; MonsterList.Add(new EntityInfoModel(data)); } return(MonsterList.Count()); }
// Add Monsters // Scale them to meet Character Strength... private void AddMonstersToRound() { // Check to see if the monster list is full, if so, no need to add more... if (MonsterList.Count() >= 6) { return; } // TODO, determine the character strength // add monsters up to that strength... var ScaleLevelMax = 2; var ScaleLevelMin = 1; // Make Sure Monster List exists and is loaded... var myMonsterViewModel = MonstersViewModel.Instance; myMonsterViewModel.ForceDataRefresh(); if (myMonsterViewModel.Dataset.Count() > 0) { // Get 6 monsters do { var rnd = HelperEngine.RollDice(1, myMonsterViewModel.Dataset.Count); { var item = new Monster(myMonsterViewModel.Dataset[rnd - 1]); // Help identify which monster it is... item.Name += " " + (1 + MonsterList.Count()).ToString(); var rndScale = HelperEngine.RollDice(ScaleLevelMin, ScaleLevelMax); item.ScaleLevel(rndScale); MonsterList.Add(item); } } while (MonsterList.Count() < 6); } else { // No monsters in DB, so add 6 new ones... for (var i = 0; i < 6; i++) { var item = new Monster(); // Help identify which monster it is... item.Name += " " + MonsterList.Count() + 1; MonsterList.Add(item); } } }
///// <summary> ///// Hackathon Scenario 33 - unlucky things happen on round 13 ///// Random character falls down dead ///// </summary> //public void UnluckyRound() //{ // // first, check whether forced dice rolls are being used // // if they are, exit to avoid trying to access an invalid index or create an endless loop // if (DiceHelper.ForceConstantRoll == true) // { // var index = DiceHelper.ForcedDiceRollValue - 1; // if (index >= 0 && index < CharacterList.Count()) // { // MakeEntityList(); // var character = CharacterList[index]; // if (character.Alive) // TargetDied(EntityList.First(a => a.Id == character.Id)); // } // return; // } // int count = 0; // while (count == 0) // { // var diceroll = DiceHelper.RollDice(1, CharacterList.Count()) - 1; // var character = CharacterList[diceroll]; // if (character.Alive) // { // TargetDied(EntityList.First(a => a.Id == character.Id)); // BattleMessages.TurnMessageSpecial = character.Name + " dies a horribly unlucky death!"; // Debug.WriteLine(BattleMessages.TurnMessageSpecial); // count++; // } // } //} /// <summary> /// Adds monsters to the round. /// Since monsters may be duplicated, appends a number to the name of each monster. /// </summary> /// <returns></returns> public int AddMonstersToRound() { // used for scaling monsters to level of characters int averageLevel = GetAverageCharacterLevel(); var level = averageLevel; var range = new List <int> { averageLevel }; if (averageLevel > 2 && averageLevel < 20) { range = new List <int> { averageLevel - 1, averageLevel, averageLevel + 1, averageLevel + 2 }; } for (var i = 0; i < MaxNumberMonsters; i++) { var data = new MonsterModel(RandomEntityHelper.GetMonsterType()); // slightly randomizes Monster levels if (range.Count > 1) { var dice = DiceHelper.RollDice(1, range.Count()) - 1; if (dice >= 0 && dice < range.Count()) { level = range.ElementAt(dice); } } data.ChangeLevel(level); if (level == 1) { // MONSTERS SHOULDN'T GIVE ZERO EXPERIENCE :( data.ExperienceGiven = 100; } MonsterList.Add(data); } return(MonsterList.Count()); }
/// <summary> /// Add Monsters to the Round /// /// Because Monsters can be duplicated, will add 1, 2, 3 to their name /// /* * Hint: * I don't have crudi monsters yet so will add 6 new ones... * If you have crudi monsters, then pick from the list * * Consdier how you will scale the monsters up to be appropriate for the characters to fight * */ /// </summary> /// <returns></returns> public int AddMonstersToRound() { // TODO: Teams, You need to implement your own Logic can not use mine. int TargetLevel = 1; if (CharacterList.Count() > 0) { // Get the Min Character Level (linq is soo cool....) TargetLevel = Convert.ToInt32(CharacterList.Min(m => m.Level)); } for (var i = 0; i < MaxNumberPartyMonsters; i++) { var data = Helpers.RandomPlayerHelper.GetRandomMonster(TargetLevel); // Help identify which Monster it is data.Name += " " + MonsterList.Count() + 1; //Scenario 31 if (BattleScore.RoundCount >= 100) { data.Attack *= 10; data.Speed *= 10; data.Defense *= 10; data.CurrHealth *= 10; data.MaxHealth *= 10; } MonsterList.Add(new PlayerInfoModel(data)); } if ((BossBattleFunctionality && DiceHelper.RollDice(1, 100) > 90) || testBossHack) { Debug.WriteLine("BOSS MONSTER APPROACHING!!!!!"); MonsterList.Clear(); int scaleFactor = 0; for (int i = 0; i < CharacterList.Count; i++) { scaleFactor += CharacterList[i].Level; } if (scaleFactor > 20) { scaleFactor = 20; } var data = new BaseMonster(); data.LevelUpToValue(scaleFactor); data.Attack = 5000; data.Defense = 5000; data.Speed = 10000; data.MaxHealth = data.CurrHealth = 1000; MonsterList.Add(new PlayerInfoModel(data)); } return(MonsterList.Count()); }
// Add Monsters // Scale them to meet Character Strength... public void AddMonstersToRound() { // Check to see if the monster list is full, if so, no need to add more... if (MonsterList.Count() >= GameGlobals.MaxNumberPartyPlayers) { return; } // Make Sure Monster List exists and is loaded... var myMonsterViewModel = MonstersViewModel.Instance; if (myMonsterViewModel.Dataset.Count() > 0) { // Scale monsters to be within the range of the Characters var ScaleLevelMax = 1; var ScaleLevelMin = 1; var ScaleLevelAverage = 1; if (CharacterList.Any()) { ScaleLevelMax = GetMaxCharacterLevel(); ScaleLevelMin = GetMinCharacterLevel(); ScaleLevelAverage = GetAverageCharacterLevel(); } // Get 6 monsters //IF BOSS BATTLE THIS CHANGES if (GameGlobals.BossBattles) { //roll D100 //determine if BB are enabled Random random = new Random(); int checkValue = random.Next(0, 100); //determine if BB is enabled if (checkValue < GameGlobals.BossBattleChance * 100) { //enable BB and the battle is a boss //this is General Woundwort var monster = new Monster(myMonsterViewModel.Dataset[0]); monster.Name += " " + (1 + MonsterList.Count()).ToString(); // Scale the monster to be between the average level of the characters+1 //but bc its a boss make it stronger var rndScale = HelperEngine.RollDice(1, ScaleLevelAverage + 4); monster.ScaleLevel(rndScale); MonsterList.Add(monster); } else { do { var rnd = HelperEngine.RollDice(1, myMonsterViewModel.Dataset.Count); { var monster = new Monster(myMonsterViewModel.Dataset[rnd - 1]); // Help identify which monster it is... monster.Name += " " + (1 + MonsterList.Count()).ToString(); // Scale the monster to be between the average level of the characters+1 var rndScale = HelperEngine.RollDice(1, ScaleLevelAverage + 1); monster.ScaleLevel(rndScale); MonsterList.Add(monster); } } while (MonsterList.Count() < GameGlobals.MaxNumberPartyPlayers); } } else { do { var rnd = HelperEngine.RollDice(1, myMonsterViewModel.Dataset.Count); { var monster = new Monster(myMonsterViewModel.Dataset[rnd - 1]); // Help identify which monster it is... monster.Name += " " + (1 + MonsterList.Count()).ToString(); // Scale the monster to be between the average level of the characters+1 var rndScale = HelperEngine.RollDice(1, ScaleLevelAverage); monster.ScaleLevel(rndScale); MonsterList.Add(monster); } } while (MonsterList.Count() < GameGlobals.MaxNumberPartyPlayers); } //// No monsters in DB, so add 6 new ones... //for (var i = 0; i < GameGlobals.MaxNumberPartyPlayers; i++) //{ // var item = new Monster(); // // Help identify which monster it is... // item.Name += " " + MonsterList.Count() + 1; // MonsterList.Add(item); //} } }
// Add Monsters // Scale them to meet Character Strength... private void AddMonstersToRound() { // Check to see if the monster list is full, if so, no need to add more... if (MonsterList.Count() >= 6) { return; } // Make suure monster list exists and is loaded... var myMonsterViewModel = MonstersViewModel.Instance; //myMonsterViewModel.ForceDataRefresh(); // Scale monsters based on current character levels if (myMonsterViewModel.Dataset.Count() > 0) { // Scale monsters to be within the range of the characters var ScaleLevelMax = 1; var ScaleLevelMin = 1; var ScaleLevelAverage = 1; // If there are any characters get min, max, and average levels of all of them if (CharacterList.Any()) { ScaleLevelMin = GetMinCharacterLevel(); ScaleLevelMax = GetMaxCharacterLevel(); ScaleLevelAverage = GetAverageCharacterLevel(); } // Get 6 monsters do { // Roll dice to get random monster from dataset var rnd = HelperEngine.RollDice(1, myMonsterViewModel.Dataset.Count); { // Ensure rnd number is less than dataset size if (rnd > myMonsterViewModel.Dataset.Count()) { rnd = myMonsterViewModel.Dataset.Count(); } // Create a new monster from the monster in the dataset var monster = new Monster(myMonsterViewModel.Dataset[rnd - 1]); // Scale the monster to be between the average level of the characters+1 var rndScale = HelperEngine.RollDice(1, ScaleLevelAverage + 1); // Scale monster to be harder later... monster.ScaleLevel(rndScale); // Add monster to the list MonsterList.Add(monster); } } while (MonsterList.Count() < 6); } else { // No mosnters in DB, so add 6 new ones... for (var i = 0; i < 6; i++) { var monster = new Monster(); // Help identify which monster it is.... monster.Name += " " + MonsterList.Count() + 1; // Add monster to the list MonsterList.Add(monster); } } // Debug output text for chosen monsters var monstersOutput = "Chosen monsters: \n"; monstersOutput += "Count: " + MonsterList.Count() + "\n";; // Add name of each monster to debug output statement foreach (var mon in MonsterList) { monstersOutput += mon.FormatOutput() + "\n"; } // Write the debug output statement Debug.WriteLine(monstersOutput); }
// Add Monsters // Scale them to meet Character Strength... public void AddMonstersToRound() { // Check to see if the monster list is full, if so, no need to add more... if (MonsterList.Count() >= 6) { return; } // init monster scaling var ScaleLevelMax = 6; var ScaleLevelMin = 6; // scale based on game harder which is enabled by default if (GameGlobals.EnableGameHarder) { // Scale monsters based on round count.. higher round higher and stronger monsters if (BattleScore.RoundCount <= 1) { ScaleLevelMax = 1; ScaleLevelMin = 1; } if (BattleScore.RoundCount > 0 && BattleScore.RoundCount <= 2) { ScaleLevelMax = 2; ScaleLevelMin = 2; } if (BattleScore.RoundCount > 2 && BattleScore.RoundCount <= 4) { ScaleLevelMax = 4; ScaleLevelMin = 4; } if (BattleScore.RoundCount > 4 && BattleScore.RoundCount <= 8) { ScaleLevelMax = 8; ScaleLevelMin = 8; } if (BattleScore.RoundCount > 8 && BattleScore.RoundCount <= 16) { ScaleLevelMax = 16; ScaleLevelMin = 16; } if (BattleScore.RoundCount > 50) { ScaleLevelMax = 20; ScaleLevelMin = 20; } } else { ScaleLevelMax = 6; ScaleLevelMin = 6; } // Make Sure Monster List exists and is loaded... var myMonsterViewModel = MonstersViewModel.Instance; //myMonsterViewModel.ForceDataRefresh(); if (myMonsterViewModel.Dataset.Count() > 0) { // Get 6 monsters based on the scaling that was set earlier and assign unique items to monster do { var RndMon = HelperEngine.RollDice(1, myMonsterViewModel.Dataset.Count); { var mons = new Monster(myMonsterViewModel.Dataset[RndMon - 1]); // Help identify which monster it is... mons.Name += " " + (1 + MonsterList.Count()).ToString(); var rndScale = HelperEngine.RollDice(ScaleLevelMin, ScaleLevelMax); mons.ScaleLevel(rndScale); MonsterList.Add(mons); } } while (MonsterList.Count() < 6); } else { // No monsters in DB, so add 6 new ones... for (var i = 0; i < 6; i++) { var mon = new Monster(); // Help identify which monster it is... mon.Name += " " + MonsterList.Count() + 1; MonsterList.Add(mon); } } }