#include #include #include #include int main(void) { char yes; do { int guardians = 0, shots, a, b, c, hit, miss, wound, bounce; int choice=0, one = 0, two =0, three=0, four=0, five=0, six=0; int kill=0, save=0; string army; clrscr(); cout << endl << endl; cout << " Welcome to the 40K Universe! You are an Eldar Warlock(an Elite Space" << endl; cout << " Elf)and in Command of one Eldar Guardian Squad which can have" << endl; cout << " anywheres from 5 guardians and up to 20. The Guardians are equipped" << endl; cout << " with standard Shuriken Catapults which have a strength of four and " << endl; cout << " an armor penetration value of 5. The Guardians have a ballistic" << endl; cout << " skill of 3. This means that on a 4+ of a D6 (6 sided dice) they will" << endl; cout << " hit their target, and then depending on their enemies toughness they" << endl; cout << " usually wound on a 3+. The armor penetration will penetrate the" << endl; cout << " enemies armor if they have an armor value of 5 or 6." << endl; cout << " So lets get going!" << endl; while(guardians > 20| guardians < 5) { cout << "how many guardians?: "; cin >> guardians; } while(choice > 3| choice < 1) { cout << "1. Imperial Guard" << endl; cout << "2. Ork Boys" << endl; cout << "3. Space Marines" << endl; cout << "Which Army? "; cin >> choice; if(choice == 1) { army = "Imperial Guards"; cout << endl <<"\tImperial Guard have a toughness of 3 and " << endl; cout << "\tan armor save of 5. They can't stand up to our Fire!" << endl; getch(); } if(choice == 2) { army = "Ork Boys"; cout << endl << "\tOrk Boys have a toughness of 4 and an" << endl; cout << "\tarmor save of 6. They CAN stand up to our Fire! " << endl; cout << "\tBut their armor can't"; getch(); } if(choice == 3) { army = "Space Marines"; cout << endl << "\tSpace Marines have a toughness of 4 and an" << endl; cout << "\tarmor save of 3. They CAN stand up to our Fire! " << endl; cout << "\tAnd their armor CAN TOO!! UHOH"; getch(); } } shots = guardians *2; clrscr(); a=1; b=10; c=0; hit = 0; miss = 0; randomize(); while(a <= shots) { a++; c = random(6)+1; if(c ==1) { clrscr(); cout<<" ____________ " << endl; cout<<" / /|" << endl; cout<<" / 1 / |" << endl; cout<<" /___________/ |" << endl; cout<<" | | 4 |" << endl; cout<<" | | |" << endl; cout<<" | 2 | /" << endl; cout<<" | | /" << endl; cout<<" |__________|/" << endl; clrscr(); one++; } if(c ==2) { clrscr(); cout<<" ____________ " << endl; cout<<" / /|" << endl; cout<<" / 2 / |" << endl; cout<<" /___________/ |" << endl; cout<<" | | 3 |" << endl; cout<<" | | |" << endl; cout<<" | 1 | /" << endl; cout<<" | | /" << endl; cout<<" |__________|/" << endl; clrscr(); two++; } if(c ==3) { clrscr(); cout<<" ____________ " << endl; cout<<" / /|" << endl; cout<<" / 3 / |" << endl; cout<<" /___________/ |" << endl; cout<<" | | 5 |" << endl; cout<<" | | |" << endl; cout<<" | 6 | /" << endl; cout<<" | | /" << endl; cout<<" |__________|/" << endl; clrscr(); three++; } if(c ==4) { clrscr(); cout<<" ____________ " << endl; cout<<" / /|" << endl; cout<<" / 4 / |" << endl; cout<<" /___________/ |" << endl; cout<<" | | 2 |" << endl; cout<<" | | |" << endl; cout<<" | 1 | /" << endl; cout<<" | | /" << endl; cout<<" |__________|/" << endl; clrscr(); four++; } if(c ==5) { clrscr(); cout<<" ____________ " << endl; cout<<" / /|" << endl; cout<<" / 5 / |" << endl; cout<<" /___________/ |" << endl; cout<<" | | 4 |" << endl; cout<<" | | |" << endl; cout<<" | 6 | /" << endl; cout<<" | | /" << endl; cout<<" |__________|/" << endl; clrscr(); five++; } if(c ==6) { clrscr(); cout<<" ____________ " << endl; cout<<" / /|" << endl; cout<<" / 6 / |" << endl; cout<<" /___________/ |" << endl; cout<<" | | 3 |" << endl; cout<<" | | |" << endl; cout<<" | 5 | /" << endl; cout<<" | | /" << endl; cout<<" |__________|/" << endl; clrscr(); six++; } if(c >= 4) { hit++; } if(c < 4) { miss++; } } cout << "\t\tThe Hit Page for the Eldar Vs. " << army <= 3) {wound++;} if(c < 3) {bounce++;} } if(choice == 2) { if(c >= 4) {wound++;} if(c < 4) {bounce++;} } if(choice == 3) { if(c >= 4) {wound++;} if(c < 4) {bounce++;} } } cout << " Your gunfire wounded " << wound << " " << army << endl; if(choice < 3) { cout << endl << endl; cout << " Since " << army << " don't have an armor save that can block Shuriken blades" << endl; cout << " at Mach 2, " << wound << " " << army << " die."; } if(choice == 3) { cout << endl << endl; cout << " Since " << army << " have an armor save of 3 versus a 5 they can make a save on a roll of 3+" << endl; cout << " Let us see who survived"; a=0; randomize(); while(a <= wound) { a++; save = random(6+1); if(save < 3) {kill++;} } cout << endl << " Wow! You managed to kill " << kill << " " << army << "! Their Kill Ratio is 1000 : 1"; } cout << " Do you wish to play again? "; cin >> yes; } while(yes == 'y'); }