Exemplo n.º 1
0
    private void CheckPosition(fieldPositions _pos)
    {
        Vector3 pos = _Camera.WorldToScreenPoint(_FieldInfo.GetPosition((int)_pos));
        float _x = pos.x;
        float _y = Camera.main.pixelHeight - pos.y;

        if(Util.MouseOn(_x - 40.0f, _y - 40, 80.0f, 140.0f, Input.mousePosition))
        {
            _CardAttached.GetGameObject().transform.position = _FieldInfo.GetPosition((int)_pos);
            _CardAttached.pos = _pos;
        }
    }
Exemplo n.º 2
0
    public void ActiveLockEffect(fieldPositions pos)
    {
        Debug.Log("" + pos);

        Vector3 newVector = new Vector3(0.0f, 0.0f, 0.0f);

        if(pos == fieldPositions.FRONT_GUARD_LEFT)       newVector = new Vector3(-25.30901f, -19.16035f, -13.45249f);
        else if(pos == fieldPositions.VANGUARD_CIRCLE)   newVector = new Vector3(-16.44314f, -19.1047f, -13.18696f);
        else if(pos == fieldPositions.FRONT_GUARD_RIGHT) newVector = new Vector3(-7.641356f, -19.1047f, -13.18696f);
        else if(pos == fieldPositions.REAR_GUARD_CENTER) newVector = new Vector3(-16.42526f, -19.1047f, -22.72871f);
        else if(pos == fieldPositions.REAR_GUARD_LEFT)   newVector = new Vector3(-25.23825f, -19.1047f, -22.72871f);
        else if(pos == fieldPositions.REAR_GUARD_RIGHT)  newVector = new Vector3(-7.890007f, -19.1047f, -22.75553f);
        else if(pos == fieldPositions.ENEMY_FRONT_LEFT)  newVector = new Vector3(-7.404234f, -19.1047f, 5.36107f);
        else if(pos == fieldPositions.ENEMY_VANGUARD)    newVector = new Vector3(-16.44624f, -19.1047f, 5.36107f);
        else if(pos == fieldPositions.ENEMY_REAR_CENTER) newVector = new Vector3(-16.44624f, -19.1047f, 14.68424f);
        else if(pos == fieldPositions.ENEMY_REAR_LEFT)   newVector = new Vector3(-7.624998f, -19.1047f, 14.91637f);
        else if(pos == fieldPositions.ENEMY_REAR_RIGHT)  newVector = new Vector3(-25.14756f, -19.1047f, 14.91637f);
        else if(pos == fieldPositions.ENEMY_FRONT_RIGHT) newVector = new Vector3(-25.14756f, -19.1047f, 5.720847f);

        lockObject = (Transform)Instantiate(lockEffect, newVector, Quaternion.identity);
    }
Exemplo n.º 3
0
    public static bool CheckPosition(fieldPositions _pos)
    {
        Camera _Camera = (Camera)GameObject.FindGameObjectWithTag("MainCamera").GetComponent("Camera");
        Vector3 pos;

        if(!Util.IsEnemyPosition(_pos))
        {
            pos = _Camera.WorldToScreenPoint(Gameplay.fieldInfo.GetPosition((int)_pos));
        }
        else
        {
            pos = _Camera.WorldToScreenPoint(Gameplay.EnemyFieldInfo.GetPosition((int)Util.TransformToEquivalentEnemyPosition(_pos)));
        }

        float _x = pos.x;
        float _y = Camera.main.pixelHeight - pos.y;

        if(Util.MouseOn(_x - 40.0f, _y - 80, 80.0f, 120, Input.mousePosition))
        {
            return true;
        }

        return false;
    }
Exemplo n.º 4
0
 /**
  * Returns true if the RC or VC is blocked. False otherwise.
  */
 public bool IsBlocked(fieldPositions p)
 {
     return _AuxBool20Array[(int)p];
 }
Exemplo n.º 5
0
 public void MoveToSoul(fieldPositions pos)
 {
     Card CardToMove = null;
     CardToMove = GetCardAt(pos);
     AddToSoul(CardToMove);
     Vector3 newPosition = fieldInfo.GetPosition((int)fieldPositions.VANGUARD_CIRCLE) + new Vector3(0, -0.01f, 0);
     CardToMove.GoTo(newPosition.x, newPosition.z);
 }
Exemplo n.º 6
0
    public void MoveToOpenRC(Card c, fieldPositions p)
    {
        Game.SendPacket(GameAction.MOVE_TO_OPENRC, (int)c.pos, (int)p, 0);
        Game.field.ClearZone(c.pos);

        c.pos = p;

        if(p == fieldPositions.FRONT_GUARD_LEFT) Game.field.Left_Front = c;
        else if(p == fieldPositions.FRONT_GUARD_RIGHT) Game.field.Right_Front = c;
        else if(p == fieldPositions.REAR_GUARD_CENTER) Game.field.Center_Rear = c;
        else if(p == fieldPositions.REAR_GUARD_RIGHT) Game.field.Right_Rear = c;
        else if(p == fieldPositions.REAR_GUARD_LEFT)  Game.field.Left_Rear = c;

        Vector3 newVector = Game.field.fieldInfo.GetPosition((int)p);
        c.GoTo(newVector.x, newVector.z);
    }
Exemplo n.º 7
0
 public fieldPositions GetSameColumPosition(fieldPositions p)
 {
     if(p == fieldPositions.VANGUARD_CIRCLE)   return fieldPositions.REAR_GUARD_CENTER;
     if(p == fieldPositions.FRONT_GUARD_LEFT)  return fieldPositions.REAR_GUARD_LEFT;
     if(p == fieldPositions.FRONT_GUARD_RIGHT) return fieldPositions.REAR_GUARD_RIGHT;
     if(p == fieldPositions.REAR_GUARD_LEFT)   return fieldPositions.FRONT_GUARD_LEFT;
     if(p == fieldPositions.REAR_GUARD_RIGHT)  return fieldPositions.FRONT_GUARD_RIGHT;
     if(p == fieldPositions.REAR_GUARD_CENTER) return fieldPositions.VANGUARD_CIRCLE;
     return fieldPositions.DECK_ZONE;
 }
Exemplo n.º 8
0
 public Card GetCardAt(fieldPositions p)
 {
     return Game.field.GetCardAt(p);
 }
Exemplo n.º 9
0
    public bool ExistsBackUnitSameColumn(fieldPositions pos)
    {
        if(pos == fieldPositions.VANGUARD_CIRCLE)
        {
            return (Game.enemyField.Center_Rear != null);
        }

        if(pos == fieldPositions.FRONT_GUARD_LEFT)
        {
            return (Game.enemyField.Right_Rear != null);
        }

        if(pos == fieldPositions.FRONT_GUARD_RIGHT)
        {
            return (Game.enemyField.Left_Rear != null);
        }

        return false;
    }
Exemplo n.º 10
0
 bool IsPlayerPosition(fieldPositions p)
 {
     return IsRearGuard(p) || p == fieldPositions.VANGUARD_CIRCLE;
 }
Exemplo n.º 11
0
 public void SendPacket(GameAction action, fieldPositions pos, int num, string str)
 {
     if(PlayerVariables.bPlayingOnServer)
     {
         networkView.RPC("SendInformationToOpponent_Server", RPCMode.Server, 0, (int)action, (int)pos, num, str, 0, Network.player);
     }
     else
     {
         networkView.RPC("SendInformationToOpponent", opponent, 0, (int)action, (int)pos, num, str, 0);
     }
 }
Exemplo n.º 12
0
 public void SendPacket(GameAction action, CardIdentifier cardID, fieldPositions pos)
 {
     if(PlayerVariables.bPlayingOnServer)
     {
         networkView.RPC("SendInformationToOpponent_Server", RPCMode.Server, (int)cardID, (int)action, (int)pos, 0, "", 0, Network.player);
     }
     else
     {
         networkView.RPC("SendInformationToOpponent", opponent, (int)cardID, (int)action, (int)pos, 0, "", 0);
     }
 }
Exemplo n.º 13
0
 public Card GetCardAt(fieldPositions pos)
 {
     if(pos == fieldPositions.FRONT_GUARD_LEFT) return Left_Front;
     else if(pos == fieldPositions.FRONT_GUARD_RIGHT) return Right_Front;
     else if(pos == fieldPositions.REAR_GUARD_CENTER) return Center_Rear;
     else if(pos == fieldPositions.REAR_GUARD_LEFT) return Left_Rear;
     else if(pos == fieldPositions.REAR_GUARD_RIGHT) return Right_Rear;
     else if(pos == fieldPositions.VANGUARD_CIRCLE)  return Vanguard;
     else return null;
 }
Exemplo n.º 14
0
    public void ClearZone(fieldPositions pos)
    {
        if(pos == fieldPositions.FRONT_GUARD_LEFT)
            Left_Front = null;

        if(pos == fieldPositions.FRONT_GUARD_RIGHT)
            Right_Front = null;

        if(pos == fieldPositions.REAR_GUARD_CENTER)
        {
            Center_Rear = null;
        }

        if(pos == fieldPositions.REAR_GUARD_RIGHT)
        {
            Right_Rear = null;
        }

        if(pos == fieldPositions.REAR_GUARD_LEFT)
        {
            Left_Rear = null;
        }
    }
Exemplo n.º 15
0
    public void CheckAbilitiesExcept(fieldPositions pos, CardState cs, Card effectOwner = null)
    {
        if(Vanguard != null && pos != fieldPositions.VANGUARD_CIRCLE)
        {
            Vanguard.CheckAbilities(cs, effectOwner);
        }

        if(Left_Front != null && pos != fieldPositions.FRONT_GUARD_LEFT)
        {
            Left_Front.CheckAbilities(cs, effectOwner);
        }

        if(Right_Front != null && pos != fieldPositions.FRONT_GUARD_RIGHT)
        {
            Right_Front.CheckAbilities(cs, effectOwner);
        }

        if(Center_Rear != null && pos != fieldPositions.REAR_GUARD_CENTER)
        {
            Center_Rear.CheckAbilities(cs, effectOwner);
        }

        if(Left_Rear != null && pos != fieldPositions.REAR_GUARD_LEFT)
        {
            Left_Rear.CheckAbilities(cs, effectOwner);
        }

        if(Right_Rear != null && pos != fieldPositions.REAR_GUARD_RIGHT)
        {
            Right_Rear.CheckAbilities(cs, effectOwner);
        }
    }
Exemplo n.º 16
0
    public void Call(Card card, fieldPositions pos)
    {
        _Game.SendGameChatMessage(card.name + ", Call!", ChatTab.GAME);
        _Game.UnitsCalled.Add(card);
        _Game.LastCall = card;

        //Reseting current status.
        ResetCard(card);

        card._Coord = CardCoord.FIELD;
        card.pos = pos;

        if(pos == fieldPositions.FRONT_GUARD_LEFT)
        {
            if(Left_Front != null)
            {
                AddToDropZone(RemoveFrom(pos));
            }

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

            Right_Front = card;
            Right_Front.GetGameObject().transform.position    = fieldInfo.GetPosition((int)fieldPositions.FRONT_GUARD_RIGHT);
            Right_Front.GetGameObject().transform.eulerAngles = fieldInfo.GetCardRotation();
            FrontRightPower.text = card.GetPower() + "";
        }
        else if(pos == fieldPositions.REAR_GUARD_CENTER)
        {
            if(Center_Rear != null)
                AddToDropZone(RemoveFrom(pos));

            Center_Rear = card;
            Center_Rear.GetGameObject().transform.position    = fieldInfo.GetPosition((int)fieldPositions.REAR_GUARD_CENTER);
            Center_Rear.GetGameObject().transform.eulerAngles = fieldInfo.GetCardRotation();
            RearCenterPower.text = card.GetPower() + "";
        }
        else if(pos == fieldPositions.REAR_GUARD_LEFT)
        {
            if(Left_Rear != null)
                AddToDropZone(RemoveFrom(pos));

            Left_Rear = card;
            Left_Rear.GetGameObject().transform.position    = fieldInfo.GetPosition((int)fieldPositions.REAR_GUARD_LEFT);
            Left_Rear.GetGameObject().transform.eulerAngles = fieldInfo.GetCardRotation();
            RearLeftPower.text = card.GetPower() + "";
        }
        else if(pos == fieldPositions.REAR_GUARD_RIGHT)
        {
            if(Right_Rear != null)
                AddToDropZone(RemoveFrom(pos));

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

        card.CheckAbilities(CardState.Call);
        LastUnitCalled = card;
        CheckAbilities(CardState.Call_NotMe, card);

        CallAnimation(card);
    }
Exemplo n.º 17
0
    public Card RemoveFrom(fieldPositions pos)
    {
        Card CardToReturn = null;

        if(pos == fieldPositions.FRONT_GUARD_LEFT)
        {
            CardToReturn = Left_Front;
            Left_Front = null;
        }
        else if(pos == fieldPositions.FRONT_GUARD_RIGHT)
        {
            CardToReturn = Right_Front;
            Right_Front = null;
        }
        else if(pos == fieldPositions.REAR_GUARD_CENTER)
        {
            CardToReturn = Center_Rear;
            Center_Rear = null;
        }
        else if(pos == fieldPositions.REAR_GUARD_LEFT)
        {
            CardToReturn = Left_Rear;
            Left_Rear = null;
        }
        else if(pos == fieldPositions.REAR_GUARD_RIGHT)
        {
            CardToReturn = Right_Rear;
            Right_Rear = null;
        }

        return CardToReturn;
    }
Exemplo n.º 18
0
 /**
  * Unblock a RC or VC, don't use this function. Use UnblockAllZones instead.
  */
 public void Unblock(fieldPositions p)
 {
     _AuxBool20Array[(int)p] = false;
 }
Exemplo n.º 19
0
 /**
  * Block a RC or VC, to see if a zone is blocked or not, use IsBlocked()
  */
 public void Block(fieldPositions p)
 {
     _AuxBool20Array[(int)p] = true;
 }
Exemplo n.º 20
0
 fieldPositions BackRow(fieldPositions p)
 {
     if(p == fieldPositions.VANGUARD_CIRCLE)   return fieldPositions.REAR_GUARD_CENTER;
     if(p == fieldPositions.FRONT_GUARD_LEFT)  return fieldPositions.REAR_GUARD_LEFT;
     if(p == fieldPositions.FRONT_GUARD_RIGHT) return fieldPositions.REAR_GUARD_RIGHT;
     return fieldPositions.DECK_ZONE;
 }
Exemplo n.º 21
0
 public void CallFromDrop(Card card, fieldPositions p)
 {
     Game.CallFromDrop(card, p);
 }
Exemplo n.º 22
0
    public void CallFromDeck_SameColum(Card card, fieldPositions p)
    {
        _MouseHelper.AttachCard(card);
        card.TurnUp();
        bCallFromDeck = true;
        bCardMenuJustClosed = false;

        bCallToSameColum = true;
        bCallSameColPos = p;
    }
Exemplo n.º 23
0
    public Card GetBackUnitSameColumn(fieldPositions pos)
    {
        if(pos == fieldPositions.VANGUARD_CIRCLE)
        {
            return Game.enemyField.Center_Rear;
        }

        if(pos == fieldPositions.FRONT_GUARD_LEFT)
        {
            return Game.enemyField.Right_Rear;
        }

        if(pos == fieldPositions.FRONT_GUARD_RIGHT)
        {
            return Game.enemyField.Left_Rear;
        }

        return null;
    }
Exemplo n.º 24
0
    public void CallFromDrop(Card card, fieldPositions p)
    {
        field.RemoveFromDropzone(card);
        field.Call(card, p);

        LastCallFromDrop = card;

        card.CheckAbilities(CardState.CallFromDrop);
        field.CheckAbilitiesExcept(card.pos, CardState.CallFromDrop_NotMe);

        SendPacket(GameAction.PLAY_CARD_FROM_DROP, card.cardID, p);
    }
Exemplo n.º 25
0
 public Card GetSameColum(fieldPositions p)
 {
     if(p == fieldPositions.VANGUARD_CIRCLE)   return Game.field.GetCardAt(fieldPositions.REAR_GUARD_CENTER);
     if(p == fieldPositions.FRONT_GUARD_LEFT)  return Game.field.GetCardAt(fieldPositions.REAR_GUARD_LEFT);
     if(p == fieldPositions.FRONT_GUARD_RIGHT) return Game.field.GetCardAt(fieldPositions.REAR_GUARD_RIGHT);
     if(p == fieldPositions.REAR_GUARD_LEFT)   return Game.field.GetCardAt(fieldPositions.FRONT_GUARD_LEFT);
     if(p == fieldPositions.REAR_GUARD_RIGHT)  return Game.field.GetCardAt(fieldPositions.FRONT_GUARD_RIGHT);
     if(p == fieldPositions.REAR_GUARD_CENTER) return Game.field.GetCardAt(fieldPositions.VANGUARD_CIRCLE);
     return null;
 }
Exemplo n.º 26
0
    public bool IsSameColumn(fieldPositions c1, fieldPositions c2)
    {
        if(c1 == c2)
        {
            return true;
        }

        if(c1  == fieldPositions.ENEMY_FRONT_LEFT  ||
           c1 == fieldPositions.ENEMY_REAR_LEFT   ||
           c1 == fieldPositions.FRONT_GUARD_RIGHT ||
           c1 == fieldPositions.REAR_GUARD_RIGHT)
        {
           if(c2 == fieldPositions.ENEMY_FRONT_LEFT  ||
          	  c2 == fieldPositions.ENEMY_REAR_LEFT   ||
              c2 == fieldPositions.FRONT_GUARD_RIGHT ||
              c2 == fieldPositions.REAR_GUARD_RIGHT)
            {
                return true;
            }
        }

        if(c1 == fieldPositions.ENEMY_FRONT_RIGHT ||
           c1 == fieldPositions.ENEMY_REAR_RIGHT  ||
           c1 == fieldPositions.FRONT_GUARD_LEFT  ||
           c1 == fieldPositions.REAR_GUARD_LEFT)
        {
           if(c2 == fieldPositions.ENEMY_FRONT_RIGHT  ||
          	  c2 == fieldPositions.ENEMY_REAR_RIGHT   ||
              c2 == fieldPositions.FRONT_GUARD_LEFT   ||
              c2 == fieldPositions.REAR_GUARD_LEFT)
            {
                return true;
            }
        }

        if(c1 == fieldPositions.ENEMY_REAR_CENTER  ||
           c1 == fieldPositions.ENEMY_VANGUARD     ||
           c1 == fieldPositions.REAR_GUARD_CENTER  ||
           c1 == fieldPositions.VANGUARD_CIRCLE)
        {
           if(c2 == fieldPositions.ENEMY_REAR_CENTER  ||
          	  c2 == fieldPositions.ENEMY_VANGUARD     ||
              c2 == fieldPositions.REAR_GUARD_CENTER  ||
              c2 == fieldPositions.VANGUARD_CIRCLE)
            {
                return true;
            }
        }

        return false;
    }
Exemplo n.º 27
0
 public bool IsRearGuard(fieldPositions p)
 {
     return !Util.IsEnemyPosition(p) && p != fieldPositions.VANGUARD_CIRCLE;
 }
Exemplo n.º 28
0
    public static fieldPositions TransformToPlayerField(fieldPositions pos)
    {
        if(pos == fieldPositions.ENEMY_VANGUARD)
            return fieldPositions.VANGUARD_CIRCLE;

        if(pos == fieldPositions.ENEMY_FRONT_LEFT)
            return fieldPositions.FRONT_GUARD_LEFT;

        if(pos == fieldPositions.ENEMY_FRONT_RIGHT)
            return fieldPositions.FRONT_GUARD_RIGHT;

        if(pos == fieldPositions.ENEMY_REAR_CENTER)
        {
            return fieldPositions.REAR_GUARD_CENTER;
        }

        if(pos == fieldPositions.ENEMY_REAR_RIGHT)
        {
            return fieldPositions.REAR_GUARD_RIGHT;
        }

        if(pos == fieldPositions.ENEMY_REAR_LEFT)
        {
            return fieldPositions.REAR_GUARD_LEFT;
        }

        return fieldPositions.DECK_ZONE;
    }
Exemplo n.º 29
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();
 }
Exemplo n.º 30
0
    public bool CanAttackPos(fieldPositions p)
    {
        if(!bCanAttackRearGuard && (p == fieldPositions.ENEMY_FRONT_RIGHT || p == fieldPositions.ENEMY_FRONT_LEFT))
        {
            return false;
        }

        return true;
    }