80 |
} |
} |
81 |
} |
} |
82 |
|
|
83 |
void actor_hit (const StoneContact &sc) { |
void actor_hit (const StoneContact &/*sc*/) { |
84 |
|
|
85 |
} |
} |
86 |
}; |
}; |
196 |
set_move_state(false, move_dir); |
set_move_state(false, move_dir); |
197 |
newStone->set_move_state(true, move_dir); |
newStone->set_move_state(true, move_dir); |
198 |
|
|
199 |
if (grabbedActor = dynamic_cast<Actor*>(impulse.sender)) { |
if (( grabbedActor = dynamic_cast<Actor*>(impulse.sender) )) { |
200 |
ActorInfo *ai = grabbedActor->get_actorinfo(); |
ActorInfo *ai = grabbedActor->get_actorinfo(); |
201 |
after_vel = ai->vel; |
after_vel = ai->vel; |
202 |
|
|
305 |
{ |
{ |
306 |
class OneWayStone : public OneWayBase { |
class OneWayStone : public OneWayBase { |
307 |
public: |
public: |
308 |
OneWayStone(Direction dir=SOUTH) : OneWayBase("st-oneway", dir) {} |
OneWayStone(Direction dir=SOUTH) : OneWayBase("st-oneway", dir) {} |
309 |
private: |
private: |
310 |
CLONEOBJ(OneWayStone); |
CLONEOBJ(OneWayStone); |
311 |
virtual bool actor_may_pass (Actor *a) { return true; } |
virtual bool actor_may_pass (Actor */*a*/) { return true; } |
312 |
}; |
}; |
313 |
|
|
314 |
|
|
315 |
class OneWayStone_black : public OneWayBase { |
class OneWayStone_black : public OneWayBase { |
316 |
public: |
public: |
317 |
OneWayStone_black(Direction dir=SOUTH) |
OneWayStone_black(Direction dir=SOUTH) |
318 |
: OneWayBase("st-oneway_black",dir) {} |
: OneWayBase("st-oneway_black",dir) {} |
319 |
private: |
private: |
320 |
CLONEOBJ(OneWayStone_black); |
CLONEOBJ(OneWayStone_black); |
321 |
virtual bool actor_may_pass (Actor *a) { |
virtual bool actor_may_pass (Actor *a) { |
325 |
|
|
326 |
class OneWayStone_white : public OneWayBase { |
class OneWayStone_white : public OneWayBase { |
327 |
public: |
public: |
328 |
OneWayStone_white(Direction dir=SOUTH) |
OneWayStone_white(Direction dir=SOUTH) |
329 |
: OneWayBase("st-oneway_white", dir) {} |
: OneWayBase("st-oneway_white", dir) {} |
330 |
private: |
private: |
331 |
CLONEOBJ(OneWayStone_white); |
CLONEOBJ(OneWayStone_white); |
332 |
virtual bool actor_may_pass (Actor *a) { |
virtual bool actor_may_pass (Actor *a) { |
465 |
} |
} |
466 |
|
|
467 |
void alarm() { |
void alarm() { |
468 |
state = MOVING; |
state = MOVING; |
469 |
GridPos last_pos = get_pos(); |
move_stone(get_dir()); |
|
Direction dir = get_dir(); |
|
|
|
|
|
move_stone(dir); |
|
470 |
state = IDLE; |
state = IDLE; |
471 |
} |
} |
472 |
|
|
572 |
case GROWING: |
case GROWING: |
573 |
change_state(SOLID); |
change_state(SOLID); |
574 |
break; |
break; |
575 |
|
default : |
576 |
|
assert(0); |
577 |
|
break; |
578 |
} |
} |
579 |
} |
} |
580 |
|
|
686 |
void maybe_move_cluster(Cluster &c, bool is_complete, Direction dir); |
void maybe_move_cluster(Cluster &c, bool is_complete, Direction dir); |
687 |
void rotate_cluster(const Cluster &c); |
void rotate_cluster(const Cluster &c); |
688 |
|
|
689 |
bool on_laserhit(Direction dir) { |
bool on_laserhit(Direction /*dir*/) { |
690 |
return get_connections() == 0; |
return get_connections() == 0; |
691 |
} |
} |
692 |
|
|
791 |
} |
} |
792 |
|
|
793 |
void |
void |
794 |
PuzzleStone::maybe_move_cluster(Cluster &c, bool is_complete, Direction dir) |
PuzzleStone::maybe_move_cluster(Cluster &c, bool /*is_complete*/, Direction dir) |
795 |
{ |
{ |
796 |
sort(c.begin(), c.end()); |
sort(c.begin(), c.end()); |
797 |
Cluster mc(c); // Moved cluster |
Cluster mc(c); // Moved cluster |
890 |
} |
} |
891 |
|
|
892 |
StoneResponse |
StoneResponse |
893 |
PuzzleStone::collision_response(const StoneContact &sc) |
PuzzleStone::collision_response(const StoneContact &/*sc*/) |
894 |
{ |
{ |
895 |
if (get_connections() == NODIRBIT) |
if (get_connections() == NODIRBIT) |
896 |
return STONE_PASS; |
return STONE_PASS; |
968 |
void actor_contact(Actor *a); |
void actor_contact(Actor *a); |
969 |
|
|
970 |
void animcb(); |
void animcb(); |
971 |
bool on_laserhit(Direction dir) {return state==OPEN;} |
bool on_laserhit(Direction /*dir*/) {return state==OPEN;} |
972 |
}; |
}; |
973 |
} |
} |
974 |
|
|
1009 |
|
|
1010 |
|
|
1011 |
StoneResponse |
StoneResponse |
1012 |
DoorBase::collision_response(const StoneContact &sc) |
DoorBase::collision_response(const StoneContact &/*sc*/) |
1013 |
{ |
{ |
1014 |
return (state == OPEN) ? STONE_PASS:STONE_REBOUND; |
return (state == OPEN) ? STONE_PASS:STONE_REBOUND; |
1015 |
} |
} |
1244 |
ShogunStone *target = 0; |
ShogunStone *target = 0; |
1245 |
|
|
1246 |
if (Stone *st = GetStone(destpos)) { |
if (Stone *st = GetStone(destpos)) { |
1247 |
target = dynamic_cast<ShogunStone*>(GetStone(destpos)); |
target = dynamic_cast<ShogunStone*>(st); |
1248 |
|
|
1249 |
/* If the stone at `p' is not a shogun stone or if smallest hole |
/* If the stone at `p' is not a shogun stone or if smallest hole |
1250 |
does not fit into target, do not transfer the smallest hole. */ |
does not fit into target, do not transfer the smallest hole. */ |
1401 |
else if (st==CLOSING) set_anim("st-stoneimpulse-anim2"); |
else if (st==CLOSING) set_anim("st-stoneimpulse-anim2"); |
1402 |
} |
} |
1403 |
|
|
1404 |
void actor_hit(const StoneContact &sc) { |
void actor_hit(const StoneContact &/*sc*/) { |
1405 |
change_state(PULSING); |
change_state(PULSING); |
1406 |
} |
} |
1407 |
|
|
1426 |
} |
} |
1427 |
} |
} |
1428 |
|
|
1429 |
StoneResponse collision_response(const StoneContact &sc) { |
StoneResponse collision_response(const StoneContact &/*sc*/) { |
1430 |
return (state == IDLE) ? STONE_PASS : STONE_REBOUND; |
return (state == IDLE) ? STONE_PASS : STONE_REBOUND; |
1431 |
} |
} |
1432 |
void actor_inside(Actor *a) { |
void actor_inside(Actor *a) { |
1711 |
} |
} |
1712 |
|
|
1713 |
void |
void |
1714 |
OxydStone::actor_hit(const StoneContact &sc) |
OxydStone::actor_hit(const StoneContact &/*sc*/) |
1715 |
{ |
{ |
1716 |
maybe_open_stone(); |
maybe_open_stone(); |
1717 |
} |
} |
2053 |
void |
void |
2054 |
Turnstile_Pivot_Base::set_arm (Direction dir) |
Turnstile_Pivot_Base::set_arm (Direction dir) |
2055 |
{ |
{ |
2056 |
char *names[4] = { "st-turnstile-w", |
const char *names[4] = { "st-turnstile-w", "st-turnstile-s", |
2057 |
"st-turnstile-s", |
"st-turnstile-e", "st-turnstile-n" }; |
2058 |
"st-turnstile-e", |
Stone *st = MakeStone(names[dir]); |
2059 |
"st-turnstile-n" }; |
GridPos newp = move(get_pos(), dir); |
|
Stone *st = MakeStone(names[dir]); |
|
|
GridPos newp = move(get_pos(), dir); |
|
2060 |
SetStone (newp, st); |
SetStone (newp, st); |
2061 |
|
|
2062 |
if (Item *it = GetItem(newp)) |
if (Item *it = GetItem(newp)) |
2158 |
// Handle items in range : |
// Handle items in range : |
2159 |
for (int i = 0; i<8; ++i) { |
for (int i = 0; i<8; ++i) { |
2160 |
if (arm_seen[i]) { |
if (arm_seen[i]) { |
2161 |
GridPos pos(pv_pos.x+to_x[i], pv_pos.y+to_y[i]); |
GridPos item_pos(pv_pos.x+to_x[i], pv_pos.y+to_y[i]); |
2162 |
if (Item *it = GetItem(pos)) it->on_stonehit(this); // hit with pivot (shouldn't matter) |
if (Item *it = GetItem(item_pos)) it->on_stonehit(this); // hit with pivot (shouldn't matter) |
2163 |
} |
} |
2164 |
} |
} |
2165 |
|
|
2174 |
int dx = ac_pos.x-pv_pos.x; |
int dx = ac_pos.x-pv_pos.x; |
2175 |
int dy = ac_pos.y-pv_pos.y; |
int dy = ac_pos.y-pv_pos.y; |
2176 |
|
|
2177 |
if (dx<-1 || dx>1 || dy<-1 || dy>1) { // actor is outside of turnstile |
if (dx<-1 || dx>1 || dy<-1 || dy>1) { // actor is outside of turnstile but might get touched |
2178 |
// @@@ FIXME: test if actor was hit by turnstile -> set actor speed |
|
2179 |
|
// @@@ FIXME: test if actor was touched by rotating turnstile -> set actor speed |
2180 |
|
|
2181 |
} |
} |
2182 |
else { // actor is inside the turnstile |
else { // actor is inside the turnstile |
2183 |
int idx_source = to_index[dx+1][dy+1]; |
int idx_source = to_index[dx+1][dy+1]; |
2254 |
SendMessage(*ac, "shatter"); |
SendMessage(*ac, "shatter"); |
2255 |
break; |
break; |
2256 |
} |
} |
2257 |
|
case STAY: { // do nothing |
2258 |
|
break; |
2259 |
|
} |
2260 |
} |
} |
2261 |
|
|
2262 |
// @@@ FIXME: it's possible that two actors are moved to the same destination field. |
// @@@ FIXME: it's possible that two actors are moved to the same destination field. |