📄 poa.cpp
字号:
gotoxy(MAPROWSIZE - 1, COLSIZE - 40); cout<<tee<<flush;
centerText("Map Key/Legend", 5, COLSIZE - 40, COLSIZE, GREY);
gotoxy(8, COLSIZE - 35); color(HERODISPLAYCOLOR); cout<<heroDisplay<<flush; color(7); cout<<" = You (The Hero)"<<flush;
gotoxy(10, COLSIZE - 35); color(GRASSCOLOR); cout<<grass<<flush; color(7); cout<<" = Grass"<<flush;
gotoxy(12, COLSIZE - 35); color(WATERCOLOR); cout<<water<<flush; color(7); cout<<" = Water"<<flush;
gotoxy(14, COLSIZE - 35); color(TREECOLOR); cout<<tree<<flush; color(7); cout<<" = Tree"<<flush;
gotoxy(16, COLSIZE - 35); color(MOUNTAINCOLOR); cout<<mountain<<flush; color(7); cout<<" = Mountain"<<flush;
gotoxy(18, COLSIZE - 35); cout<<mapTown<<flush; cout<<" = Town"<<flush;
gotoxy(20, COLSIZE - 35); color(ARROWSCOLOR); cout<<rightMap<<flush; color(7); cout<<" = Move Right to Next Map Tile"<<flush;
gotoxy(22, COLSIZE - 35); color(ARROWSCOLOR); cout<<leftMap<<flush; color(7); cout<<" = Move Left to Next Map Tile"<<flush;
gotoxy(24, COLSIZE - 35); color(ARROWSCOLOR); cout<<upMap<<flush; color(7); cout<<" = Move Up to Next Map Tile"<<flush;
gotoxy(26, COLSIZE - 35); color(ARROWSCOLOR); cout<<downMap<<flush; color(7); cout<<" = Move Down to Next Map Tile"<<flush;
gotoxy(0, 0); cout<<flush;
getch();
clrselection(3, MAPROWSIZE - 1, COLSIZE - 40, COLSIZE - 1);
gotoxy(2, COLSIZE - 40); cout<<horwall<<flush;
gotoxy(MAPROWSIZE - 1, COLSIZE - 40); cout<<horwall<<flush;
color(GRASSCOLOR);
for(int a = 3; a < MAPROWSIZE - 1; a++){
for(int b = COLSIZE - 40; b < COLSIZE - 1; b++){
gotoxy(a, b); cout<<grass<<flush;
}
}
color(7);
tiles[mainchar.gettileY()][mainchar.gettileX()].printmap(3, MAPROWSIZE - 1, COLSIZE - 40, COLSIZE - 1);
break;
case 109: // m pressed (map position)
clrselection(3, MAPROWSIZE - 1, COLSIZE - 40, COLSIZE - 1);
centerText("The Square with Your Hero on it", 7, COLSIZE - 40, COLSIZE, GREY);
centerText("represents which tile of the entire", 8, COLSIZE - 40, COLSIZE, GREY);
centerText("map that you are currently in", 9, COLSIZE - 40, COLSIZE, GREY);
for(int a = 3; a < MAPROWSIZE - 1; a++){
gotoxy(a, COLSIZE - 40); cout<<vertwall<<flush;
}
for(int a = 0; a < 4; a++){
for(int b = 0; b < 7; b++){
gotoxy(b + 12, COLSIZE - 25 + (a*2)); cout<<vertwall<<flush;
}
}
for(int a = 0; a < 4; a++){
for(int b = 0; b < 7; b++){
gotoxy(12 + (a*2), b + COLSIZE - 25); cout<<horwall<<flush;
}
}
gotoxy(2, COLSIZE - 40); cout<<fliptee<<flush;
gotoxy(MAPROWSIZE - 1, COLSIZE - 40); cout<<tee<<flush;
gotoxy(12, COLSIZE - 25); cout<<tlc<<flush;
gotoxy(12, COLSIZE - 19); cout<<trc<<flush;
gotoxy(18, COLSIZE - 25); cout<<blc<<flush;
gotoxy(18, COLSIZE - 19); cout<<brc<<flush;
gotoxy(12, COLSIZE - 23); cout<<fliptee<<flush;
gotoxy(12, COLSIZE - 21); cout<<fliptee<<flush;
gotoxy(18, COLSIZE - 23); cout<<tee<<flush;
gotoxy(18, COLSIZE - 21); cout<<tee<<flush;
gotoxy(14, COLSIZE - 25); cout<<lefttee<<flush;
gotoxy(16, COLSIZE - 25); cout<<lefttee<<flush;
gotoxy(14, COLSIZE - 19); cout<<righttee<<flush;
gotoxy(16, COLSIZE - 19); cout<<righttee<<flush;
gotoxy(14, COLSIZE - 23); cout<<cross<<flush;
gotoxy(16, COLSIZE - 23); cout<<cross<<flush;
gotoxy(14, COLSIZE - 21); cout<<cross<<flush;
gotoxy(16, COLSIZE - 21); cout<<cross<<flush;
gotoxy(13 + (2 * mainchar.gettileY()), COLSIZE - 24 + (2 * mainchar.gettileX())); cout<<heroDisplay<<flush;
gotoxy(0, 0); cout<<flush;
getch();
clrselection(3, MAPROWSIZE - 1, COLSIZE - 40, COLSIZE - 1);
gotoxy(2, COLSIZE - 40); cout<<horwall<<flush;
gotoxy(MAPROWSIZE - 1, COLSIZE - 40); cout<<horwall<<flush;
color(GRASSCOLOR);
for(int a = 3; a < MAPROWSIZE - 1; a++){
for(int b = COLSIZE - 40; b < COLSIZE - 1; b++){
gotoxy(a, b); cout<<grass<<flush;
}
}
color(7);
tiles[mainchar.gettileY()][mainchar.gettileX()].printmap(3, MAPROWSIZE - 1, COLSIZE - 40, COLSIZE - 1);
break;
case 224:
arrowmove = getch();
switch(arrowmove){
case 72: // Up
if(map[y-1][x] == grass || map[y-1][x] == mapTown || map[y-1][x] == upMap || map[y-1][x] == downMap|| map[y-1][x] == rightMap|| map[y-1][x] == leftMap){
gotoxy(y, x);
if(map[y][x] == grass){
color(GRASSCOLOR);
cout<<grass<<flush;
}
else if(map[y][x] == mapTown){
color(7);
cout<<mapTown<<flush;
}
y -= 1;
gotoxy(y, x);
color(HERODISPLAYCOLOR);
cout<<heroDisplay<<flush;
color(7);
}
break;
case 80: // Down
if(map[y+1][x] == grass || map[y+1][x] == mapTown || map[y+1][x] == upMap || map[y+1][x] == downMap|| map[y+1][x] == rightMap|| map[y+1][x] == leftMap){
gotoxy(y, x);
if(map[y][x] == grass){
color(GRASSCOLOR);
cout<<grass<<flush;
}
else if(map[y][x] == mapTown){
color(7);
cout<<mapTown<<flush;
}
y += 1;
gotoxy(y, x);
color(HERODISPLAYCOLOR);
cout<<heroDisplay<<flush;
color(7);
}
break;
case 75: // Left
if(map[y][x-1] == grass || map[y][x-1] == mapTown || map[y][x-1] == upMap || map[y][x-1] == downMap|| map[y][x-1] == rightMap|| map[y][x-1] == leftMap){
gotoxy(y, x);
if(map[y][x] == grass){
color(GRASSCOLOR);
cout<<grass<<flush;
}
else if(map[y][x] == mapTown){
color(7);
cout<<mapTown<<flush;
}
x -= 1;
gotoxy(y, x);
color(HERODISPLAYCOLOR);
cout<<heroDisplay<<flush;
color(7);
}
break;
case 77: // Right
if(map[y][x+1] == grass || map[y][x+1] == mapTown || map[y][x+1] == upMap || map[y][x+1] == downMap|| map[y][x+1] == rightMap|| map[y][x+1] == leftMap){
gotoxy(y, x);
if(map[y][x] == grass){
color(GRASSCOLOR);
cout<<grass<<flush;
}
else if(map[y][x] == mapTown){
color(7);
cout<<mapTown<<flush;
}
x += 1;
gotoxy(y, x);
color(HERODISPLAYCOLOR);
cout<<heroDisplay<<flush;
color(7);
}
break;
default:
break;
}
break;
default:
break;
}
cout<<flush;
gotoxy(0, 0);
cout<<flush;
}
void CMap::printmap(int top, int bottom, int left, int right){
color(7);
cout<<flush;
for(int a = top; a < bottom; a++){
for(int b = left; b < right; b++){
if(map[a][b] != grass){
gotoxy(a, b);
if(map[a][b] == tree)
color(TREECOLOR);
else if(map[a][b] == water)
color(WATERCOLOR);
else if(map[a][b] == mountain)
color(MOUNTAINCOLOR);
else if(map[a][b] == mapTown)
color(7);
else if(map[a][b] == rightMap)
color(ARROWSCOLOR);
else if(map[a][b] == leftMap)
color(ARROWSCOLOR);
else if(map[a][b] == upMap)
color(ARROWSCOLOR);
else if(map[a][b] == downMap)
color(ARROWSCOLOR);
else
Error("Error: printmap: Map Object Not Recognized");
cout<<map[a][b]<<flush;
}
}
}
gotoxy(y, x);
color(HERODISPLAYCOLOR);
cout<<heroDisplay<<flush;
color(7);
gotoxy(0, 0);
}
void CMap::printborders(){
cout<<flush;
for(int a = 0; a < TOTALROW; a++){
for(int b = 0; b < COLSIZE; b++){
if(map[a][b] != grass){
gotoxy(a, b);
cout<<map[a][b]<<flush;
}
}
}
gotoxy(32, 1); color(GREEN); cout<<"General Information"<<flush; color(GREY);
gotoxy(34, 1); cout<<"Class: "<<flush;
gotoxy(36, 1); cout<<"Experience: "<<flush;
gotoxy(38, 1); cout<<"Level : "<<flush;
gotoxy(40, 1); cout<<"Gold : "<<flush;
gotoxy(42, 1); cout<<"Hitpoints: "<<flush;
gotoxy(44, 1); cout<<"Mana : "<<flush;
gotoxy(46, 1); cout<<"Total Defense: "<<flush;
gotoxy(48, 1); cout<<"Map Tile: "<<flush;
centerText("Stats", 32, 20, 50, GREEN);
gotoxy(33, 21); cout<<" Strength : "<<flush;
gotoxy(34, 21); cout<<" Dexterity: "<<flush;
gotoxy(35, 21); cout<<" Vitality : "<<flush;
gotoxy(36, 21); cout<<" Energy : "<<flush;
centerText("Gear", 38, 20, 50, GREEN);
gotoxy(39, 21); cout<<"Weapon: "<<flush;
gotoxy(40, 21); cout<<"Helmet: "<<flush;
gotoxy(41, 21); cout<<"Armor : "<<flush;
gotoxy(42, 21); cout<<"Shield: "<<flush;
centerText("Inventory", 44, 20, 50, GREEN);
centerText("Spellbook", 32, 50, 80, GREEN);
centerText("Potions", 39, 50, 80, GREEN);
}
/******************************Town Class Function Definitions*****************************/
void CTown::assignAll(char* ttownName, int tposY, int tposX, int ttileY, int ttileX, int tminItemLvl, int tmaxItemLvl, int tminSpellLvl, int tmaxSpellLvl, int ttownNum){
strcpy(townName, ttownName);
posY = tposY;
posX = tposX;
tileY = ttileY;
tileX = ttileX;
minItemLvl = tminItemLvl;
maxItemLvl = tmaxItemLvl;
minSpellLvl = tminSpellLvl;
maxSpellLvl = tmaxSpellLvl;
townNum = ttownNum;
}
// MAIN AND FUNCTION DEFINITIONS
int main(){
int choice;
int pot_ids[] = {0, 0, 0, 0, 0, 0};
int spell_ids[] = {0, 0, 0, 0, 0};
int inv_ids[] = {0, 0, 0, 0};
int exitGame = 1;
int counter;
srand(GetTickCount());
system("cls");
scanInPotions(allPotions);
scanInSpells(allSpells);
scanInBonuses(allBonuses);
scanInItems(allItems);
scanInMonsters(allMonsters);
scanInLevels(allLevels);
town1.assignAll("Tristram Clouds", 3, 1, 0, 0, 1, 2, 1, 3, 1);
town2.assignAll("Unfinished (Town 2)", 14, 5, 0, 2, 1, 2, 1, 3, 2);
town3.assignAll("Unfinished (Town 3)", 8, 30, 2, 1, 1, 2, 1, 3, 3);
town4.assignAll("Unfinished (Town 4)", 24, 60, 2, 2, 1, 2, 1, 3, 4);
tile_tl(tiles[0][0]);
tile_tc(tiles[0][1]);
tile_tr(tiles[0][2]);
tile_ml(tiles[1][0]);
tile_mc(tiles[1][1]);
tile_mr(tiles[1][2]);
tile_bl(tiles[2][0]);
tile_bc(tiles[2][1]);
tile_br(tiles[2][2]);
mainchar.assembleChar("Unknown", "Unknown", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, spell_ids, inv_ids, pot_ids, 0, 0);
SetConsoleTitle("Proverbs of Apocrypha -- Version 2.0 - Beta 1.0");
SizeWindow();
Blank.printborders();
mainchar.displayinfo();
do{
counter = 3;
centerText(")()( )()( ()() )( )( )()()( )()( )()() ()() ", counter++, 0, COLSIZE, TITLECOLOR);
centerText(")( )( )( )( )( )( )( )( )( )( )( )( )( )( ", counter++, 0, COLSIZE, TITLECOLOR);
centerText(")()( )()( )( )( )( )( )()() )()() )()()( ()()(", counter++, 0, COLSIZE, TITLECOLOR);
centerText(")( )( )( )( )( ()( )( )( )( )( )( )(", counter++, 0, COLSIZE, TITLECOLOR);
centerText(")( )( )( ()() ( )()()( )( )( )()() ()() ", counter++, 0, COLSIZE, TITLECOLOR);
counter++;
centerText(" ()() )()()(", counter++, 0, COLSIZE, TITLECOLOR);
centerText(")( )( )( ", counter++, 0, COLSIZE, TITLECOLOR);
centerText(")( )( )()( ", counter++, 0, COLSIZE, TITLECOLOR);
centerText(")( )( )( ", counter++, 0, COLSIZE, TITLECOLOR);
centerText(" ()() )( ", counter++, 0, COLSIZE, TITLECOLOR);
counter++;
centerText(" )( )()( ()() ()()( )()( )( )( )()( )( )( )( ", counter++, 0, COLSIZE, TITLECOLOR);
centerText(" )()( )( )( )( )( )( )( )( )( )( )( )( )( )( )()( ", counter++, 0, COLSIZE, TITLECOLOR);
centerText(" )( )( )()( )( )( )( )()() )( )()( )()()( )( )( ", counter++, 0, COLSIZE, TITLECOLOR);
centerText(")( )( )( )( )( )( )( )( )( )( )( )( )( )(", counter++, 0, COLSIZE, TITLECOLOR);
centerText(")( )( )( ()() ()()( )( )( )( )( )( )( )( )(", counter++, 0, COLSIZE, TITLECOLOR);
counter++;
centerText("Proverbs of Apocrypha Version 1.0 Beta", counter++);
cout<<flush;
newtop("This is where the Last/Current Action is displayed throughout the game");
counter++;
choice = menu(counter, 0, 6, " Start a New Game ", " Continue a Saved Game ", " People and Places (List) ", " Go To Full Screen ", "Help", " Exit ");
switch(choice){
case 1:
newGame();
break;
case 2:
loadGame();
break;
case 3:
peoplePlaces();
clrnon_border();
break;
case 4:
FullScreen();
break;
case 5:
helpMenu();
clrnon_border();
break;
case 6:
system("cls");
exitGame = 0;
exit(0);
break;
default:
Error("Error: Main: Invalid choice");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -