summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/trap_def.h
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-27 16:53:38 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-27 16:53:49 +0100
commitb2ab02a8348c2ea560a72a62a773c0a0d6820734 (patch)
tree74b68986945c666a269c7b8cc582081e795633e5 /crawl-ref/source/trap_def.h
parentdf9015848b407ce1d802759739706b4804b906b9 (diff)
downloadcrawl-ref-b2ab02a8348c2ea560a72a62a773c0a0d6820734.tar.gz
crawl-ref-b2ab02a8348c2ea560a72a62a773c0a0d6820734.zip
Move trap_def from externs.h to trap_def.h.
Diffstat (limited to 'crawl-ref/source/trap_def.h')
-rw-r--r--crawl-ref/source/trap_def.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/crawl-ref/source/trap_def.h b/crawl-ref/source/trap_def.h
new file mode 100644
index 0000000000..90c2cc4372
--- /dev/null
+++ b/crawl-ref/source/trap_def.h
@@ -0,0 +1,30 @@
+#ifndef TRAP_DEF_H
+#define TRAP_DEF_H
+
+struct trap_def
+{
+ coord_def pos;
+ trap_type type;
+ int ammo_qty;
+
+ dungeon_feature_type category() const;
+ std::string name(description_level_type desc = DESC_PLAIN) const;
+ bool is_known(const actor* act = 0) const;
+ void trigger(actor& triggerer, bool flat_footed = false);
+ void disarm();
+ void destroy();
+ void hide();
+ void reveal();
+ void prepare_ammo();
+ bool type_has_ammo() const;
+ bool active() const;
+
+private:
+ void message_trap_entry();
+ void shoot_ammo(actor& act, bool was_known);
+ item_def generate_trap_item();
+ int shot_damage(actor& act);
+};
+
+#endif
+