// 이하 스킬유즈 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("마나가 부족해")); } }
//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(); // 생각좀해보자 }
protected override void Attack() { // 왼쪽의 X키를 누르면 if (MagicEquipments.enabled == true && Input.GetKeyDown(KeyCode.X)) { // 공격모션중이면 return~ 공격모션을 다마친후에 다음것동작 if (IsAttack()) { return; } // string과 int가 있으면 형변환이 string으로 우선됨 _attackIndex = Random.Range(1, 3); _animator.SetTrigger("MagicA" + _attackIndex); polyPlay.playPoly(1); } }
// 이부분 몬스터별로 데미지 줄수있게... parameter int형으로 만들고 호출해야할듯 몬스터 데미지도 각각해주고 public void Damage(float damage) { // _state.state == CharacterState.State.Damage || 이부분은 idle전환에서 문제가 많아서 빼버림 if (_animator.GetCurrentAnimatorStateInfo(1).IsName("Damage")) { return; } Instantiate(_damagePrefab, _fxPosition.position, Quaternion.identity); _hpGager.HpDown(damage); _state._hp -= damage; StartCoroutine(dtCoroutinCall.AttackDamageShow(damageUIImage, damageUIText, damage)); polyPlay.playPoly(5); // 플레이어의 상태를 데미지 상태로 변경함 _state.state = CharacterState.State.Damage; // 피격 애니메이션을 실행함 _animator.Play("Damage", 1); if (_state._hp <= 0) { for (int i = 0; i < colliders.Length; i++) { colliders[i].sharedMaterial = frictionMax; } deathInteract = false; _state._isDie = true; _animator.SetTrigger("Die"); _animator.Play("Die"); gameObject.tag = "Untagged"; // 죽고나면 스캔안되고 안맞게 gameObject.layer = 0; StartCoroutine(chatCon.ChatBoxOpener("엌ㅋㅋㅋ..")); DeadPannelOpen openD = GameObject.Find("ButtonPanel").GetComponent <DeadPannelOpen>(); openD.DeathPannelOpen(); } }
protected override void Attack() { // 왼쪽의 X키를 누르면 if (LHTwoHandSword.enabled == true && Input.GetKeyDown(KeyCode.X)) { // 공격모션중이면 return~ 공격모션을 다마친후에 다음것동작 if (IsAttack()) { return; } // string과 int가 있으면 형변환이 string으로 우선됨 _attackIndex = Random.Range(1, 4); _animator.SetTrigger("TwoHandSwordA" + _attackIndex); polyPlay.playPoly(0); // if (_attackIndex > 3) _attackIndex = 1; } }
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(); // 생각좀해보자 }