Changeset 721
- Timestamp:
- 02/26/08 05:10:14 (6 months ago)
- Files:
-
- trunk/src/cmd6.c (modified) (5 diffs)
- trunk/src/effects.c (modified) (4 diffs)
- trunk/src/effects.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cmd6.c
r633 r721 118 118 int effect; 119 119 bool ident = FALSE, used; 120 bool was_aware = object_aware_p(o_ptr); 120 121 int dir = 5; 121 122 … … 136 137 } 137 138 138 /* Use energy regardless of failure */ 139 /* Use energy regardless of failure */ 139 140 p_ptr->energy_use = 100; 140 141 … … 158 159 } 159 160 161 /* A bit of a hack to make ID work better. 162 -- Check for "obvious" effects beforehand. */ 163 if (effect_obvious(effect)) object_aware(o_ptr); 164 160 165 /* Do effect */ 161 used = do_effect(effect, &ident, dir, beam_chance(o_ptr->tval));166 used = effect_do(effect, &ident, dir, beam_chance(o_ptr->tval)); 162 167 163 168 /* Food feeds the player */ … … 177 182 * it as "tried". 178 183 */ 179 if (ident && ! object_aware_p(o_ptr))184 if (ident && !was_aware) 180 185 { 181 186 /* Object level */ … … 192 197 } 193 198 194 199 195 200 /* Some uses are "free" */ 196 201 if (!used) return; trunk/src/effects.c
r720 r721 44 44 * Utility functions 45 45 */ 46 bool effect_aim( inteffect)46 bool effect_aim(effect_type effect) 47 47 { 48 48 if (effect < 1 || effect > EF_MAX) … … 52 52 } 53 53 54 const char *effect_desc( inteffect)54 const char *effect_desc(effect_type effect) 55 55 { 56 56 if (effect < 1 || effect > EF_MAX) … … 60 60 } 61 61 62 bool effect_obvious(effect_type effect) 63 { 64 if (effect == EF_IDENTIFY) 65 return TRUE; 66 67 return FALSE; 68 } 69 62 70 63 71 /* 64 72 * The "wonder" effect. 65 * 73 * 66 74 * Returns TRUE if the effect is evident. 67 75 */ … … 136 144 * Do an effect, given an object. 137 145 */ 138 bool do_effect(inteffect, bool *ident, int dir, int beam)146 bool effect_do(effect_type effect, bool *ident, int dir, int beam) 139 147 { 140 148 int py = p_ptr->py; trunk/src/effects.h
r720 r721 19 19 #define INCLUDED_EFFECTS_H 20 20 21 bool do_effect(int effect, bool *ident, int dir, int beam);22 bool effect_aim(int effect);23 const char *effect_desc(int effect);24 25 21 /* Types of effect */ 26 22 typedef enum … … 33 29 } effect_type; 34 30 31 /*** Functions ***/ 32 33 bool effect_do(effect_type effect, bool *ident, int dir, int beam); 34 bool effect_aim(effect_type effect); 35 const char *effect_desc(effect_type effect); 36 bool effect_obvious(effect_type effect); 37 35 38 #endif /* INCLUDED_EFFECTS_H */
