Advertisement
makispaiktis

Main2- List of consumables

Mar 24th, 2019 (edited)
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.11 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. #include "Player.h"
  4. #include "Consumable.h"
  5. #include "MiniShield.h"
  6. #include "BigShield.h"
  7.  
  8. using namespace std;
  9.  
  10. void displayStars(unsigned int n){
  11.     for(unsigned int i=0; i<n; i++){
  12.         cout << "*";
  13.     }
  14.     cout << endl;
  15. }
  16.  
  17. int main()
  18. {
  19.     // Intro
  20.     displayStars(63);
  21.     cout << "****   This is an example of a Fortnite player healing!    ****\n";
  22.     displayStars(63);
  23.     cout << endl;
  24.  
  25.     // 1. Choosing character/skin
  26.     cout << "First of all you have to choose your character/skin. You have 4 choices (press 1,2,3 or 4): " << endl;
  27.     cout << "1. DJ Yonder\n2. Calamity\n3. Ice King\n4. Hybrid\n\n";
  28.  
  29.     int skinChoice;
  30.     cin >> skinChoice;
  31.     cout << endl;
  32.     string skinChoosed;
  33.     switch(skinChoice){
  34.         case 1:
  35.             skinChoosed = "DJ Yonder";
  36.             break;
  37.  
  38.         case 2:
  39.             skinChoosed = "Calamity";
  40.             break;
  41.  
  42.         case 3:
  43.             skinChoosed = "Ice King";
  44.             break;
  45.  
  46.         case 4:
  47.             skinChoosed = "Hybrid";
  48.             break;
  49.  
  50.         default:
  51.             skinChoosed = "DJ Yonder";
  52.     }
  53.  
  54.     // 2. Choosing backpack
  55.     cout << "It's time to choose your backpack. You have 4 choices (press 1,2,3 or 4): " << endl;
  56.     cout << "1. Rufus\n2. Dusk Wings\n3. Fabled Cape\n4. Waveform\n\n";
  57.  
  58.     int backpackChoice;
  59.     cin >> backpackChoice;
  60.     cout << endl;
  61.     string backpackChoosed;
  62.     switch(backpackChoice){
  63.         case 1:
  64.             backpackChoosed = "Rufus";
  65.             break;
  66.  
  67.         case 2:
  68.             backpackChoosed = "Dusk Wings";
  69.             break;
  70.  
  71.         case 3:
  72.             backpackChoosed = "Fabled Cape";
  73.             break;
  74.  
  75.         case 4:
  76.             backpackChoosed = "Waveform";
  77.             break;
  78.  
  79.         default:
  80.             backpackChoosed = "Rufus";
  81.     }
  82.  
  83.     // 3. Choosing health
  84.     cout << "Now it is time to choose your player's health. Be careful, because the health cannot be over 100\n";
  85.     cout << "neither below 1 (1 <= health <= 100)\n";
  86.  
  87.     unsigned int healthChoice;
  88.     do{
  89.         cin >> healthChoice;
  90.     } while(healthChoice < 1 || healthChoice > 100);
  91.  
  92.     // 4. Choosing shield
  93.     cout << "\nLast step is to choose your player's shield according to the same rules relating with the health as above\n";
  94.     cout << "with the difference that your shield can be 0.\n";
  95.     unsigned int shieldChoice;
  96.     do{
  97.         cin >> shieldChoice;
  98.     } while(shieldChoice < 0 || shieldChoice > 100);
  99.     cout << endl;
  100.  
  101.     // a) Create the player and show user's choices
  102.     Player player = Player(skinChoosed, backpackChoosed, healthChoice, shieldChoice);
  103.     player.show();
  104.     // b) Show the list of consumables
  105.     cout << endl << endl;
  106.     displayStars(30);
  107.     MiniShield mini1 = MiniShield();
  108.     mini1.show();
  109.     BigShield big1 = BigShield();
  110.     big1.show();
  111.     Bandage ban1 = Bandage();
  112.     ban1.show();
  113.     MedKit med1 = MedKit();
  114.     med1.show();
  115.     Slurp slurp1 = Slurp();
  116.     slurp1.show();
  117.     ChugJug chug1 = ChugJug();
  118.     chug1.show();
  119.     displayStars(30);
  120.  
  121.  
  122.     return 0;
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement