1 /* 2 * This file contains misc functions for dealing with armor 3 * @(#)armor.c 1.2 (AI Design) 2/12/84 4 * 5 */ 6 7 #include "rogue.h" 8 #include "curses.h" 9 10 /* 11 * wear: 12 * The player wants to wear something, so let him/her put it on. 13 */ 14 wear() 15 { 16 register THING *obj; 17 register char *sp; 18 19 if (cur_armor != NULL) { 20 msg("you are already wearing some%s.", 21 noterse(". You'll have to take it off first")); 22 after = FALSE; 23 return; 24 } 25 if ((obj = get_item("wear",ARMOR)) == NULL) 26 return; 27 if (obj->o_type != ARMOR) { 28 msg("you can't wear that"); 29 return; 30 } 31 waste_time(); 32 obj->o_flags |= ISKNOW ; 33 sp = inv_name(obj, TRUE); 34 cur_armor = obj; 35 msg("you are now wearing %s", sp); 36 } 37 38 /* 39 * take_off: 40 * Get the armor off of the player's back 41 */ 42 take_off() 43 { 44 register THING *obj; 45 46 if ((obj = cur_armor) == NULL) { 47 after = FALSE; 48 msg("you aren't wearing any armor"); 49 return; 50 } 51 if (!can_drop(cur_armor)) 52 return; 53 cur_armor = NULL; 54 msg("you used to be wearing %c) %s", pack_char(obj), inv_name(obj, TRUE)); 55 } 56 57 /* 58 * waste_time: 59 * Do nothing but let other things happen 60 */ 61 waste_time() 62 { 63 do_daemons(); 64 do_fuses(); 65 } 66 ÿ