1712 |
GridPos last_pos = get_pos(); |
GridPos last_pos = get_pos(); |
1713 |
Direction dir = get_dir(); |
Direction dir = get_dir(); |
1714 |
|
|
1715 |
if (move_stone(dir)) { |
move_stone(dir); |
|
// send a message to the stone that's blocking our way |
|
|
if (Stone *st = GetStone(move (get_pos(), dir))) |
|
|
SendMessage(st, "trigger", Value(dir)); |
|
|
} |
|
1716 |
state = IDLE; |
state = IDLE; |
1717 |
} |
} |
1718 |
|
|
1719 |
|
void on_move() { |
1720 |
|
// send a message to the stone that's blocking our way |
1721 |
|
Direction dir = get_dir(); |
1722 |
|
|
1723 |
|
if (Stone *st = GetStone(move(get_pos(), dir))) { |
1724 |
|
SendMessage(st, "trigger", Value(dir)); |
1725 |
|
} |
1726 |
|
} |
1727 |
|
|
1728 |
// Stone interface. |
// Stone interface. |
1729 |
void init_model() |
void init_model() |
1730 |
{ |
{ |
1749 |
} |
} |
1750 |
|
|
1751 |
void on_impulse (const Impulse& impulse) { |
void on_impulse (const Impulse& impulse) { |
|
move_stone(impulse.dir); |
|
1752 |
if (impulse.sender && 0 == strncmp(impulse.sender->get_kind(), "st-rotator-", 11)) { |
if (impulse.sender && 0 == strncmp(impulse.sender->get_kind(), "st-rotator-", 11)) { |
1753 |
set_dir(impulse.dir); |
set_dir(impulse.dir); |
1754 |
} |
} |
1755 |
init_model(); |
init_model(); |
1756 |
|
move_stone(impulse.dir); |
1757 |
} |
} |
1758 |
|
|
1759 |
void actor_inside(Actor *a) {SendMessage(a, "shatter");} |
void actor_inside(Actor *a) {SendMessage(a, "shatter");} |