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

Diff of /enigma/src/items.cc

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

revision 1.32 by dheck, Tue May 13 18:47:48 2003 UTC revision 1.33 by ant_39, Tue May 13 19:04:49 2003 UTC
# Line 1296  namespace Line 1296  namespace
1296          CLONEOBJ(Crack);          CLONEOBJ(Crack);
1297      public:      public:
1298          Crack() : Item("it-crack"),anim_end(false)          Crack() : Item("it-crack"),anim_end(false)
1299          { set_attrib("type", 0.0);          {
1300                set_attrib("type", 0.0);
1301                set_attrib("fixed", 0.0);
1302          }          }
1303      private:      private:
1304          bool anim_end;          bool anim_end;
1305    
1306          int get_type() const { return int_attrib("type"); }          int get_type() const { return int_attrib("type"); }
1307            int get_fixed() const { return int_attrib("fixed"); }
1308    
1309          void init_model() {          void init_model() {
1310              if (int t=get_type()) {              if (int t=get_type()) {
# Line 1328  namespace Line 1331  namespace
1331              }              }
1332          }          }
1333          void actor_enter(Actor *a) {          void actor_enter(Actor *a) {
1334                if (get_fixed())
1335                    return;
1336    
1337              SendMessage(this, "crack");              SendMessage(this, "crack");
1338    
1339              if( get_type() <= 3) {              if( get_type() <= 3) {
# Line 1382  namespace Line 1388  namespace
1388              return false;              return false;
1389          }          }
1390          void message(const string &msg, const Value &val) {          void message(const string &msg, const Value &val) {
1391              if (msg == "crack") {              if ((msg == "crack") && (get_fixed() == 0)) {
1392                  set_attrib("type", Value(int_attrib("type") + 1));                  set_attrib("type", Value(int_attrib("type") + 1));
1393                  play_sound("crack");                  play_sound("crack");
1394                  init_model();                  init_model();

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

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