comparison xrogue/daemons.c @ 239:837044d2c362

Merge the GCC5 and build fix branches. This fixes all warnings produced by GCC 5, except the ones related to system functions. Those could be fixed by including the proper headers, but it would be better to replace the system-dependent code with functions from mdport.c.
author John "Elwin" Edwards
date Fri, 11 Mar 2016 19:47:52 -0500
parents 7c1cb43f346e
children 0250220d8cdd
comparison
equal deleted inserted replaced
232:bac2c81fec78 239:837044d2c362
112 */ 112 */
113 113
114 void 114 void
115 swander(void) 115 swander(void)
116 { 116 {
117 start_daemon(rollwand, (VOID *)NULL, BEFORE); 117 start_daemon(rollwand, NULL, BEFORE);
118 } 118 }
119 119
120 /* 120 /*
121 * rollwand: 121 * rollwand:
122 * Called to roll to see if a wandering monster starts up 122 * Called to roll to see if a wandering monster starts up
135 ((player.t_ctype != C_THIEF && player.t_ctype != C_ASSASSIN) || 135 ((player.t_ctype != C_THIEF && player.t_ctype != C_ASSASSIN) ||
136 (rnd(30) >= dex_compute()))) { 136 (rnd(30) >= dex_compute()))) {
137 if (levtype != POSTLEV) 137 if (levtype != POSTLEV)
138 wanderer(); 138 wanderer();
139 kill_daemon(rollwand); 139 kill_daemon(rollwand);
140 fuse(swander, (VOID *)NULL, WANDERTIME, BEFORE); 140 fuse(swander, NULL, WANDERTIME, BEFORE);
141 } 141 }
142 between = 0; 142 between = 0;
143 } 143 }
144 } 144 }
145 145
220 /* 220 /*
221 * land: 221 * land:
222 * Player can no longer fly 222 * Player can no longer fly
223 */ 223 */
224 224
225 int 225 void
226 land(void) 226 land(void)
227 { 227 {
228 turn_off(player, ISFLY); 228 turn_off(player, ISFLY);
229 msg("You regain your normal weight"); 229 msg("You regain your normal weight");
230 running = FALSE; 230 running = FALSE;
231 return(0);
232 } 231 }
233 232
234 /* 233 /*
235 * sight: 234 * sight:
236 * He gets his sight back 235 * He gets his sight back
251 /* 250 /*
252 * res_strength: 251 * res_strength:
253 * Restore player's strength 252 * Restore player's strength
254 */ 253 */
255 254
256 int 255 void
257 res_strength(long howmuch) 256 res_strength(long howmuch)
258 { 257 {
259 258
260 /* If lost_str is non-zero, restore that amount of strength, 259 /* If lost_str is non-zero, restore that amount of strength,
261 * else all of it 260 * else all of it
269 if (howmuch > 0) 268 if (howmuch > 0)
270 pstats.s_str = 269 pstats.s_str =
271 min(pstats.s_str + howmuch, max_stats.s_str + ring_value(R_ADDSTR)); 270 min(pstats.s_str + howmuch, max_stats.s_str + ring_value(R_ADDSTR));
272 271
273 updpack(TRUE, &player); 272 updpack(TRUE, &player);
274 return(0);
275 } 273 }
276 274
277 /* 275 /*
278 * nohaste: 276 * nohaste:
279 * End the hasting 277 * End the hasting
505 503
506 /* 504 /*
507 * otto's irresistable dance wears off 505 * otto's irresistable dance wears off
508 */ 506 */
509 507
510 int 508 void
511 undance(void) 509 undance(void)
512 { 510 {
513 turn_off(player, ISDANCE); 511 turn_off(player, ISDANCE);
514 msg ("Your feet take a break.....whew!"); 512 msg ("Your feet take a break.....whew!");
515 return(0);
516 } 513 }
517 514
518 /* 515 /*
519 * if he has our favorite necklace of strangulation then take damage every turn 516 * if he has our favorite necklace of strangulation then take damage every turn
520 */ 517 */
613 } 610 }
614 if (item == NULL) 611 if (item == NULL)
615 return; 612 return;
616 if (tobj->o_charges < QUILLCHARGES) 613 if (tobj->o_charges < QUILLCHARGES)
617 tobj->o_charges++; 614 tobj->o_charges++;
618 fuse (quill_charge, (VOID *)NULL, player.t_ctype == C_MAGICIAN ? 4 : 8, AFTER); 615 fuse (quill_charge, NULL, player.t_ctype == C_MAGICIAN ? 4 : 8, AFTER);
619 } 616 }
620 617
621 /* 618 /*
622 * take the skills away gained (or lost) by the potion of skills 619 * take the skills away gained (or lost) by the potion of skills
623 */ 620 */
635 632
636 /* 633 /*
637 * charge up the cloak of Emori 634 * charge up the cloak of Emori
638 */ 635 */
639 636
640 int 637 void
641 cloak_charge(struct object *obj) 638 cloak_charge(struct object *obj)
642 { 639 {
643 if (obj->o_charges < 1) 640 if (obj->o_charges < 1)
644 obj->o_charges = 1; 641 obj->o_charges = 1;
645 return(0);
646 } 642 }
647 643
648 /* 644 /*
649 * nofire: 645 * nofire:
650 * He lost his fire resistance 646 * He lost his fire resistance
721 int time; 717 int time;
722 718
723 time = SPELLTIME - max(17-pstats.s_intel, 0); 719 time = SPELLTIME - max(17-pstats.s_intel, 0);
724 time = max(time, 5); 720 time = max(time, 5);
725 if (spell_power > 0) spell_power--; 721 if (spell_power > 0) spell_power--;
726 fuse(spell_recovery, (VOID *)NULL, time, AFTER); 722 fuse(spell_recovery, NULL, time, AFTER);
727 } 723 }
728 724
729 /* 725 /*
730 * give the hero back some prayer points 726 * give the hero back some prayer points
731 */ 727 */
736 int time; 732 int time;
737 733
738 time = SPELLTIME - max(17-pstats.s_wisdom, 0); 734 time = SPELLTIME - max(17-pstats.s_wisdom, 0);
739 time = max(time, 5); 735 time = max(time, 5);
740 if (pray_time > 0) pray_time--; 736 if (pray_time > 0) pray_time--;
741 fuse(prayer_recovery, (VOID *)NULL, time, AFTER); 737 fuse(prayer_recovery, NULL, time, AFTER);
742 } 738 }
743 739
744 /* 740 /*
745 * give the hero back some chant points 741 * give the hero back some chant points
746 */ 742 */
751 int time; 747 int time;
752 748
753 time = SPELLTIME - max(17-pstats.s_wisdom, 0); 749 time = SPELLTIME - max(17-pstats.s_wisdom, 0);
754 time = max(time, 5); 750 time = max(time, 5);
755 if (chant_time > 0) chant_time--; 751 if (chant_time > 0) chant_time--;
756 fuse(chant_recovery, (VOID *)NULL, time, AFTER); 752 fuse(chant_recovery, NULL, time, AFTER);
757 } 753 }
758 754