Mercurial > hg > early-roguelike
comparison arogue7/rings.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 |
comparison
equal
deleted
inserted
replaced
| 224:4d0f53998e8a | 225:4f6e056438eb |
|---|---|
| 10 * | 10 * |
| 11 * See the file LICENSE.TXT for full copyright and licensing information. | 11 * See the file LICENSE.TXT for full copyright and licensing information. |
| 12 */ | 12 */ |
| 13 | 13 |
| 14 #include <stdlib.h> | 14 #include <stdlib.h> |
| 15 #include <string.h> | |
| 15 #include "curses.h" | 16 #include "curses.h" |
| 16 #include "rogue.h" | 17 #include "rogue.h" |
| 17 | 18 |
| 18 /* | 19 /* |
| 19 * routines dealing specifically with rings | 20 * routines dealing specifically with rings |
| 21 | 22 |
| 22 | 23 |
| 23 /* | 24 /* |
| 24 * how much food does this ring use up? | 25 * how much food does this ring use up? |
| 25 */ | 26 */ |
| 26 ring_eat(hand) | 27 int |
| 27 register int hand; | 28 ring_eat(int hand) |
| 28 { | 29 { |
| 29 if (cur_ring[hand] == NULL) | 30 if (cur_ring[hand] == NULL) |
| 30 return 0; | 31 return 0; |
| 31 switch (cur_ring[hand]->o_which) { | 32 switch (cur_ring[hand]->o_which) { |
| 32 case R_VAMPREGEN: | 33 case R_VAMPREGEN: |
| 46 return (-(cur_ring[hand]->o_ac)); | 47 return (-(cur_ring[hand]->o_ac)); |
| 47 } | 48 } |
| 48 return 0; | 49 return 0; |
| 49 } | 50 } |
| 50 | 51 |
| 51 ring_on(item) | 52 void |
| 52 register struct linked_list *item; | 53 ring_on(struct linked_list *item) |
| 53 { | 54 { |
| 54 register struct object *obj; | 55 register struct object *obj; |
| 55 register int save_max; | 56 register int save_max; |
| 56 | 57 |
| 57 obj = OBJPTR(item); | 58 obj = OBJPTR(item); |
| 109 | 110 |
| 110 /* | 111 /* |
| 111 * print ring bonuses | 112 * print ring bonuses |
| 112 */ | 113 */ |
| 113 char * | 114 char * |
| 114 ring_num(obj) | 115 ring_num(struct object *obj) |
| 115 register struct object *obj; | |
| 116 { | 116 { |
| 117 static char buf[5]; | 117 static char buf[5]; |
| 118 | 118 |
| 119 if (!(obj->o_flags & ISKNOW)) | 119 if (!(obj->o_flags & ISKNOW)) |
| 120 return ""; | 120 return ""; |
| 144 } | 144 } |
| 145 | 145 |
| 146 /* | 146 /* |
| 147 * Return the effect of the specified ring | 147 * Return the effect of the specified ring |
| 148 */ | 148 */ |
| 149 ring_value(type) | 149 int |
| 150 ring_value(int type) | |
| 150 { | 151 { |
| 151 int result = 0; | 152 int result = 0; |
| 152 | 153 |
| 153 if (ISRING(LEFT_1, type)) result += cur_ring[LEFT_1]->o_ac; | 154 if (ISRING(LEFT_1, type)) result += cur_ring[LEFT_1]->o_ac; |
| 154 if (ISRING(LEFT_2, type)) result += cur_ring[LEFT_2]->o_ac; | 155 if (ISRING(LEFT_2, type)) result += cur_ring[LEFT_2]->o_ac; |
