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 |
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" |
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 |
} |
} |
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 |
|
|
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") { |
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); |
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) |
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"); |