//protected PlayerSkill mpUp;


    public override void ItemUse(int i)
    {
        if (ItemBagList.itemBagStuffList[i].ItemQttProp >= 1)
        {
            ChatBoxController chatCon = GameObject.Find("Player").GetComponent <ChatBoxController>();
            chatCon.StartCoroutine(chatCon.ChatBoxOpener("이거슨\n매직머슈룸!?"));

            PlayerSkill  mpUp  = GameObject.Find("Player").GetComponent <PlayerSkill>();
            PortionFxGen fxGen = GameObject.Find("Player").GetComponent <PortionFxGen>();

            PlayerAudioSource polyPlay = GameObject.Find("Player").GetComponent <PlayerAudioSource>();
            polyPlay.playPoly(7);
            mpUp.StartCoroutine(mpUp.MpPortionDOT());


            fxGen.PortionFxGener(1);

            ItemBagList.itemBagStuffList[i].ItemQttProp = ItemBagList.itemBagStuffList[i].ItemQttProp - 1;



            if (ItemBagList.itemBagStuffList[i].ItemQttProp == 0)
            {
                ItemBagList.itemBagStuffList.Remove(ItemBagList.itemBagStuffList[i]);
                Debug.Log("바이바이");
            }
        }

        methodCaller.WhatIsInBag();

        // 생각좀해보자
    }
    // 이하 스킬유즈 3개 줄여보기

    protected void SkillUse()       // 블레이드 쉴드 테스트
    {
        if (nowMp >= 2 && thsChecker.LHTwoHandSword.enabled == true && Input.GetKeyDown(KeyCode.Q) && coolCounter[0].nowCoolDown == coolCounter[0].skillCoolDown)
        {
            mpGageControl.MpDown(2);
            nowMp = nowMp - 2;


            _animator.Play("TwoHandSkillUse");

            Vector3   PrefabPosition;
            Transform buffPosition = GameObject.Find("PlayerBuffPosition").GetComponent <Transform>();
            PrefabPosition        = buffPosition.position;
            buffPosition.position = new Vector3(buffPosition.position.x, 0f);
            //    buffPosition.position += new Vector3(0f, 0f);

            ////new Vector3(buffPosition.position.y, );
            //     PrefabPosition.y = -5;     // 피벗이 낮아서 플레이어는 부모없으니까 로컬이든 포지션이든 기준에서 -5 빼주고 차일드로 들어갈땐 인스펙터값 치환됨
            StartCoroutine(chatBoxCall.ChatBoxOpener("블레이드쉴드!"));


            GameObject        skill    = Instantiate(SkillPrefab[0], PrefabPosition, Quaternion.identity);
            PlayerAudioSource polyPlay = GameObject.Find("Player").GetComponent <PlayerAudioSource>();
            polyPlay.playPoly(6);
            skill.transform.parent        = GameObject.Find("Player").GetComponent <Transform>();
            skill.transform.localPosition = new Vector3(0f, -1f);
            SkillCoolZero(0);
            SkillCoolRecharge(0);
            //스킬쓸때 x포지션 프리즈걸고 애니메이션 끝날때 프리즈 풀까 생각중
        }
        else if (nowMp < 2 && thsChecker.LHTwoHandSword.enabled == true && Input.GetKeyDown(KeyCode.Q) && coolCounter[0].nowCoolDown == coolCounter[0].skillCoolDown)
        {
            StartCoroutine(chatBoxCall.ChatBoxOpener("마나가 부족해"));
        }
        if (nowMp >= 3 && magicChecker.MagicEquipments.enabled == true && Input.GetKeyDown(KeyCode.Q) && coolCounter[3].nowCoolDown == coolCounter[3].skillCoolDown)
        {
            mpGageControl.MpDown(3);
            nowMp = nowMp - 3;

            _animator.Play("MagicSkillUse");   // skill use하니까 이상함

            Transform skillPosition = GameObject.Find("Player").GetComponent <Transform>();

            StartCoroutine(chatBoxCall.ChatBoxOpener("썬더필드!"));
            StartCoroutine(ThunderFieldGen(skillPosition));
            polyPlay.playPoly(2);
            //       Instantiate(SkillPrefab[3], PrefabPosition, Quaternion.identity);

            //            skill.SendMessage("MagicFlipper", _cState._isRightDir);
            SkillCoolZero(3);
            SkillCoolRecharge(3);
        }
        else if (nowMp < 3 && magicChecker.MagicEquipments.enabled == true && Input.GetKeyDown(KeyCode.Q) && coolCounter[3].nowCoolDown == coolCounter[3].skillCoolDown)
        {
            StartCoroutine(chatBoxCall.ChatBoxOpener("마나가 부족해"));
        }
    }
 public void Awake()
 {
     _state         = GetComponent <CharacterState>();
     _animator      = GetComponent <Animator>();
     _hpGager       = GetComponent <HpGageShare>();
     dtCoroutinCall = GetComponent <DamageText>();
     chatCon        = gameObject.GetComponent <ChatBoxController>();
     deathInteract  = true;
     polyPlay       = gameObject.GetComponent <PlayerAudioSource>();
 }
 /// <summary>
 /// Start is called on the frame when a script is enabled just before
 /// any of the Update methods is called the first time.
 /// </summary>
 void Start()
 {
     if (this == player)
     {
         playerTransform  = player.transform;
         hpManager        = player.GetComponentInChildren <PlayerHealthManager>();
         physics          = player.GetComponentInChildren <PlayerPhysics>();
         movementModifier = player.GetComponentInChildren <PlayerMovementModifier>();
         clipManager      = player.GetComponentInChildren <PlayerClipManager>();
         graphicsManager  = player.GetComponentInChildren <PlayerGraphicsManager>();
         playerController = player.GetComponentInChildren <PlayerControllerScript>();
         playerAudio      = player.GetComponentInChildren <PlayerAudioSource>();
     }
 }
    public override void ItemUse(int i)
    {
        if (ItemBagList.itemBagStuffList[i].ItemQttProp >= 1)
        {
            PortionFxGen fxGen = GameObject.Find("Player").GetComponent <PortionFxGen>();
            fxGen.PortionFxGener(0);
            ChatBoxController chatCon = GameObject.Find("Player").GetComponent <ChatBoxController>();
            chatCon.StartCoroutine(chatCon.ChatBoxOpener("포션기모찌\n인정?"));

            PlayerAudioSource polyPlay = GameObject.Find("Player").GetComponent <PlayerAudioSource>();
            polyPlay.playPoly(7);

            float dotHealRate = hpUp._MaxHp / 100;
            if (hpUp._hp > hpUp._MaxHp)
            {
                //                hpUp._hp = hpUp._MaxHp;
                hpGageUP.HpUp(1);   // 그냥 1을 넣어주면 알아서 메소드에서 맞춰줌
                                    //     yield break; 멈출필요는 없는듯 걍 만피만 유지해주면됨 만피에서 떨어지면 이하가실행
            }
            hpUp._hp = hpUp._hp + (dotHealRate * 30);
            hpGageUP.HpUp(0.3f);



            ItemBagList.itemBagStuffList[i].ItemQttProp = ItemBagList.itemBagStuffList[i].ItemQttProp - 1;


            if (ItemBagList.itemBagStuffList[i].ItemQttProp == 0)
            {
                ItemBagList.itemBagStuffList.Remove(ItemBagList.itemBagStuffList[i]);
            }
        }

        methodCaller.WhatIsInBag();

        // 생각좀해보자
    }
예제 #6
0
    private IEnumerator PlayerDeath()
    {
        // Turn everything off
        DisablePlayer(true);

        if (MainCollider.enabled)
        {
            MainCollider.enabled = false;
        }

        if (!isDead)
        {
            isDead = !isDead;
            switch (currentState)
            {
            case PlayerStates.SPIKE_DEAD:
                PlayerAudioSource.PlayOneShot(spikeDeathClip);
                break;

            case PlayerStates.BOOM_DEAD:
                PlayerAudioSource.PlayOneShot(boomDeathClip);
                break;
            }

            // If the player is dead, stop the level music.
            if (SoundManager.MusicSource.isPlaying)
            {
                SoundManager.MusicSource.Stop();
            }

            yield return(new WaitForSeconds(1.5f));

            OnPlayerIsDead?.Invoke(isDead);
            enabled = false;
        }
    }
 void Awake()
 {
     MpPortionEffect = false;
     chatBoxCall     = gameObject.GetComponent <ChatBoxController>();
     polyPlay        = gameObject.GetComponent <PlayerAudioSource>();
 }
 protected override void Awake()
 {
     base.Awake();
     polyPlay = gameObject.GetComponent <PlayerAudioSource>();
 }