*** empty log message ***
[supertux.git] / src / badguy.h
index 9a1869a..6d2fb5c 100644 (file)
 #include "collision.h"
 
 /* Enemy modes: */
-#define NORMAL 0
-#define FLAT 1
-#define KICK 2
-#define HELD 3
+enum {
+    NORMAL=0,
+    FLAT,
+    KICK,
+    HELD,
+
+    BOMB_TICKING,
+    BOMB_EXPLODE,
+
+    STALACTITE_SHAKING,
+    STALACTITE_FALL
+};
 
 extern texture_type img_bsod_squished_left;
 extern texture_type img_bsod_squished_right;
@@ -41,14 +49,43 @@ extern texture_type img_laptop_left[3];
 extern texture_type img_laptop_right[3];
 extern texture_type img_money_left[2];
 extern texture_type img_money_right[2];
+extern texture_type img_mrbomb_left[4];
+extern texture_type img_mrbomb_right[4];
+extern texture_type img_stalactite;
+extern texture_type img_stalactite_broken;
+extern texture_type img_flame[2];
 
 /* Bad guy kinds: */
 enum BadGuyKind {
   BAD_BSOD,
   BAD_LAPTOP,
-  BAD_MONEY
+  BAD_MONEY,
+  BAD_MRBOMB,
+  BAD_BOMB,
+  BAD_STALACTITE,
+  BAD_FLAME
+};
+
+BadGuyKind  badguykind_from_string(const std::string& str);
+std::string badguykind_to_string(BadGuyKind kind);
+void load_badguy_gfx();
+void free_badguy_gfx();
+
+struct BadGuyData
+{
+  BadGuyKind kind;
+  int x;
+  int y;
+
+  BadGuyData(BadGuyKind kind_, int x_, int y_) 
+    : kind(kind_), x(x_), y(y_) {}
+
+  BadGuyData()
+    : kind(BAD_BSOD), x(0), y(0) {}
 };
 
+class Player;
+
 /* Badguy type: */
 class BadGuy
 {
@@ -69,15 +106,38 @@ class BadGuy
   void action();
   void draw();
 
-  void action_bsod();
-  void action_laptop();
-  void action_money();
+  void collision(void* p_c_object, int c_object,
+          CollisionType type = COLLISION_NORMAL);
+  
+ private:
+  void fall(bool dojump=false);
+  void remove_me();
 
+  void action_bsod();
   void draw_bsod();
+
+  void action_laptop();
   void draw_laptop();
+   
+  void action_money(); 
   void draw_money();
 
-  void collision(void* p_c_object, int c_object);
+  void action_bomb();
+  void draw_bomb();
+
+  void action_mrbomb();
+  void draw_mrbomb();
+
+  void action_stalactite();
+  void draw_stalactite();
+
+  void action_flame();
+  void draw_flame();
+
+  void make_player_jump(Player* player);
+  void check_horizontal_bump(bool checkcliff = false);
+  void bump();
+  void squich(Player* player);
 };
 
 #endif /*SUPERTUX_BADGUY_H*/