enigma-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Enigma-cvs] enigma/src stones.cc,1.21,1.22


From: Daniel Heck <address@hidden>
Subject: [Enigma-cvs] enigma/src stones.cc,1.21,1.22
Date: Thu, 20 Nov 2003 20:24:24 +0000

Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv2211/src

Modified Files:
        stones.cc 
Log Message:

- Added SpitterStone (st-spitter).


Index: stones.cc
===================================================================
RCS file: /cvsroot/enigma/enigma/src/stones.cc,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** stones.cc   20 Oct 2003 08:05:46 -0000      1.21
--- stones.cc   20 Nov 2003 20:24:22 -0000      1.22
***************
*** 225,229 ****
  }
  
! // 
--------------------------------------------------------------------------------
  
  YieldedGridStone::YieldedGridStone(Stone *st)
--- 225,265 ----
  }
  
! 
! /* -------------------- SpitStone -------------------- */
! 
! namespace
! {
!     class SpitterStone : public Stone {
!         CLONEOBJ(SpitStone);
! 
!         enum State { IDLE, LOADING, SPITTING };
!         State state;
!     public:
!         SpitterStone () : Stone("st-spitter"), state (IDLE) {
!         }
! 
!         void actor_hit (const StoneContact &sc);
!     };
! }
! 
! void SpitterStone::actor_hit (const StoneContact &sc) {
!     if (player::Inventory *inv = player::GetInventory(sc.actor)) {
!         int lifepos = inv->find("it-extralife");
!         if (lifepos == -1) 
!             return; // no extra life to shoot
!         
!         delete inv->yield_item(lifepos);
!     }
!     V2 vel = sc.actor->get_vel();
!     Actor *ball = MakeActor ("ac-cannonball");
!     ActorInfo *ai = ball->get_actorinfo();
!     ai->vel = vel;
!     V2 pos = get_pos().center();
! 
!     world::AddActor (pos[0], pos[1], ball);
! }
! 
! 
! /* -------------------- YieldedGridStone -------------------- */
  
  YieldedGridStone::YieldedGridStone(Stone *st)
***************
*** 268,271 ****
--- 304,308 ----
      Register (new ChargeStone ("st-chargeminus", -1.0));
      Register (new ChargeStone ("st-chargezero", 0.0));
+     Register (new SpitterStone);
  
      // Init stones from stones_simple.cc and stones_complex.cc:





reply via email to

[Prev in Thread] Current Thread [Next in Thread]