/[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.70 by reallysoft, Sun May 11 14:06:09 2003 UTC revision 1.71 by reallysoft, Sun May 11 17:54:04 2003 UTC
# Line 73  world::PerformAction(Object *o, bool ono Line 73  world::PerformAction(Object *o, bool ono
73      o->string_attrib("action", &action);      o->string_attrib("action", &action);
74      o->string_attrib("target", &target);      o->string_attrib("target", &target);
75    
76    //     o->warning("PerformAction action=%s target=%s", action.c_str(), target.c_str());
77    
78      if (action == "callback") {      if (action == "callback") {
79          lua::CallFunc(target.c_str(), Value(onoff));          lua::CallFunc(target.c_str(), Value(onoff));
80      }      }
# Line 82  world::PerformAction(Object *o, bool ono Line 84  world::PerformAction(Object *o, bool ono
84      else if (Object *o = GetNamedObject(target)) {      else if (Object *o = GetNamedObject(target)) {
85          SendMessage(o, action);          SendMessage(o, action);
86      }      }
87        else {
88            fprintf(stderr, "Unknown target '%s' for action '%s'\n", target.c_str(), action.c_str());
89        }
90  }  }
91    
92  //----------------------------------------  //----------------------------------------
# Line 193  namespace  { Line 198  namespace  {
198  };  };
199    
200  void  void
201  Object::log(const char *format, ...) const {  Object::warning(const char *format, ...) const {
202      va_list arg_ptr;      va_list arg_ptr;
203    
204      va_start(arg_ptr, format);      va_start(arg_ptr, format);
# Line 212  GridObject::play_sound(const char *name) Line 217  GridObject::play_sound(const char *name)
217  }  }
218    
219  void  void
220  GridObject::log(const char *format, ...) const {  GridObject::warning(const char *format, ...) const {
221      va_list        arg_ptr;      va_list        arg_ptr;
222      const GridPos& pos = get_pos();      const GridPos& pos = get_pos();
223    
# Line 1687  namespace Line 1692  namespace
1692                  Stone   *st       = GetStone(next_pos);                  Stone   *st       = GetStone(next_pos);
1693    
1694                  if (st) {                  if (st) {
 //                     log("BolderStone sends 'trigger'");  
1695                      SendMessage(st, "trigger", Value(dir));                      SendMessage(st, "trigger", Value(dir));
1696                  }                  }
1697              }              }
# Line 1781  namespace { Line 1785  namespace {
1785                  case SHRINKING: {                  case SHRINKING: {
1786                      Item *it = world::MakeItem("it-blocker-new");                      Item *it = world::MakeItem("it-blocker-new");
1787                      world::SetItem(get_pos(), it);                      world::SetItem(get_pos(), it);
1788                        TransferObjectName(this, it);
1789                      world::KillStone(get_pos());                      world::KillStone(get_pos());
1790                      break;                      break;
1791                  }                  }
# Line 1791  namespace { Line 1796  namespace {
1796          }          }
1797    
1798          void message(const string &msg, const Value &) {          void message(const string &msg, const Value &) {
1799              if (msg == "trigger") { // e.g from st-bolder              if (msg == "trigger" || msg == "signal") {
                 if (state == SOLID) {  
                     change_state(SHRINKING);  
                 }  
             }  
             else if (msg == "signal") { // e.g from it-trigger  
1800                  if (state == SHRINKING) {                  if (state == SHRINKING) {
1801                      change_state(GROWING);                      change_state(GROWING);
1802                  }                  }
# Line 2751  ShogunStone::get_holes() const Line 2751  ShogunStone::get_holes() const
2751      if (h>=1 && h<=7)      if (h>=1 && h<=7)
2752          return Holes(h);          return Holes(h);
2753      else {      else {
2754          log("Wrong 'holes' attribute (%i)", h);          warning("Wrong 'holes' attribute (%i)", h);
2755          return SMALL;          return SMALL;
2756      }      }
2757  }  }

Legend:
Removed from v.1.70  
changed lines
  Added in v.1.71

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