1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
#include <iostream>
#include <ctime>
#include <string>
#include "Combat.h"
#include "Combatant.h"
#include "Scenario.h"
#include "Dice.h"
#include "Equipment.h"
#include "Players.h"
using namespace std;
Combat::Combat()
{
}
bool Combat::runCombat()
{
void introduceCharacters();
const int entities = 7;
Combatant combatants[entities];
combatants[0] = fighter;
combatants[1] = mage;
combatants[2] = marksman;
combatants[3] = assassin;
combatants[4] = support;
combatants[5] = tank;
combatants[6] = blank;
bool cbat = true;
while (cbat == true)
{
int swapHolder;
Combatant swapper;
int end = entities;
int length = entities;
int position[entities] = { combatants[0]._speed, combatants[1]._speed, combatants[2]._speed, combatants[3]._speed, combatants[4]._speed, combatants[5]._speed, combatants[6]._speed };
for (int counter = length - 1; counter > 0; counter--) {
for (int index = 0; index < end; index++) {
if (position[index] < position[index + 1]) {
swapHolder = position[index + 1];
swapper = combatants[index + 1];
position[index + 1] = position[index];
combatants[index + 1] = combatants[index];
position[index] = swapHolder;
combatants[index] = swapper;
}
}
}
cout << "Turn Order" << endl;
cout << combatants[0]._name << endl;
cout << combatants[1]._name << endl;
cout << combatants[2]._name << endl;
cout << combatants[3]._name << endl;
cout << combatants[4]._name << endl;
cout << combatants[5]._name << endl;
for (int counter = 0; counter < 6; counter++) {
switch (combatants[counter].pickAction)
{
case 1:
combatants[counter].printStats;
break;
case 2:
break;
}
}
return true;
}
}
void Combat::introduceCharacters()
{
Combatant blank;
blank._name = "Blank";
blank.stats(0, 0, 0, 0, 0, 0, 0, 0, 0);
blank.chosenArmor(ablank);
blank.chosenWeapon(wblank);
Combatant fighter;
fighter._name = "Fighter";
fighter.stats(30, 1030, 1075, 850, 125, 96, 64, 1.8, 115);
fighter.chosenArmor(fighterArmor);
fighter.chosenWeapon(greatSword);
Combatant mage;
mage._name = "Mage";
mage.stats(28, 1000, 850, 1150, 146, 90, 96, 1.5, 88);
mage.chosenArmor(mageArmor);
mage.chosenWeapon(longStaff);
Combatant marksman;
marksman._name = "Marksman";
marksman.stats(35, 1120, 1030, 970, 140, 70, 100, 2.8, 85);
marksman.chosenArmor(marksmanArmor);
marksman.chosenWeapon(marksmanRifle);
Combatant assassin;
assassin._name = "Assassin";
assassin.stats(32, 850, 1075, 880, 164, 80, 76, 3.0, 92.5);
assassin.chosenArmor(assassinArmor);
assassin.chosenWeapon(dagger);
Combatant support;
support._name = "Support";
support.stats(22, 970, 925, 1120, 170, 80, 90, 1.0, 103);
support.chosenArmor(supportArmor);
support.chosenWeapon(assaultRifle);
Combatant tank;
tank._name = "Tank";
tank.stats(25, 1150, 1075, 1000, 110, 84, 76, 1.2, 112);
tank.chosenArmor(tankArmor);
tank.chosenWeapon(greatHammer);
}
void Combat::introduceEquipment()
{
wblank.mStats("Blank", 0, 0, 0, 0);
wblank.melee = true;
greatSword.mStats("Great Sword", 85, 150, 2, 275);
greatSword.melee = true;
greatHammer.mStats("Great Hammer", 65, 210, 1, 340);
greatHammer.melee = true;
dagger.mStats("Dagger", 100, 100, 3, 175);
dagger.melee = true;
marksmanRifle.rStats("Marksman Rifle", 90, 115, 5, 50, 172.5);
marksmanRifle.melee = false;
longStaff.rStats("Staff", 80, 150, 1, 10, 225);
longStaff.melee = false;
assaultRifle.rStats("Assault Rifle", 70, 80, 10, 100, 120);
assaultRifle.melee = false;
ablank.stats("Blank Armor", 0, 0, 0);
fighterArmor.stats("Fighter's Armor", 60, 40, 30);
mageArmor.stats("Mage's Armor", 40, 60, 30);
marksmanArmor.stats("Marksman Armor", 20, 20, 12);
assassinArmor.stats("Assassin Armor", 40, 20, 18);
supportArmor.stats("Support Armor", 40, 40, 24);
tankArmor.stats("Tank Armor", 60, 60, 36);
}
|