/[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.5 by reallysoft, Wed Jun 4 12:56:57 2003 UTC revision 1.6 by reallysoft, Wed Jun 4 20:05:28 2003 UTC
# Line 388  namespace Line 388  namespace
388      private:      private:
389          enum State { IDLE, BREAK };          enum State { IDLE, BREAK };
390          State state;          State state;
391    
392            void break_me() {
393                play_sound("explosion1");
394                state = BREAK;
395                set_anim("st-stone_break-anim");
396            }
397    
398          void actor_hit(const StoneContact &sc)          void actor_hit(const StoneContact &sc)
399          {          {
400              if( state == IDLE)              if( state == IDLE && wielded_item_is(sc.actor, "it-hammer")) {
401              {                  break_me();
                 if (wielded_item_is(sc.actor, "it-hammer")) {  
                     play_sound("explosion1");  
                     state = BREAK;  
                     set_anim("st-stone_break-anim");  
                 }  
402              }              }
403          }          }
404            bool on_laserhit(Direction) {
405                break_me();
406                return false;
407            }
408          void animcb() {          void animcb() {
409              if (state == BREAK) {              if (state == BREAK) {
410                  KillStone(get_pos());                  KillStone(get_pos());
411              }              }
412          }          }
413      };      };
414    
415  }  }
416    
417  //----------------------------------------  //----------------------------------------
# Line 715  namespace Line 722  namespace
722    
723  /** \page st-wood Wooden Stone  /** \page st-wood Wooden Stone
724    
725  This stone can is movable.  If moved into abyss or water it will  This stone is movable.  If moved into abyss or water it will
726  disappear and change into a wooden plank.  disappear and change into a wooden plank.
727    
728  \subsection woode Example  \subsection woode Example
# Line 1763  namespace Line 1770  namespace
1770    
1771              GridPos  p  = get_pos();              GridPos  p  = get_pos();
1772              Item    *it = GetItem(p);              Item    *it = GetItem(p);
1773              if (it && 0 == strcmp(it->get_kind(), "it-blocker")) {              if (it && it->is_kind("it-blocker")) {
1774                  KillItem(p);                  KillItem(p);
1775                  play_sound("explosion1");                  play_sound("explosion1");
1776              }              }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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