Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Player.h"
- #include "Consumable.h"
- #include "MiniShield.h"
- #include "BigShield.h"
- using namespace std;
- void displayStars(unsigned int n){
- for(unsigned int i=0; i<n; i++){
- cout << "*";
- }
- cout << endl;
- }
- int main()
- {
- // Intro
- displayStars(63);
- cout << "**** This is an example of a Fortnite player healing! ****\n";
- displayStars(63);
- cout << endl;
- // 1. Choosing character/skin
- cout << "First of all you have to choose your character/skin. You have 4 choices (press 1,2,3 or 4): " << endl;
- cout << "1. DJ Yonder\n2. Calamity\n3. Ice King\n4. Hybrid\n\n";
- int skinChoice;
- cin >> skinChoice;
- cout << endl;
- string skinChoosed;
- switch(skinChoice){
- case 1:
- skinChoosed = "DJ Yonder";
- break;
- case 2:
- skinChoosed = "Calamity";
- break;
- case 3:
- skinChoosed = "Ice King";
- break;
- case 4:
- skinChoosed = "Hybrid";
- break;
- default:
- skinChoosed = "DJ Yonder";
- }
- // 2. Choosing backpack
- cout << "It's time to choose your backpack. You have 4 choices (press 1,2,3 or 4): " << endl;
- cout << "1. Rufus\n2. Dusk Wings\n3. Fabled Cape\n4. Waveform\n\n";
- int backpackChoice;
- cin >> backpackChoice;
- cout << endl;
- string backpackChoosed;
- switch(backpackChoice){
- case 1:
- backpackChoosed = "Rufus";
- break;
- case 2:
- backpackChoosed = "Dusk Wings";
- break;
- case 3:
- backpackChoosed = "Fabled Cape";
- break;
- case 4:
- backpackChoosed = "Waveform";
- break;
- default:
- backpackChoosed = "Rufus";
- }
- // 3. Choosing health
- cout << "Now it is time to choose your player's health. Be careful, because the health cannot be over 100\n";
- cout << "neither below 1 (1 <= health <= 100)\n";
- unsigned int healthChoice;
- do{
- cin >> healthChoice;
- } while(healthChoice < 1 || healthChoice > 100);
- // 4. Choosing shield
- cout << "\nLast step is to choose your player's shield according to the same rules relating with the health as above\n";
- cout << "with the difference that your shield can be 0.\n";
- unsigned int shieldChoice;
- do{
- cin >> shieldChoice;
- } while(shieldChoice < 0 || shieldChoice > 100);
- cout << endl;
- // a) Create the player and show user's choices
- Player player = Player(skinChoosed, backpackChoosed, healthChoice, shieldChoice);
- player.show();
- // b) Show the list of consumables
- cout << endl << endl;
- displayStars(30);
- MiniShield mini1 = MiniShield();
- mini1.show();
- BigShield big1 = BigShield();
- big1.show();
- Bandage ban1 = Bandage();
- ban1.show();
- MedKit med1 = MedKit();
- med1.show();
- Slurp slurp1 = Slurp();
- slurp1.show();
- ChugJug chug1 = ChugJug();
- chug1.show();
- displayStars(30);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement