/[enigma]/enigma/src/stones_complex.cc
ViewVC logotype

Diff of /enigma/src/stones_complex.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.27 by reallysoft, Sat Jul 5 08:29:16 2003 UTC revision 1.28 by reallysoft, Sun Jul 6 12:47:04 2003 UTC
# Line 86  namespace Line 86  namespace
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              }              }
# Line 293  OneWayBase::actor_hit(const StoneContact Line 293  OneWayBase::actor_hit(const StoneContact
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          }          }
# Line 407  namespace Line 407  namespace
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");
# Line 563  namespace Line 563  namespace
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              }              }
# Line 572  namespace Line 572  namespace
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    
# Line 1248  PuzzleStone::on_impulse(const Impulse& i Line 1252  PuzzleStone::on_impulse(const Impulse& i
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);
# Line 1414  PuzzleStone::actor_hit(const StoneContac Line 1418  PuzzleStone::actor_hit(const StoneContac
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;
# Line 2010  namespace Line 2014  namespace
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              }              }
# Line 2367  CoinSlot::tick(double dtime) Line 2371  CoinSlot::tick(double dtime)
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();

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26