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

Diff of /enigma/src/stones.cc

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

revision 1.1 by dheck, Sat May 10 23:34:29 2003 UTC revision 1.2 by dheck, Sun May 11 08:45:56 2003 UTC
# Line 20  Line 20 
20  #include "stones.hh"  #include "stones.hh"
21  #include "objects.hh"  #include "objects.hh"
22  #include "object_mixins.hh"  #include "object_mixins.hh"
23    #include "game.hh"
24    #include "world.hh"
25    
26  using namespace std;  using namespace std;
27  using namespace world;  using namespace world;
# Line 28  using namespace enigma; Line 30  using namespace enigma;
30  //----------------------------------------  //----------------------------------------
31  //  EasyModeStone  //  EasyModeStone
32  //  //
 //  
33  // I'm not quite sure what this one is supposed to do, but a stone  // I'm not quite sure what this one is supposed to do, but a stone
34  // like this appears in all Per.Oxyd landscapes that look different in  // like this appears in all Per.Oxyd landscapes that look different in
35  // easy mode.  For now, this stone simply does nothing.  // easy mode.  For now, this stone simply does nothing.
# Line 40  namespace Line 41  namespace
41      public:      public:
42          EasyModeStone() : Stone("st-easymode") {}          EasyModeStone() : Stone("st-easymode") {}
43    
44            void on_creation() {
45                if (enigma::Difficulty == DIFFICULTY_EASY) {
46                    SetFloor (get_pos(), MakeFloor ("fl-normal"));
47                } else {
48                    KillItem (get_pos());
49                }
50                KillStone (get_pos());
51            }
52    
53          StoneResponse collision_response(const StoneContact &sc) {          StoneResponse collision_response(const StoneContact &sc) {
54              return STONE_PASS;              return STONE_PASS;
55          }          }
# Line 96  namespace Line 106  namespace
106      };      };
107  }  }
108    
109    
110    //----------------------------------------
111    // Grate3
112    //
113    // Horses and small marbles can move through this stone, but normal
114    // marbles can't.
115    //----------------------------------------
116    namespace
117    {
118        class Grate3 : public Stone {
119            SINGLETONOBJ(Grate3);
120        public:
121            Grate3() : Stone("st-grate3") {}
122    
123            StoneResponse collision_response(const StoneContact &sc) {
124                string actorkind = sc.actor->get_kind();
125                if (actorkind == "ac-horse" || actorkind == "ac-whiteball-small")
126                    return STONE_PASS;
127                else
128                    return STONE_REBOUND;
129            }
130        };
131    }
132    
133    
134  void stones::Init()  void stones::Init()
135  {  {
136      Register (new EasyModeStone);      Register (new EasyModeStone);
137        Register (new Grate3);
138      Register (new RotatorStone (true));      Register (new RotatorStone (true));
139      Register (new RotatorStone (false));      Register (new RotatorStone (false));
140  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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