/[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.22 by dheck, Wed Apr 30 09:06:12 2003 UTC revision 1.23 by reallysoft, Thu May 1 09:17:33 2003 UTC
# Line 442  namespace Line 442  namespace
442              px::V2 item_center(get_pos().x + 0.5, get_pos().y + 0.5);              px::V2 item_center(get_pos().x + 0.5, get_pos().y + 0.5);
443              double dist = length(a->get_pos()-item_center);              double dist = length(a->get_pos()-item_center);
444              if (dist < ITEM_RADIUS) {              if (dist < ITEM_RADIUS) {
445                  set_anim("it-springboard_anim");                                          set_anim("it-springboard_anim");
446                  SendMessage(a, "jump");                  SendMessage(a, "jump");
447              }              }
448              return false;              return false;
# Line 961  ShogunDot::init_model() Line 961  ShogunDot::init_model()
961  void  void
962  ShogunDot::stone_change(Stone *st)  ShogunDot::stone_change(Stone *st)
963  {  {
964      if (activated && st == 0) {      if (activated) {
965          assert(0);              // no proper message was sent to ShogunDot          assert(st != 0);        // if fails : ShogunStone disappeared w/o sending proper message to ShogunDot
966        }
967        else {
968            if (st) {               // some Stone on inactive ShogunDot
969                SendMessage(st, "renotify"); // ask stone to notify me (again)
970    
971                // if ShogunDot was set _after_ ShogunStone during level startup,
972                // the ShogunDot does not get activated.
973            }
974      }      }
975  }  }
976    
# Line 1277  namespace Line 1285  namespace
1285      class Crack : public Item {      class Crack : public Item {
1286          CLONEOBJ(Crack);          CLONEOBJ(Crack);
1287      public:      public:
1288          Crack() : Item("it-crack"),anim_end(false)          Crack() : Item("it-crack"),anim_end(false)
1289          { set_attrib("type", 0.0);          { set_attrib("type", 0.0);
1290          }          }
1291      private:      private:
1292          bool anim_end;          bool anim_end;
1293            
1294          int get_type() const { return int_attrib("type"); }          int get_type() const { return int_attrib("type"); }
1295    
1296          void init_model() {          void init_model() {
1297              if (int t=get_type()) {              if (int t=get_type()) {
1298                  if( t > 3)                  if( t > 3)
1299                      set_anim("it-crack_anim1");                                      set_anim("it-crack_anim1");
1300                  //SetItem(get_pos(), MakeItem("it-debris"));                  //SetItem(get_pos(), MakeItem("it-debris"));
1301                  else {                  else {
1302                      char modelname[20];                      char modelname[20];
# Line 1315  namespace Line 1323  namespace
1323              if( get_type() <= 3) {              if( get_type() <= 3) {
1324                  Item *it;                  Item *it;
1325                  GridPos p;                  GridPos p;
1326            
1327                  p = move(get_pos(),enigma::NORTH);                  p = move(get_pos(),enigma::NORTH);
1328                  it = GetItem(p);                  it = GetItem(p);
1329                    
1330                  if( it)                  if( it)
1331                      SendMessage( it, "crack");                      SendMessage( it, "crack");
1332                  else {                  else {
# Line 1326  namespace Line 1334  namespace
1334                      if( fl->get_kind() != "fl-abyss")                      if( fl->get_kind() != "fl-abyss")
1335                          SetItem(p, MakeItem("it-crack"));                          SetItem(p, MakeItem("it-crack"));
1336                  }                  }
1337            
1338                  p = move(get_pos(),enigma::EAST);                  p = move(get_pos(),enigma::EAST);
1339                  it = GetItem(p);                  it = GetItem(p);
1340                  if( it)                  if( it)
# Line 1336  namespace Line 1344  namespace
1344                      if( fl->get_kind() != "fl-abyss")                      if( fl->get_kind() != "fl-abyss")
1345                          SetItem(p, MakeItem("it-crack"));                          SetItem(p, MakeItem("it-crack"));
1346                  }                  }
1347            
1348                  p = move(get_pos(),enigma::SOUTH);                  p = move(get_pos(),enigma::SOUTH);
1349                  it = GetItem(p);                  it = GetItem(p);
1350                  if( it)                  if( it)
# Line 1346  namespace Line 1354  namespace
1354                      if( fl->get_kind() != "fl-abyss")                      if( fl->get_kind() != "fl-abyss")
1355                          SetItem(p, MakeItem("it-crack"));                          SetItem(p, MakeItem("it-crack"));
1356                  }                  }
1357            
1358                  p = move(get_pos(),enigma::WEST);                  p = move(get_pos(),enigma::WEST);
1359                  it = GetItem(p);                  it = GetItem(p);
1360                  if( it)                  if( it)
# Line 1422  namespace Line 1430  namespace
1430      public:      public:
1431          Rubberband() : Item ("it-rubberband") {}          Rubberband() : Item ("it-rubberband") {}
1432      };      };
1433        
1434  }  }
1435    
1436    

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

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