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

Diff of /enigma/src/objects.cc

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

revision 1.19 by dheck, Fri Feb 14 19:04:51 2003 UTC revision 1.20 by sfennig, Thu Feb 20 06:56:21 2003 UTC
# Line 491  Other stones: Line 491  Other stones:
491  - \ref st-bolder  - \ref st-bolder
492  - \ref st-puzzle  - \ref st-puzzle
493  - \ref st-stone_break  - \ref st-stone_break
494    - \ref st-break_acwhite
495    - \ref st-break_acblack
496  - \ref st-oneway  - \ref st-oneway
497  - \ref st-oneway_black  - \ref st-oneway_black
498  - \ref st-oneway_white  - \ref st-oneway_white
# Line 1016  namespace Line 1018  namespace
1018  }  }
1019    
1020  //----------------------------------------  //----------------------------------------
1021    // Break_acwhite
1022    //----------------------------------------
1023    
1024    /** \page st-break_acwhite Breakable Stone
1025    
1026    This stone can be destroyed by actor (whiteball) having a
1027    hammer.
1028    
1029    \subsection break_acwhite Example
1030    \verbatim
1031    set_stone("st-break_acwhite", 10,10)
1032    \endverbatim
1033    
1034    \image html st-break_acwhite.png
1035    */
1036    namespace
1037    {
1038        class Break_acwhite : public Stone {
1039            CLONEOBJ(Break_acwhite);
1040            const char *collision_sound() {return "st-stone";}
1041        public:
1042            Break_acwhite() : Stone("st-break_acwhite"), state(IDLE) {}
1043        private:
1044            enum State { IDLE, FRAGILE, BREAK };
1045            State state;
1046            void actor_hit(const StoneContact &sc)
1047         {
1048              if (state == IDLE) {
1049                 if (sc.actor->get_attrib("whiteball")) {
1050                     state = FRAGILE;}
1051               }
1052         {
1053              if( state == FRAGILE)
1054         {
1055                 if (wielded_item_is(sc.actor, "it-hammer")) {
1056                    play_sound("explosion1");
1057                    state = BREAK;
1058                    set_anim("st-break_acwhite-anim");
1059               }
1060            }
1061         }
1062      }
1063            void animcb() {
1064                if (state == BREAK) {
1065                KillStone(get_pos());
1066             }
1067          }
1068       };
1069    }
1070    
1071    //----------------------------------------
1072    // Break_acblack
1073    //----------------------------------------
1074    
1075    /** \page st-break_acblack Breakable Stone
1076    
1077    This stone can be destroyed by actor (blackball) having a
1078    hammer.
1079    
1080    \subsection break_acblack Example
1081    \verbatim
1082    set_stone("st-break_acblack", 10,10)
1083    \endverbatim
1084    
1085    \image html st-break_acblack.png
1086    */
1087    namespace
1088    {
1089        class Break_acblack : public Stone {
1090            CLONEOBJ(Break_acblack);
1091            const char *collision_sound() {return "st-stone";}
1092        public:
1093            Break_acblack() : Stone("st-break_acblack"), state(IDLE) {}
1094        private:
1095            enum State { IDLE, FRAGILE, BREAK };
1096            State state;
1097            void actor_hit(const StoneContact &sc)
1098         {
1099              if (state == IDLE) {
1100                 if (sc.actor->get_attrib("blackball")) {
1101                     state = FRAGILE;}
1102               }
1103         {
1104              if( state == FRAGILE)
1105         {
1106                 if (wielded_item_is(sc.actor, "it-hammer")) {
1107                    play_sound("explosion1");
1108                    state = BREAK;
1109                    set_anim("st-break_acblack-anim");
1110               }
1111            }
1112         }
1113      }
1114            void animcb() {
1115                if (state == BREAK) {
1116                KillStone(get_pos());
1117             }
1118          }
1119       };
1120    }
1121    
1122    
1123    //----------------------------------------
1124  // Brownie  // Brownie
1125  //----------------------------------------  //----------------------------------------
1126    
# Line 2210  namespace Line 2315  namespace
2315  //----------------------------------------  //----------------------------------------
2316  namespace  namespace
2317  {  {
2318      class ShogunStone : public Stone {      class ShogunStone : public MovableStone {
2319          CLONEOBJ(ShogunStone);          CLONEOBJ(ShogunStone);
2320      public:      public:
2321          ShogunStone() : Stone("st-shogun") {          ShogunStone() : MovableStone("st-shogun") {
2322              set_holes(SMALL);              set_holes(SMALL);
2323          }          }
2324      private:      private:
# Line 3418  ObjectRepos::ObjectRepos() Line 3523  ObjectRepos::ObjectRepos()
3523      add_templ(new Rock3_move);      add_templ(new Rock3_move);
3524      add_templ(new Stonebrush);      add_templ(new Stonebrush);
3525      add_templ(new Break_invisible);      add_templ(new Break_invisible);
3526        add_templ(new Break_acwhite);
3527        add_templ(new Break_acblack);
3528  }  }
3529    
3530  ObjectRepos::~ObjectRepos()  ObjectRepos::~ObjectRepos()

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

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