Ejemplo n.º 1
0
 public override StateChange revealType(int pauseTime)
 {
     if (!isTypeRevealed)
     {
         EnemySoundManager.requestSound(EnemySoundManager.SoundType.FRANKENSTIEN_INTRO);
         base.revealType(pauseTime);
         storedStateChangeObject.setToDefualts();
         clobber(currentRow, currentCollumn - 1, pauseTime);
         clobber(currentRow, currentCollumn + 1, pauseTime);
         storedStateChangeObject.changInBatteryCharge = -0.5f;
     }
     return(storedStateChangeObject);
 }
Ejemplo n.º 2
0
 public override StateChange revealType(int pauseTime)
 {
     base.revealType(pauseTime);
     if (hostSet != null)
     {
         EnemySoundManager.requestSound(EnemySoundManager.SoundType.ZOMBIE_INTRO);
         infect(currentRow, currentCollumn + 2, 3);
         infect(currentRow, currentCollumn + 1, 3);
         infect(currentRow, currentCollumn - 1, 3);
         infect(currentRow, currentCollumn - 2, 3);
     }
     return(null);
 }
Ejemplo n.º 3
0
 public override StateChange revealType(int pauseTime)
 {
     EnemySoundManager.requestSound(EnemySoundManager.SoundType.DRACULA_INTRO);
     storedStateChangeObject.setToDefualts();
     base.revealType(pauseTime);
     setByteTarget();
     if (pauseTime == 0)
     {
         BiteTarget(byteTarget);
     }
     byteTime = pauseTime;
     bytePos  = 0;
     storedStateChangeObject.puaseForAnimation = true;
     return(storedStateChangeObject);
 }
Ejemplo n.º 4
0
 /**
  * Will Bite a Random Enemy on the current Row
  * @return the Score Decrement as a result of the Bite
  */
 private void BiteTarget(BaseEnemy target)
 {
     if (hostSet != null && target != null)
     {
         EnemySoundManager.requestSound(EnemySoundManager.SoundType.DRACKULA_ATTACK);
         //Target is Ghost
         //Making Angry
         if (target.type == InteractableObject.ObjectType.GHOST)
         {
             //if not revealed
             if (!target.isTypeRevealed)
             {
                 target.revealType(0);
             }
             ((Ghost)target).MakeAngry();
         }
         //Target is already an angry Ghost
         else if (target.type == InteractableObject.ObjectType.ANGRY)
         {
             //if not revealed
             if (!target.isTypeRevealed)
             {
                 target.revealType(0);
             }
             ((Ghost)target).explode();
             removeThis();
         }
         //Target is not an Angry Ghost
         //Removing Target and Making it an angry Ghost
         else if (target != this && target.type != InteractableObject.ObjectType.CAT)
         {
             target.removeThis();
             Ghost angryGhost = new Ghost(BaseCode.activeLibrary);
             angryGhost.revealType(0);
             hostSet.addEnemy(angryGhost, currentRow, targetEnemyCollumn);
             angryGhost.setCenter(base.getCenterX(), base.getCenterY());
             angryGhost.setAnimationTarget(currentRow, targetEnemyCollumn);
         }
     }
     if (currentTarget != null)
     {
         currentTarget.removeNode();
         currentTarget = null;
     }
     targetEnemyCollumn = -1;
 }
Ejemplo n.º 5
0
 public override StateChange revealType(int pauseTime)
 {
     if (!isTypeRevealed)
     {
         EnemySoundManager.requestSound(EnemySoundManager.SoundType.MUMMY_INTRO);
         base.revealType(pauseTime);
         if (hostSet != null)
         {
             for (int loop = 0; loop < hostSet.getNumberOfCollumns(currentRow); loop++)
             {
                 BaseEnemy target = hostSet.getEnemyAt(currentRow, loop);
                 if (target != null && target != this)
                 {
                     target.unrevealType();
                 }
             }
         }
     }
     return(storedStateChangeObject);
 }
Ejemplo n.º 6
0
 private void ByteTarget(BaseEnemy target)
 {
     if (target != null && hostSet != null)
     {
         EnemySoundManager.requestSound(EnemySoundManager.SoundType.CAT_ATTACK);
         if (target.type == InteractableObject.ObjectType.ANGRY)
         {
             ((Ghost)target).explode();
             removeThis();
         }
         else
         {
             target.removeThis();
         }
     }
     if (currentTarget != null)
     {
         currentTarget.removeNode();
         currentTarget = null;
     }
     targetEnemyCollumn = -1;
 }
Ejemplo n.º 7
0
        /**
         * Will Make the Ghost Explode and return the changes to the player state
         * @return any changes to player state as a result of the explotion
         */
        public StateChange explode()
        {
            EnemySoundManager.requestSound(EnemySoundManager.SoundType.GHOST_EXPLODE);
            if (!isTypeRevealed)
            {
                revealType(0);
            }
            if (!angry)
            {
                MakeAngry();
            }
            base.setSprite(explodeSprite);
            explodeTimer.visible = false;
            angryTimer           = (explodeSprite.getTotalFrames() * 2);
            explodeTimer.setFilledSegments(0);
            killEnemy(currentRow - 1, currentCollumn + 1);
            killEnemy(currentRow - 1, currentCollumn - 1);
            killEnemy(currentRow - 1, currentCollumn);
            killEnemy(currentRow + 1, currentCollumn + 1);
            killEnemy(currentRow + 1, currentCollumn - 1);
            killEnemy(currentRow + 1, currentCollumn);
            killEnemy(currentRow, currentCollumn + 1);
            killEnemy(currentRow, currentCollumn - 1);

            if (hostSet != null)
            {
                base.setWidth(hostSet.getCollumnSpacing() * 3);
                base.setHeight(hostSet.getRowSpacing() * 3);
                hostSet.moveEnemytoSubSet(this);
            }
            else
            {
                base.setSize(base.getWidth() * 5, base.getHeight() * 5);
            }
            vibrate = false;
            return(getExplodeEffects());
        }
Ejemplo n.º 8
0
 public override StateChange revealType(int pauseTime)
 {
     EnemySoundManager.requestSound(EnemySoundManager.SoundType.GHOST_INTRO);
     explodeTimer.visible = true;
     return(base.revealType(pauseTime));
 }