public void AttackContainer(IMinionContainer target)
 {
     mTargetContainer = target;
       if (mLaser != null)
     mLaser.Alive = false;
       AttackTarget(target);
 }
Example #2
0
 /// <summary>
 /// Creates a minion which automatically has a starting planet and a target planet.
 /// </summary>
 /// <param name="initialContainer"></param>
 /// <param name="targetContainer"></param>
 /// <param name="allegiance"></param>
 /// <param name="count">The amount of minions that are covered by this game object</param>
 public Minion(IMinionContainer initialContainer, IMinionContainer targetContainer, Allegiance allegiance, int count)
     : base(initialContainer.Position, allegiance)
 {
     Count = count;
       mTargetReached = false;
       mTargetContainer = targetContainer;
       mMovement = new MinionMovement(initialContainer, targetContainer, this);
       mVisibility = new Visibility(this);
 }
Example #3
0
 // TODO: Not Adjusted for Deathstar (Moving target)
 public MinionMovement(IMinionContainer initialContainer, IMinionContainer targetContainer, Minion owner)
 {
     mOwner = owner;
       mOwner.Position = initialContainer.Position;
       mMovement = new FreeMovement(mOwner);
       Vector2? startPos = mMovement.MoveTo(targetContainer);
       if (startPos != null)
       {
     mOwner.Position = (Vector2)startPos;
       }
 }
Example #4
0
 /// <summary>
 /// Creates and sends minions from the initialContainer to the targetContainer
 /// </summary>
 /// <param name="initialContainer"></param>
 /// <param name="targetContainer"></param>
 public void MoveMinions(IMinionContainer initialContainer, IMinionContainer targetContainer)
 {
     if (initialContainer == targetContainer) return;
       var minion = mGameObjectFactory.MoveMinions(initialContainer, targetContainer);
       AddUnit(minion);
 }
Example #5
0
        /// <summary>
        /// Changes the allegiance and if its a deathstar, converts it into a normal planet.
        /// </summary>
        /// <param name="targetContainer"></param>
        /// <param name="allegiance"></param>
        public IMinionContainer ChangeMinionContainerAllegiance(IMinionContainer targetContainer, Allegiance allegiance)
        {
            // Note the Fog manager about the change:
              GameLogic.GetInstance().SuperFogManager.ChangeAllegiance(targetContainer, allegiance);
              // Note the statistics about the change:
              mStats.PlanetAllegianceChange(targetContainer.Allegiance, allegiance);
              // Note the AI about the change:
              GameLogic.GetInstance().mSpaceshipAi.AllegianceChanged(targetContainer, allegiance);
              // Note the Unit sector manager about the change:
              IVisible visible = targetContainer as IVisible;
              if (visible != null) GameLogic.GetInstance().SectorManager.AllegianceChanged(visible, allegiance);

              targetContainer.Allegiance = allegiance;

              var deathStar = targetContainer as DeathStar;
              if (deathStar != null)
              {
            deathStar.Halt();
            deathStar.Alive = false;
            RemoveGameObject(deathStar);
            SetHasDeathStar(false, allegiance == Allegiance.Player ? Allegiance.Computer : Allegiance.Player);
            return CreatePlanet(deathStar.Position, deathStar.Allegiance, PlanetSize.Large, deathStar.MinionCount);
              }
              return null;
        }
Example #6
0
 public void AutoAttackIMinionContainer(IMinionContainerAttacker attacker, IMinionContainer target)
 {
     if (attacker.Allegiance != target.Allegiance)
       {
     attacker.AutoAttackMinionContainer(target);
       }
 }
Example #7
0
 public Minion MoveMinions(IMinionContainer initialContainer, IMinionContainer targetContainer)
 {
     // %maxi% ich hab mal gemacht dass 25% geschickt werden
       var minionsToMove = (int) (initialContainer.MinionCount*.25f);
       initialContainer.MinionCount -= minionsToMove;
       var minion = new Minion(initialContainer, targetContainer, initialContainer.Allegiance, minionsToMove);
       return minion;
 }
Example #8
0
 public void AutoAttackMinionContainer(IMinionContainer target)
 {
     if (!mSpaceshipAttackMode && !mMovementMode && !mPlanetAttackMode || AggressiveMovementMode)
       {
     AttackMinionContainer(target);
       }
 }
Example #9
0
 /// <summary>
 /// Makes the DeathStar attack an IMinionContainer 
 /// </summary>
 /// <param name="targetContainer"></param>
 public void AttackMinionContainer(IMinionContainer targetContainer)
 {
     Halt();
       mPlanetAttackMode = true;
       mPlanetAttackBehaviour.AttackContainer(targetContainer);
 }