Mercurial > hg > early-roguelike
diff xrogue/daemons.c @ 220:f54901b9c39b
XRogue: convert to ANSI-style function declarations.
author | John "Elwin" Edwards |
---|---|
date | Wed, 02 Mar 2016 21:13:26 -0500 |
parents | cadff8f047a1 |
children | b67b99f6c92b |
line wrap: on
line diff
--- a/xrogue/daemons.c Fri Feb 19 21:02:28 2016 -0500 +++ b/xrogue/daemons.c Wed Mar 02 21:13:26 2016 -0500 @@ -24,8 +24,8 @@ * A healing daemon that restors hit points after rest */ -doctor(tp) -register struct thing *tp; +void +doctor(struct thing *tp) { register int ohp; register int limit, new_points; @@ -111,7 +111,8 @@ * Called when it is time to start rolling for wandering monsters */ -swander() +void +swander(void) { start_daemon(rollwand, (VOID *)NULL, BEFORE); } @@ -123,7 +124,8 @@ int between = 0; -rollwand() +void +rollwand(void) { if (++between >= 4) @@ -145,7 +147,8 @@ * this function is a daemon called each turn when the character is a thief */ -trap_look() +void +trap_look(void) { if (rnd(100) < (2*dex_compute() + 5*pstats.s_lvl)) search(TRUE, FALSE); @@ -156,7 +159,8 @@ * Release the poor player from his confusion */ -unconfuse() +void +unconfuse(void) { turn_off(player, ISHUH); msg("You feel less confused now"); @@ -167,7 +171,8 @@ * He lost his see invisible power */ -unsee() +void +unsee(void) { if (!ISWEARING(R_SEEINVIS)) { turn_off(player, CANSEE); @@ -180,7 +185,8 @@ * Remove to-hit handicap from player */ -unstink() +void +unstink(void) { turn_off(player, HASSTINK); } @@ -190,7 +196,8 @@ * Player is no longer immune to confusion */ -unclrhead() +void +unclrhead(void) { turn_off(player, ISCLEAR); msg("The blue aura about your head fades away."); @@ -201,7 +208,8 @@ * Player can no longer walk through walls */ -unphase() +void +unphase(void) { turn_off(player, CANINWALL); msg("Your dizzy feeling leaves you."); @@ -215,7 +223,7 @@ */ int -land() +land(void) { turn_off(player, ISFLY); msg("You regain your normal weight"); @@ -228,7 +236,8 @@ * He gets his sight back */ -sight() +void +sight(void) { if (on(player, ISBLIND)) { @@ -245,8 +254,7 @@ */ int -res_strength(howmuch) -long howmuch; +res_strength(long howmuch) { /* If lost_str is non-zero, restore that amount of strength, @@ -271,7 +279,8 @@ * End the hasting */ -nohaste() +void +nohaste(void) { turn_off(player, ISHASTE); msg("You feel yourself slowing down."); @@ -282,7 +291,8 @@ * End the slowing */ -noslow() +void +noslow(void) { turn_off(player, ISSLOW); msg("You feel yourself speeding up."); @@ -293,7 +303,8 @@ * If this gets called, the player has suffocated */ -suffocate() +void +suffocate(void) { pstats.s_hpt = -1; death(D_SUFFOCATION); @@ -303,7 +314,8 @@ * digest the hero's food */ -stomach() +void +stomach(void) { register int oldfood, old_hunger, food_use, i; @@ -387,7 +399,8 @@ * daemon for curing the diseased */ -cure_disease() +void +cure_disease(void) { turn_off(player, HASDISEASE); if (off (player, HASINFEST)) @@ -400,7 +413,8 @@ * Become visible again */ -appear() +void +appear(void) { turn_off(player, ISINVIS); PLAYER = VPLAYER; @@ -413,7 +427,8 @@ * dust of disappearance wears off */ -dust_appear() +void +dust_appear(void) { turn_off(player, ISINVIS); PLAYER = VPLAYER; @@ -426,7 +441,8 @@ * the effects of "dust of choking and sneezing" wear off */ -unchoke() +void +unchoke(void) { if (!find_slot(unconfuse)) turn_off(player, ISHUH); @@ -440,8 +456,8 @@ * make some potion for the guy in the Alchemy jug */ -alchemy(obj) -register struct object *obj; +void +alchemy(struct object *obj) { register struct object *tobj = NULL; register struct linked_list *item; @@ -492,7 +508,7 @@ */ int -undance() +undance(void) { turn_off(player, ISDANCE); msg ("Your feet take a break.....whew!"); @@ -503,7 +519,8 @@ * if he has our favorite necklace of strangulation then take damage every turn */ -strangle() +void +strangle(void) { if ((pstats.s_hpt -= 6) <= 0) { pstats.s_hpt = -1; @@ -515,7 +532,8 @@ * if he has on the gauntlets of fumbling he might drop his weapon each turn */ -fumble() +void +fumble(void) { register struct linked_list *item; @@ -557,7 +575,8 @@ * it's a lot like trap_look() */ -ring_search() +void +ring_search(void) { if (rnd(75) < (2*dex_compute() + 5*pstats.s_lvl)) search(TRUE, FALSE); else search(FALSE, FALSE); @@ -567,7 +586,8 @@ * this is called each turn the hero has the ring of teleportation on */ -ring_teleport() +void +ring_teleport(void) { if (rnd(100) < 3) teleport(); } @@ -576,7 +596,8 @@ * this is called to charge up the quill of Nagrom */ -quill_charge() +void +quill_charge(void) { register struct object *tobj = NULL; register struct linked_list *item; @@ -601,7 +622,8 @@ * take the skills away gained (or lost) by the potion of skills */ -unskill() +void +unskill(void) { if (pstats.s_lvladj != 0) { pstats.s_lvl -= pstats.s_lvladj; @@ -616,8 +638,7 @@ */ int -cloak_charge(obj) -register struct object *obj; +cloak_charge(struct object *obj) { if (obj->o_charges < 1) obj->o_charges = 1; @@ -629,7 +650,8 @@ * He lost his fire resistance */ -nofire() +void +nofire(void) { if (!ISWEARING(R_FIRE)) { turn_off(player, NOFIRE); @@ -642,7 +664,8 @@ * He lost his cold resistance */ -nocold() +void +nocold(void) { if (!ISWEARING(R_WARMTH)) { turn_off(player, NOCOLD); @@ -655,7 +678,8 @@ * He lost his protection from lightning */ -nobolt() +void +nobolt(void) { turn_off(player, NOBOLT); msg("Your skin loses its bluish tint"); @@ -666,8 +690,8 @@ * an artifact eats gold */ -eat_gold(obj) -register struct object *obj; +void +eat_gold(struct object *obj) { if (purse == 250) msg("%s.. Bids you to find some more gold. ", inv_name(obj, FALSE)); @@ -691,7 +715,8 @@ * give the hero back some spell points */ -spell_recovery() +void +spell_recovery(void) { int time; @@ -705,7 +730,8 @@ * give the hero back some prayer points */ -prayer_recovery() +void +prayer_recovery(void) { int time; @@ -719,7 +745,8 @@ * give the hero back some chant points */ -chant_recovery() +void +chant_recovery(void) { int time;