comparison xrogue/trader.c @ 220:f54901b9c39b

XRogue: convert to ANSI-style function declarations.
author John "Elwin" Edwards
date Wed, 02 Mar 2016 21:13:26 -0500
parents ce0cf824c192
children
comparison
equal deleted inserted replaced
219:f9ef86cf22b2 220:f54901b9c39b
14 14
15 #include <curses.h> 15 #include <curses.h>
16 #include <string.h> 16 #include <string.h>
17 #include "rogue.h" 17 #include "rogue.h"
18 18
19 bool open_market(void);
20 void trans_line(void);
21 char *typ_name(struct object *obj);
22
19 /* 23 /*
20 * buy_it: 24 * buy_it:
21 * Buy the item on which the hero stands 25 * Buy the item on which the hero stands
22 */ 26 */
23 27
24 buy_it() 28 void
29 buy_it(void)
25 { 30 {
26 reg int wh; 31 reg int wh;
27 struct linked_list *item = NULL; 32 struct linked_list *item = NULL;
28 struct object *obj = NULL; 33 struct object *obj = NULL;
29 int wasfood = FALSE; 34 int wasfood = FALSE;
82 } 87 }
83 88
84 /* 89 /*
85 * do_post: 90 * do_post:
86 * Put a trading post room and stuff on the screen 91 * Put a trading post room and stuff on the screen
87 */ 92 * startup: True if equipping the player at the beginning of the game
88 93 */
89 do_post(startup) 94
90 bool startup; /* True if equipping the player at the beginning of the game */ 95 void
96 do_post(bool startup)
91 { 97 {
92 coord tp; 98 coord tp;
93 reg int i, j = 0, k; 99 reg int i, j = 0, k;
94 reg struct room *rp; 100 reg struct room *rp;
95 reg struct object *op; 101 reg struct object *op;
346 /* 352 /*
347 * open_market: 353 * open_market:
348 * Retruns TRUE when ok do to transacting 354 * Retruns TRUE when ok do to transacting
349 */ 355 */
350 356
351 open_market() 357 bool
358 open_market(void)
352 { 359 {
353 if (trader >= MAXPURCH && !wizard && level != 0) { 360 if (trader >= MAXPURCH && !wizard && level != 0) {
354 msg("The market is closed. The stairs are that-a-way! "); 361 msg("The market is closed. The stairs are that-a-way! ");
355 return FALSE; 362 return FALSE;
356 } 363 }
362 /* 369 /*
363 * price_it: 370 * price_it:
364 * Price the object that the hero stands on 371 * Price the object that the hero stands on
365 */ 372 */
366 373
367 price_it() 374 bool
375 price_it(void)
368 { 376 {
369 reg struct linked_list *item; 377 reg struct linked_list *item;
370 reg struct object *obj; 378 reg struct object *obj;
371 reg int worth; 379 reg int worth;
372 reg char *str; 380 reg char *str;
402 /* 410 /*
403 * sell_it: 411 * sell_it:
404 * Sell an item to the trading post 412 * Sell an item to the trading post
405 */ 413 */
406 414
407 sell_it() 415 void
416 sell_it(void)
408 { 417 {
409 reg struct linked_list *item; 418 reg struct linked_list *item;
410 reg struct object *obj; 419 reg struct object *obj;
411 reg int wo, ch; 420 reg int wo, ch;
412 421
449 /* 458 /*
450 * trans_line: 459 * trans_line:
451 * Show how many transactions the hero has left 460 * Show how many transactions the hero has left
452 */ 461 */
453 462
454 trans_line() 463 void
464 trans_line(void)
455 { 465 {
456 if (level == 0) 466 if (level == 0)
457 sprintf(prbuf, "You are welcome to spend whatever gold you have."); 467 sprintf(prbuf, "You are welcome to spend whatever gold you have.");
458 else if (!wizard) 468 else if (!wizard)
459 sprintf(prbuf,"You have %d transactions remaining.", 469 sprintf(prbuf,"You have %d transactions remaining.",
470 * typ_name: 480 * typ_name:
471 * Return the name for this type of object 481 * Return the name for this type of object
472 */ 482 */
473 483
474 char * 484 char *
475 typ_name(obj) 485 typ_name(struct object *obj)
476 reg struct object *obj;
477 { 486 {
478 static char buff[20]; 487 static char buff[20];
479 reg int wh; 488 reg int wh;
480 489
481 switch (obj->o_type) { 490 switch (obj->o_type) {