Mercurial > hg > early-roguelike
comparison arogue5/potions.c @ 218:56e748983fa8
Advanced Rogue 5: convert to ANSI function declarations.
This still leaves over a thousand lines of warning messages, mostly
related to the return types of daemons and fuses.
| author | John "Elwin" Edwards |
|---|---|
| date | Sun, 07 Feb 2016 14:39:21 -0500 |
| parents | 34a87d84ea31 |
| children |
comparison
equal
deleted
inserted
replaced
| 217:94a0d9dd5ce1 | 218:56e748983fa8 |
|---|---|
| 15 #include "curses.h" | 15 #include "curses.h" |
| 16 #include "rogue.h" | 16 #include "rogue.h" |
| 17 #include <stdlib.h> | 17 #include <stdlib.h> |
| 18 #include <string.h> | 18 #include <string.h> |
| 19 | 19 |
| 20 void res_intelligence(void); | |
| 21 void res_wisdom(void); | |
| 20 | 22 |
| 21 | 23 |
| 22 /* | 24 /* |
| 23 * Increase player's constitution | 25 * Increase player's constitution |
| 24 */ | 26 */ |
| 25 | 27 |
| 26 add_const(cursed) | 28 void |
| 27 bool cursed; | 29 add_const(bool cursed) |
| 28 { | 30 { |
| 29 /* Do the potion */ | 31 /* Do the potion */ |
| 30 if (cursed) { | 32 if (cursed) { |
| 31 msg("You feel less healthy now."); | 33 msg("You feel less healthy now."); |
| 32 pstats.s_const--; | 34 pstats.s_const--; |
| 45 | 47 |
| 46 /* | 48 /* |
| 47 * Increase player's dexterity | 49 * Increase player's dexterity |
| 48 */ | 50 */ |
| 49 | 51 |
| 50 add_dexterity(cursed) | 52 void |
| 51 bool cursed; | 53 add_dexterity(bool cursed) |
| 52 { | 54 { |
| 53 int ring_str; /* Value of ring strengths */ | 55 int ring_str; /* Value of ring strengths */ |
| 54 | 56 |
| 55 /* Undo any ring changes */ | 57 /* Undo any ring changes */ |
| 56 ring_str = ring_value(R_ADDHIT); | 58 ring_str = ring_value(R_ADDHIT); |
| 78 /* | 80 /* |
| 79 * add_haste: | 81 * add_haste: |
| 80 * add a haste to the player | 82 * add a haste to the player |
| 81 */ | 83 */ |
| 82 | 84 |
| 83 add_haste(blessed) | 85 void |
| 84 bool blessed; | 86 add_haste(bool blessed) |
| 85 { | 87 { |
| 86 int hasttime; | 88 int hasttime; |
| 87 | 89 |
| 88 if (blessed) hasttime = HASTETIME*2; | 90 if (blessed) hasttime = HASTETIME*2; |
| 89 else hasttime = HASTETIME; | 91 else hasttime = HASTETIME; |
| 108 } | 110 } |
| 109 | 111 |
| 110 /* | 112 /* |
| 111 * Increase player's intelligence | 113 * Increase player's intelligence |
| 112 */ | 114 */ |
| 113 add_intelligence(cursed) | 115 void |
| 114 bool cursed; | 116 add_intelligence(bool cursed) |
| 115 { | 117 { |
| 116 int ring_str; /* Value of ring strengths */ | 118 int ring_str; /* Value of ring strengths */ |
| 117 | 119 |
| 118 /* Undo any ring changes */ | 120 /* Undo any ring changes */ |
| 119 ring_str = ring_value(R_ADDINTEL); | 121 ring_str = ring_value(R_ADDINTEL); |
| 139 } | 141 } |
| 140 | 142 |
| 141 /* | 143 /* |
| 142 * this routine makes the hero move slower | 144 * this routine makes the hero move slower |
| 143 */ | 145 */ |
| 144 add_slow() | 146 void |
| 147 add_slow(void) | |
| 145 { | 148 { |
| 146 if (on(player, ISHASTE)) { /* Already sped up */ | 149 if (on(player, ISHASTE)) { /* Already sped up */ |
| 147 extinguish(nohaste); | 150 extinguish(nohaste); |
| 148 nohaste(); | 151 nohaste(); |
| 149 } | 152 } |
| 162 | 165 |
| 163 /* | 166 /* |
| 164 * Increase player's strength | 167 * Increase player's strength |
| 165 */ | 168 */ |
| 166 | 169 |
| 167 add_strength(cursed) | 170 void |
| 168 bool cursed; | 171 add_strength(bool cursed) |
| 169 { | 172 { |
| 170 | 173 |
| 171 if (cursed) { | 174 if (cursed) { |
| 172 msg("You feel slightly weaker now."); | 175 msg("You feel slightly weaker now."); |
| 173 chg_str(-1); | 176 chg_str(-1); |
| 180 | 183 |
| 181 /* | 184 /* |
| 182 * Increase player's wisdom | 185 * Increase player's wisdom |
| 183 */ | 186 */ |
| 184 | 187 |
| 185 add_wisdom(cursed) | 188 void |
| 186 bool cursed; | 189 add_wisdom(bool cursed) |
| 187 { | 190 { |
| 188 int ring_str; /* Value of ring strengths */ | 191 int ring_str; /* Value of ring strengths */ |
| 189 | 192 |
| 190 /* Undo any ring changes */ | 193 /* Undo any ring changes */ |
| 191 ring_str = ring_value(R_ADDWISDOM); | 194 ring_str = ring_value(R_ADDWISDOM); |
| 213 | 216 |
| 214 /* | 217 /* |
| 215 * Lower a level of experience | 218 * Lower a level of experience |
| 216 */ | 219 */ |
| 217 | 220 |
| 218 lower_level(who) | 221 void |
| 219 short who; | 222 lower_level(short who) |
| 220 { | 223 { |
| 221 int fewer, nsides = 0; | 224 int fewer, nsides = 0; |
| 222 | 225 |
| 223 if (--pstats.s_lvl == 0) | 226 if (--pstats.s_lvl == 0) |
| 224 death(who); /* All levels gone */ | 227 death(who); /* All levels gone */ |
| 237 pstats.s_hpt = 1; | 240 pstats.s_hpt = 1; |
| 238 if (max_stats.s_hpt < 1) | 241 if (max_stats.s_hpt < 1) |
| 239 death(who); | 242 death(who); |
| 240 } | 243 } |
| 241 | 244 |
| 242 quaff(which, flag, is_potion) | 245 void |
| 243 int which; | 246 quaff(int which, int flag, bool is_potion) |
| 244 int flag; | |
| 245 bool is_potion; | |
| 246 { | 247 { |
| 247 register struct object *obj = NULL; | 248 register struct object *obj = NULL; |
| 248 register struct linked_list *item, *titem; | 249 register struct linked_list *item, *titem; |
| 249 register struct thing *th; | 250 register struct thing *th; |
| 250 bool cursed, blessed; | 251 bool cursed, blessed; |
| 623 * res_dexterity: | 624 * res_dexterity: |
| 624 * Restore player's dexterity | 625 * Restore player's dexterity |
| 625 * if called with zero the restore fully | 626 * if called with zero the restore fully |
| 626 */ | 627 */ |
| 627 | 628 |
| 628 res_dexterity(howmuch) | 629 void |
| 629 int howmuch; | 630 res_dexterity(int howmuch) |
| 630 { | 631 { |
| 631 short save_max; | 632 short save_max; |
| 632 int ring_str; | 633 int ring_str; |
| 633 | 634 |
| 634 /* Discount the ring value */ | 635 /* Discount the ring value */ |
| 654 /* | 655 /* |
| 655 * res_intelligence: | 656 * res_intelligence: |
| 656 * Restore player's intelligence | 657 * Restore player's intelligence |
| 657 */ | 658 */ |
| 658 | 659 |
| 659 res_intelligence() | 660 void |
| 661 res_intelligence(void) | |
| 660 { | 662 { |
| 661 short save_max; | 663 short save_max; |
| 662 int ring_str; | 664 int ring_str; |
| 663 | 665 |
| 664 /* Discount the ring value */ | 666 /* Discount the ring value */ |
| 678 /* | 680 /* |
| 679 * res_wisdom: | 681 * res_wisdom: |
| 680 * Restore player's wisdom | 682 * Restore player's wisdom |
| 681 */ | 683 */ |
| 682 | 684 |
| 683 res_wisdom() | 685 void |
| 686 res_wisdom(void) | |
| 684 { | 687 { |
| 685 short save_max; | 688 short save_max; |
| 686 int ring_str; | 689 int ring_str; |
| 687 | 690 |
| 688 /* Discount the ring value */ | 691 /* Discount the ring value */ |
