Ejemplo n.º 1
0
    public void AddToGuardZone(Card _card, bool bPlayerView)
    {
        cards.Add(_card);
        _card.TurnUp();

        Vector3 newPosition = positions[(cards.Count - 1) % 4];
        Vector3 newAngle;

        if(bPlayerView) newAngle = playerRotation;
        else newAngle = enemyRotation;

        _card.MoveAndRotate(newPosition, newAngle);

        _card._Coord = CardCoord.GUARD;
    }
Ejemplo n.º 2
0
    public void AddToHand(Card card)
    {
        hand.Add(card);

        for(int i = 0; i < hand.Count - 1; i++)
        {
            hand[i].MoveAndRotate(GetPositionOf(i));
        }

        card._Coord = CardCoord.HAND;

        //FixPositions();
        //card.GetGameObject().transform.eulerAngles = new Vector3(24.0f, 180.0f, 0.0f);
        card.MoveAndRotate(GetPositionOf(hand.Count - 1));
        bFixHandPosition = true;
        card.TurnUp();

        //card.TurnUp();
        card.bIsInhand = true;
    }
Ejemplo n.º 3
0
 public void CallFromDeck(Card c, fieldPositions p)
 {
     Game.playerDeck.RemoveFromDeck(c);
     Game.field.Call(c, p);
     c.CheckAbilities(CardState.CallFromDeck, c);
     Game.field.CheckAbilitiesExcept(c.pos, CardState.CallFromDeck_NotMe, c);
     Game.SendPacket(GameAction.PLAY_CARD_FROM_DECK, c.cardID, (int)Util.TranformToEnemyPosition(c.pos));
     c.TurnUp();
 }
Ejemplo n.º 4
0
    /**
     * This method performs the animation of the cards that will be send to Bind Zone. And also performs
     * the remove from deck, add to bind and networking communication. This method must be call in a
     * Update function after a BindFromDeck method was called. When all Cards passed in the BindFromDeck
     * argument were sent to BindZone, func delegate will be executed.
     */
    public void BindFromDeckUpdate(Void0ParamsDelegate func)
    {
        if(BindFromDeck_Active)
        {
            if(BindFromDeck_Card == null || !BindFromDeck_Card.AnimationOngoing())
            {
                if(BindFromDeck_Card != null)
                {
                    //Remove from deck and add to BindZone.
                    Game.playerDeck.RemoveFromDeck(BindFromDeck_Card);
                    Game.field.AddToBindZone(BindFromDeck_Card);
                    BindFromDeck_Card = null;
                }

                //Send the next card in the list, if any. If not, func delegate is called.
                if(BindFromDeck_CardList.Count > 0)
                {
                    BindFromDeck_Card = BindFromDeck_CardList[0];
                    BindFromDeck_CardList.RemoveAt(0);
                    BindFromDeck_Card.TurnUp();
                    BindFromDeck_Card.BindAnim();
                    Game.SendPacket (GameAction.BIND_FROM_DECK, BindFromDeck_Card.cardID);
                }
                else
                {
                    BindFromDeck_Active = false;
                    func();
                }
            }
        }
    }
Ejemplo n.º 5
0
 public void FromDeckToDamage(Card c, bool bFaceup = false)
 {
     Game.playerDeck.RemoveFromDeck(c);
     Game.field.AddToDamageZone(c);
     if(bFaceup)
     {
         c.TurnUp();
         Game.SendPacket(GameAction.FROM_DECK_TO_DAMAGE_FACEUP, c.cardID);
     }
     else
     {
         c.TurnDown();
         Game.SendPacket(GameAction.FROM_DECK_TO_DAMAGE, c.cardID);
     }
 }
Ejemplo n.º 6
0
 void FromDamageToDeck(Card c)
 {
     int idx = Game.field.GetDamageIndexOf(c);
     Game.field.RemoveFromDamage(c);
     Game.playerDeck.AddCard(c);
     c.TurnUp();
     Game.SendPacket(GameAction.FROM_DAMAGE_TO_DECK, idx);
 }
Ejemplo n.º 7
0
    public void CallFromDeck_SameColum(Card card, fieldPositions p)
    {
        _MouseHelper.AttachCard(card);
        card.TurnUp();
        bCallFromDeck = true;
        bCardMenuJustClosed = false;

        bCallToSameColum = true;
        bCallSameColPos = p;
    }
Ejemplo n.º 8
0
    public void AddToDropZone(Card card)
    {
        LastCardSentToDrop = card;
        card._Coord = CardCoord.DROP;
        card.NormalizeMaterial();
        DropZone.Add(card);
        card.TurnUp();
        card.Stand();

        card.MoveAndRotate(fieldInfo.GetPosition((int)fieldPositions.DROP_ZONE) + new Vector3(0.0f, 0.01f * (DropZone.Count - 1), 0.0f),
                           new Vector3(0.0f, 180.0f, 0.0f));

        //card.GetGameObject().transform.position = fieldInfo.GetPosition((int)fieldPositions.DROP_ZONE) + new Vector3(0.0f, 0.01f * (DropZone.Count - 1), 0.0f);
        //card.GetGameObject().transform.eulerAngles = new Vector3(0.0f, 180.0f, 0.0f);
    }
Ejemplo n.º 9
0
    public void Ride(Card card)
    {
        if(Soul.Count > 0)
            Soul[Soul.Count - 1].SetIsVanguard(false);
        Soul.Add (card);

        card.pos = fieldPositions.ENEMY_VANGUARD;
        card._Coord = CardCoord.ENEMY_FIELD;

        card.SetIsVanguard(true);
        Vanguard = card;

        for(int i = 0; i < Soul.Count - 1; i++)
        {
            Soul[i].GetGameObject().transform.position = fieldInfo.GetPosition((int)EnemyFieldPosition.VANGUARD) + delta * i;
        }

        Vector3 newPosition = fieldInfo.GetPosition((int)EnemyFieldPosition.VANGUARD) + delta * (Soul.Count - 1);

        Vanguard.TurnUp();
        Vanguard.MoveAndRotate(newPosition, fieldInfo.GetCardRotation());

        //Vanguard.GetGameObject().transform.eulerAngles = fieldInfo.GetCardRotation();
        VanguardPower.text = card.GetPower() + "";

        CallAnimation(card, newPosition);
    }
Ejemplo n.º 10
0
    void SendInformationToOpponent(int cardID, int gameAction, int other1, int other2, string str1, int other3 = 0)
    {
        CardIdentifier _cardID = (CardIdentifier)cardID;
        GameAction _gameAction = (GameAction)gameAction;

        DataTransferManager.getTransferManager().ExecuteDataTransfer(new DataTransfer(_cardID, _gameAction, other1, other2, other3, str1));

        if(_gameAction == GameAction.LOSE_BY_CARD_EFFECT)
        {
            bGameEnded = true;
            bPauseGameplay = false;
            bWinByCardEffect = false;
            bLoseByCardEffect = true;
        }
        else if(_gameAction == GameAction.FORCE_DAMAGE_CHECK)
        {
            ForceDamageCheck(other1);
        }
        else if(_gameAction == GameAction.FROM_DECK_TO_GUARDIANCIRCLE)
        {
            Card tempCard = enemyDeck.DrawCard();
            Data.FillCardWithData(tempCard, _cardID);
            guardZone.AddToGuardZone(tempCard, false);
            //guardZone.AddExtraPower(tempCard.shield);
            CardToAttack.AddExtraShield(tempCard.shield);
            tempCard.TurnUp();
        }
        else if(_gameAction == GameAction.FROM_BIND_TO_DROP)
        {
            Card tmp = enemyField.GetCardFromBindByID(_cardID);
            enemyField.RemoveFromBindZone(tmp);
            enemyField.AddToDropZone(tmp, false);
        }
        else if(_gameAction == GameAction.OPPONENT_FROM_BIND_TO_DROP)
        {
            Card tmp = field.GetBoundByID(_cardID);
            dummyUnitObject.FromBindToDrop(tmp);
        }
        else if(_gameAction == GameAction.OPPONENT_FROM_HAND_TO_BIND)
        {
            int index = playerHand.Size() - other1;
            dummyUnitObject.FromHandToBind(playerHand.GetCardAtIndex(index), index, true);
        }
        else if(_gameAction == GameAction.ENEMY_FROM_BIND_TO_HAND)
        {
            Card cardToReturn = field.GetBoundByID(_cardID);
            dummyUnitObject.FromBindToHand(cardToReturn);
        }
        else if(_gameAction == GameAction.SET_ENEMY_ENDTURN)
        {
            enemyPhase = EnemyPhase.ENDTURN;
            SendPacket(GameAction.CONFORM_ENEMY_ENDTURN);
        }
        else if(_gameAction == GameAction.CONFORM_ENEMY_ENDTURN)
        {
            bConfirmEndTurn = true;
        }
        else if(_gameAction == GameAction.MOVE_TO_OPENRC)
        {
            Card c = enemyField.GetCardAt(Util.TranformToEnemyPosition((fieldPositions)other1));

            EnemyFieldPosition p2 = Util.TranformToEnemyPosition((fieldPositions)other2);
            fieldPositions p = Util.EnemyToFieldPosition(p2);

            enemyField.ClearZone(Util.TransformToEquivalentEnemyPosition(c.pos));

            c.pos = p;

            if(p == fieldPositions.ENEMY_FRONT_LEFT) enemyField.Left_Front = c;
            else if(p == fieldPositions.ENEMY_FRONT_RIGHT) enemyField.Right_Front = c;
            else if(p == fieldPositions.ENEMY_REAR_CENTER) enemyField.Center_Rear = c;
            else if(p == fieldPositions.ENEMY_REAR_RIGHT) enemyField.Right_Rear = c;
            else if(p == fieldPositions.ENEMY_REAR_LEFT)  enemyField.Left_Rear = c;

            Vector3 newVector = enemyField.fieldInfo.GetPosition((int)p2);
            c.GoTo(newVector.x, newVector.z);
        }
        else if(_gameAction == GameAction.EXCHANGE)
        {
            Card c1 = enemyField.GetCardAt(Util.TranformToEnemyPosition((fieldPositions)other1));
            Card c2 = enemyField.GetCardAt(Util.TranformToEnemyPosition((fieldPositions)other2));

            fieldPositions p1 = c1.pos;
            fieldPositions p2 = c2.pos;

            if(p1 == fieldPositions.ENEMY_REAR_CENTER)      enemyField.Center_Rear = c2;
            else if(p1 == fieldPositions.ENEMY_REAR_LEFT)   enemyField.Left_Rear   = c2;
            else if(p1 == fieldPositions.ENEMY_REAR_RIGHT)  enemyField.Right_Rear  = c2;
            else if(p1 == fieldPositions.ENEMY_FRONT_LEFT)  enemyField.Left_Front  = c2;
            else if(p1 == fieldPositions.ENEMY_FRONT_RIGHT) enemyField.Right_Front = c2;

            if(p2 == fieldPositions.ENEMY_REAR_CENTER)      enemyField.Center_Rear = c1;
            else if(p2 == fieldPositions.ENEMY_REAR_LEFT)   enemyField.Left_Rear   = c1;
            else if(p2 == fieldPositions.ENEMY_REAR_RIGHT)  enemyField.Right_Rear  = c1;
            else if(p2 == fieldPositions.ENEMY_FRONT_LEFT)  enemyField.Left_Front  = c1;
            else if(p2 == fieldPositions.ENEMY_FRONT_RIGHT) enemyField.Right_Front = c1;

            c1.pos = p2;
            c2.pos = p1;

            Vector3 c1NewPos = enemyField.fieldInfo.GetPosition((int)Util.TransformToEquivalentEnemyPosition(c1.pos));
            Vector3 c2NewPos = enemyField.fieldInfo.GetPosition((int)Util.TransformToEquivalentEnemyPosition(c2.pos));

            c1.GoTo(c1NewPos.x, c1NewPos.z);
            c2.GoTo(c2NewPos.x, c2NewPos.z);
        }
        else if(_gameAction == GameAction.SET_ENEMY_MAIN)
        {
            enemyPhase = EnemyPhase.MAIN;
        }
        else if(_gameAction == GameAction.BIND_HAND_FACEDOWN_RETURN_ENDTURN)
        {
            _OppBindHandFacedownReturnEndTurn = true;
            GameChat.AddHelpMessage("Choose a card from your hand and bind it.");
        }
        else if(_gameAction == GameAction.OPPONENT_FROM_FIELD_TO_DAMAGE)
        {
            _OppFromFieldToDamage = true;
            GameChat.AddHelpMessage("Choose one of your rear-guards.");
        }
        else if(_gameAction == GameAction.ENEMY_FROM_DAMAGE_TO_DROP)
        {
            Card c = field.GetDamageAtIndex(other1);
            dummyUnitObject.FromDamageToDrop (c);
        }
        else if(_gameAction == GameAction.FROM_DRIVE_TO_DROP)
        {
            enemyField.AddToDropZone(DriveCard, false);
        }
        else if(_gameAction == GameAction.OPEN_DECISIONWINDOW)
        {
            Card tmp = enemyField.GetCardAt(Util.TranformToEnemyPosition((fieldPositions)other1));

            _DecisionWindow.Set(tmp, other2);
            _DecisionWindow.SetCaption(str1);

        }
        else if(_gameAction == GameAction.DECISIONWINDOW_ACCEPT)
        {
            Card tmp = field.GetCardAt(Util.TransformToPlayerField((fieldPositions)other1));
            if(tmp != null)
            {
                tmp.unitAbilities.DecisionWindowAccept(other2);
            }
        }
        else if(_gameAction == GameAction.REGISTER_ID)
        {
            lastIDRegistered = other1;
        }
        else if(_gameAction == GameAction.DECISIONWINDOW_DENIED)
        {
            Card tmp = field.GetCardAt(Util.TransformToPlayerField((fieldPositions)other1));

            if(tmp != null)
            {
                tmp.unitAbilities.DecisionWindowDenied(other2);
            }
            else
            {
                GameChat.AddChatMessage("ADMIN", "NULL");
            }
        }
        else if(_gameAction == GameAction.EFFECT_ON)
        {
            bEnemyEffectOngoing = true;
        }
        else if(_gameAction == GameAction.EFFECT_OFF)
        {
            bEnemyEffectOngoing = false;
        }
        else if(_gameAction == GameAction.BLOCK_EFFECT_TRIGGER_THIS_BATTLE)
        {
            bBlockTriggerEffects = true;
        }
        else if(_gameAction == GameAction.CREATE_AUXILIAR_INT_ARRAY)
        {
            intArr = new List<int>();
        }
        else if(_gameAction == GameAction.ADD_TO_INT_ARRAY)
        {
            intArr.Add(other1);
        }
        else if(_gameAction == GameAction.FORCE_CALL_FROM_BIND)
        {
            bForceToCallFromBind = true;
            iNumberOfUnitsToCallFromBind = other1;
            field.ViewBindZone(1, delegate(Card c) {
                for(int i = 0; i < intArr.Count; i++)
                {
                    CardIdentifier tmpId = (CardIdentifier)intArr[i];
                    if(tmpId == c.cardID)
                    {
                        return true;
                    }
                }
                return false;
            });
            bEndEvent = false;
        }
        else if(_gameAction == GameAction.OPPONENT_CANNOT_NORMAL_GUARD_ENDBATTLE)
        {
            bCanNormalGuard = false;
        }
        else if(_gameAction == GameAction.OPPONENT_CANNOT_RECEIVEDAMAGE_ENDBATTLE)
        {
            bCanReceiveDamage = false;
        }
        else if(_gameAction == GameAction.BIND_FROM_DECK)
        {
            //Take the top card of the enemy deck.
            Card c = enemyDeck.DrawCard();
            //Transform the card to the desired card identifier.
            Data.FillCardWithData(c, _cardID);
            //Add the card to the enemy bind zone.
            enemyField.AddToBindZone(c);
            //Perform the bind animation.
            c.TurnUp();
            c.BindAnim();
        }
        else if(_gameAction == GameAction.FROM_BIND_TO_DECK)
        {
            Card c = enemyField.GetCardFromBindByID(_cardID);

            enemyField.RemoveFromBindZone(c);
            enemyDeck.AddCard(c);

            c.FromEnemyBindTo(new Vector3(-15.89146f, -2.667145f, 9.565327f),
            delegate {
                enemyDeck.SetDeckPosition();
            });
        }
        else if(_gameAction == GameAction.OPPONENT_MOVE_SOUL)
        {
            fieldPositions p = (fieldPositions)other1;
            Card c = field.GetCardAt(Util.TransformToPlayerField(p));
            if(c != null)
            {
                MoveToSoul(c);
            }
        }
        else if(_gameAction == GameAction.DRAW_FROM_DECK)
        {
            //Remove a number "other1" of cards from the deck an put them on the enemy hand.
            for(int i = 0; i < other1; i++)
            {
                enemyHand.AddToHand (enemyDeck.DrawCard());
            }
        }
        else if(_gameAction == GameAction.FROM_DROP_TO_HAND)
        {
            Card c = enemyField.GetDropByID(_cardID);
            enemyField.RemoveFromDropZone(c);
            enemyHand.AddToHand(c);
        }
        else if(_gameAction == GameAction.BLOCK_GUARD_END_BATTLE)
        {
            bBlockGuardEndBattle = true;
            bMaxGuardGradeBlocked = other1;
        }
        else if(_gameAction == GameAction.BLOCK_GUARD_END_BATTLE_MIN)
        {
            bBlockGuardEndBattle = true;
            bMinGuardGradeBlocked = other1;
        }
        else if(_gameAction == GameAction.UNIT_CANNOT_INTERCEPT_ENDTURN)
        {
            fieldPositions p = Util.TransformToPlayerField((fieldPositions)other1);
            Card c = field.GetCardAt(p);
            SelectAnimField(c);
            c.BlockInterceptEndTurn();
        }
        else if(_gameAction == GameAction.RIDE_FROM_BIND)
        {
            Card c = enemyField.GetCardFromBindByID(_cardID);
            if(c != null)
            {
                enemyField.RemoveFromBindZone(c);
                enemyField.Ride(c);
            }
        }
        else if(_gameAction == GameAction.PLAY_CARD_ON_THE_FIELD)
        {
            //The opponent Call/Ride an unit from hand.
            EnemyFieldPosition pos = (EnemyFieldPosition)other1;
            if(pos != EnemyFieldPosition.VANGUARD)
            {
                Card tempCard = enemyHand.RemoveFromHand();
                Data.FillCardWithData(tempCard, _cardID);
                enemyField.Call(tempCard, pos);
            }
            else
            {
                Card tempCard = enemyHand.RemoveFromHand();
                Data.FillCardWithData(tempCard, _cardID);
                enemyField.Ride(tempCard);
            }
        }
        else if(_gameAction == GameAction.LOCK)
        {
            fieldPositions tmpPos = (fieldPositions)other1;
            Card card = field.GetCardAt(Util.TransformToPlayerField(tmpPos));
            card.Lock();
        }
        else if(_gameAction == GameAction.UNLOCK)
        {
            fieldPositions tmpPos = (fieldPositions)other1;
            Card card = field.GetCardAt(Util.TransformToPlayerField(tmpPos));
            card.Unlock();
        }
        else if(_gameAction == GameAction.LOCK_ENEMY)
        {
            enemyField.GetCardAt((EnemyFieldPosition)other1).Lock();
        }
        else if(_gameAction == GameAction.OMEGA_LOCK)
        {
            fieldPositions tmpPos = (fieldPositions)other1;
            Card card = field.GetCardAt(Util.TransformToPlayerField(tmpPos));
            card.SetOmegaLock(true);
        }
        else if(_gameAction == GameAction.UNLOCK_ENEMY)
        {
            EnemyFieldPosition pos = (EnemyFieldPosition)other1;
            Card tempCard = enemyField.GetCardAt(pos);
            tempCard.Unlock();
            field.CheckAbilities(CardState.EnemyUnlockCard, tempCard);
            bEndEvent = true;
        }
        else if(_gameAction == GameAction.PLAY_CARD_FROM_SOUL)
        {
            EnemyFieldPosition pos = (EnemyFieldPosition)other1;
            Card tempCard = enemyField.GetCardFromSoulByID(_cardID);
            enemyField.RemoveFromSoul(tempCard);
            enemyField.Call(tempCard, pos);
        }
        else if(_gameAction == GameAction.FROM_BIND_TO_FIELD)
        {
            EnemyFieldPosition pos = (EnemyFieldPosition)other1;
            Card tempCard = enemyField.GetCardFromBindByID(_cardID);
            enemyField.RemoveFromBindZone(tempCard);
            enemyField.Call(tempCard, pos);
        }
        else if(_gameAction == GameAction.REST_UNIT)
        {
            enemyField.GetCardAt((EnemyFieldPosition)other1).RestEnemy();
        }
        else if(_gameAction == GameAction.ADD_EXTRA_SHIELD)
        {
            if(CardToAttack != null)
            {
                CardToAttack.AddExtraShield(other1);
            }
        }
        else if(_gameAction == GameAction.FROM_HAND_TO_BIND)
        {
            Card c = enemyHand.GetCardAtIndex(enemyHand.Size() - other1 - 1);
            Data.FillCardWithData(c, _cardID);

            FromHandToBindList.Add(c);
            c.BindAnim();
        }
        else if(_gameAction == GameAction.SELECT_UNIT_TO_ATTACK)
        {
            Card tempCard = field.GetCardAt(Util.TransformToPlayerField((fieldPositions)other1));
            PutSelectorOnCard(tempCard);
            CardToAttack = tempCard;

            AttackedList.Add(CardToAttack);
            CurAttackedListIndex = 0;

            CardAttacking = enemyField.GetCardAt((EnemyFieldPosition)other2);
            bShowAttackPowerWindow = true;
            bShowDefensePowerWindow = true;

            SendPacket (GameAction.REQUEST_BOOT);
            //gamePhase = GamePhase.GUARD;
        }
        else if(_gameAction == GameAction.ATTACK_ALL_UNITS)
        {
            AttackedList.Clear();

            Card c = field.GetCardAt(fieldPositions.FRONT_GUARD_LEFT);
            if(c != null) AttackedList.Add(c);

            c = field.GetCardAt(fieldPositions.FRONT_GUARD_RIGHT);
            if(c != null) AttackedList.Add(c);

            c = field.GetCardAt(fieldPositions.REAR_GUARD_LEFT);
            if(c != null) AttackedList.Add(c);

            c = field.GetCardAt(fieldPositions.REAR_GUARD_CENTER);
            if(c != null) AttackedList.Add(c);

            c = field.GetCardAt(fieldPositions.REAR_GUARD_RIGHT);
            if(c != null) AttackedList.Add(c);

            c = field.GetCardAt(fieldPositions.VANGUARD_CIRCLE);
            if(c != null) AttackedList.Add(c);

            CardToAttack = AttackedList[0];
            CurAttackedListIndex = 0;
            TargetCard(CardToAttack);

            CardAttacking = enemyField.GetCardAt((EnemyFieldPosition)other1);
            bShowAttackPowerWindow = true;
            bShowDefensePowerWindow = true;

            BeginGuardPhase();

            gamePhase = GamePhase.GUARD;
        }
        else if(_gameAction == GameAction.ALL_FRONT)
        {
            AttackedList.Clear();

            Card c = field.GetCardAt(fieldPositions.FRONT_GUARD_LEFT);
            if(c != null) AttackedList.Add(c);

            c = field.GetCardAt(fieldPositions.FRONT_GUARD_RIGHT);
            if(c != null) AttackedList.Add(c);

            c = field.GetCardAt(fieldPositions.VANGUARD_CIRCLE);
            if(c != null) AttackedList.Add(c);

            CardToAttack = AttackedList[0];
            CurAttackedListIndex = 0;
            TargetCard(CardToAttack);

            CardAttacking = enemyField.GetCardAt((EnemyFieldPosition)other1);
            bShowAttackPowerWindow = true;
            bShowDefensePowerWindow = true;

            BeginGuardPhase();

            gamePhase = GamePhase.GUARD;
        }
        else if(_gameAction == GameAction.FROM_DAMAGE_TO_DROP)
        {
            Card c = enemyField.GetDamageAtIndex(other1);
            enemyField.RemoveFromDamage(c);
            enemyField.AddToDropZone(c, false);
        }
        else if(_gameAction == GameAction.FROM_DAMAGE_TO_SOUL)
        {
            Card tempCard = enemyField.GetDamageAtIndex(other1);
            enemyField.RemoveFromDamage(tempCard);
            enemyField.AddToSoul(tempCard);
            tempCard.TurnUp();
            tempCard.SetRotation(0,0,0);
            Vector3 newPosition = EnemyFieldInfo.GetPosition((int)EnemyFieldPosition.VANGUARD) + new Vector3(0.0f, -0.002f, 0.0f);
            tempCard.GoTo (newPosition.x, newPosition.y, newPosition.z);
        }
        else if(_gameAction == GameAction.ADD_TO_GUARDZONE)
        {
            Card tempCard = enemyHand.RemoveFromHand();
            Data.FillCardWithData(tempCard, _cardID);
            guardZone.AddToGuardZone(tempCard, false);
            CardToAttack.AddExtraShield(tempCard.shield);
        }
        else if(_gameAction == GameAction.FROM_SOUL_TO_GC)
        {
            Card tempCard = enemyField.GetCardFromSoulByID(_cardID);
            enemyField.RemoveFromSoul(tempCard);
            guardZone.AddToGuardZone(tempCard, false);
            CardToAttack.AddExtraShield(tempCard.shield);
        }
        else if(_gameAction == GameAction.END_ATTACK)
        {
            CardSelector.transform.position = new Vector3(0.0f, 100.0f, 0.0f);
            bShowAttackPowerWindow = false;
            bShowDefensePowerWindow = false;
            bAttacking = false;
            guardZone.CleanGuardZone(enemyField);
            bDoAttackOnce = true;
            bBlockGuardEndBattle = false;
        }
        else if(_gameAction == GameAction.ADD_TO_DAMAGEZONE)
        {
            Card tmpCard = enemyDeck.DrawCard();
            Data.FillCardWithData(tmpCard, _cardID);
            enemyField.AddToDamageZone(tmpCard);
        }
        else if(_gameAction == GameAction.SURRENDER)
        {
            bGameEnded = true;
            bSurrender = false;
            bOpponentSurrender = true;
        }
        else if(_gameAction == GameAction.FROM_DAMAGE_TO_DECK)
        {
            Card c = enemyField.GetDamageAtIndex(other1);
            enemyField.RemoveFromDamage(c);
            enemyDeck.AddCard(c);
            enemyDeck.SetDeckPosition();
            //c.TurnUp();
        }
        else if(_gameAction == GameAction.END_TURN)
        {
            bBlockInterceptUntilEndTurn = false;

            enemyField.ResetPowers();
            enemyField.ResetTurnPowers();
            field.ResetPowers();
            field.ResetTurnPowers();
            gamePhase = GamePhase.DRAW;
            field.DoStandPhase();
            SendPacket(GameAction.STAND_ALL_UNITS);
            numTurn++;
        }
        else if(_gameAction == GameAction.FROM_BIND_TO_HAND)
        {
            Card c = enemyField.GetCardFromBindByID(_cardID);
            if(c != null)
            {
                enemyField.RemoveFromBindZone(c);
                enemyHand.AddToHand(c);
            }
        }
        else if(_gameAction == GameAction.POWER_INCREASE)
        {
            enemyField.GetCardAt((EnemyFieldPosition)other1).IncreasePower(other2);
        }
        else if(_gameAction == GameAction.CAN_BE_RETIRED)
        {
            if(other2 == 0)
            {
                enemyField.GetCardAt((EnemyFieldPosition)other1).bCanBeRetireByEffects = false;
            }
            else
            {
                enemyField.GetCardAt((EnemyFieldPosition)other1).bCanBeRetireByEffects = true;
            }

        }
        else if(_gameAction == GameAction.FLIPDOWN)
        {
            Card c = enemyField.GetDamageAtIndex(other1);
            if(c != null)
            {
                c.TurnDown();
            }
        }
        else if(_gameAction == GameAction.FLIPUP)
        {
            Card c = enemyField.GetDamageAtIndex(other1);
            if(c != null)
            {
                c.TurnUp();
            }
        }
        else if(_gameAction == GameAction.INCREASE_POWER_END_TURN)
        {
            enemyField.GetCardAt((EnemyFieldPosition)other1).IncreasePowerUntilEndTurn(other2);
        }
        else if(_gameAction == GameAction.INCREASE_CRITICAL_END_TURN)
        {
            enemyField.GetCardAt((EnemyFieldPosition)other1).IncreaseCriticalUntilEndTurn(other2);
        }
        else if(_gameAction == GameAction.STAND_ALL_UNITS)
        {
            //enemyField.StandAllUnits();
            enemyField.DoStandPhase();
        }
        else if(_gameAction == GameAction.SEND_TO_DROPZONE)
        {
            enemyField.AddToDropZone(enemyField.GetCardAt((EnemyFieldPosition)other1), true);
            enemyField.ClearZone((EnemyFieldPosition)other1);
        }
        else if(_gameAction == GameAction.SELECT_ANIM_DAMAGE)
        {
            enemyField.GetDamageAtIndex(other1).DoSelectAnim();
        }
        else if(_gameAction == GameAction.DRIVE_CHECK)
        {
            if(field.GetCardAt(fieldPositions.VANGUARD_CIRCLE).hasTwinDrive())
            {
                bTwinDrive = true;
            }
            else
            {
                bTwinDrive = false;
            }
            DriveCheck();
        }
        else if(_gameAction == GameAction.PUT_CARD_ON_DRIVEZONE)
        {
            DriveCard = enemyDeck.DrawCard();
            if(DriveCard != null)
            {
                Data.FillCardWithData(DriveCard, _cardID);
                DriveCard.GetGameObject().transform.position = EnemyFieldInfo.GetPosition((int)EnemyFieldPosition.DRIVE);
                DriveCard.GetGameObject().transform.eulerAngles = EnemyFieldInfo.GetDriveRotation();
                DriveCard.TurnUp();
            }
        }
        else if(_gameAction == GameAction.SEND_DRIVE_TO_HAND)
        {
            if(DriveCard != null)
            {
                enemyHand.AddToHand(DriveCard);
                DriveCard = null;
            }
        }
        else if(_gameAction == GameAction.END_DRIVECHECK)
        {
            for(int i = 0; i < AttackedList.Count - 1; i++)
            {
                ResolveBattle(AttackedList[i]);
            }

            ResolveLastBattle(AttackedList[AttackedList.Count - 1]);
        }
        else if(_gameAction == GameAction.STAND_UNIT)
        {
            enemyField.GetCardAt((EnemyFieldPosition)other1).StandEnemy();
        }
        else if(_gameAction == GameAction.REST_ENEMY_UNIT)
        {
            fieldPositions p = Util.TransformToPlayerField((fieldPositions)other1);
            Card c = field.GetCardAt(p);
            if(c != null)
            {
                c.Rest();
            }
        }
        else if(_gameAction == GameAction.CRITICAL_INCREASE)
        {
            enemyField.GetCardAt((EnemyFieldPosition)other1).IncreaseCritical(other2);
        }
        else if(_gameAction == GameAction.END_BATTLE)
        {
            Card temp = field.GetCardAt(Util.TransformToPlayerField((fieldPositions)(other1)));
            temp.ResetPower();
            temp.IsBoostedBy = null;
            field.CheckAbilitiesBind(CardState.BindZone_EndBattle);
            temp.CheckAbilities(CardState.EndBattle);
            field.CheckAbilitiesExcept(temp.pos, CardState.EndBattle_NotMe, temp);
            bBlockGuardEndBattle = false;
            bMinGuardGradeBlocked = 0;
            bMaxGuardGradeBlocked = 99;
            bDoPerfectGuardPerBattle = false;
            bBlockInterceptUntilEndBattle = false;
            CardToAttack.ResetPower();
            field.CheckAbilities(CardState.ClearEndBattleVariables);
        }
        else if(_gameAction == GameAction.FROM_DROP_TO_DECK)
        {
            DD_Card = enemyField.GetDropByID(_cardID);
            Vector3 newPos = EnemyFieldInfo.GetPosition((int)EnemyFieldPosition.DECK);
            DD_Card.GoTo(newPos.x, newPos.z);
        }
        else if(_gameAction == GameAction.HEAL_TRIGGER)
        {
            enemyField.AddToDropZone(enemyField.RemoveFromDamage(), false);
        }
        else if(_gameAction == GameAction.ADD_CARD_TO_ABILITYSTACK)
        {
            //Description: When an enemy ability is resolved during your turn. The enemy effect
            //will be added to the Stack Ability and it will be performed like any normal ability does.
            //The game will be paused for current player and enemy will take the control.
            fieldPositions p = Util.TransformToPlayerField((fieldPositions)other1);
            EnemyTurnStackedCards.Add(field.GetCardAt(p));
        }
        else if(_gameAction == GameAction.CLEAR_ZONE)
        {
            enemyField.ClearZone((EnemyFieldPosition)other1);
        }
        else if(_gameAction == GameAction.INTERCEPT)
        {
            Card c = enemyField.GetCardAt((EnemyFieldPosition)other1);
            guardZone.AddToGuardZone(enemyField.GetCardAt((EnemyFieldPosition)other1), true);
            CardToAttack.AddExtraShield(c.shield);
        }
        else if(_gameAction == GameAction.SHOW_CARD)
        {
            ShowCardEffect(Resources.Load ("CardHelper/" + Data.GetCardInfo(_cardID).clan + "/" + Data.GetImageName(_cardID)) as Texture2D);
        }
        else if(_gameAction == GameAction.FLIPDAMAGE)
        {
            enemyField.FlipDamageZoneCard();
        }
        else if(_gameAction == GameAction.UNFLIPDAMAGE)
        {
            enemyField.UnflipDamageZoneCard();
        }
        else if(_gameAction == GameAction.ENEMY_REMOVE_FROM_GUARDIAN)
        {
            guardZone.Remove(guardZone.cards[other1], true);
        }
        else if(_gameAction == GameAction.SEND_TO_DROPZONE_ALLY)
        {
            fieldPositions tmpPos = (fieldPositions)other1;
            Card card = field.GetCardAt(Util.TransformToPlayerField(tmpPos));

            Debug.Log("Send to drop zone ally event");
            if(!card.IsVanguard())
            {
                Debug.Log("Sent to dropzone: " + card.cardID);
                card.CheckAbilities(CardState.DropZoneFromRC);
            }

            field.AddToDropZone(field.GetCardAt(Util.TransformToPlayerField(tmpPos)));
            field.ClearZone(Util.TransformToPlayerField(tmpPos));
        }
        else if(_gameAction == GameAction.SEND_TO_BINDZONE_ALLY)
        {
            fieldPositions tmpPos = (fieldPositions)other1;
            Card card = field.GetCardAt(Util.TransformToPlayerField(tmpPos));
            field.AddToBindZone(field.GetCardAt(Util.TransformToPlayerField(tmpPos)));
            field.ClearZone(Util.TransformToPlayerField(tmpPos));
            card.BindAnim();
        }
        else if(_gameAction == GameAction.ENEMY_DISCARD)
        {
            Card tmpCard = enemyHand.RemoveFromHand();
            Data.FillCardWithData(tmpCard, _cardID);
            enemyField.AddToDropZone(tmpCard, false);
            tmpCard.TurnUp();
        }
        else if(_gameAction == GameAction.RETURN_FROM_HAND_TO_DECK)
        {
            Card tmpCard = enemyHand.RemoveFromHand();
            enemyDeck.AddCard(tmpCard);
            enemyDeck.SetDeckPosition();
        }
        else if(_gameAction == GameAction.FROM_HAND_TO_DECK)
        {
            Card tmpCard = enemyHand.RemoveFromHand(playerHand.Size() - other1 - 1);
            enemyDeck.AddCard(tmpCard);
            enemyDeck.SetDeckPosition();
        }
        else if(_gameAction == GameAction.DRAW_FROM_DECK_AND_SHOW)
        {
            Card tmpCard = enemyDeck.DrawCard();
            enemyHand.AddToHand(tmpCard);
            Data.FillCardWithData(tmpCard, _cardID);
            tmpCard.TurnUp();
            ShowingCardAtHandTimer = SHOW_CARD_FROM_HAND_DELAY;
            bIsCardAtHandShowing = true;
        }
        else if(_gameAction == GameAction.FROM_DAMAGE_TO_HAND)
        {
            Card c = enemyField.GetDamageAtIndex(other1);
            enemyField.RemoveFromDamage(c);
            enemyHand.AddToHand(c);
        }
        else if(_gameAction == GameAction.CARDSTATE_FROM_BIND_TO_HAND_END_TURN)
        {
            Card c = playerHand.GetCardAtIndex(playerHand.Size() - other1 - 1);
            if(c != null)
            {
                Debug.Log ("Adding Ability to " + c.cardID);

                c.unitAbilities.AddExternAuto(delegate(CardState cs, Card effectOwner) {
                    if(cs == CardState.EnemyEndTurn)
                    {
                        c.unitAbilities.FromBindToHand(c);
                    }
                });
            }
        }
        else if(_gameAction == GameAction.FROM_HAND_TO_DAMAGE)
        {
            Card c = enemyHand.GetCardAtIndex(enemyHand.Size() - other1 - 1);
            Data.FillCardWithData(c, _cardID);
            enemyHand.RemoveFromHand(c);
            enemyField.AddToDamageZone(c);
        }
        else if(_gameAction == GameAction.SHOW_CARD_HAND)
        {
            Card tmpCard = enemyHand.GetCardAtIndex(enemyHand.Size() - other1 - 1);
            Data.FillCardWithData(tmpCard, _cardID);
            tmpCard.TurnUp();
            ShowingCardAtHandTimer = SHOW_CARD_FROM_HAND_DELAY;
            bIsCardAtHandShowing = true;
        }
        else if(_gameAction == GameAction.ATTACK_HITS)
        {
            CardAttacking.CheckAbilities(CardState.AttackHits, CardAttacking);
            field.CheckAbilitiesExcept(CardAttacking.pos, CardState.AttackHits_NotMe, CardAttacking);
        }
        else if(_gameAction == GameAction.ADD_POWER_TO_GUARDZONE)
        {
            guardZone.AddExtraPower(other1);
        }
        else if(_gameAction == GameAction.RETURN_FROM_FIELD_TO_DECK)
        {
            Card tempCard = enemyField.GetCardAt((EnemyFieldPosition)other1);
            enemyField.RemoveFrom((EnemyFieldPosition)other1);
            tempCard.SetRotation(0,0,0);
            enemyDeck.ReturnToDeck(tempCard);
            ReturnToDeckCard = tempCard;
        }
        else if(_gameAction == GameAction.FROM_FIELD_TO_DAMAGE)
        {
            Card tempCard = enemyField.GetCardAt((EnemyFieldPosition)other1);
            enemyField.RemoveFrom((EnemyFieldPosition)other1);
            enemyField.AddToDamageZone(tempCard);
        }
        else if(_gameAction == GameAction.SOULCHARGE)
        {
            Card tempCard = enemyDeck.DrawCard();
            Data.FillCardWithData(tempCard, _cardID);
            enemyField.AddToSoul(tempCard);
            tempCard.TurnUp();
            tempCard.SetRotation(0,0,0);
            //Vector3 newPosition = fieldInfo.GetPosition((int)fieldPositions.VANGUARD_CIRCLE) + new Vector3(0.0f, -0.001f, 0.0f);
            Vector3 newPosition = EnemyFieldInfo.GetPosition((int)EnemyFieldPosition.VANGUARD) + new Vector3(0.0f, -0.002f, 0.0f);
            tempCard.GoTo (newPosition.x, newPosition.y, newPosition.z);

        }
        else if(_gameAction == GameAction.SOULBLAST)
        {
            EnemySoulBlastQueue.Add(enemyField.GetCardFromSoulByID(_cardID));
        }
        else if(_gameAction == GameAction.PERSISTENT_POWER)
        {
            fieldPositions pos = (fieldPositions)other1;

            Card temp = enemyField.GetCardAt(Util.TranformToEnemyPosition(pos));
            if(temp != null)
            {
                temp.SetPersistentPower(other2);
            }
        }
        else if(_gameAction == GameAction.RIDE_FROM_FIELD)
        {
            Card c = enemyField.GetCardAt(Util.TransformToEquivalentEnemyPosition((fieldPositions)other1));
            fieldPositions p = c.pos;
            enemyField.RemoveFrom(Util.TransformToEquivalentEnemyPosition(c.pos));
            enemyField.Ride(c);
            SendPacket (GameAction.RIDE_FROM_FIELD_OPP, p);
        }
        else if(_gameAction == GameAction.PERSISTENT_CRITICAL)
        {
            fieldPositions pos = (fieldPositions)other1;

            Card temp = enemyField.GetCardAt(Util.TranformToEnemyPosition(pos));
            if(temp != null)
            {
                temp.SetPersistentCritical(other2);
            }
        }
        else if(_gameAction == GameAction.HEAL_TRIGGER_SELECT)
        {
            Card c = enemyField.RemoveFromDamage(other1);
            enemyField.AddToDropZone(c, false);
        }
        else if(_gameAction == GameAction.PLAY_CARD_FROM_DECK)
        {
            Card tempCard = enemyDeck.DrawCard();
            Data.FillCardWithData(tempCard, _cardID);
            tempCard.TurnUp();
            enemyField.Call(tempCard, (EnemyFieldPosition)other1);
        }
        else if(_gameAction == GameAction.FROM_DECK_TO_DAMAGE)
        {
            Card c = enemyDeck.DrawCard();
            Data.FillCardWithData(c, _cardID);
            enemyField.AddToDamageZone(c);
            c.TurnDown();
        }
        else if(_gameAction == GameAction.FROM_DECK_TO_DAMAGE_FACEUP)
        {
            Card c = enemyDeck.DrawCard();
            Data.FillCardWithData(c, _cardID);
            enemyField.AddToDamageZone(c);
            c.TurnUp();
        }
        else if(_gameAction == GameAction.FROM_FIELD_TO_SOUL)
        {
            Card tempCard = enemyField.GetCardAt((EnemyFieldPosition)other1);

            enemyField.MoveToSoul(Util.TransformToEquivalentEnemyPosition(tempCard.pos));
            enemyField.AddToSoul(tempCard);
            enemyField.RemoveFrom(Util.TransformToEquivalentEnemyPosition(tempCard.pos));
        }
        else if(_gameAction == GameAction.PLAY_CARD_FROM_DROP)
        {

            Card tempCard = enemyField.GetDropByID(_cardID);
            if(tempCard != null)
            {
                enemyField.RemoveFromDropZone(tempCard);
                enemyField.Call(tempCard, Util.TranformToEnemyPosition((fieldPositions)other1));
            }
            else
            {
            }

        }
        else if(_gameAction == GameAction.CHECK_CARD_ABILITY)
        {
            Card c = EnemyTurnStackedCards[0];
            EnemyTurnStackedCards.RemoveAt(0);
            EffectOnGoingEnemyTurn = true;
            c.CheckAbilities((CardState)other1);
        }
        else if(_gameAction == GameAction.FIELD_FROM_DAMAGE)
        {
            Card c = enemyField.GetDamageAtIndex(other2);
            enemyField.RemoveFromDamage(c);
            enemyField.Call(c, Util.TranformToEnemyPosition((fieldPositions)other1));
        }
        else if(_gameAction == GameAction.BIND_HAND)
        {
            Card c = playerHand.GetCardAtIndex(playerHand.Size() - other1 - 1);
            if(c != null)
            {
                BindHand(c);
            }
        }
        else if(_gameAction == GameAction.RIDE_FROM_DECK)
        {
            Card tempCard = enemyDeck.DrawCard();
            Data.FillCardWithData(tempCard, _cardID);
            enemyField.Ride(tempCard);
        }
        else if(_gameAction == GameAction.RETURN_CARD_FROM_HAND_TO_DECK)
        {
            Card tempCard = enemyHand.RemoveFromHand();
            enemyDeck.AddCard(tempCard);
            enemyDeck.SetDeckPosition();
        }
        else if(_gameAction == GameAction.PERFECT_GUARD)
        {
            guardZone.ActivePerfectGuard();
            CardToAttack.PerfectGuard();
        }
        else if(_gameAction == GameAction.MOVE_ALLY)
        {
            EnemyFieldPosition pos = Util.TranformToEnemyPosition((fieldPositions)other1);
            Card temp = enemyField.GetCardAt(pos);
            enemyField.Move(temp);
        }
        else if(_gameAction == GameAction.NEGATE_ENEMY_STAND)
        {
            fieldPositions pos = Util.TransformToPlayerField((fieldPositions)other1);
            Card temp = field.GetCardAt(pos);
            temp.NegateStand();
        }
        else if(_gameAction == GameAction.ALLY_DISCARD)
        {
            bEffectOnGoing = true;
            GameChat.AddChatMessage("ADMIN", "ALLY_DISCARD");
            bDiscard = true;
            _GameHelper.CustomMessage("Choose a card from your hand and discard it.");
        }
        else if(_gameAction == GameAction.RIDE_FROM_DROP)
        {
            Card tempCard = enemyField.SearchInDropZone(_cardID);
            enemyField.RemoveFromDropZone(tempCard);
            enemyField.Ride(tempCard);
        }
        else if(_gameAction == GameAction.FROM_DROP_TO_SOUL)
        {
            Card tmp = enemyField.SearchInDropZone(_cardID);
            if(tmp != null)
            {
                enemyField.MoveToSoul(tmp);
                enemyField.RemoveFromDropZone(tmp);
            }
        }
        else if(_gameAction == GameAction.FROM_DECK_TO_DROP)
        {
            Card tmp = enemyDeck.DrawCard();
            Data.FillCardWithData(tmp, _cardID);
            tmp.TurnUp();
            tmp.SetRotation(0,0,0);
            enemyField.AddToDropZone(tmp, false);
        }
        else if(_gameAction == GameAction.BLOCK_INTERCEPT_UNTIL_ENDTURN)
        {
            bBlockInterceptUntilEndTurn = true;
        }
        else if(_gameAction == GameAction.BLOCK_INTERCEPT_UNTIL_ENDBATTLE)
        {
            bBlockInterceptUntilEndBattle = true;
        }
        else if(_gameAction == GameAction.PLAY_CARD_FROM_DRIVE)
        {
            enemyField.Call(DriveCard, (EnemyFieldPosition)other1);
            DriveCard = null;
        }
        else if(_gameAction == GameAction.RETURN_FROM_FIELD_TO_HAND)
        {
            fieldPositions pos = (fieldPositions)other1;
            EnemyFieldPosition enemyPos = Util.TranformToEnemyPosition(pos);
            Card c = enemyField.GetCardAt(enemyPos);
            enemyField.RemoveFrom(enemyPos);
            enemyHand.AddToHand(c);
        }
        else if(_gameAction == GameAction.ATTACK_NOT_HIT)
        {
            CardAttacking.CheckAbilities(CardState.AttackNotHit);
            field.CheckAbilitiesExcept(CardAttacking.pos, CardState.AttackNotHit_NotMe);
            field.CheckAbilitiesBind(CardState.BindZone_AttackNotHit);
        }
        else if(_gameAction == GameAction.INCREASE_ENEMY_POWER_BATTLE)
        {
            fieldPositions p = Util.TransformToPlayerField((fieldPositions)other1);
            Card c = field.GetCardAt(p);
            if(c != null)
            {
                c.IncreasePower(other2);
                SendPacket(GameAction.POWER_INCREASE, c.pos, other2);
            }
        }
        else if(_gameAction == GameAction.INCREASE_ENEMY_POWER_TURN)
        {
            fieldPositions p = Util.TransformToPlayerField((fieldPositions)other1);
            Card c = field.GetCardAt(p);
            if(c != null)
            {
                c.IncreasePowerUntilEndTurn(other2);
                SendPacket(GameAction.INCREASE_POWER_END_TURN, c.pos, other2);
            }
        }
        else if(_gameAction == GameAction.BOOST)
        {
            Card c = enemyField.GetCardAt(Util.TranformToEnemyPosition((fieldPositions)other1));
            if(c != null)
            {
                fieldPositions p = fieldPositions.DECK_ZONE;
                if(c.pos == fieldPositions.ENEMY_FRONT_LEFT)
                {
                    p = fieldPositions.ENEMY_REAR_LEFT;
                }

                if(c.pos == fieldPositions.ENEMY_FRONT_RIGHT)
                {
                    p = fieldPositions.ENEMY_REAR_RIGHT;
                }

                if(c.pos == fieldPositions.ENEMY_VANGUARD)
                {
                    p = fieldPositions.ENEMY_REAR_CENTER;
                }

                Card d = enemyField.GetCardAt(Util.TransformToEquivalentEnemyPosition(p));
                if(d != null)
                {
                    c.IsBoostedBy = d;
                }
            }
        }
        else if(_gameAction == GameAction.REQUEST_BOOT)
        {
            bEffectOnGoing = true;
            GameChat.AddChatMessage("ADMIN", "REQUEST_BOOT");
            if(CanBeBoosted(CardAttacking))
            {
                bBoostWindow = true;
            }
            else
            {
                BoostUnit();
            }
        }
        else if(_gameAction == GameAction.BEGIN_GUARD)
        {
            BeginGuardPhase();

            gamePhase = GamePhase.GUARD;
        }
        else if(_gameAction == GameAction.FROM_HAND_TO_SOUL)
        {
            Card c = enemyHand.GetCardAtIndex(other1);
            Data.FillCardWithData(c, _cardID);
            enemyHand.RemoveFromHand(c);
            enemyField.AddToBindZone(c);
            c.TurnUp();
            c.BindAnim();
            /*
            FromHandToSoulCard = c;
            Vector3 newPos = EnemyFieldInfo.GetPosition((int)EnemyFieldPosition.VANGUARD);
            c.SetRotation(0,0,0);
            c.GoTo(newPos.x, newPos.y, newPos.z);
            c.TurnUp();
            */
        }
        else if(_gameAction == GameAction.FROM_HAND_TO_SOUL)
        {
            Card c = enemyHand.GetCardAtIndex(other1);
            Data.FillCardWithData(c, _cardID);
            FromHandToSoulCard = c;
            Vector3 newPos = EnemyFieldInfo.GetPosition((int)EnemyFieldPosition.VANGUARD);
            c.SetRotation(0,0,0);
            c.GoTo(newPos.x, newPos.y, newPos.z);
            c.TurnUp();
        }
        else if(_gameAction == GameAction.REVEAL_TOP_CARD)
        {
            Card c = enemyDeck.TopCard();
            Data.FillCardWithData(c, _cardID);
            c.TurnUp();
        }
        else if(_gameAction == GameAction.HIDE_TOP_CARD)
        {
            enemyDeck.TopCard().TurnDown();
        }
        else if(_gameAction == GameAction.TARGET_CARD)
        {
            Card c = enemyField.GetCardAt(Util.TranformToEnemyPosition((fieldPositions)other1));
            c.IsTargetted(true);
            CardToAttack = c;
        }
        else if(_gameAction == GameAction.UNTARGET_CARD)
        {
            Card c = enemyField.GetCardAt(Util.TranformToEnemyPosition((fieldPositions)other1));
            if(c != null)
            {
                c.IsTargetted(false);
            }
        }
        else if(_gameAction == GameAction.RIDE_FROM_SOUL)
        {
            Card c = enemyField.GetCardFromSoulByID(_cardID);
            if(c != null)
            {
                enemyField.RemoveFromSoul(c);
                enemyField.Ride(c);
            }
        }
        else if(_gameAction == GameAction.SELECT_ANIM_FIELD)
        {
            Card c = enemyField.GetCardAt(Util.TranformToEnemyPosition((fieldPositions)other1));
            if(c != null)
            {
                c.DoSelectAnim();
            }
        }
        else if(_gameAction == GameAction.OPPONENT_CALL_FROM_TOP_DECK)
        {
            bEffectOnGoing = true;

            dummyUnitObject.SetBool(1);
            dummyUnitObject.GetDeck().ViewDeck(1, SearchMode.TOP_CARD, other1, delegate(Game2DCard c) {
                return c._CardInfo.grade >= other2 && c._CardInfo.grade <= other3;
            });
        }
        else if(_gameAction == GameAction.EVENT_END_BATTLE)
        {
            field.CheckAbilitiesEnemyTurn(CardState.EnemyBeginRide);
        }
        else if(_gameAction == GameAction.EVENT_BEGIN_RIDEPHASE)
        {
            field.CheckAbilitiesEnemyTurn(CardState.EnemyEndBattle);
        }
        else if(_gameAction == GameAction.EVENT_BEGIN_ENDTURN)
        {
            //field.CheckAbilities(CardState.EnemyEndTurn);
            field.CheckBindZoneAbilities(CardState.EnemyEndTurn);
            bEndEvent = true;
            //bEnemyWaiting = true;
        }
        else if(_gameAction == GameAction.DISPLAY_WINDOW)
        {
            bOpponentWindow = true;
            bOpponentWindowMessage = str1;
            bEffectOnGoing = true;
            GameChat.AddChatMessage("ADMIN", "DISPLAY_WINDOW");
        }
        else if(_gameAction == GameAction.PLAYER_ACCEPT)
        {
            LastOpponentWindow = OPPWINDOW.ACCEPT;
        }
        else if(_gameAction == GameAction.PLAYER_DENIED)
        {
            LastOpponentWindow = OPPWINDOW.DENIED;
        }
        else if(_gameAction == GameAction.BLOCK_NORMALRIDE)
        {
            bRideThisTurn = false;
            bEffectOnGoing = false;
        }
        else if(_gameAction == GameAction.RIDE_FROM_FIELD_OPP)
        {
            //Opponent performs a Ride on my field.
            Card c = field.GetCardAt(Util.TransformToPlayerField((fieldPositions)other1));
            if(c != null)
            {
                field.RemoveFrom(c.pos);
                field.Ride (c, false);
            }
        }
        else if(_gameAction == GameAction.OPPONENT_RIDE_FROM_SOUL)
        {
            field.ViewSoul(1);
            _OppRideFromSoulEvent = true;
        }
        else if(_gameAction == GameAction.OPPONENT_DRAW)
        {
            playerHand.AddToHand(playerDeck.DrawCard());
            SendPacket(GameAction.DRAW_FROM_DECK, 1);
            bEffectOnGoing = false;
            bEndEvent = true;
        }
        else if(_gameAction == GameAction.END_EVENT)
        {
            //bEffectOnGoing = false;
            if(ownerCardCallEvent != null)
            {
                ownerCardCallEvent.unitAbilities.EndEvent(other1);
                ownerCardCallEvent = null;
            }
            else
            {
                bEffectOnGoing = false;
            }
        }
        else if(_gameAction == GameAction.OPPONENT_RETIRE_UNIT)
        {
            _OppRetireUnitEvent = true;
            _GameHelper.CustomMessage("Choose one of your rear-guards, and retire it");
            GameChat.SetTab(ChatTab.HELP);
        }
        else if(_gameAction == GameAction.MESSAGE)
        {
            GameChat.AddHelpMessage(str1);
        }
    }
Ejemplo n.º 11
0
    public void Call(Card card, EnemyFieldPosition pos)
    {
        card.pos = (fieldPositions)((int)pos + 9);

        card._Coord = CardCoord.ENEMY_FIELD;

        card.TurnUp();

        Vector3 newPosition, newAngle;

        if(pos == EnemyFieldPosition.FRONT_LEFT)
        {
            if(Left_Front != null)
            {
                AddToDropZone(RemoveFrom(pos), false);
            }

            Left_Front = card;
            //Left_Front.GetGameObject().transform.position    = fieldInfo.GetPosition((int)pos);
            //Left_Front.GetGameObject().transform.eulerAngles = fieldInfo.GetCardRotation();
            FrontLeftPower.text = card.GetPower() + "";
        }
        else if(pos == EnemyFieldPosition.FRONT_RIGHT)
        {
            if(Right_Front != null)
            {
                Debug.Log("Adding to DropZone");
                AddToDropZone(RemoveFrom(pos), false);
            }

            Right_Front = card;
            //Right_Front.GetGameObject().transform.position    = fieldInfo.GetPosition((int)pos);
            //Right_Front.GetGameObject().transform.eulerAngles = fieldInfo.GetCardRotation();
            FrontRightPower.text = card.GetPower() + "";
        }
        else if(pos == EnemyFieldPosition.REAR_CENTER)
        {
            if(Center_Rear != null)
                AddToDropZone(RemoveFrom(pos), false);

            Center_Rear = card;
            //Center_Rear.GetGameObject().transform.position    = fieldInfo.GetPosition((int)pos);
            //Center_Rear.GetGameObject().transform.eulerAngles = fieldInfo.GetCardRotation();
            RearCenterPower.text = card.GetPower() + "";
        }
        else if(pos == EnemyFieldPosition.REAR_LEFT)
        {
            if(Left_Rear != null)
                AddToDropZone(RemoveFrom(pos), false);

            Left_Rear = card;
            //Left_Rear.GetGameObject().transform.position    = fieldInfo.GetPosition((int)pos);
            //Left_Rear.GetGameObject().transform.eulerAngles = fieldInfo.GetCardRotation();
            RearLeftPower.text = card.GetPower() + "";
        }
        else if(pos == EnemyFieldPosition.REAR_RIGHT)
        {
            if(Right_Rear != null)
                AddToDropZone(RemoveFrom(pos), false);

            Right_Rear = card;
            //Right_Rear.GetGameObject().transform.position    = fieldInfo.GetPosition((int)pos);
            //Right_Rear.GetGameObject().transform.eulerAngles = fieldInfo.GetCardRotation();
            RearRightPower.text = card.GetPower() + "";
        }

        newPosition = fieldInfo.GetPosition((int)pos);
        newAngle    = fieldInfo.GetCardRotation();

        card.MoveAndRotate(newPosition, newAngle);
        CallAnimation(card, newPosition);
    }
Ejemplo n.º 12
0
    public void AddToDropZone(Card card, bool bFromField)
    {
        DropZone.Add(card);
        card.TurnUp();
        card.StandEnemy();
        //card.GetGameObject().transform.position = fieldInfo.GetPosition((int)fieldPositions.DROP_ZONE) + new Vector3(0.0f, 0.01f * (DropZone.Count - 1), 0.0f);
        //card.GetGameObject().transform.eulerAngles = new Vector3(0.0f, 0.0f, 0.0f);

        card.MoveAndRotate(fieldInfo.GetPosition((int)fieldPositions.DROP_ZONE) + new Vector3(0.0f, 0.01f * (DropZone.Count - 1), 0.0f),
                           new Vector3(0.0f, 0.0f, 0.0f));

        if(bFromField)
        {
            //Game.playerHand.CheckHandEffects(CardState.EnemyCardSendToDropZone);
            //Game.field.CheckAbilities(CardState.EnemyCardSendToDropZone);
        }
    }
Ejemplo n.º 13
0
    public void AddToDamageZone(Card card)
    {
        card._Coord = CardCoord.ENEMY_DAMAGE;
        DamageZone.Add(card);
        card.TurnUp();

        Vector3 newPosition = new Vector3(15.70469f, 0.7570782f, 5.772846f) + new Vector3(0.0f, 0.01f * (DamageZone.Count - 1), 2.0f * (DamageZone.Count - 1));
        Vector3 newAngle    = new Vector3(0.0f, -90.0f, 0.0f);

        card.MoveAndRotate(newPosition, newAngle);

        //card.GetGameObject().transform.position = new Vector3(15.70469f, 0.7570782f, 5.772846f) + new Vector3(0.0f, 0.01f * (DamageZone.Count - 1), 2.0f * (DamageZone.Count - 1));
        //card.GetGameObject().transform.eulerAngles = new Vector3(0.0f, -90.0f, 0.0f);
    }
Ejemplo n.º 14
0
 public void CallFromDeckUpdate(Void0ParamsDelegate func)
 {
     if(_CFDAux_Bool1)
     {
         if(Game._MouseHelper.GetAttachedCard() == null)
         {
             if(_CFDAux_Int1 <= 0)
             {
                 _CFDAux_Bool1 = false;
                 func();
             }
             else
             {
                 _CFDAux_Card = Game.playerDeck.SearchForID(_CFDAux_IDVector[0]);
                 CallFromDeckList.Add(Game.playerDeck.SearchForID(_CFDAux_IDVector[0]));
                 _CFDAux_IDVector.RemoveAt(0);
                 Game.playerDeck.RemoveFromDeck(_CFDAux_Card);
                 Game.CallFromDeck(_CFDAux_Card);
                 _CFDAux_Card.TurnUp();
                 _CFDAux_Int1--;
             }
         }
         else
         {
             Game.HandleCallFromDeck();
         }
     }
 }
Ejemplo n.º 15
0
    public void RideFromDeck(Card card)
    {
        card.TurnUp();
        playerDeck.RemoveFromDeck(card);

        SendPacket(GameAction.RIDE_FROM_DECK, card.cardID);
        field.Ride(card);
    }
Ejemplo n.º 16
0
 public void FlipupCard(Card c)
 {
     c.TurnUp();
     Game.SendPacket(GameAction.FLIPUP, Game.field.GetDamageIndexOf(c));
 }
Ejemplo n.º 17
0
    public void AddToDamageZone(Card card)
    {
        card._Coord = CardCoord.DAMAGE;
        DamageZone.Add(card);
        card.TurnUp();
        /*
        card.GetGameObject().transform.position = new Vector3(-16.16396f, 0.5685959f, -5.766267f);
        card.GetGameObject().transform.position += new Vector3(0.0f, 0.01f * (DamageZone.Count - 1), -2.0f * (DamageZone.Count - 1));
        card.GetGameObject().transform.eulerAngles = new Vector3(0.0f, 90.0f, 0.0f);
        */

        Vector3 newPosition = new Vector3(-16.16396f, 0.5685959f, -5.766267f) + new Vector3(0.0f, 0.01f * (DamageZone.Count - 1), -2.0f * (DamageZone.Count - 1));
        Vector3 newAngle    = new Vector3(0.0f, 90.0f, 0.0f);

        card.MoveAndRotate(newPosition, newAngle);

        CheckAbilities(CardState.CardPutInDamage, card);
        CheckAbilitiesDamage(CardState.DamageZone_CardPutInDamage, card);
    }