Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i am looking for code that goes in line with what the definitions in the first picture ask the program below to perform. v i
i am looking for code that goes in line with what the definitions in the first picture ask the program below to perform.
v
i need help implementing these functions into the required code that i sent.
1. Increment player's level 2. randonly at health to player using randomHealth distribution (at least 1) 3. same for strength, but randomstrength distribution. 4. create distributions for random item a. unifrom -Item: : Type: :numTypes-1 for type b. normal player. level, player. level /3 for bonusvalue. 5. create new item with randon values. 6. cout the information about the iten. 7. use find to see if you have that type of item. a. If you don't, assign it. b. if you do, check bonus value. Keep if new iten bigger. int calculateAC(const Object\& object) //check for armor and shield //return to the combined bonus values. std: ivectoreobject ereatellonsters(const objecta player ); void ponsterttick(objecta player, const std: vectoreobjectae monsters); vold bringoutYoundeau(std: ivectoreobjectat mensters); void ptayenketrek(const objecte player, stditvectoreobjectoa nonsters); vold tenotup(objectg player); Nis bssuts found std: icout s "What do you do? (a)ttack (h)eal "; char conaand ' ' x ' 3 ; std: cin > s conand; sin1 tech (conand) t case 'a': t playerAttack(player, monsters); break; case 'h': heat(player); break; defautt: std: :cout "please enter a or h* stdi iendl; break; bringoutYourDead(nonsters); monsterAttack(player, nonsters); systea("PAUSE"); systen("CLS"); If (player. health nonsters; std: : normal_distributionedouble> randonvunHonsters((double)player. Level, player.levet / 2.e); int numhonsters ( std: max(1, (int)randonNunHonsters(engine)) ); for (int 1(1;1 monsterlevel(cfloat)player. Level, player. Level /4.0); int levelf std: aax(1, (int)monsterlevel(engine)) ); std: :uniforn_int_distribution1; double strengthVariancef 0.0}; double healthvariancef 0.01; snitch (nane) case Object: T Type: s stine: strengthvariance = level 1.5; heatthvariance = level 1.25; break; case Object: :Type:tore: strengthvariance = level * 2; heatthvariance = level level 1.25; break; case object::Type: : sprite: strengthvariance = level 1.75; heatthvariance = level; break; case object:: Type: :dragon: strengthvariance = level 6; heatthvartance = level level 3;i quoid playerattack(const object player, std: ivectoreobject>e nonsters) quoid levelup(objecte player) 1. 1. Increnent player's level 2. randonly at heatth to player using randomHealth distribution (at least 1) 3. sase for strength, but randonstrength distribution. 4. create distributions for random item a. unifrom 0-Itea: :Type: inuatypes-1 for type b. normal player. Level, player. level/3 for bonusvatue. 5. create new iten with randon vatues. 6. cout the information about the item. 7. use find to see if you have that type of itea. a. If you don't, assign it. b. if you do, check bonus value. Keep if new iten bigger. std: :noreal_distresubionedouble> randonHeat th (20.0+ player. Level 5,5.0); std: :noreal_distributionedouble> randonstrength(3.0 + player. Level, 1.0); Gvoid bringoutYourbead(std: ivectoreobjectad nonsters) for(automonsterIter(monsters,begin(O);wonsterIteri=nensters,end();)( If(monsterIter-sheatthen0) printhae(*mensterIter); std: : cout e " has died111" std: tendl \& std: iendli; monsterIter = mensters, exase(aensterIter); 1 else t nonsterIter+4; 1. Increment player.s level 2. randomly add health to player using randomHealth distribution (at least 1) 3. same for strength, but randomstrength distribution. 4. create distributions for random item a. unif rom 0 -Item: : Type: :numTypess-1 for type b. normal player.level, playT. level/3 for bonuaValue. 5. create new iten with random vatues. 6. cout the information about the item. 7. use find to see if you have that type of item. a. If you. don"t, assign it. b. If you do, check bonus value. Keep if new Item bigger. 1. Increment player's level 2. randonly at health to player using randomHealth distribution (at least 1) 3. same for strength, but randomstrength distribution. 4. create distributions for random item a. unifrom -Item: : Type: :numTypes-1 for type b. normal player. level, player. level /3 for bonusvalue. 5. create new item with randon values. 6. cout the information about the iten. 7. use find to see if you have that type of item. a. If you don't, assign it. b. if you do, check bonus value. Keep if new iten bigger. int calculateAC(const Object\& object) //check for armor and shield //return to the combined bonus values. std: ivectoreobject ereatellonsters(const objecta player ); void ponsterttick(objecta player, const std: vectoreobjectae monsters); vold bringoutYoundeau(std: ivectoreobjectat mensters); void ptayenketrek(const objecte player, stditvectoreobjectoa nonsters); vold tenotup(objectg player); Nis bssuts found std: icout s "What do you do? (a)ttack (h)eal "; char conaand ' ' x ' 3 ; std: cin > s conand; sin1 tech (conand) t case 'a': t playerAttack(player, monsters); break; case 'h': heat(player); break; defautt: std: :cout "please enter a or h* stdi iendl; break; bringoutYourDead(nonsters); monsterAttack(player, nonsters); systea("PAUSE"); systen("CLS"); If (player. health nonsters; std: : normal_distributionedouble> randonvunHonsters((double)player. Level, player.levet / 2.e); int numhonsters ( std: max(1, (int)randonNunHonsters(engine)) ); for (int 1(1;1 monsterlevel(cfloat)player. Level, player. Level /4.0); int levelf std: aax(1, (int)monsterlevel(engine)) ); std: :uniforn_int_distribution1; double strengthVariancef 0.0}; double healthvariancef 0.01; snitch (nane) case Object: T Type: s stine: strengthvariance = level 1.5; heatthvariance = level 1.25; break; case Object: :Type:tore: strengthvariance = level * 2; heatthvariance = level level 1.25; break; case object::Type: : sprite: strengthvariance = level 1.75; heatthvariance = level; break; case object:: Type: :dragon: strengthvariance = level 6; heatthvartance = level level 3;i quoid playerattack(const object player, std: ivectoreobject>e nonsters) quoid levelup(objecte player) 1. 1. Increnent player's level 2. randonly at heatth to player using randomHealth distribution (at least 1) 3. sase for strength, but randonstrength distribution. 4. create distributions for random item a. unifrom 0-Itea: :Type: inuatypes-1 for type b. normal player. Level, player. level/3 for bonusvatue. 5. create new iten with randon vatues. 6. cout the information about the item. 7. use find to see if you have that type of itea. a. If you don't, assign it. b. if you do, check bonus value. Keep if new iten bigger. std: :noreal_distresubionedouble> randonHeat th (20.0+ player. Level 5,5.0); std: :noreal_distributionedouble> randonstrength(3.0 + player. Level, 1.0); Gvoid bringoutYourbead(std: ivectoreobjectad nonsters) for(automonsterIter(monsters,begin(O);wonsterIteri=nensters,end();)( If(monsterIter-sheatthen0) printhae(*mensterIter); std: : cout e " has died111" std: tendl \& std: iendli; monsterIter = mensters, exase(aensterIter); 1 else t nonsterIter+4; 1. Increment player.s level 2. randomly add health to player using randomHealth distribution (at least 1) 3. same for strength, but randomstrength distribution. 4. create distributions for random item a. unif rom 0 -Item: : Type: :numTypess-1 for type b. normal player.level, playT. level/3 for bonuaValue. 5. create new iten with random vatues. 6. cout the information about the item. 7. use find to see if you have that type of item. a. If you. don"t, assign it. b. If you do, check bonus value. Keep if new Item bigger Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started