/[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.1 by dheck, Sun Jan 5 19:56:39 2003 UTC revision 1.2 by dheck, Mon Jan 6 12:26:01 2003 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (C) 2002 Daniel Heck   * Copyright (C) 2002,2003 Daniel Heck
3   *   *
4   * This program is free software; you can redistribute it and/or   * This program is free software; you can redistribute it and/or
5   * modify it under the terms of the GNU General Public License   * modify it under the terms of the GNU General Public License
# Line 14  Line 14 
14   * You should have received a copy of the GNU General Public License along   * You should have received a copy of the GNU General Public License along
15   * with this program; if not, write to the Free Software Foundation, Inc.,   * with this program; if not, write to the Free Software Foundation, Inc.,
16   * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.   * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17     *
18     * $Id$
19   */   */
20  #include "enigma.hh"  #include "enigma.hh"
21  #include "objects.hh"  #include "objects.hh"
# Line 254  namespace Line 256  namespace
256  }  }
257    
258  Gradient::Gradient()  Gradient::Gradient()
259      : Floor("fl-gradient", 12, 2)      : Floor("fl-gradient", 6, 2)
260  {  {
261      set_attrib("type", Value(MINTYPE));      set_attrib("type", Value(MINTYPE));
262  }  }
# Line 300  Gradient::get_force(Actor *a) Line 302  Gradient::get_force(Actor *a)
302      };      };
303      force = V3(xforce[t-MINTYPE], yforce[t-MINTYPE], 0);      force = V3(xforce[t-MINTYPE], yforce[t-MINTYPE], 0);
304    
305      return 20*force;      return 30*force;
306  }  }
307    
308    
# Line 1045  namespace Line 1047  namespace
1047          WoodenStone() : MovableStone("st-wood") {}          WoodenStone() : MovableStone("st-wood") {}
1048      private:      private:
1049    
1050          void actor_hit(const StoneContact &sc)          void on_move() {
         {  
             MovableStone::actor_hit(sc);  
1051              if (Floor *fl=GetFloor(get_pos())) {              if (Floor *fl=GetFloor(get_pos())) {
1052                  const string &k = fl->get_kind();                  const string &k = fl->get_kind();
1053                  if (k == "fl-abyss" || k=="fl-water" || k=="fl-swamp") {                  if (k == "fl-abyss" || k=="fl-water" || k=="fl-swamp") {
# Line 1056  namespace Line 1056  namespace
1056                  }                  }
1057              }              }
1058          }          }
1059    //         void actor_hit(const StoneContact &sc)
1060    //         {
1061    //             MovableStone::actor_hit(sc);
1062    //         }
1063      };      };
1064      class WoodenStone_Growing : public Stone {      class WoodenStone_Growing : public Stone {
1065          CLONEOBJ(WoodenStone_Growing);          CLONEOBJ(WoodenStone_Growing);
# Line 1141  namespace Line 1145  namespace
1145          }          }
1146          void set_dir(Direction d) {set_attrib("direction", d);}          void set_dir(Direction d) {set_attrib("direction", d);}
1147    
1148          bool on_move() { return true; }          bool is_movable() { return true; }
1149    
1150          void on_creation() {          void on_creation() {
1151              if (state == IDLE)              if (state == IDLE)
# Line 2231  namespace Line 2235  namespace
2235                  state = CLOSING;                  state = CLOSING;
2236                  GridPos p = get_pos();                  GridPos p = get_pos();
2237    
2238                  MaybeMoveStone( move( p, NORTH), NORTH);                  MaybeMoveStone (move(p,NORTH), NORTH);
2239                  MaybeMoveStone( move( p, EAST), EAST);                  MaybeMoveStone (move(p,EAST), EAST);
2240                  MaybeMoveStone( move( p, SOUTH), SOUTH);                  MaybeMoveStone (move(p,SOUTH), SOUTH);
2241                  MaybeMoveStone( move( p, WEST), WEST);                  MaybeMoveStone (move(p,WEST), WEST);
2242                                    
2243                  SendMessage(GetStone(move(p, NORTH)), "stoneimpulse");                  SendMessage(GetStone(move(p, NORTH)), "stoneimpulse");
2244                  SendMessage(GetStone(move(p, EAST)), "stoneimpulse");                  SendMessage(GetStone(move(p, EAST)), "stoneimpulse");

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