/[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.60 by reallysoft, Tue May 6 21:53:00 2003 UTC revision 1.61 by dheck, Wed May 7 20:40:12 2003 UTC
# Line 182  GridObject::play_sound(const char *name) Line 182  GridObject::play_sound(const char *name)
182  //======================================================================  //======================================================================
183    
184  Floor::Floor(const char *kind, double friction, double mfactor)  Floor::Floor(const char *kind, double friction, double mfactor)
185      : TGridObject<GRID_FLOOR>(kind) , _friction(friction)  : TGridObject<GRID_FLOOR>(kind),
186      traits (kind, friction, mfactor, FLOOR_Normal)
187  {  {
     _mousefactor = mfactor;  
188  }  }
189    
190    Floor::Floor (const FloorTraits &tr)
191    : TGridObject<GRID_FLOOR>(tr.name), traits (tr)
192    {
193    }
194    
195    
196  Floor *Floor::clone() {  Floor *Floor::clone() {
197      return this;      return this;
198  }  }
# Line 198  void Floor::dispose() { Line 204  void Floor::dispose() {
204  void  void
205  Floor::message(const string& msg, const Value &val)  Floor::message(const string& msg, const Value &val)
206  {  {
     if (msg == "explode")  
         SetFloor(get_pos(), MakeFloor("fl-abyss"));  
207  }  }
208    
209  //----------------------------------------  //----------------------------------------
# Line 4073  Turnstile_Pivot::warpActorsInRange(bool Line 4077  Turnstile_Pivot::warpActorsInRange(bool
4077                  };                  };
4078    
4079                  const DirectionBits neededArm[2][8] = {                  const DirectionBits neededArm[2][8] = {
4080                      { WESTBIT, NORTHBIT, NORTHBIT, EASTBIT, EASTBIT, SOUTHBIT, SOUTHBIT, WESTBIT },         // anticlockwise                      // anticlockwise
4081                      { NORTHBIT, NORTHBIT, EASTBIT, EASTBIT, SOUTHBIT, SOUTHBIT, WESTBIT, WESTBIT }          // clockwise                      { WESTBIT, NORTHBIT, NORTHBIT, EASTBIT, EASTBIT, SOUTHBIT, SOUTHBIT, WESTBIT },
4082                        // clockwise
4083                        { NORTHBIT, NORTHBIT, EASTBIT, EASTBIT, SOUTHBIT, SOUTHBIT, WESTBIT, WESTBIT }
4084                  };                  };
4085    
4086                  DirectionBits arms = arms_present(); // already the rotated state                  DirectionBits arms = arms_present(); // already the rotated state
# Line 4091  Turnstile_Pivot::warpActorsInRange(bool Line 4097  Turnstile_Pivot::warpActorsInRange(bool
4097                          bool           shatter = true;                          bool           shatter = true;
4098    
4099                          if (arm) { // if stone is turnstile arm -> hit it!                          if (arm) { // if stone is turnstile arm -> hit it!
4100                              const DirectionBits impulse_dir[2][8] = {                              const int impulse_dir[2][8] = {
4101                                  { DirectionBits(SOUTHBIT|WESTBIT), WESTBIT, DirectionBits(NORTHBIT|WESTBIT), NORTHBIT,                                  // anticlockwise
4102                                    DirectionBits(NORTHBIT|EASTBIT), EASTBIT, DirectionBits(SOUTHBIT|EASTBIT), SOUTHBIT }, // anticlockwise                                  { SOUTHBIT|WESTBIT, WESTBIT, NORTHBIT|WESTBIT, NORTHBIT,
4103                                  { DirectionBits(NORTHBIT|EASTBIT), EASTBIT, DirectionBits(SOUTHBIT|EASTBIT), SOUTHBIT,                                    NORTHBIT|EASTBIT, EASTBIT, SOUTHBIT|EASTBIT, SOUTHBIT },
4104                                    DirectionBits(SOUTHBIT|WESTBIT), WESTBIT, DirectionBits(NORTHBIT|WESTBIT), NORTHBIT }  // clockwise                                  // clockwise
4105                                    { NORTHBIT|EASTBIT, EASTBIT, SOUTHBIT|EASTBIT, SOUTHBIT,
4106                                      SOUTHBIT|WESTBIT, WESTBIT, NORTHBIT|WESTBIT, NORTHBIT }
4107                              };                              };
4108    
4109                              DirectionBits possible_impulses = impulse_dir[clockwise][idx_target];                              DirectionBits possible_impulses =
4110                                    static_cast<DirectionBits>(impulse_dir[clockwise][idx_target]);
4111    
4112                              for (int d = 0; d<4; ++d) {                              for (int d = 0; d<4; ++d) {
4113                                  if (has_dir(possible_impulses, Direction(d))) {                                  if (has_dir(possible_impulses, Direction(d))) {

Legend:
Removed from v.1.60  
changed lines
  Added in v.1.61

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