Results 1 to 15 of 15
  1. #1
    schim's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My chair
    Posts
    367
    Reputation
    10
    Thanks
    115
    My Mood
    Twisted

    [RELEASE] Simple game

    Hi everyone, I was bored to day so I decided to make an even more boring game

    Why have I made this game??
    1. I don't know, I was bored so I just started coding.
    2. For anyone who wants to have a target for their trainers/hacks and stuff
    3. For anyone who's just as bored as I'm and wants to play a less boring game so that they won't be that bored anymore

    Ok so here it is:

    Code:
    #include <iostream>
    #include <windows.h>
    #include <fstream>
    #include <ostream>
    #include <ctime>
    
    void engine(/*int h, int m*/);
    
    using namespace std;
    int i = 5 , s = 5, a = 5;
    char name[40];
    int eh = 100, em = 100;
    int attribute = 3;
    int mode;
    int h, m;
    int att;
    
    void gui(){
    	system("cls");
    	cout<<"Made by: SCHiM, Part of iANDi, Greetings to: DiM\n################################################################################\n";
    }
    
    void hturn(int att){
    int dmg = 0;
    int he = 0;
    	
    	if(att == 1){
    
    time_t t;
    time(&t);
    srand(t);
    
    dmg = rand() % 10 + (s*s/(s*2)) ; // change this value to be dynamic later on
    
    cout<<"You hit your enemy for "<<dmg<<" HP\n";
    eh = eh - dmg;
    Sleep(2000);
    	} 
    
    	if(att == 2){
    		if(m < 10){
    cout<<"You have not enouch Mana for this kind of action\n";
    
    goto A;
    		}
    		
    time_t t;
    time(&t);
    srand(t);
    
    dmg = rand() % 15 + (i*i/(i*2)) ; // change this value to be dynamic later on
    
    cout<<"You hit your enemy for "<<dmg<<" HP\n";
    eh = eh - dmg;
     m = m - 10; //update mana after magic usage
     cout<<"You have used 10 mana (- 10 mana)\n";
    	Sleep(2000);
    	}
    	if (att == 3){
    	if(m < 15){
    cout<<"You have not enouch Mana for this kind of action\n";
    goto A;
    		}
    
    time_t t;
    time(&t);
    srand(t);
    
    he = rand () % 30 + (i*i/(i*2)); // change this value to be dynamic later on
    if( he == 0 ){
    he = 10;
    }
    cout<<"You have healed yourself for "<<he<<" health\n";
    h = h + he;
    m = m - 15; // updata mana after magic usage
     cout<<"You have used 15 mana (- 15 mana)\n";
     Sleep(2000);
    	}
    	if(1 != 1){
    A:
    		
    time_t t;
    time(&t);
    srand(t);
    	dmg = rand() % 10 + (s*s/(s*2)); // change this value to be dynamic later on
    
    if(dmg == 0){
    
    	cout<<"Your attack missed its target!\n";
    }
    cout<<"You hit your enemy for "<<dmg<<" HP\n";
    eh = eh - dmg;
    Sleep(2000);
    	}
    
    }
    
    void ai(){
    	
    
    int r = 0;
    	int edmg = 0; 
    		if(eh > 65) {
    time_t t;
    time(&t);
    srand(t);
    r = rand() % 2;
    		}
    	if(eh < 65){
    		
    time_t t;
    time(&t);
    srand(t);
    r = rand() % 4;
    	}
    
    	
    if(r == 0 || r == 1){
    		
    time_t t;
    time(&t);
    srand(t);
    edmg = rand() % 10 + (s*s/(s*2)) ;
    h = h - edmg;
    cout<<"Your enemy hits you for "<<edmg<<" HP\n";
    Sleep(2000);
    	}
    
    
    
    	if(r == 2){
    		if(em < 10) {
    goto B;
    		}
    time_t t;
    time(&t);
    srand(t);
    edmg = rand() % 15 + (i*i/(i*2)) ;
    h = h - edmg;
    cout<<"Your enemy hits you with a fireball for "<<edmg<<" HP\n";
    Sleep(2000);
    em = em - 10;
    }
    
    	if(r == 3){
    		if(em < 15) {
    goto B;
    		}
    	time_t t;
    time(&t);
    srand(t);
    edmg = rand() % 30 + (i*i/(i*2)) ;
    eh = eh + edmg;
    cout<<"Your enemy has healed him self for "<<edmg<<" HP\n";
    Sleep(2000);
    em = em - 15;
    	
    	}	
    
    
    if( 1 != 1)
    {
    B:
    time_t t;
    time(&t);
    srand(t);
    edmg = rand() % 10 + i / (i - 1) ;
    h = h - edmg;
    cout<<"Your enemy hits you for "<<edmg<<" HP\n";
    Sleep(2000);
    } 
    
    
    
    
    
    }
    void spendpoints(){
    	system("cls");
    cout<<"Exelent\nYou may now spend your attribute points to the following stats:\n1.Intelligence\n2.Strength\n3.Agility\nYour stats determine your chance to hit a target, how many damage you do\nand how many spells you may cast.\n";
    	cout<<"\nYour current stats are: \nIntelligence: "<<i<<"\nStrength: "<<s<<"\nAgility: "<<a<<"\nYou currently have: "<<attribute<<" attribute points\nHow would you like to spend them?\n";
    	cout<<"press:\n S to Assign 1 point to Strength\n A to Assign 1 point to Agility\n I to assign 1 point to Intelligence\n";
    	system("pause");
    	while (attribute != 0 ){
    		system("cls");
    			
    
    if (GetKeyState(0x41)<0) {
    	//GetKeyState(0x41) == 0;
    	a++;
    	attribute--;
        cout<<"\nYour current stats are: \nIntelligence: "<<i<<"\nStrength: "<<s<<"\nAgility: "<<a<<"\nYou currently have: "<<attribute<<" attribute points\nHow would you like to spend them?\n";
        cout<<"press:\n S to Assign 1 point to Strength\n A to Assign 1 point to Agility\n I to assign 1 point to Intelligence\n";	 
    system("pause");
    }
    
    if (GetKeyState(0x53)<0) {
    	//GetKeyState(0x53) == 0;
    	s++;
    	attribute--;
        cout<<"\nYour current stats are: \nIntelligence: "<<i<<"\nStrength: "<<s<<"\nAgility: "<<a<<"\nYou currently have: "<<attribute<<" attribute points\nHow would you like to spend them?\n";
        cout<<"press:\n S to Assign 1 point to Strength\n A to Assign 1 point to Agility\n I to assign 1 point to Intelligence\n";	 
    system("pause");
    }
    
    if (GetKeyState(0x49)<0) {
    	//GetKeyState(0x49) == 0;
    	i++;
    	attribute--;
        cout<<"\nYour current stats are: \nIntelligence: "<<i<<"\nStrength: "<<s<<"\nAgility: "<<a<<"\nYou currently have: "<<attribute<<" attribute points\nHow would you like to spend them?\n";
        cout<<"press:\n S to Assign 1 point to Strength\n A to Assign 1 point to Agility\n I to assign 1 point to Intelligence\n";	 
    system("pause");
    }
    
    //Sleep(100);
    	} 
    }
    
    
    
    void savegame(/*int health, int mana, int points*/){
    
    std::ofstream put( name );
    put << h;
    put << " ";
    put << m;
    put << " ";
    put << attribute;
    put << " ";
    put << s;
    put << " ";
    put << i;
    put << " ";
    put << a;
    put.close();
    cout<<"Saved"<<endl;
    return 0;
    system("pause");
    
    }
    void update(){
    system("cls");
    cout<<"You have: "<<h<<" health and: "<<m<<" mana\n";
    cout<<"Your enemy has: "<<eh<<" health\n";
    }
    
    void magic(){
    system("cls");
    cout<<"1.Fireball, 2. heal\n";
    cin>>att;
    att++;
    }
    
    void mainmenu(){
    	while(1){
    gui();
    	char a[2];
    	
    	cout<<"######################################MENU######################################\n1.Save game\n2.Fight\n3.Spend Attribute Points\n";
    	cin>>a;
    	if(!strcmp(a, "1" )){
    		//savegame(h , m, attribute); 
    		savegame();
    	} 
    	if(!strcmp(a, "2" )){
    cout<<"1.Easy\n2.Medium\n3.Hard\n";
    cin>>mode;
    
    	if (mode == 1){
    	eh = 50;
    	}
    	if (mode == 2){
    	eh = 100;
    	}
    	if (mode == 3){
    	eh = 150;	
    	}
    	engine();
    	char n[2];
    	cout<<"Do you want to continue playing?(Y/N)\n";
    	cin>>n;
    	if(!strcmp(n, "n")){
    break;
    	}
    	}
    	if(!strcmp(a, "3") && attribute != 0  ){
    	spendpoints();
    	} else { 
    	cout<<"You don't have any attribute points to spend\n";
    	Sleep(3000);
    	}
    }
    }
    
    void engine(){
    		
    	while(h > 0 && eh > 0){
    
    			time_t t;
    			time(&t);
    			srand(t);
    			update();
    			cout<<"1 : attack, 2 : use magic\n";
    			cin>> att;
    			if(att == 2){
    				magic();
    			}
    
    			hturn(att); 
    			ai();
    	}
    		if(h > eh){
    cout<<"You have won the battle!\n";
    cout<<"You have earned 3 attribute points\n";
    cout<<"Your health and mana have been reset to 100\n";
    m = 100;
    h = 100;
    attribute = 3;
    
    		} else {
    cout<<"You face defeat, GAME OVER!\n";
    		}
       }
    
    
    
    
    void LG(  ){
    	int health;
    	int mana;
    	
    std::ifstream erin(name);
    erin >> h;
    erin >> m;
    erin >> attribute;
    erin >> s;
    erin >> i;
    erin >> a;
    erin.close();
    
    }
    
    void NG(){
    
    	system("cls");
    	cout<<"You have chosen to start a new game.\nEnter your character name: ";
    	cin>>name;
    	system("cls");
    	cout<<"Exelent\nYou may now spend your attribute points to the following stats:\n1.Intelligence\n2.Strength\n3.Agility\nYour stats determine your chance to hit a target, how many damage you do\nand how many spells you may cast.\n";
    	cout<<"\nYour current stats are: \nIntelligence: "<<i<<"\nStrength: "<<s<<"\nAgility: "<<a<<"\nYou currently have: "<<attribute<<" attribute points\nHow would you like to spend them?\n";
    	cout<<"press:\n S to Assign 1 point to Strength\n A to Assign 1 point to Agility\n I to assign 1 point to Intelligence\n";
    	system("pause");
    	while (attribute != 0 ){
    		system("cls");
    			
    
    if (GetKeyState(0x41)<0) {
    	//GetKeyState(0x41) == 0;
    	a++;
    	attribute--;
        cout<<"\nYour current stats are: \nIntelligence: "<<i<<"\nStrength: "<<s<<"\nAgility: "<<a<<"\nYou currently have: "<<attribute<<" attribute points\nHow would you like to spend them?\n";
        cout<<"press:\n S to Assign 1 point to Strength\n A to Assign 1 point to Agility\n I to assign 1 point to Intelligence\n";	 
    system("pause");
    }
    
    if (GetKeyState(0x53)<0) {
    	//GetKeyState(0x53) == 0;
    	s++;
    	attribute--;
        cout<<"\nYour current stats are: \nIntelligence: "<<i<<"\nStrength: "<<s<<"\nAgility: "<<a<<"\nYou currently have: "<<attribute<<" attribute points\nHow would you like to spend them?\n";
        cout<<"press:\n S to Assign 1 point to Strength\n A to Assign 1 point to Agility\n I to assign 1 point to Intelligence\n";	 
    system("pause");
    }
    
    if (GetKeyState(0x49)<0) {
    	//GetKeyState(0x49) == 0;
    	i++;
    	attribute--;
        cout<<"\nYour current stats are: \nIntelligence: "<<i<<"\nStrength: "<<s<<"\nAgility: "<<a<<"\nYou currently have: "<<attribute<<" attribute points\nHow would you like to spend them?\n";
        cout<<"press:\n S to Assign 1 point to Strength\n A to Assign 1 point to Agility\n I to assign 1 point to Intelligence\n";	 
    system("pause");
    }
    
    //Sleep(100);
    	} // while brace
    
    cout<<"Exelent, Now you have created your hero you may start the game\n";
    Sleep(1000);
    h = 100;
    m = 100;
    mainmenu();
    } // class brace 
    
    
    void init(){
    	char a[2];
    	cout<<"######################################MENU######################################\n1.New game\n2.Load game\n";
    	cin>>a;
    	if(!strcmp(a, "1" )){
    		NG();
    	} else {
    		cout<<"Enter the name of the character you want to load: ";
    		cin>>name;
    LG();
    mainmenu();
    	}
    }
    
    int main(){
    	gui();
    init();
    }
    410 lines of useless code, I hope you like it
    BTW: this isn't a native C++ program, it has to be compiled using the .Net framework it's tested on VC++ 2008, and will surely work when using VC++ 2008.
    I've also uploaded the exe, to be sure
    also, the game isn't perfect there are a few bugs but I'm to tired to go and fix them now.
    I've made an error in the code posted here so that dumb C & p can not use it, I'm sure that anyone with only 0.001% knowledge of C++ knows how to fix it (if you can't tip: void functions are typeles, they don't return anything)
    vir scan:
    Game.rar MD5:5cdde05093bf3a5f27add50debc5bef8 - VirSCAN.org Scanners did not find malware!

    credits:
    SCHiM << 100% My work, don't claim otherwise, don't distribute.
    Last edited by schim; 06-05-2010 at 07:54 PM. Reason: Somone requested title change...

  2. #2
    kilert's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    65
    Reputation
    10
    Thanks
    6
    My Mood
    Hot
    wow! this is incredibly boring!

  3. #3
    schim's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My chair
    Posts
    367
    Reputation
    10
    Thanks
    115
    My Mood
    Twisted
    Quote Originally Posted by kilert View Post
    wow! this is incredibly boring!
    It is, an the best has yet to come, it never stops!!! there is no uber-boss battle after 10 levels, only hardcore farming in this game
    ps: if somone manages to beat hard mode(withouth cheating) i'll make 'n update adding some bosses, fixing the last bugs

  4. #4
    pjrat111's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    Around the Corner
    Posts
    192
    Reputation
    10
    Thanks
    17
    My Mood
    Amused
    Not working for me

  5. #5
    mwb1234's Avatar
    Join Date
    May 2009
    Gender
    male
    Posts
    460
    Reputation
    7
    Thanks
    65
    /request title change for copying idea please

  6. #6
    schim's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My chair
    Posts
    367
    Reputation
    10
    Thanks
    115
    My Mood
    Twisted
    Quote Originally Posted by mwb1234 View Post
    /request title change for copying idea please
    Which idea???
    But OK, I'll change my title if you so badly want that...

    @pjrat111 what kind of error did you get???

    EDIT: just found out I can't change my tittle....
    Last edited by schim; 06-05-2010 at 07:59 PM.

  7. #7
    mwb1234's Avatar
    Join Date
    May 2009
    Gender
    male
    Posts
    460
    Reputation
    7
    Thanks
    65
    Quote Originally Posted by schim View Post
    Which idea???
    But OK, I'll change my title if you so badly want that...

    @pjrat111 what kind of error did you get???

    EDIT: just found out I can't change my tittle....
    I know. /me requested an admin changes title.

  8. #8
    schim's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My chair
    Posts
    367
    Reputation
    10
    Thanks
    115
    My Mood
    Twisted
    Quote Originally Posted by mwb1234 View Post
    I know. /me requested an admin changes title.
    ok, but what is this idea I have "copied"?

  9. #9
    lalakijilp's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Posts
    310
    Reputation
    9
    Thanks
    53
    My Mood
    Blah
    Code:
    if(1 != 1)
    ¿wut?/

  10. #10
    schim's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My chair
    Posts
    367
    Reputation
    10
    Thanks
    115
    My Mood
    Twisted
    Quote Originally Posted by lalakijilp View Post
    Code:
    if(1 != 1)
    ¿wut?/
    That code isn't supposed to run in the normal loop, I know there are better methods of cutting some piece of code out of a loop (continue(); among others)
    Now I look at it again I would even say this is one of the most sloppy codes ever made
    But I was very tired when I made the last part of the game (that part)
    So that's why

    ps: 1 is always equal to 1 so, that's why that statement is always false and wil never run

  11. #11
    lalakijilp's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Posts
    310
    Reputation
    9
    Thanks
    53
    My Mood
    Blah
    Quote Originally Posted by schim View Post
    That code isn't supposed to run in the normal loop, I know there are better methods of cutting some piece of code out of a loop (continue(); among others)
    Now I look at it again I would even say this is one of the most sloppy codes ever made
    But I was very tired when I made the last part of the game (that part)
    So that's why

    ps: 1 is always equal to 1 so, that's why that statement is always false and wil never run
    then why just don't make it a comment

  12. #12
    schim's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My chair
    Posts
    367
    Reputation
    10
    Thanks
    115
    My Mood
    Twisted
    Quote Originally Posted by lalakijilp View Post
    then why just don't make it a comment
    This is the actual source code right out of my project, I didn't need a comment right there

  13. #13
    lilneo's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Canada
    Posts
    217
    Reputation
    8
    Thanks
    28
    I beat it on Hard without cheating... I just strategically healed and attacked after uber-farming to 25 str.

  14. #14
    schim's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My chair
    Posts
    367
    Reputation
    10
    Thanks
    115
    My Mood
    Twisted
    Quote Originally Posted by lilneo View Post
    I beat it on Hard without cheating... I just strategically healed and attacked after uber-farming to 25 str.
    K
    Then I will go and make some updates somewhere this week

  15. #15
    GridMaster's Avatar
    Join Date
    Mar 2009
    Gender
    male
    Location
    Georgia, USA
    Posts
    1,629
    Reputation
    54
    Thanks
    204
    When i try to run it says something cant run alongside something else...

    Quote Originally Posted by Dave84311 View Post
    Boys and girls, this is what we call a retard.

Similar Threads

  1. SCCT Versus request [release]
    By LiLLeO in forum Hack Requests
    Replies: 2
    Last Post: 01-27-2013, 01:18 PM
  2. [RELEASE] My Boredom Shows! Look!
    By mwb1234 in forum C++/C Programming
    Replies: 2
    Last Post: 05-31-2010, 08:24 PM
  3. WarRockSkins Version 3.1 [release]
    By Kyojiro in forum WarRock - International Hacks
    Replies: 4
    Last Post: 04-30-2006, 08:01 PM
  4. Anti-Sniper Kit v1.0 [Release]
    By Kyojiro in forum WarRock - International Hacks
    Replies: 8
    Last Post: 04-29-2006, 08:33 PM