ok.. my problem is..
my midterm source code is due tomorw.. unfortunatly i cant get thsi music to play... my group REALLy wants the music and i thin itll boost my chances of an a... when i ran this music in the original(just the music) it runs fine.. when i put it in the iff statement in my code... i get 7000 errors... most complain about mmsystem.h:sad:
if i take out the mmsystem.h i get no errors for the most part and it runs like normal.. but no music.,...:cry:
i have left out mmsystem.h in this version.. if u run dev-c++ u have to add linker winlibmm.a using project options>>parameters>> add linker.
#include <iostream.h>
#include <iomanip.h>
#include <cstdlib>
#include <windows.h>
using namespace std;
int main()
{
char gender;
char option;
char race;
int hp = 100;
int ehp = 100;
int str;
int intel;
int suck = 10;
int mp;
int armor;
int weapon;
int armor2;
cout << "Please choose your gender(M/F). ";
cin >> gender;
switch(gender)
{
case 'm':
case 'M':
cout << "You have chosen a male character. \n";
cout << "Please choose your class.(Mage,Fighter,Archer.[M,F,A]) ";
cin >> race;
switch(race)
{ //start of male race switch
case 'm':
case 'M':
cout << "You have chosen the Mage. ";
hp = 75;
str = 5;
intel = 15;
armor = 2;
mp = intel * 10;
break;
case 'f':
case 'F':
cout << "You have chosen the Fighter. ";
hp = 120;
str = 15;
intel = 5;
armor = 5;
mp = intel * 10;
break;
case 'a':
case 'A':
cout << "You have chosen the Archer. ";
hp = 100;
str = 10;
intel = 10;
armor = 3;
mp = intel * 10;
break;
}//end of male race switch
break;
case 'f':
case 'F':
cout << "You have chosen a female character.\n ";
cout << "Please choose your class.(Mage,Fighter,Archer.[M,F,A]) ";
cin >> race;
switch(race)
{//start of female race switch
case 'm':
case 'M':
cout << "You have chosen the Mage. ";
hp = 75;
str = 5;
intel = 15;
armor = 2;
mp = intel * 10;
break;
case 'f':
case 'F':
cout << "You have chosen the Fighter. ";
hp = 120;
str = 15;
intel = 5;
armor = 5;
mp = intel * 10;
break;
case 'a':
case 'A':
cout << "You have chosen the Archer. ";
hp = 100;
str = 10;
intel = 10;
armor = 3;
mp = intel * 10;
break;
}//end of F race switch
break;
}//end of Gender
cout << "Choose your weapon.\n";
cout << "Katana(1). \n";
cout << "Great sword(2). \n";
cout << "Battle Staff(3). \n";
cout << "Silver bow(4). \n";
cout << "Winged Staff(5). \n";
cin >> weapon;
switch(weapon)
{
case 1:
cout << "You have chosen the Katana. \n";
str = str + 3;
break;
case 2:
cout << "You have chosen the Great sword. \n";
str = str + 5;
armor = armor - 2;
break;
case 3:
cout << "You have chosen the Battle Staff. \n";
str = str + 2;
intel = intel - 2;
break;
case 4:
cout << "You have chosen the Silver Bow. \n";
str = str + 2;
armor = armor + 2;
break;
case 5:
cout << "You have chosen the Winged Staff. \n";
intel = intel + 4;
armor = armor + 1;
break;
}
cout << "Choose your armor.\n";
cout << "Chain armor(1). \n";
cout << "Leather armor(2). \n";
cin >> armor;
switch(armor)
{
case 1:
cout << "You have chosen Chain armor.\n";
armor = armor + 4;
intel = intel - 2;
break;
case 2:
cout << "You have chosen Leather armor.\n";
armor = armor + 2;
break;
}
cout << "An Oppel attacks! \n \n";
while(ehp > 0 && hp > 0)
{
cout << "Choose an option. Attack,Magic,Items,Run. \n";
cin >> option;
switch(option)
{
case 'a':
case 'A':
ehp = ehp - str;
hp = hp - (suck - armor);
suck++;
cout << "Your hp is " << hp << ". \n";
cout << "The Oppel's hp is " << ehp << ". \n";
cout << "Your mp is " << mp << ". \n";
if(ehp < 0)
{
ehp = 0;
}
break;
case 'm':
case 'M':
ehp = ehp - intel;
hp = hp - (suck - armor);
suck++;
mp = mp - 10;
if(ehp < 0)
{
ehp = 0;
}
cout << "Your hp is " << hp << ". \n";
cout << "The Oppel's hp is " << ehp << ". \n";
cout << "Your mp is " << mp << ". \n";
break;
case 'i':
case 'I':
cout << "You have no items! \n";
break;
case 'r':
case 'R':
cout << "You flee the Oppel in shame. \n";
hp = 0;
break;
}
}
if(ehp <= 0)
{
cout << "VICTORY! \n";
cout << "Please wait...";
mciSendString("play E:\ff7vict2.midi",NULL,0,NULL);
cout << "\n\nPress Enter to stop ...";
cin.get();
mciSendString("stop E:\ff7vict2.midi",NULL,0,NULL);
}
if(hp <= 0)
{
cout << "You have lost. \n";
cout << "GAME OVER!! \n";
}
system("PAUSE");
return 0;
}