LCOV - code coverage report
Current view: top level - omega-rpg-0.90-pa9 - stats.c (source / functions) Hit Total Coverage
Test: lcov.info Lines: 0 61 0.0 %
Date: 2017-09-08 22:00:26 Functions: 0 1 0.0 %
Branches: 0 29 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* omega copyright (C) by Laurence Raphael Brothers, 1987,1988, 1989 */
       2                 :            : /* stats.c */
       3                 :            : 
       4                 :            : /* this file contains one function, editstats(), that allows the player
       5                 :            :  * (if in cheat mode) to alter their stats, HP, mana, gold, etc.
       6                 :            :  *
       7                 :            :  * a later version may add options to set other things like guild
       8                 :            :  * membership, alignment, and so on
       9                 :            :  */
      10                 :            : 
      11                 :            : #ifndef MSDOS_SUPPORTED_ANTIQUE
      12                 :            : #include <unistd.h>
      13                 :            : #include <ctype.h>
      14                 :            : #endif
      15                 :            : 
      16                 :            : #include "glob.h"
      17                 :            : 
      18                 :          0 : void editstats(void)
      19                 :            : {
      20                 :          0 :   int slot = 1, to, done = FALSE;
      21                 :            :   int response, num;
      22                 :            : 
      23                 :          0 :   clearmsg();
      24                 :          0 :   menuclear();
      25                 :            : 
      26                 :          0 :   display_stats();
      27                 :            : 
      28                 :          0 :   move_slot(1,1,NUMSTATS);
      29                 :            : 
      30                 :            :   do {
      31                 :          0 :     print1("Currently selected stat is preceded by highlit >>");
      32                 :          0 :     print2("Move selected option with '>' and '<', ' ' to change value, ESCAPE to quit");
      33                 :            : 
      34                 :          0 :     response = mcigetc();
      35   [ #  #  #  #  :          0 :     switch(response) {
                      # ]
      36                 :            :     case 'j':
      37                 :            :     case '>':
      38                 :            : #ifdef KEY_DOWN
      39                 :            :     case KEY_DOWN:
      40                 :            : #endif
      41                 :          0 :       to = slot + 1;
      42                 :          0 :       slot = move_slot(slot,to,NUMSTATS+1);
      43                 :          0 :       break;
      44                 :            :     case 'k':
      45                 :            :     case '<':
      46                 :            : #ifdef KEY_UP
      47                 :            :     case KEY_UP:
      48                 :            : #endif
      49                 :          0 :       to = slot - 1;
      50         [ #  # ]:          0 :       if (to > 0)
      51                 :          0 :         slot = move_slot(slot,to, NUMSTATS+1);
      52                 :          0 :       break;
      53                 :            :     case ESCAPE:
      54                 :          0 :       done = TRUE;
      55                 :          0 :       break;
      56                 :            :     case ' ':
      57                 :          0 :       print1("enter new value:");
      58                 :          0 :       num = (int) parsenum("");
      59 [ #  # ][ #  # ]:          0 :       if ((slot < 7) && ((num > 32) || (num < 1)))
                 [ #  # ]
      60                 :            :       {
      61                 :          0 :         print1("You don't really think I'll let you get away with that, do you?");
      62                 :          0 :         morewait();
      63                 :          0 :         break;
      64                 :            :       }
      65   [ #  #  #  #  :          0 :       switch(slot)
          #  #  #  #  #  
                #  #  # ]
      66                 :            :       {
      67                 :            :       case 1:
      68                 :          0 :         Player.str = Player.maxstr = num;
      69                 :          0 :         break;
      70                 :            :       case 2:
      71                 :          0 :         Player.con = Player.maxcon = num;
      72                 :          0 :         break;
      73                 :            :       case 3:
      74                 :          0 :         Player.dex = Player.maxdex = num;
      75                 :          0 :         break;
      76                 :            :       case 4:
      77                 :          0 :         Player.agi = Player.maxagi = num;
      78                 :          0 :         break;
      79                 :            :       case 5:
      80                 :          0 :         Player.iq  = Player.maxiq  = num;
      81                 :          0 :         break;
      82                 :            :       case 6:
      83                 :          0 :         Player.pow = Player.maxpow = num;
      84                 :          0 :         break;
      85                 :            :       case 7:
      86                 :          0 :         Player.hp                  = num;
      87                 :          0 :         break;
      88                 :            :       case 8:
      89                 :          0 :         Player.maxhp               = num;
      90                 :          0 :         break;
      91                 :            :       case 9:
      92                 :          0 :         Player.mana                = num;
      93                 :          0 :         break;
      94                 :            :       case 10:
      95                 :          0 :         Player.maxmana             = num;
      96                 :          0 :         break;
      97                 :            :       case 11:
      98                 :          0 :         Player.cash                = num;
      99                 :          0 :         break;
     100                 :            :       }
     101                 :          0 :       calc_melee();
     102                 :          0 :       break;
     103                 :            :     default:
     104                 :          0 :       print3("That response is meaningless for this option.");
     105                 :          0 :       break;
     106                 :            :     }
     107                 :          0 :     print1("Currently selected stat is preceded by highlit >>");
     108                 :          0 :     display_stat_slot(slot/*,slot,NUMSTATS+1 WDT HACK! */);
     109                 :          0 :     move_slot(slot,slot,NUMSTATS+1);
     110         [ #  # ]:          0 :   } while (! done);
     111         [ #  # ]:          0 :   if (optionp(SHOW_COLOUR))
     112                 :          0 :     colour_on();
     113                 :            :   else
     114                 :          0 :     colour_off();
     115                 :            : #if !defined(MSDOS_SUPPORTED_ANTIQUE) && !defined(AMIGA)
     116                 :          0 :   xredraw();
     117                 :            : #endif
     118                 :          0 : }
     119                 :            : 

Generated by: LCOV version 1.11