Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <array>
- #include <random>
- using namespace std;
- int main() {
- array<string, 17> obj = {
- "Flood the cargo bay and destroy the cargo if possible.", //0
- "Dump all wrenches and screwdrivers you can find. Then Sabotage the ballast pumps",
- "Dump all non inventory stored oxygen tanks on the sub.",
- "Ensure the guns of the sub are unusable.",
- "Cause a reactor meltdown.",
- "Set and detonate 2 explosives simultaneously in the sub.",
- "killX",
- "Steal 3 weapons from the armory.",
- "Spray paint in 4 non ballast rooms.",
- //"Find and wear the clown costume.",
- "Sabotage at least 8 lights.",
- "Sabotage at least 4 doors.",
- "Dump all bandages, blood, and saline in the sub.",
- "Plasma cut the outer airlock doors.",
- "Dump all diving suits in the sub.",
- "Ensure the crew have no way of leaving.",
- "Cause the sub to crash.",
- "Ensure the crew do not complete their main objective", //16
- };
- array<string, 4> role = {
- "Captain",
- "Engineer",
- "Mechanic",
- "Doctor",
- };
- random_device rd; //real randomness thingy for seeding
- default_random_engine generator(rd()); //seed the generator with real randomness
- uniform_int_distribution<int> distribution(0,role.size() - 1); //Setting distribution to role array size
- array<int, 3> rdm;
- rdm[2] = distribution(generator);
- distribution.param(uniform_int_distribution<int>::param_type{0,obj.size() - 1}); //Setting distribution to obj array size
- rdm[0] = distribution(generator);
- rdm[1] = distribution(generator);
- while (rdm[0] == rdm[1]) {
- rdm[1] = distribution(generator);
- }
- cout << "Your other traitor objectives are:\n\n";
- for (int i = 0; i < 2; i++) {
- if (obj[rdm[i]] == "killX") {
- if (rdm[2] == 1) {
- cout << i + 1 << ": Ensure the Captains death.";
- }
- else {
- cout << i + 1 << ": Ensure a " << role[rdm[3]] << " dies.";
- }
- }
- else {
- cout << i + 1 << ": " << obj[rdm[i]];
- }
- cout << "\n\n";
- }
- cout << "Good luck.";
- return 0;
- }
Add Comment
Please, Sign In to add comment