/[projet1]/users/barnsey123/HNEFATAFL/main.c
Defence Force logotype

Diff of /users/barnsey123/HNEFATAFL/main.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 977 by barnsey123, Sat Nov 9 14:02:59 2013 UTC revision 978 by barnsey123, Sun Nov 24 18:35:12 2013 UTC
# Line 58  Line 58 
58  // 07-11-2013 NB v0.075 New credits text  // 07-11-2013 NB v0.075 New credits text
59  // 08-11-2013 NB v0.076 New Trophy Graphic, contents drawn  // 08-11-2013 NB v0.076 New Trophy Graphic, contents drawn
60  // 09-11-2013 NB v0.077 Draw Trophy Grid edges and Color Headings  // 09-11-2013 NB v0.077 Draw Trophy Grid edges and Color Headings
61    // 24-11-2013 NB v0.078 Adds text to Trophy Screen...
62  /****************************************/  /****************************************/
63  // TODO:  // TODO:
64  // Add Text to Trophy Screen (Trophy Descriptions)  // Add Text to Trophy Screen (Trophy Descriptions)
# Line 396  unsigned char subpacc,subpacd; // used i Line 397  unsigned char subpacc,subpacd; // used i
397  unsigned char turncount;                        // used to count the number of turns  unsigned char turncount;                        // used to count the number of turns
398  //unsigned char enemytargetcount;       // count of enemy targets on a route  //unsigned char enemytargetcount;       // count of enemy targets on a route
399  unsigned char brokenarrow[4];   // NORTH/SOUTH/EAST/WEST: 0=OK, 1=BROKENARROW, 2=POTENTIAL BROKEN ARROW in that direction  unsigned char brokenarrow[4];   // NORTH/SOUTH/EAST/WEST: 0=OK, 1=BROKENARROW, 2=POTENTIAL BROKEN ARROW in that direction
400  unsigned char deadattackers, deaddefenders, deadplayers, deadtoggle; deadcurset; // count of dead attackers or defenders  unsigned char deadattackers, deaddefenders, deadplayers, deadtoggle; deadcurset;  // count of dead attackers or defenders
401  //unsigned char deadchar;  //unsigned char deadchar;
402  unsigned char kingtoedge[4];    // number of TARGETS from king to edge of board  unsigned char kingtoedge[4];    // number of TARGETS from king to edge of board
403  unsigned char tzonemode;                // 0=PARTIAL1, 1=PARTIAL2, 2=FULL  unsigned char tzonemode;                // 0=PARTIAL1, 1=PARTIAL2, 2=FULL
# Line 416  unsigned char bottompattern;   // draw ful Line 417  unsigned char bottompattern;   // draw ful
417  unsigned char Trophies[7][2];   // trophy array [trophytype][playertype]  unsigned char Trophies[7][2];   // trophy array [trophytype][playertype]
418  unsigned char TurnsRemaining;   // for awarding the RAIDO Trophy (win on last turn)  unsigned char TurnsRemaining;   // for awarding the RAIDO Trophy (win on last turn)
419  //unsigned char TrophyTitle[12];        // Titles of Trophies  //unsigned char TrophyTitle[12];        // Titles of Trophies
420  unsigned char TextChar; // Character of Trophy String  unsigned char textchar; // Character of Trophy String
421  unsigned char TextCursor; // Location of Text string  //unsigned char TextCursor; // Location of Text string
422  /****************** MAIN PROGRAM ***********************************/  /****************** MAIN PROGRAM ***********************************/
423  main(){  main(){
424    //gameinput=0;        // 0=undefined 1=play against computer, 2=human vs human    //gameinput=0;        // 0=undefined 1=play against computer, 2=human vs human
# Line 434  main(){ Line 435  main(){
435      //playertype=0;                             // 1=attacker, 2=defender (set at zero as incremented within loop)      //playertype=0;                             // 1=attacker, 2=defender (set at zero as incremented within loop)
436      firstblood=1;      firstblood=1;
437      ClearTrophies();                    // initialize trophy array      ClearTrophies();                    // initialize trophy array
438        //PrintTrophyScreen();
439      drawboard();                                // draw the board      drawboard();                                // draw the board
440      while (gamestyle==3){      while (gamestyle==3){
441        message="PLAYERS:1-2";    // number of players        message="PLAYERS:1-2";    // number of players
# Line 488  main(){ Line 490  main(){
490      if ( game == 0 ) message="             KING WINS!";      if ( game == 0 ) message="             KING WINS!";
491      // computer can't move      // computer can't move
492      if ( game == -1 ) message="STALEMATE - OR TURN LIMIT EXCEEDED";      if ( game == -1 ) message="STALEMATE - OR TURN LIMIT EXCEEDED";
493      // Award RAIDO Trophy (win on last turn)      // Award RAIDO AND URUZ Trophies (RAIDO = win on last turn, URUZ >=5 turns remaining)
494      if (( game != -1 )&&(TurnsRemaining==0)){      if ( game != -1 ){
495              Trophies[RAIDO][playertype-1]=TROPHY;              if (TurnsRemaining == 0){
496                    Trophies[RAIDO][playertype-1]=TROPHY;
497            }
498            if (TurnsRemaining >= 5){
499                    Trophies[URUZ][playertype-1]=TROPHY;
500            }
501      }      }
502      printmessage();      printmessage();
503      erasetext=120; // 40*3 (3 lines to erase)      erasetext=120; // 40*3 (3 lines to erase)
# Line 2061  void PrintTrophyScreen(){ Line 2068  void PrintTrophyScreen(){
2068          AlgizThorTrophyCalc();                  // Calculate the awarding of ALGIZ/THOR Trophies          AlgizThorTrophyCalc();                  // Calculate the awarding of ALGIZ/THOR Trophies
2069          PrintTrophyScreen3();                   // print the trophy grid (with trophies)          PrintTrophyScreen3();                   // print the trophy grid (with trophies)
2070          cy=2;cx=7;inverse();cx=8;inverse();     // inverse the trophy head columns          cy=2;cx=7;inverse();cx=8;inverse();     // inverse the trophy head columns
2071          //PrintTrophyScreen4();                 // print text onto the hires part of screen          PrintTrophyScreen4();                   // print text onto the hires part of screen
2072          getchar();          getchar();
2073  }  }
2074  void PrintTrophyScreen1(){  void PrintTrophyScreen1(){
# Line 2097  void PrintTrophyScreen3(){ Line 2104  void PrintTrophyScreen3(){
2104          DrawTrophyBottom();          DrawTrophyBottom();
2105  }  }
2106  // Print the trophy names  // Print the trophy names
2107    
2108  void PrintTrophyScreen4(){  void PrintTrophyScreen4(){
2109          TextCursor=0xa5ae;      //starting position of text on screen          //deadtext=0xa5ae;      //starting position of text on screen
2110            row=3;col=2;
2111          for (x=0;x<6;x++){          for (x=0;x<6;x++){
2112                  for (y=0;y<12;y++){                  //deadcurset=0xad29+((40*8)*(x*2))+((40*8)*2);
2113                          TextChar=0x9800+(TrophyText[x][y]*8);                  deadcurset=0xa002+(40*18*row)+(40*6)+(col*3);
2114                    for (y=0;y<11;y++){
2115                            //textchar=(TrophyText[x][y]-32)*8;
2116                            textchar=TrophyText[x][y];
2117                          chasm2();                          chasm2();
2118                          TextCursor++;                          deadcurset++;
2119                  }                  }
2120                  TextCursor=0xa5ae+(40*8);                  row++;
2121                    //deadtext=0xa5ae+((40*8)*2);
2122          }          }
2123  }  }
2124    
2125  void AlgizThorTrophyCalc(){     // Calculate if anyone should get the ALGIZ or THOR Trophies  void AlgizThorTrophyCalc(){     // Calculate if anyone should get the ALGIZ or THOR Trophies
2126          //if ( playertype == 1){ // if current player is ATTACKER          //if ( playertype == 1){ // if current player is ATTACKER
2127                  if (deadattackers==0) Trophies[ALGIZ][0]=TROPHY;                  if (deadattackers==0) Trophies[ALGIZ][0]=TROPHY;

Legend:
Removed from v.977  
changed lines
  Added in v.978

  ViewVC Help
Powered by ViewVC 1.1.26