home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / sources.arc / DANG_SRC.LZH / D_USER2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-12  |  2.2 KB  |  97 lines

  1.  
  2. #include<globals2.h>
  3. /* This module :        
  4.                   - recieves the var dir
  5.                   - and displays the users stats
  6.                   - checks for experience and will 
  7.                     award a new lvl plus unc stats etc.
  8.                                                          */
  9.   display_user_stats()  
  10.   {
  11.    
  12. if(user.exp > (user.lvl*100))
  13.  {
  14.    v_gtext(handle,6,19,"You gained a level!");
  15.    user.lvl++;
  16.    user.str++;
  17.    user.dex++;
  18.    user.inte++;
  19.    user.wis++;
  20.    user.con++;
  21.    user.max_hp+=(abs(user.con-18));
  22.    user.max_sp+=(abs(user.wis-18));
  23.    user.hp = user.max_hp;
  24.    user.sp = user.max_sp;
  25.  }
  26.   
  27. /* put this const shit in the main module! */
  28.    
  29.     v_gtext(handle,74,104,user.name);   
  30.     v_gtext(handle,74,112,user.align);
  31.    v_gtext(handle,74,120,user.class);
  32.     sprintf(string,"%d ",user.ac);
  33.                     
  34.  
  35.     v_gtext(handle,80,128,string);
  36.  
  37.  
  38.    
  39.     sprintf(string,"%d  ",user.lvl);
  40.     v_gtext(handle,80,136,string);
  41.  
  42.  
  43.  
  44.   
  45.  
  46.  
  47.     
  48.     sprintf(string,"%d  ",user.str);
  49.     v_gtext(handle,80,144,string);
  50.  
  51.  
  52.   sprintf(string,"%d  ",user.inte);
  53.     v_gtext(handle,80,152,string);
  54.  
  55.   sprintf(string,"%d  ",user.dex);
  56.     v_gtext(handle,80,160,string);  
  57.  
  58.  
  59.  sprintf(string,"Direction:%c",dir);
  60. v_gtext(handle,204,118,string);
  61.  
  62.  
  63.                      
  64.      sprintf(string,"%5ld",user.hp);
  65.     v_gtext(handle,244,148,string); 
  66.  
  67.      sprintf(string,"%5ld",user.sp);
  68.     v_gtext(handle,244,156,string); 
  69.  
  70.                                         /* display hunger/thurst stat */
  71.   switch(user.hunger_thurst_status[0])
  72.   {
  73.    case 0:
  74.    case 1:
  75.    case 2:
  76.    case 3: v_gtext(handle,204,126,"         "); break;
  77.    case 4: v_gtext(handle,204,126,"Hungry   "); break;
  78.    case 5: case 6: case 7: v_gtext(handle,204,126,"Starving!"); break;
  79.    case 8: case 9: case 10:v_gtext(handle,204,126,"Famished!"); break;
  80.   }
  81.    switch(user.hunger_thurst_status[1])
  82.   {
  83.    case 0:
  84.    case 1:
  85.    case 2:
  86.    case 3: v_gtext(handle,204,134,"       "); break;
  87.    case 4: v_gtext(handle,204,134,"Thirsty"); break;
  88.    case 5: case 6: case 7:
  89.    case 8: case 9: case 10:v_gtext(handle,204,134,"Parched"); break;
  90.   }
  91.   
  92.  
  93.     
  94.  
  95. }       
  96.  
  97.