00001 #ifndef TRAP_DEF_H 00002 #define TRAP_DEF_H 00003 00004 struct trap_def 00005 { 00006 coord_def pos; 00007 trap_type type; 00008 int ammo_qty; 00009 00010 dungeon_feature_type category() const; 00011 std::string name(description_level_type desc = DESC_PLAIN) const; 00012 bool is_known(const actor* act = 0) const; 00013 void trigger(actor& triggerer, bool flat_footed = false); 00014 void disarm(); 00015 void destroy(); 00016 void hide(); 00017 void reveal(); 00018 void prepare_ammo(); 00019 bool type_has_ammo() const; 00020 bool active() const; 00021 bool defined() const { return active(); } 00022 int max_damage(const actor& act); 00023 00024 private: 00025 void message_trap_entry(); 00026 void shoot_ammo(actor& act, bool was_known); 00027 item_def generate_trap_item(); 00028 int shot_damage(actor& act); 00029 }; 00030 00031 #endif