Beispiel #1
0
 private void assignRescue(EnemyFormation formation, int type)
 {
     if (_formation.numberOfPikes < 10 || _formation.numberOfShots < 10)
     {
         Soldier soldier;
         switch(type)
         {
             case Soldier.TYPE_PIKE:
                 soldier = new Pikeman(this, formation.getPosition().X, formation.getPosition().Y, SIDE_PLAYER);
                 break;
             case Soldier.TYPE_SHOT:
                 soldier = new Arquebusier(this, formation.getPosition().X, formation.getPosition().Y, SIDE_PLAYER);
                 break;
             case Soldier.TYPE_SWINGER:
                 if(doppelType)
                     soldier = new Dopple(this, formation.getPosition().X, formation.getPosition().Y, SIDE_PLAYER);
                 else
                     soldier = new CrossbowmanPavise(this, formation.getPosition().X, formation.getPosition().Y, SIDE_PLAYER);
                 break;
             default:
                 soldier = new Dopple(this, formation.getPosition().X, formation.getPosition().Y, SIDE_PLAYER);
                 break;
         }
         formation.addSoldier(soldier);
         soldier.setSpeed(0.25f);
     }
         //TODO: HEY MAN, THIS COULD CAUSE PRO-BLEMS
     else
     {
         formation.addSoldier(new Dopple(this, formation.getPosition().X, formation.getPosition().Y, SIDE_PLAYER));
     }
 }
Beispiel #2
0
 public void reiteratePikeCommand(Pikeman soldier)
 {
     ArrayList firstRow = (ArrayList)_pikeRows[0];
     Pikeman pikeman = (Pikeman)firstRow[0];
     if (pikeman.getState() == Pikeman.STATE_ATTACKING || pikeman.getState() == Pikeman.STATE_LOWERED ||
         pikeman.getState() == Pikeman.STATE_RECOILING || (pikeman.getState() == Pikeman.STATE_READY && _state == STATE_PIKE))
         pikeAttack();
     else if (pikeman.getState() == Pikeman.STATE_RAISING)
         pikeRaise();
     else if (pikeman.getState() == Pikeman.STATE_LOWER45)
         soldier.lower45();
 }