/[enigma]/enigma/src/stones_simple.cc
ViewVC logotype

Diff of /enigma/src/stones_simple.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by dheck, Sun May 18 19:09:14 2003 UTC revision 1.3 by reallysoft, Mon May 19 12:14:36 2003 UTC
# Line 77  namespace Line 77  namespace
77          Object *clone() {          Object *clone() {
78              return new SimpleStoneHollow(get_kind());              return new SimpleStoneHollow(get_kind());
79          }          }
80          StoneResponse collision_response(const StoneContact &sc) {          StoneResponse collision_response(const StoneContact &/*sc*/) {
81              return STONE_PASS;              return STONE_PASS;
82          }          }
83          bool on_laserhit(Direction) { return true; }          bool on_laserhit(Direction) { return true; }
# Line 167  namespace Line 167  namespace
167              KillStone (get_pos());              KillStone (get_pos());
168          }          }
169    
170          StoneResponse collision_response(const StoneContact &sc) {          StoneResponse collision_response(const StoneContact &/*sc*/) {
171              return STONE_PASS;              return STONE_PASS;
172          }          }
173      };      };
# Line 226  namespace Line 226  namespace
226                  modelname = fl->get_kind();                  modelname = fl->get_kind();
227              set_model(modelname);              set_model(modelname);
228          }          }
229          StoneResponse collision_response(const StoneContact &sc) {          StoneResponse collision_response(const StoneContact &/*sc*/) {
230              return STONE_PASS;              return STONE_PASS;
231          }          }
232      };      };
# Line 331  namespace Line 331  namespace
331      public:      public:
332          Window() : Stone("st-window"), state(IDLE) {}          Window() : Stone("st-window"), state(IDLE) {}
333      private:      private:
334          bool on_laserhit(Direction dir) { return true; }          bool on_laserhit(Direction /*dir*/) { return true; }
335          enum State { IDLE, BREAK };          enum State { IDLE, BREAK };
336          State state;          State state;
337          void actor_hit(const StoneContact &sc)          void actor_hit(const StoneContact &sc)
# Line 566  namespace Line 566  namespace
566                  }                  }
567              }              }
568          }          }
569          bool on_laserhit(Direction dir) {          bool on_laserhit(Direction /*dir*/) {
570              return state != BRICK;              return state != BRICK;
571          }          }
572      };      };
# Line 690  namespace Line 690  namespace
690          CLONEOBJ(InvisibleMagic);          CLONEOBJ(InvisibleMagic);
691          const char *collision_sound() {return "st-thud";}          const char *collision_sound() {return "st-thud";}
692      public:      public:
693          InvisibleMagic() : Stone("st-invisible_magic"), state(INVISIBLE) {}          InvisibleMagic() : Stone("st-invisible_magic"), state(INVISIBLE) {}
694      private:      private:
695          enum State { INVISIBLE, STONE } state;          enum State { INVISIBLE, STONE } state;
696          void actor_hit(const StoneContact &sc)          void actor_hit(const StoneContact &sc)
697          {          {
698              if( state == INVISIBLE)              if( state == INVISIBLE)
699              {              {
700                  if (wielded_item_is(sc.actor, "it-magicwand")) {                  if (wielded_item_is(sc.actor, "it-magicwand")) {
701                      play_sound("st-magic");                      play_sound("st-magic");
702                      state = STONE;                      state = STONE;
703                      set_model("st-greenbrown");                      set_model("st-greenbrown");
704                      laser::MaybeRecalcLight(get_pos());                      laser::MaybeRecalcLight(get_pos());
705                  }                  }
706              }              }
707          }          }
708          bool on_laserhit(Direction dir) {return state==INVISIBLE;}          bool on_laserhit(Direction /*dir*/) {return state==INVISIBLE;}
709      };      };
710  }  }
711    
# Line 937  namespace Line 937  namespace
937              set_model(is_on() ? "st-switch1" : "st-switch0");              set_model(is_on() ? "st-switch1" : "st-switch0");
938          }          }
939    
940          void actor_hit(const StoneContact &sc) {          void actor_hit(const StoneContact &/*sc*/) {
941              set_on(!is_on());              set_on(!is_on());
942              PerformAction(this, is_on());              PerformAction(this, is_on());
943              play_sound("st-switch");              play_sound("st-switch");
# Line 1104  namespace Line 1104  namespace
1104              }              }
1105          }          }
1106    
1107          void actor_hit(const StoneContact &sc)          void actor_hit(const StoneContact &/*sc*/)
1108          {          {
1109              set_on(!is_on());              set_on(!is_on());
1110              PerformAction(this, is_on());              PerformAction(this, is_on());
# Line 1113  namespace Line 1113  namespace
1113              m_direction = rotate(m_direction, true);              m_direction = rotate(m_direction, true);
1114              init_model();              init_model();
1115          }          }
1116          const char *collision_sound() { return "st-metal"; }          const char *collision_sound() { return "st-metal"; }
1117      };      };
1118  }  }
1119    
# Line 1163  LaserSwitch::~LaserSwitch() Line 1163  LaserSwitch::~LaserSwitch()
1163  }  }
1164    
1165  void  void
1166  LaserSwitch::actor_hit(const StoneContact &sc)  LaserSwitch::actor_hit(const StoneContact &/*sc*/)
1167  {  {
1168  }  }
1169    
# Line 1420  namespace Line 1420  namespace
1420          FakeOxydStone() : Stone("st-fakeoxyd"), state(IDLE) {}          FakeOxydStone() : Stone("st-fakeoxyd"), state(IDLE) {}
1421      private:      private:
1422          enum State { IDLE, BLINKING } state;          enum State { IDLE, BLINKING } state;
1423          void actor_hit(const StoneContact &sc) {          void actor_hit(const StoneContact &/*sc*/) {
1424              if (state == IDLE) {              if (state == IDLE) {
1425                  set_anim("st-fakeoxyd-blink");                  set_anim("st-fakeoxyd-blink");
1426                  state = BLINKING;                  state = BLINKING;
# Line 1668  namespace Line 1668  namespace
1668      public:      public:
1669          MagicStone() : Stone("st-magic") {}          MagicStone() : Stone("st-magic") {}
1670      private:      private:
1671          void actor_hit(const StoneContact &sc) {          void actor_hit(const StoneContact &/*sc*/) {
1672              KillStone(get_pos());              KillStone(get_pos());
1673              display::GetStatusBar()->show_text("We don't sell books..", display::TEXT_2SECONDS);              display::GetStatusBar()->show_text("We don't sell books..", display::TEXT_2SECONDS);
1674          }          }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26