77 |
Object *clone() { |
Object *clone() { |
78 |
return new SimpleStoneHollow(get_kind()); |
return new SimpleStoneHollow(get_kind()); |
79 |
} |
} |
80 |
StoneResponse collision_response(const StoneContact &sc) { |
StoneResponse collision_response(const StoneContact &/*sc*/) { |
81 |
return STONE_PASS; |
return STONE_PASS; |
82 |
} |
} |
83 |
bool on_laserhit(Direction) { return true; } |
bool on_laserhit(Direction) { return true; } |
167 |
KillStone (get_pos()); |
KillStone (get_pos()); |
168 |
} |
} |
169 |
|
|
170 |
StoneResponse collision_response(const StoneContact &sc) { |
StoneResponse collision_response(const StoneContact &/*sc*/) { |
171 |
return STONE_PASS; |
return STONE_PASS; |
172 |
} |
} |
173 |
}; |
}; |
226 |
modelname = fl->get_kind(); |
modelname = fl->get_kind(); |
227 |
set_model(modelname); |
set_model(modelname); |
228 |
} |
} |
229 |
StoneResponse collision_response(const StoneContact &sc) { |
StoneResponse collision_response(const StoneContact &/*sc*/) { |
230 |
return STONE_PASS; |
return STONE_PASS; |
231 |
} |
} |
232 |
}; |
}; |
331 |
public: |
public: |
332 |
Window() : Stone("st-window"), state(IDLE) {} |
Window() : Stone("st-window"), state(IDLE) {} |
333 |
private: |
private: |
334 |
bool on_laserhit(Direction dir) { return true; } |
bool on_laserhit(Direction /*dir*/) { return true; } |
335 |
enum State { IDLE, BREAK }; |
enum State { IDLE, BREAK }; |
336 |
State state; |
State state; |
337 |
void actor_hit(const StoneContact &sc) |
void actor_hit(const StoneContact &sc) |
566 |
} |
} |
567 |
} |
} |
568 |
} |
} |
569 |
bool on_laserhit(Direction dir) { |
bool on_laserhit(Direction /*dir*/) { |
570 |
return state != BRICK; |
return state != BRICK; |
571 |
} |
} |
572 |
}; |
}; |
690 |
CLONEOBJ(InvisibleMagic); |
CLONEOBJ(InvisibleMagic); |
691 |
const char *collision_sound() {return "st-thud";} |
const char *collision_sound() {return "st-thud";} |
692 |
public: |
public: |
693 |
InvisibleMagic() : Stone("st-invisible_magic"), state(INVISIBLE) {} |
InvisibleMagic() : Stone("st-invisible_magic"), state(INVISIBLE) {} |
694 |
private: |
private: |
695 |
enum State { INVISIBLE, STONE } state; |
enum State { INVISIBLE, STONE } state; |
696 |
void actor_hit(const StoneContact &sc) |
void actor_hit(const StoneContact &sc) |
697 |
{ |
{ |
698 |
if( state == INVISIBLE) |
if( state == INVISIBLE) |
699 |
{ |
{ |
700 |
if (wielded_item_is(sc.actor, "it-magicwand")) { |
if (wielded_item_is(sc.actor, "it-magicwand")) { |
701 |
play_sound("st-magic"); |
play_sound("st-magic"); |
702 |
state = STONE; |
state = STONE; |
703 |
set_model("st-greenbrown"); |
set_model("st-greenbrown"); |
704 |
laser::MaybeRecalcLight(get_pos()); |
laser::MaybeRecalcLight(get_pos()); |
705 |
} |
} |
706 |
} |
} |
707 |
} |
} |
708 |
bool on_laserhit(Direction dir) {return state==INVISIBLE;} |
bool on_laserhit(Direction /*dir*/) {return state==INVISIBLE;} |
709 |
}; |
}; |
710 |
} |
} |
711 |
|
|
937 |
set_model(is_on() ? "st-switch1" : "st-switch0"); |
set_model(is_on() ? "st-switch1" : "st-switch0"); |
938 |
} |
} |
939 |
|
|
940 |
void actor_hit(const StoneContact &sc) { |
void actor_hit(const StoneContact &/*sc*/) { |
941 |
set_on(!is_on()); |
set_on(!is_on()); |
942 |
PerformAction(this, is_on()); |
PerformAction(this, is_on()); |
943 |
play_sound("st-switch"); |
play_sound("st-switch"); |
1104 |
} |
} |
1105 |
} |
} |
1106 |
|
|
1107 |
void actor_hit(const StoneContact &sc) |
void actor_hit(const StoneContact &/*sc*/) |
1108 |
{ |
{ |
1109 |
set_on(!is_on()); |
set_on(!is_on()); |
1110 |
PerformAction(this, is_on()); |
PerformAction(this, is_on()); |
1113 |
m_direction = rotate(m_direction, true); |
m_direction = rotate(m_direction, true); |
1114 |
init_model(); |
init_model(); |
1115 |
} |
} |
1116 |
const char *collision_sound() { return "st-metal"; } |
const char *collision_sound() { return "st-metal"; } |
1117 |
}; |
}; |
1118 |
} |
} |
1119 |
|
|
1163 |
} |
} |
1164 |
|
|
1165 |
void |
void |
1166 |
LaserSwitch::actor_hit(const StoneContact &sc) |
LaserSwitch::actor_hit(const StoneContact &/*sc*/) |
1167 |
{ |
{ |
1168 |
} |
} |
1169 |
|
|
1420 |
FakeOxydStone() : Stone("st-fakeoxyd"), state(IDLE) {} |
FakeOxydStone() : Stone("st-fakeoxyd"), state(IDLE) {} |
1421 |
private: |
private: |
1422 |
enum State { IDLE, BLINKING } state; |
enum State { IDLE, BLINKING } state; |
1423 |
void actor_hit(const StoneContact &sc) { |
void actor_hit(const StoneContact &/*sc*/) { |
1424 |
if (state == IDLE) { |
if (state == IDLE) { |
1425 |
set_anim("st-fakeoxyd-blink"); |
set_anim("st-fakeoxyd-blink"); |
1426 |
state = BLINKING; |
state = BLINKING; |
1668 |
public: |
public: |
1669 |
MagicStone() : Stone("st-magic") {} |
MagicStone() : Stone("st-magic") {} |
1670 |
private: |
private: |
1671 |
void actor_hit(const StoneContact &sc) { |
void actor_hit(const StoneContact &/*sc*/) { |
1672 |
KillStone(get_pos()); |
KillStone(get_pos()); |
1673 |
display::GetStatusBar()->show_text("We don't sell books..", display::TEXT_2SECONDS); |
display::GetStatusBar()->show_text("We don't sell books..", display::TEXT_2SECONDS); |
1674 |
} |
} |