public override void Auto(CardState cs, Card ownerEffect)
 {
     if(cs == CardState.Attacking_NotMe)
     {
         if(VC ()
            && GetDefensor().IsVanguard()
            && !ownerEffect.IsVanguard()
            && ownerEffect.BelongsToClan("Great Nature"))
         {
             StartEffect();
             ShowAndDelay();
         }
     }
 }
 public override void Auto(CardState cs, Card ownerEffect)
 {
     if(cs == CardState.Attacking_NotMe)
     {
         if(VC()
            && LimitBreak(4)
            && GetDefensor().IsVanguard()
            && !ownerEffect.IsVanguard()
            && Game.numBattle >= 3)
         {
             IncreasePowerAndCriticalByTurn(OwnerCard, 2000, 1);
         }
     }
     else if(cs == CardState.Attacking)
     {
         if(VC ()
            && GetDefensor().IsVanguard()
            && Game.numBattle >= 4)
         {
             IncreasePowerByBattle(OwnerCard, 5000);
         }
     }
 }
Ejemplo n.º 3
0
    public void Open(Card card)
    {
        bIgnore = true;
        _Card = card;
        bOpen = true;
        iSelectedCard = 0;
        _Game.playerHand.bBlockHand = false;

        num_options = 0;
        if(_Card.bIsInhand)
        {
            Card tmpVanguard = _Game.field.GetCardAt(fieldPositions.VANGUARD_CIRCLE);
            if(tmpVanguard.grade >= _Card.grade)
            {
                SetOption("Call");
            }

            if(tmpVanguard.grade == _Card.grade || tmpVanguard.grade == (_Card.grade - 1))
            {
                if(_Game.bRideThisTurn && _Card.unitAbilities.CanRide())
                {
                    SetOption("Ride");
                }
            }

            if(_Card.unitAbilities.HasInHandEffect(_Card))
            {
                SetOption ("Activate");
            }
        }
        else if(_Card._Coord == CardCoord.DAMAGE)
        {
            if(_Card.unitAbilities.HasOnDamageEffect() > 0)
            {
                SetOption("Activate");
            }
        }
        else
        {
            //Card is on the field.
            int count = _Card.unitAbilities.HasOnFieldEffect(_Card);
            if(count == 1)
            {
                SetOption("Activate");
            }
            else if(count > 1)
            {
                for(int i = 1; i <= count; i++)
                {
                    SetOption("Activate " + i);
                }
            }

            if(card.IsVanguard() && _Game.field.GetNumberOfCardsInSoul() > 0)
            {
                SetOption("View soul");
            }

            if(card.pos == fieldPositions.REAR_GUARD_LEFT ||
               card.pos == fieldPositions.REAR_GUARD_RIGHT||
               card.pos == fieldPositions.FRONT_GUARD_LEFT||
               card.pos == fieldPositions.FRONT_GUARD_RIGHT)
            {
                Card c = card.unitAbilities.GetSameColum(card.pos);
                if(c == null || !c.IsLocked())
                {
                    SetOption("Move");
                }
            }
        }

        SetOption("Cancel");

        Vector3 pos = _Camera.WorldToScreenPoint(card.GetGameObject().transform.position);
        _x = pos.x + 10.0f;
        _y = Camera.main.pixelHeight - pos.y - 50.0f;
        //_Game.bBlockMouse = true;

        if(num_options == 1)
        {
            Close ();
            _Game.bCardMenuJustClosed = false;
        }
    }
Ejemplo n.º 4
0
    public void ReturnToHand(Card c)
    {
        bool bIsVanguard = c.IsVanguard();
        fieldPositions cardPos = c.pos;
        Game.SendPacket(GameAction.RETURN_FROM_FIELD_TO_HAND, c.pos);
        Game.field.RemoveFrom(c.pos);
        Game.playerHand.AddToHand(c);
        if(!bIsVanguard)
        {
            c.CheckAbilities(CardState.HandFromRear);

            //Game.GameChat.AddChatMessage("ADMIN", c.name + " returns to hand." + " " + cardPos);

            Game.field.CheckAbilitiesExcept(cardPos, CardState.HandFromRear_NotMe, c);
        }
    }
Ejemplo n.º 5
0
    public void RetireUnit(Card card)
    {
        if(!card.bCanBeRetireByEffects)
        {
            SelectAnimField(card);
            return;
        }

        Game.field.ClearZone(card.pos);
        Game.field.AddToDropZone(card);
        Game.SendPacket(GameAction.SEND_TO_DROPZONE, card.pos);

        if(!card.IsVanguard())
        {
            Game.field.CheckAbilitiesExcept(card.pos, CardState.UnitSendToDropZoneFromRC, card);
            card.CheckAbilities(CardState.DropZoneFromRC);
        }
    }
Ejemplo n.º 6
0
 public void GoldRutile_Auto(CardState cs, Card card)
 {
     if(cs == CardState.AttackHits)
     {
         if(card.IsVanguard())
         {
             if(GetDefensor().IsVanguard())
             {
                 if(Game.field.GetNumberOfUnitRested() > 1 && Game.field.GetNumberOfCardsWithClanName("Nova Grappler") > 1)
                 {
                     if(Game.field.GetNumberOfDamageCardsFaceup() >= 2)
                     {
                         SetCard(card);
                         DisplayConfirmationWindow();
                     }
                 }
             }
         }
     }
     else if(cs == CardState.Attacking)
     {
         ConfirmAttack();
     }
     else if(cs == CardState.AttackHits_NotMe)
     {
         if(card.IsVanguard())
         {
             if(GetAttacker() != OwnerCard)
             {
                 if(GetDefensor().IsVanguard())
                 {
                     if(Game.field.GetNumberOfDamageCardsFacedown() >= 1)
                     {
                         ShowOnScreen(card);
                         UnflipCardInDamageZone(1);
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 7
0
 public void FlameOfHopeAermo_Auto(CardState cs, Card card)
 {
     if(cs == CardState.AttackHits_NotMe)
     {
         if(!card.IsVanguard())
         {
             if(card.boostedUnit == GetAttacker())
             {
                 SetCard(card);
                 DisplayConfirmationWindow();
             }
         }
     }
     else if(cs == CardState.Attacking)
     {
         ConfirmAttack();
     }
 }
Ejemplo n.º 8
0
 public void DemonicDragonMageRakshasa_Auto(CardState cs, Card card)
 {
     if(cs == CardState.EnemyCardSendToDropZone)
     {
         if(CurrentPhaseIs(GamePhase.MAIN_PHASE))
         {
             if(!card.IsVanguard())
             {
                 _AuxCard = card;
                 IncreasePowerByTurn(3000);
             }
         }
     }
     else if(cs == CardState.Attacking)
     {
         ConfirmAttack();
     }
 }
Ejemplo n.º 9
0
 public void WyvernStrikeJarran_Auto(CardState cs, Card card)
 {
     if(cs == CardState.Boost)
     {
         if(!card.IsVanguard())
         {
             if(card.boostedUnit.cardID == CardIdentifier.WYVERN_STRIKE_TEJAS)
             {
                 _AuxCard = card.boostedUnit;
                 IncreasePowerByBattle(4000);
             }
         }
     }
     else if(cs == CardState.Attacking)
     {
         ConfirmAttack();
     }
 }
Ejemplo n.º 10
0
 public void ReturnToHand(Card c)
 {
     bool bIsVanguard = c.IsVanguard();
     Game.SendPacket(GameAction.RETURN_FROM_FIELD_TO_HAND, c.pos);
     Game.field.RemoveFrom(c.pos);
     Game.playerHand.AddToHand(c);
     if(!bIsVanguard)
     {
         c.CheckAbilities(CardState.HandFromRear);
         Game.field.CheckAbilitiesExcept(c.pos, CardState.HandFromRear_NotMe, c);
     }
 }
Ejemplo n.º 11
0
    public void RetireUnit(Card card)
    {
        if(!card.IsVanguard())
        {
            card.CheckAbilities(CardState.DropZoneFromRC);
        }

        field.ClearZone(card.pos);
        field.AddToDropZone(card);
        SendPacket(GameAction.SEND_TO_DROPZONE, card.pos);
    }
Ejemplo n.º 12
0
    private void ResolveLastBattle(Card c)
    {
        bTakeDamage = false;

        if(c.IsVanguard())
        {
            if(AttackHits(c))
            {
                if(bCanReceiveDamage)
                {
                    bTakeDamage = true;
                }
                else
                {
                    SendPacket(GameAction.ATTACK_HITS);
                }
            }
            else
            {
                SendPacket(GameAction.ATTACK_NOT_HIT);
            }
        }
        else
        {
            ResolveBattle(c);
        }

        //End the guard phase
        bShowAttackPowerWindow = false;
        bShowDefensePowerWindow = false;
        SendAction(GameAction.END_ATTACK);
        guardZone.CleanGuardZone(field);
        bBlockGuardEndBattle = false;
        bMinGuardGradeBlocked = 0;
        bMaxGuardGradeBlocked = 99;
        UntargetCard(c);
        AttackedList.Clear();

        //Damage
        if(bTakeDamage)
        {
            num_damage = CardAttacking.GetCritical();
            Debug.Log ("Damage: " + num_damage);
            DamageCheck();
        }
        else
        {
            /*
            SendConfirmation();
            CardAttacking.ResetPower();
            SendPacket(GameAction.END_BATTLE, CardAttacking.pos);
            bDoPerfectGuardPerBattle = false;
            gamePhase = GamePhase.ENEMY_TURN;
            UntargetCard(c);
            CardToAttack = null;
            CardAttacking = null;
            bBlockGuardEndBattle = false;
            */
            EndBattle(false);
            UntargetCard(c);
            CardToAttack = CardAttacking = null;
            gamePhase = GamePhase.ENEMY_TURN;
            LastAttackedListIndex = -1;

            for(int i = 0; i < playerHand.Size(); i++)
            {
                Card tempCard = playerHand.GetCardAtIndex(i);
                if(tempCard != null)
                {
                    tempCard.SetOpacity(true);
                }
            }
        }
    }
Ejemplo n.º 13
0
    bool CanBeBoosted(Card c)
    {
        if(c == null) return false;

        if(c.IsVanguard() && !c.CanBeBoostedVanguard()) return false;
        if(!c.IsVanguard() && !c.CanBeBoostedRearGuard()) return false;

        Card b = field.GetCardAt(BackRow(c.pos));
        if(b == null) return false;
        if(!b.CanBoost(c)) return false;
        if(!b.IsStand()) return false;
        if(b.IsLocked()) return false;

        return true;
    }