comparison rogue4/extern.c @ 279:d3968e9cb98d

Use C stdio functions for score files and save files. Switching from Unix file descriptor operations to C standard FILE* functions will reduce portability problems.
author John "Elwin" Edwards
date Fri, 15 Sep 2017 19:57:54 -0400
parents e7aab31362af
children 0250220d8cdd
comparison
equal deleted inserted replaced
278:c222f9d56776 279:d3968e9cb98d
98 int fung_hit = 0; /* Number of time fungi has hit */ 98 int fung_hit = 0; /* Number of time fungi has hit */
99 int quiet = 0; /* Number of quiet turns */ 99 int quiet = 0; /* Number of quiet turns */
100 int food_left; /* Amount of food in hero's stomach */ 100 int food_left; /* Amount of food in hero's stomach */
101 int group = 2; /* Current group number */ 101 int group = 2; /* Current group number */
102 int hungry_state = 0; /* How hungry is he */ 102 int hungry_state = 0; /* How hungry is he */
103 int fd; /* File descriptor for score file */
104 int lfd; /* File descriptor for log file */
105 int a_chances[MAXARMORS] = { /* Chance for each armor type */ 103 int a_chances[MAXARMORS] = { /* Chance for each armor type */
106 20, 104 20,
107 35, 105 35,
108 50, 106 50,
109 63, 107 63,
133 THING *cur_weapon; /* Which weapon he is weilding */ 131 THING *cur_weapon; /* Which weapon he is weilding */
134 THING *cur_ring[2]; /* Which rings are being worn */ 132 THING *cur_ring[2]; /* Which rings are being worn */
135 THING *lvl_obj = NULL; /* List of objects on this level */ 133 THING *lvl_obj = NULL; /* List of objects on this level */
136 THING *mlist = NULL; /* List of monsters on the level */ 134 THING *mlist = NULL; /* List of monsters on the level */
137 THING *_monst[MAXLINES*MAXCOLS]; /* Pointers for monsters at each spot */ 135 THING *_monst[MAXLINES*MAXCOLS]; /* Pointers for monsters at each spot */
136
137 FILE *score_file = NULL; /* Scoreboard */
138 FILE *log_file = NULL; /* Log file */
138 139
139 WINDOW *hw; /* Used as a scratch window */ 140 WINDOW *hw; /* Used as a scratch window */
140 141
141 #define INIT_STATS { 16, 0, 1, 10, 12, "1d4", 12 } 142 #define INIT_STATS { 16, 0, 1, 10, 12, "1d4", 12 }
142 143