Ejemplo n.º 1
0
    } // 일반 터치

    public void PlayerAISwipe()
    {
        if (isAI)
        {
            isSwipe = true;
            if ((!Anim.GetBool("isAttack") || Cancel) && (stats.Stamina >= 20))
            {
                stats.Stamina -= stats.ReductionStamina * 1.5f;
                State          = PlayerCurState.STRONG_ATTACK;


                Debug.Log("스와이프 : " + (SessionId)index + (int)Direction);

                if (BackEndMatchManager.instance.isHost && !isAI)
                {
                    int        keyCode = (int)State;
                    KeyMessage msg     = new KeyMessage(keyCode, transform.position, Direction);
                    BackEndMatchManager.instance.AddMsgToLocalQueue(msg);
                }
                else
                {
                    PlayerStrongAttackMessage strongMsg = new PlayerStrongAttackMessage(index, Direction);
                    BackEndMatchManager.instance.SendDataToInGame(strongMsg);
                }
            }
        }
    } // 스와이프
Ejemplo n.º 2
0
    } // 긴 터치

    public void PlayerAITouch()
    {
        if (isAI)
        {
            if ((!Anim.GetBool("isAttack") || Cancel) && (stats.Stamina >= 10))
            {
                stats.Stamina -= stats.ReductionStamina;
                State          = PlayerCurState.WEAK_ATTACK;



                Debug.Log("터치 : " + (SessionId)index + (int)Direction);

                if (BackEndMatchManager.instance.isHost && !isAI)
                {
                    int        keyCode = (int)State;
                    KeyMessage msg     = new KeyMessage(keyCode, transform.position);
                    msg = new KeyMessage(keyCode, transform.position, Direction);

                    BackEndMatchManager.instance.AddMsgToLocalQueue(msg);
                }
                else
                {
                    PlayerWeakAttackMessage weakMsg = new PlayerWeakAttackMessage(index, Direction);
                    BackEndMatchManager.instance.SendDataToInGame(weakMsg);
                }
            }
        }
    } // 일반 터치
Ejemplo n.º 3
0
    public IEnumerator CR_Stun(float Time)
    {
        State = PlayerCurState.STUN;
        if (BackEndMatchManager.instance.isHost)
        {
            int        keyCode = (int)State;
            KeyMessage msg     = new KeyMessage(keyCode, transform.position, Direction);
            BackEndMatchManager.instance.AddMsgToLocalQueue(msg);
        }
        else
        {
            PlayerStunMessage stunMsg = new PlayerStunMessage(index);
            BackEndMatchManager.instance.SendDataToInGame(stunMsg);
        }
        yield return(new WaitForSeconds(Time));

        isStun = false;
    }// 스턴 코루틴
Ejemplo n.º 4
0
    } // 스와이프

    public void PlayerLongTouch()
    {
        if ((!Anim.GetBool("isAttack") || Cancel))
        {
            State = PlayerCurState.DEFENSE;

            Debug.Log("긴 터치 : " + (SessionId)index + (int)Direction);

            if (BackEndMatchManager.instance.isHost)
            {
                int        keyCode = (int)State;
                KeyMessage msg     = new KeyMessage(keyCode, transform.position, Direction);
                BackEndMatchManager.instance.AddMsgToLocalQueue(msg);

                StartCoroutine(cameraFuncs.ZoomCamera(0.5f, 2.0f));
            }
            else
            {
                PlayerDefenseMessage defenceMsg = new PlayerDefenseMessage(index, Direction);
                BackEndMatchManager.instance.SendDataToInGame(defenceMsg);
            }
        }
    } // 긴 터치
Ejemplo n.º 5
0
 public void isStunFalse()
 {
     isStun = false;
     State  = PlayerCurState.IDLE;
 }
Ejemplo n.º 6
0
    public void PlayerSetting(bool isMe, SessionId index, string nickName, bool isAI = false)
    {
        this.isMe     = isMe;
        this.index    = index;
        this.nickName = nickName;
        this.isAI     = isAI;

        if (this.isMe)
        {
            //Anim = CharactersPrefab[stats.nowCharacter].GetComponent<Animator>();

            // 여기다가 자기 자신 캐릭터에 따라 캐릭터 레벨에 따라 스탯 변경되는거 넣기
            // ...
            foreach (var prefab in CharactersPrefab)
            {
                prefab.SetActive(false);
            }
            //CharactersPrefab[stats.nowCharacter].SetActive(true);
            cameraFuncs = characterCamera.GetComponent <CameraFuncs>();
            stats       = (PlayerStats.Player)BackEndServerManager.instance.myInfo.Copy();

            //Debug.Log("현재 캐릭터들 개수 : " + stats.charactersLevel[stats.nowCharacter]);
            //Debug.Log("현재 캐릭터 : " + stats.nowCharacter);

            //if (stats.charactersLevel[stats.nowCharacter] == 1)
            //{
            //    // 여기 수정 ...
            //    //stats.MaxHp = stats.pMaxHp[stats.nowCharacter];
            //    //stats.Stamina = stats.pStamina[stats.nowCharacter];
            //    //stats.StaminaM = stats.pStaminaM[stats.nowCharacter];
            //    //stats.Damage = stats.pDamage[stats.nowCharacter];
            //    //stats.Penetration = stats.pPenetration[stats.nowCharacter];
            //}
            //else if (stats.charactersLevel[stats.nowCharacter] >= 2)
            //{
            //    // 여기 수정 ...
            //    //stats.MaxHp = stats.pMaxHp[stats.nowCharacter] * (stats.charactersLevel[stats.nowCharacter] * 0.6f);
            //    //stats.Stamina = stats.pStamina[stats.nowCharacter] * (stats.charactersLevel[stats.nowCharacter] * 0.6f);
            //    //stats.StaminaM = stats.pStaminaM[stats.nowCharacter] * (stats.charactersLevel[stats.nowCharacter] * 0.6f);
            //    //stats.Damage = stats.pDamage[stats.nowCharacter] * (stats.charactersLevel[stats.nowCharacter] * 0.6f);
            //    //stats.Penetration = stats.pPenetration[stats.nowCharacter] * (stats.charactersLevel[stats.nowCharacter] * 0.6f);
            //}

            State = PlayerCurState.IDLE;

            Direction = Direction.NONE;
            //StartCoroutine(CR_StaminaHeal());

            transform.position = WorldPackage.instance.startingPoint[0].position;
            transform.rotation = WorldPackage.instance.startingPoint[0].rotation;
        }
        else
        {
            transform.position = WorldPackage.instance.startingPoint[1].position;
            transform.rotation = WorldPackage.instance.startingPoint[1].rotation;

            if (isAI)
            {
                int charKind = Random.Range((int)CharacterKind.기사, (int)CharacterKind.MAX);

                CharactersPrefab[charKind].SetActive(true);

                stats.MaxHp                   = stats.CurHp = BackEndServerManager.instance.myInfo.pMaxHp[charKind];
                stats.Stamina                 = BackEndServerManager.instance.myInfo.pStamina[charKind];
                stats.ReductionStamina        = BackEndServerManager.instance.myInfo.pReductionStamina[charKind];
                stats.WeakAttackDamage        = BackEndServerManager.instance.myInfo.pWeakAttackDamage[charKind];
                stats.WeakAttackStun          = BackEndServerManager.instance.myInfo.pWeakAttackStun[charKind];
                stats.WeakAttackPenetration   = BackEndServerManager.instance.myInfo.pWeakAttackPenetration[charKind];
                stats.StrongAttackDamage      = BackEndServerManager.instance.myInfo.pStrongAttackDamage[charKind];
                stats.StrongAttackStun        = BackEndServerManager.instance.myInfo.pStrongAttackStun[charKind];
                stats.StrongAttackPenetration = BackEndServerManager.instance.myInfo.pStrongAttackPenetration[charKind];
                stats.DefeneseReceivingDamage = BackEndServerManager.instance.myInfo.pDefenseReceivingDamage[charKind];
                stats.DefeneseReductionStun   = BackEndServerManager.instance.myInfo.pDefenseReductionStun[charKind];
                stats.nowCharacter            = charKind;
                Anim = CharactersPrefab[charKind].GetComponent <Animator>();

                gameObject.AddComponent <AIScript>();
            }
        }

        isLive = true;
    }