Categories: Uncategorized

Object Oriented programming C++ Assignment | Essay Help Services

write a program that simulates the fundamental aspects of the combat of the game Darkest Dungeon by Red Hook Studios.CMP 1002 – Object Oriented Programming – Spring 2020
Darkest Dungeon Combat Simulator Project

“In time, you will know the tragic extent of my failings …”
Outline: In this project, you are expected to write a program that simulates the fundamental aspects of the combat of the game Darkest Dungeon by Red Hook Studios.
Darkest Dungeon is a roguelike dungeon crawler game where you fight with monsters in dungeons with a team of heroes (the game has other aspects, but this is what we are focusing on in the project.) In a combat, up to 4 heroes (hero team) fight with up to 4 monsters (monster team) in a turn-based fashion. The combat is divided into discrete rounds, and in each round each hero and monster (i.e., unit) have a single turn where he/she uses one skill. The combat lasts until either all heroes in the hero team dies or all monsters in the monster team dies.
Turn order:
All units have a Speed rating (int value, could be any value). At the start of the round, for each unit the game generates a random number between 1 – 8 (i.e., Uniform (1,8)) and adds this number to the unit’s speed rating. Then, the units act in the descending order of this round speed starting with the one with the highest.
Skills:
When it is their turn, a unit uses one skill based on their position in their party. The skills are either attack skills, which causes damage to at least one unit of the other team, or utility skills, which gives a benefit to a unit of their team. Each skill is only usable at certain positions within the party and can only target units at certain positions within the party.
Example: The attack skill named “Smite” of a Crusader is only usable if the Crusader is either at Position 1 or 2 of the hero team and can only target monsters at Position 1 or 2 of the monster team.
Hero Team
Monster Team
2
Example: The utility skill named “Bulwark of Faith” of a Crusader is only usable if the Crusader is either at Position 1 or 2 of the hero team and can only target the Crusader himself regardless of his position. On the other hand, the utility skill named “Battle Heal” of a Crusader is usable in any position and can target any hero in the hero team.
Attack and Dealing Damage:
When a unit uses a combat skill over another unit, then the game makes a couple of checks if the attack is successful, and if it is how much damage the attacker dealt to the defender.
1. Hitting or Missing: Each attack skill has a Base Accuracy (e.g., Smite 85) (baseAcc). Then, each unit has an accuracy modifier (accMod) rating based on the unit type and unit level. Similarly, the target unit has a dodge rating (dodge). The hit chance of the attack is:
Hit Chance = baseAcc + accMod – dodge
Then, the game generates a random number between 0 – 100, if the random number is less than or equal to the hit chance, the attack hits; otherwise it misses.
If the attack hits, then the game calculates if the hit is a critical hit or a normal hit. Each unit has a base critical chance (baseCrit) and each skill has a critical modifier (critMod). The critical chance of an attack is:
Critical Chance = baseCrit + critMod
Then, the game generates a random number between 0 – 100, if the random number is less than or equal to the critical chance, the attack is a critical hit; otherwise it is a normal hit.
2. Dealing Damage: Each unit has a base minimum damage (minDmg) and a maximum damage (maxDmg). Then each attack skill has a damage modifier (dmgMod). Finally, the defender has a protection rating (prot).
First, the game generates a random damage (dmg) between minDmg – maxDmg of the unit. Then, dmg is multiplied by (100 + dmgMod)/100 that gives rawDmg. Finally, this rawDmg is reduced by the prot rating (prot/100) to find the actualDmg:
rawDmg = dmg*(100 + dmgMod)/100
actualDmg = rawDmg – rawDmg*(prot/100)
If the attack is a critical hit, the dmg is auıtomatically 1.5 * maxDmg.
3. Dying: Each unit has a hit point rating (hp) reflecting. If the unit takes damage, its hp is subtracted by actualDmg value to a minimum of 0.
– A monster unit that is reduced to 0 hp instantly dies.
– A hero unit that is reduced to 0 goes to a special state named “Death’s Door”.
– If a hero unit that is already at “Death’s Door” takes AT LEAST 1 damage, it makes a check against the hero’s Death Blow Resistance (deathBlowResist). The game generates a random number between 0 – 100, it the random number is less than or equal to deathBlowResist, nothing happens; otherwise the hero dies.
3
Stunning Attacks:
In addition to inflict damage, some attack skills have a chance of stunning an enemy unit. Each stun attack skill has a stun base level (stunBase) and each unit has a stun resistance (stunResist).
– If an attack is a hit the game generates calculates a stun success chance as
Stun success chance = stunBase – stunResist
– If an attack is a critical hit, the game generates calculates a stun success chance as
– Stun success chance = 20 + stunBase – stunResist
Then, the game generates a random number between 0 – 100, if the random number is less than or equal to the stun success chance, the target unit is stunned for one turn which means the target will NOT USE ANY SKILL during its next turn.
Move Skills:
In addition to the attack and utility skills, each unit also has a move skill. This skill allows the unit to change its positions to a new position within the team and pushes other units between the old position and new position as:
– 1 position back if moving forward
– 1 position forward if moving backward
Objective of the Project:
In the project, you are expected to simulate a combat according to the rules explained above between a hero team of 2 Crusader class heroes and 2 Vestal class heroes against a monster team of 2 Bone Soldiers and 2 Bone Defenders until one of the team completely dies.
The initial setup of the teams is as below:
Hero Team:
Position
4
3
2
1
Hero
Vestal # 2
Vestal # 1
Crusader # 2
Crusader # 1
Monster Team:
Position
4
3
2
1
Monster
Bone Defender
Bone Soldier
Bone Defender
Bone Soldier
Each turn, each unit chooses one of the available skills of their class (as explained below) BASED ON THEIR CURRENT POSITION and uses that skill on a unit. The monsters should act RANDOMLY whereas for heroes you have two options:
a. Act randomly (90% chance of selecting an attack or utility skill; 10% chance of selecting move skill)
b. Get input from the user to conduct which skill on which unit (more difficult)
4
Input:
– If selected option a; NOTHING
– If selected option b; which skill to choose and which target to choose for every turn
Output:
– At the end of each turn, which unit did what? (e.g., Crusader #1 uses Smite on Bone Soldier; attack hits; 8 dmg …)
– At the end of each round, print our “End of Round 1, 2, …”
– At the end of the combat, which team has won, and which units are alive.
Crusader Class (Hero):
Max HP
dodge
prot
speed
accMod
baseCrit
minDmg
maxDmg
deathBlowResist
stunResist
33
5
0
1
+0
3
6
12
67
40
Skills:
– Smite (Attack)
Position
Target
dmgMod
baseAcc
critMod
stunEffect
1 or 2
1 or 2
0
85
+0
No
– Stunning Blow (Attack)
Position
Target
dmgMod
baseAcc
critMod
stunEffect
stunBase
1 or 2
1 or 2
-50
90
+0
Yes
100
– Holy Lance (Attack)
Position
Target
dmgMod
baseAcc
critMod
stunEffect
Move
3 or 4
2, 3, or 4
0
85
+6.5
No
Forward 1
– Bulwark of Faith (Utility)
Position
Target
Effect
1 or 2
SELF
+20 Prot for 3 round
NOTE: Holy Lance also acts like a weak Move skill. It moves the Crusader forward by 1 position.
Vestal Class (Hero):
Max HP
dodge
prot
speed
accMod
baseCrit
minDmg
maxDmg
deathBlowResist
stunResist
24
0
0
4
+0
1
4
8
77
30
Skills:
– Mace Bash (Attack)
Position
Target
dmgMod
baseAcc
critMod
stunEffect
1 or 2
1 or 2
0
85
+0
No
– Dazzling Light (Attack)
Position
Target
dmgMod
baseAcc
critMod
stunEffect
stunBase
5
2, 3 or 4
1, 2 or 3
-75
90
+5
Yes
100
– Divine Grace (Utility)
Position
Target
Effect
3 or 4
Any
Heal for 4 – 5
– Divine Comfort (Utility)
Position
Target
Effect
2, 3 or 4
ALL
Heal for 1 – 3
NOTE: Divine Grace and Divine Comfort heals units for a random amount of value as stated in the skill. Hp of a unit cannot be more than its Max HP.
Bone Soldier Class (Monster):
Max HP
dodge
prot
speed
accMod
baseCrit
minDmg
maxDmg
stunResist
10
10
15
2
+0
+0
3
8
25
Skills:
– Graveyard Slash (Attack)
Position
Target
dmgMod
baseAcc
critMod
stunEffect
1, 2 or 3
1, 2 or 3
0
85
+6
No
– Graveyard Stumble (Attack)* (Similar to Holy Lance)
Position
Target
dmgMod
baseAcc
critMod
stunEffect
Move
4
1 or 2
-50
45
+0
No
Forward 1
Bone Defender Class (Monster):
Max HP
dodge
prot
speed
accMod
baseCrit
minDmg
maxDmg
stunResist
22
8
45
1
+0
+0
2
4
45
Skills:
– Axeblade (Attack)
Position
Target
dmgMod
baseAcc
critMod
stunEffect
1 or 2
1 or 2
0
72
+6
No
– Dead Weight (Attack)
Position
Target
dmgMod
baseAcc
critMod
stunEffect
stunBase
1, 2, or 3
1 or 2
-25
82
+6
Yes
100
– Knitting Bones (Utility)* (Similar to Divine Grace)
Position
Target
Effect
3 or 4
Any
Heal for 2 – 3
6
Object Oriented Programming Requirements & Hints
1. You are expected to have the following classes based on the mechanics of the game:
– class Unit
o class Hero: public Unit
▪ class Crusader: public Hero
▪ class Vestal: public Hero
o class Monster: public Unit
▪ class Bone_Soldier: public Monster
▪ class Bone_Defender: public Monster
– class StunSkill
– class Skill
o class AttackSkill: public Skill
▪ class Smite: public AttackSkill
▪ class Stunning_Blow: public AttackSkill, public StunSkill
▪ etc…
o class UtilitySkill: public Skill
▪ class Divine_Grace: public UtilitySkill
▪ etc…
o class MoveSkill: public Skill
2. You are expected to write appropriate fields and functions to each of the classes above
Example: class Unit has int maxHP, int hp, int dodge, …
3. Local fields of ALL classes MUST BE PROTECTED.
4. DO NOT USE POINTERS, INSTEAD USE SMART POINTERS.
5. While designing the classes, if two classes having the same parent class having a similar functionality, try to write it as a virtual function
Example: Crusader attacks, Vestal attacks, however their attacks use different skills. therefore Hero class should have a virtual attack() function
6. Hero and Monster sub-classes has the appropriate objects of Skill sub-classes.
7. In the main() while declaring the 4 hero objects and 4 monster objects, use vectors
Example: std::vector<Hero> heroes;
Example std::vector<Monster> monsters;
8. Note that some skill classes will have multiple inheritance due to the stunSkill mechanism.
NOTE: Official Darkest Dungeon combat mechanism are more complicated as are described in this document. You are required to implement what is written in the document, NOT what is in the game. However, if you want to experiment you can add additional components of the game (e.g., stress level, bleed attacks, blight attacks, etc…)
NOTE: All calculations will be done as real (i.e., double) operations but the result will be ROUNDED DOWN to int.
NOTE: In random number calculations, you can use the rand() function as well as the srand() function to set up the randomization seed value. If you wish, you can use more complicated randomization tools.
NOTE: As for more reference you can check numerous Darkest Dungeon YouTube series as well as the Darkest Dungeon wiki: https://darkestdungeon.gamepedia.com/Darkest_Dungeon_Wiki
HINT: Writing the attack() function could be tricky, since one object is effecting another object. If you get stuck, you can use a temporary object like an “Attack class” which is generated by the attacker object and then passed to the defending object.

Don't use plagiarized sources. Get Your Custom Essay on
Object Oriented programming C++ Assignment | Essay Help Services
Get an essay WRITTEN FOR YOU, Plagiarism free, and by an EXPERT!
Order Essay

 

Suzie Mercy

Recent Posts

What is the easy difination of science | Quick Solution

Science is the pursuit and application of knowledge and understanding of the natural and social…

4 years ago

definition, values, meaning of such values and type of goods with such elasticity value …….. | Quick Solution

Clearly stating the definition, the values, the meaning of such values and the type of…

4 years ago

Acct 422 – Nora D | Quick Solution

All answered must be typed using Times New Roman (size 12, double-spaced) font. No pictures…

4 years ago

Acct 322 – Nora D | Quick Solution

All answered must be typed using Times New Roman (size 12, double-spaced) font. No pictures…

4 years ago

Macro Economics Question | Quick Solution

https://www.npr.org/sections/ed/2018/04/25/605092520/high-paying-trade-jobs-sit-empty-while-high-school-grads-line-up-for-university Click on the link above. Read the entire link and answer the questions below…

4 years ago

MGT 322 – Nora D | Quick Solution

All answered must be typed using Times New Roman (size 12, double-spaced) font. No pictures…

4 years ago