1 /** 2 * \file obj-chest.h 3 * \brief Encapsulation of chest-related functions 4 * 5 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke 6 * Copyright (c) 2012 Peter Denison 7 * 8 * This work is free software; you can redistribute it and/or modify it 9 * under the terms of either: 10 * 11 * a) the GNU General Public License as published by the Free Software 12 * Foundation, version 2, or 13 * 14 * b) the "Angband licence": 15 * This software may be copied and distributed for educational, research, 16 * and not for profit purposes provided that this copyright and statement 17 * are included in all such copies. Other copyrights may also apply. 18 */ 19 20 #ifndef OBJECT_CHEST_H 21 #define OBJECT_CHEST_H 22 23 /** 24 * Chest check types 25 */ 26 enum chest_query { 27 CHEST_ANY, 28 CHEST_OPENABLE, 29 CHEST_TRAPPED 30 }; 31 32 extern struct file_parser chest_trap_parser; 33 34 char *chest_trap_name(const struct object *obj); 35 bool is_trapped_chest(const struct object *obj); 36 bool is_locked_chest(const struct object *obj); 37 int pick_chest_traps(struct object *obj); 38 void unlock_chest(struct object *obj); 39 struct object *chest_check(struct loc grid, enum chest_query check_type); 40 int count_chests(struct loc *grid, enum chest_query check_type); 41 bool do_cmd_open_chest(struct loc grid, struct object *obj); 42 bool do_cmd_disarm_chest(struct object *obj); 43 44 #endif /* OBJECT_CHEST_H */ 45