Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- #include <conio.h>
- class Wrog
- {
- public:
- int poziom;
- int doswiadczenie;
- int bron;
- int obrazenia;
- int hit_points;
- int gold;
- virtual void statystyki()=0;
- virtual void atak()=0;
- virtual void otrzymaj_obrazenia(int obrazenia)=0;
- };
- class Wilk :public Wrog
- {
- public:
- virtual void statystyki()
- {
- hit_points = 50;
- doswiadczenie = 0;
- poziom = 0;
- bron = 0;
- gold = 10;
- obrazenia = 0;
- }
- virtual void atak()
- {
- srand( time( NULL ) );
- obrazenia = (std::rand() % 10) + 0;
- }
- virtual void otrzymaj_obrazenia(int obrazenia)
- {
- hit_points = hit_points - obrazenia;
- if(hit_points <= 0)
- {
- cout<<"\nPotwor pokonany!\n";
- }
- }
- };
Add Comment
Please, Sign In to add comment