86 |
} |
} |
87 |
|
|
88 |
void actor_hit (const StoneContact &sc) { |
void actor_hit (const StoneContact &sc) { |
89 |
if (wielded_item_is(sc.actor, "it-wrench")) { |
if (player::wielded_item_is(sc.actor, "it-wrench")) { |
90 |
clockwise = !clockwise; |
clockwise = !clockwise; |
91 |
init_model(); |
init_model(); |
92 |
} |
} |
293 |
Direction o=get_orientation(); |
Direction o=get_orientation(); |
294 |
|
|
295 |
if (has_dir(contact_faces(sc), o)) { |
if (has_dir(contact_faces(sc), o)) { |
296 |
if (wielded_item_is(sc.actor, "it-magicwand")) { |
if (player::wielded_item_is(sc.actor, "it-magicwand")) { |
297 |
set_orientation(reverse(o)); |
set_orientation(reverse(o)); |
298 |
init_model(); |
init_model(); |
299 |
} |
} |
407 |
void |
void |
408 |
KeyStone::actor_hit(const StoneContact &sc) |
KeyStone::actor_hit(const StoneContact &sc) |
409 |
{ |
{ |
410 |
if (player::Inventory *inv = get_inventory(sc.actor)) |
if (player::Inventory *inv = player::GetInventory(sc.actor)) |
411 |
{ |
{ |
412 |
if (is_on()) { |
if (is_on()) { |
413 |
Item *key = MakeItem("it-key"); |
Item *key = MakeItem("it-key"); |
563 |
{ |
{ |
564 |
Actor *a = sc.actor; |
Actor *a = sc.actor; |
565 |
|
|
566 |
if (wielded_item_is(a, "it-magicwand")) { |
if (player::wielded_item_is(a, "it-magicwand")) { |
567 |
set_dir(reverse(get_dir())); |
set_dir(reverse(get_dir())); |
568 |
init_model(); |
init_model(); |
569 |
} |
} |
572 |
bool on_laserhit(Direction) { |
bool on_laserhit(Direction) { |
573 |
set_dir(reverse(get_dir())); |
set_dir(reverse(get_dir())); |
574 |
init_model(); |
init_model(); |
575 |
|
|
576 |
|
// @@@ FIXME: the direction should only be inverted on NEW laserbeam |
577 |
|
// not on every light-recalc. Need to use PhotoCell! |
578 |
|
|
579 |
return false; |
return false; |
580 |
} |
} |
581 |
|
|
1252 |
bool actor_with_wand = false; |
bool actor_with_wand = false; |
1253 |
|
|
1254 |
if (Actor *ac = dynamic_cast<Actor*>(impulse.sender)) { |
if (Actor *ac = dynamic_cast<Actor*>(impulse.sender)) { |
1255 |
actor_with_wand = wielded_item_is(ac, "it-magicwand"); |
actor_with_wand = player::wielded_item_is(ac, "it-magicwand"); |
1256 |
} |
} |
1257 |
|
|
1258 |
maybe_move_cluster(c, is_complete, actor_with_wand, impulse.dir); |
maybe_move_cluster(c, is_complete, actor_with_wand, impulse.dir); |
1418 |
|
|
1419 |
bool oxyd1style = oxyd1_compatible(); |
bool oxyd1style = oxyd1_compatible(); |
1420 |
|
|
1421 |
if (oxyd1style || wielded_item_is(sc.actor, "it-magicwand")) { |
if (oxyd1style || player::wielded_item_is(sc.actor, "it-magicwand")) { |
1422 |
// check whether to explode cluster |
// check whether to explode cluster |
1423 |
if (explode_complete_cluster()) |
if (explode_complete_cluster()) |
1424 |
return; |
return; |
2014 |
void on_impulse(const Impulse& impulse) { |
void on_impulse(const Impulse& impulse) { |
2015 |
if (move_stone(impulse.dir)) { |
if (move_stone(impulse.dir)) { |
2016 |
Actor *hitman = dynamic_cast<Actor*>(impulse.sender); |
Actor *hitman = dynamic_cast<Actor*>(impulse.sender); |
2017 |
if (hitman && wielded_item_is(hitman, "it-magicwand")) { |
if (hitman && player::wielded_item_is(hitman, "it-magicwand")) { |
2018 |
return; // do not change state to PULSING |
return; // do not change state to PULSING |
2019 |
} |
} |
2020 |
} |
} |
2371 |
void |
void |
2372 |
CoinSlot::actor_hit(const StoneContact &sc) |
CoinSlot::actor_hit(const StoneContact &sc) |
2373 |
{ |
{ |
2374 |
if (wielded_item_is(sc.actor, "it-coin")) |
if (player::wielded_item_is(sc.actor, "it-coin")) |
2375 |
{ |
{ |
2376 |
if (player::Inventory *inv = get_inventory(sc.actor)) |
if (player::Inventory *inv = player::GetInventory(sc.actor)) |
2377 |
{ |
{ |
2378 |
play_sound("st-coinslot"); |
play_sound("st-coinslot"); |
2379 |
Item *it = inv->yield_first(); |
Item *it = inv->yield_first(); |