Mercurial > hg > early-roguelike
diff arogue7/daemons.c @ 225:4f6e056438eb
Merge the GCC5 and build fix branches.
author | John "Elwin" Edwards |
---|---|
date | Wed, 02 Mar 2016 21:28:34 -0500 |
parents | f9ef86cf22b2 |
children | e1cd27c5464f |
line wrap: on
line diff
--- a/arogue7/daemons.c Fri Feb 26 17:30:30 2016 -0500 +++ b/arogue7/daemons.c Wed Mar 02 21:28:34 2016 -0500 @@ -25,8 +25,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; @@ -108,7 +108,8 @@ * Called when it is time to start rolling for wandering monsters */ -swander() +void +swander(void) { start_daemon(rollwand, 0, BEFORE); } @@ -120,7 +121,8 @@ int between = 0; -rollwand() +void +rollwand(void) { if (++between >= 4) @@ -140,7 +142,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); @@ -151,7 +154,8 @@ * Release the poor player from his confusion */ -unconfuse() +void +unconfuse(void) { turn_off(player, ISHUH); msg("You feel less confused now"); @@ -162,7 +166,8 @@ * unsee: * He lost his see invisible power */ -unsee() +void +unsee(void) { if (!ISWEARING(R_SEEINVIS)) { turn_off(player, CANSEE); @@ -175,7 +180,8 @@ * Remove to-hit handicap from player */ -unstink() +void +unstink(void) { turn_off(player, HASSTINK); } @@ -185,7 +191,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."); @@ -196,7 +203,8 @@ * Player can no longer walk through walls */ -unphase() +void +unphase(void) { turn_off(player, CANINWALL); msg("Your dizzy feeling leaves you."); @@ -208,7 +216,8 @@ * Player can no longer fly */ -land() +void +land(void) { turn_off(player, ISFLY); msg("You regain your normal weight"); @@ -220,7 +229,8 @@ * He gets his sight back */ -sight() +void +sight(void) { if (on(player, ISBLIND)) { @@ -237,8 +247,7 @@ */ void -res_strength(howmuch) -int howmuch; +res_strength(int howmuch) { /* If lost_str is non-zero, restore that amount of strength, @@ -262,7 +271,8 @@ * End the hasting */ -nohaste() +void +nohaste(void) { turn_off(player, ISHASTE); msg("You feel yourself slowing down."); @@ -273,7 +283,8 @@ * End the slowing */ -noslow() +void +noslow(void) { turn_off(player, ISSLOW); msg("You feel yourself speeding up."); @@ -284,7 +295,8 @@ * If this gets called, the player has suffocated */ -suffocate() +void +suffocate(void) { death(D_SUFFOCATION); } @@ -292,7 +304,8 @@ /* * digest the hero's food */ -stomach() +void +stomach(void) { register int oldfood, old_hunger, food_use, i; @@ -368,7 +381,8 @@ /* * daemon for curing the diseased */ -cure_disease() +void +cure_disease(void) { turn_off(player, HASDISEASE); if (off (player, HASINFEST)) @@ -380,7 +394,8 @@ * appear: * Become visible again */ -appear() +void +appear(void) { turn_off(player, ISINVIS); PLAYER = VPLAYER; @@ -391,7 +406,8 @@ * dust_appear: * dust of disappearance wears off */ -dust_appear() +void +dust_appear(void) { turn_off(player, ISINVIS); PLAYER = VPLAYER; @@ -402,7 +418,8 @@ * unchoke: * the effects of "dust of choking and sneezing" wear off */ -unchoke() +void +unchoke(void) { if (!find_slot(unconfuse)) turn_off(player, ISHUH); @@ -414,8 +431,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; @@ -464,7 +481,8 @@ * otto's irresistable dance wears off */ -undance() +void +undance(void) { turn_off(player, ISDANCE); msg ("Your feet take a break.....whew!"); @@ -473,14 +491,16 @@ /* * if he has our favorite necklace of strangulation then take damage every turn */ -strangle() +void +strangle(void) { if ((pstats.s_hpt -= 6) <= 0) death(D_STRANGLE); } /* * if he has on the gauntlets of fumbling he might drop his weapon each turn */ -fumble() +void +fumble(void) { register struct linked_list *item; @@ -519,21 +539,24 @@ /* * this is called each turn the hero has the ring of searching on */ -ring_search() +void +ring_search(void) { search(FALSE, FALSE); } /* * this is called each turn the hero has the ring of teleportation on */ -ring_teleport() +void +ring_teleport(void) { if (rnd(100) < 2) teleport(); } /* * 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; @@ -556,7 +579,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; @@ -569,8 +593,8 @@ * charge up the cloak of Emori */ -cloak_charge(obj) -register struct object *obj; +void +cloak_charge(struct object *obj) { if (obj->o_charges < 1) obj->o_charges = 1; @@ -580,7 +604,8 @@ * nofire: * He lost his fire resistance */ -nofire() +void +nofire(void) { if (!ISWEARING(R_FIRE)) { turn_off(player, NOFIRE); @@ -592,7 +617,8 @@ * nocold: * He lost his cold resistance */ -nocold() +void +nocold(void) { if (!ISWEARING(R_WARMTH)) { turn_off(player, NOCOLD); @@ -604,7 +630,8 @@ * nobolt: * He lost his protection from lightning */ -nobolt() +void +nobolt(void) { turn_off(player, NOBOLT); msg("Your skin looses its bluish tint"); @@ -613,8 +640,8 @@ * eat_gold: * an artifact eats gold */ -eat_gold(obj) -register struct object *obj; +void +eat_gold(struct object *obj) { if (purse == 1) msg("%s demand you find more gold", inv_name(obj, FALSE)); @@ -628,36 +655,39 @@ /* * give the hero back some spell points */ -spell_recovery() +void +spell_recovery(void) { int time; time = SPELLTIME - max(17-pstats.s_intel, 0); time = max(time, 5); if (spell_power > 0) spell_power--; - fuse(spell_recovery, NULL, time, AFTER); + fuse(spell_recovery, 0, time, AFTER); } /* * give the hero back some prayer points */ -prayer_recovery() +void +prayer_recovery(void) { int time; time = SPELLTIME - max(17-pstats.s_wisdom, 0); time = max(time, 5); if (pray_time > 0) pray_time--; - fuse(prayer_recovery, NULL, time, AFTER); + fuse(prayer_recovery, 0, time, AFTER); } /* * give the hero back some chant points */ -chant_recovery() +void +chant_recovery(void) { int time; time = SPELLTIME - max(17-pstats.s_wisdom, 0); time = max(time, 5); if (chant_time > 0) chant_time--; - fuse(chant_recovery, NULL, time, AFTER); + fuse(chant_recovery, 0, time, AFTER); }