925 |
public: |
public: |
926 |
Window() : Stone("st-window"), state(IDLE) {} |
Window() : Stone("st-window"), state(IDLE) {} |
927 |
private: |
private: |
928 |
|
bool on_laserhit(Direction dir) { return true; } |
929 |
enum State { IDLE, BREAK }; |
enum State { IDLE, BREAK }; |
930 |
State state; |
State state; |
931 |
void actor_hit(const StoneContact &sc) |
void actor_hit(const StoneContact &sc) |
1094 |
void actor_hit(const StoneContact &sc) |
void actor_hit(const StoneContact &sc) |
1095 |
{ |
{ |
1096 |
if (state == IDLE) { |
if (state == IDLE) { |
1097 |
if (sc.actor->get_attrib("blackball")) { |
if (sc.actor->get_attrib("blackball")) |
1098 |
state = FRAGILE;} |
state = FRAGILE; |
1099 |
} |
} |
1100 |
{ |
if( state == FRAGILE) { |
1101 |
if( state == FRAGILE) |
if (wielded_item_is(sc.actor, "it-hammer")) |
1102 |
{ |
change_state(BREAK); |
|
if (wielded_item_is(sc.actor, "it-hammer")) { |
|
|
play_sound("explosion1"); |
|
|
state = BREAK; |
|
|
set_anim("st-break_acblack-anim"); |
|
|
} |
|
|
} |
|
1103 |
} |
} |
1104 |
} |
} |
1105 |
void animcb() { |
void animcb() { |
1106 |
if (state == BREAK) { |
if (state == BREAK) |
1107 |
KillStone(get_pos()); |
KillStone(get_pos()); |
|
} |
|
1108 |
} |
} |
1109 |
bool on_laserhit(Direction) { |
bool on_laserhit(Direction) { |
1110 |
change_state(BREAK); |
change_state(BREAK); |