public override void Q() { isQ = true; QSkillObj.SetActive(true); qTIme = 4f; if (photonView.isMine) { float dam = 1; switch (TheChampionData.skill_Q) { case 1: dam = 0.31f; break; case 2: dam = 0.46f; break; case 3: dam = 0.64f; break; case 4: dam = 0.84f; break; case 5: dam = 1.08f; break; } TheChampionData.skillPlusAtkDam = Mathf.Round(dam * (TheChampionData.mystat.Attack_Damage + TheChampionData.itemstat.attack_damage)); TheChampionData.TotalStatDamDefUpdate(); TheChampionData.UIStat.Refresh(); } }
private void Update() { //우클릭하거나 esc키를 누르면 스킬 선택이 해제된다. if (Input.GetMouseButtonDown(1) || Input.GetKeyDown(KeyCode.Escape)) { CancelSkill(); } // Q 스킬을 선택한 후 마우스 왼쪽 버튼을 클릭 if (skillSelect.Equals(SkillSelect.Q)) { if (Input.GetMouseButtonDown(0)) { skillSelect = SkillSelect.none; Vector3 mousePos = Input.mousePosition; Ray r = Camera.main.ScreenPointToRay(mousePos); RaycastHit[] hits = Physics.RaycastAll(r, 50f); arguVec = Vector3.zero; foreach (RaycastHit hit in hits) { //클릭된 지점을 향해 스킬 발동 if (hit.collider.tag.Equals("Terrain")) { isSkilling = true; TheSplatManager.Cancel(); CallChampDataUsedSkill("Q"); arguVec = hit.point; arguVec.y = 0.5f; championAnimation.AnimationApply("Q", true); championAnimation.AnimationApply("Q", false, 0.5f); Invoke("Q", 0.2f); break; } } } } // W 스킬을 사용중이라면 시간을 계산 if (isW) { wTime -= Time.deltaTime; if (wTime < 0) { wTime += 1; // 체력이 소진되었다면 W 스킬을 해제한다 if (TheChampionData.totalStat.Hp - 2 < TheChampionData.mana_W) { HitEffectRPC("Mundo", "W"); wSkillObj.SetActive(false); isW = false; wTime = 1; EndSkill(0f); } else // 체력이 남아있다면 체력을 깎는다 { TheChampionData.totalStat.Hp -= TheChampionData.mana_W; } } } // E 스킬을 사용중이라면 시간을 계산 if (isE) { if (photonView.isMine) { //일정 시간동안 공격력이 증가한다 eTime -= Time.deltaTime; float losedHpPercent = ((TheChampionData.totalStat.MaxHp - TheChampionData.totalStat.Hp) / TheChampionData.totalStat.MaxHp); float minimalSkillAD = skillData.eDamage[TheChampionData.skill_E - 1] / 2f; TheChampionData.skillPlusAtkDam = minimalSkillAD + (minimalSkillAD * losedHpPercent); if (TheChampionAtk.skillKey.Equals("MundoE") && TheChampionAtk.skillKeyNum > 0) { int eLv = TheChampionData.skill_E - 1; TheChampionData.skillPlusAtkDam += TheChampionData.totalStat.MaxHp * (0.03f + (float)eLv * 0.005f); } TheChampionData.skillPlusAtkDam = Mathf.Round(TheChampionData.skillPlusAtkDam); // 지속 시간이 끝나면 E 스킬을 해제 if (eTime <= 0) { HitEffectRPC("Mundo", "E"); E(); } TheChampionData.TotalStatDamDefUpdate(); TheChampionData.UIStat.Refresh(); } } // R 스킬을 사용중이라면 시간을 계산 if (isR) { if (photonView.isMine) { // 만약 스킬이 지속되는 도중 죽는다면 스킬 관련 값을 초기화한다 if (TheChampionBehaviour.isDead) { rSkillObj.SetActive(false); TheChampionData.totalStat.Hp = 0; ChampionSound.instance.TempAudio.Stop(); ChampionSound.instance.TempAudio.loop = false; ChampionSound.instance.TempAudio.clip = null; TheChampionData.skillPlusSpeed = 0; TheChampionData.TotalStatSpeedUpdate(); TheChampionData.UIStat.Refresh(); return; } rTime -= Time.deltaTime; // 1초마다 체력을 회복한다 if (rTime <= 0) { rTime = 1f; TheChampionData.totalStat.Hp += rHealValue; // 지속시간이 끝나면 스킬을 해제한다 if (--rCount == 0) { HitEffectRPC("Mundo", "R"); R(); } } } } }
private void Update() { if (Input.GetMouseButtonDown(1) || Input.GetKeyDown(KeyCode.Escape)) {//스킬선택해제 CancelSkill(); } if (skillselect.Equals(SSelect.Q)) { if (Input.GetMouseButtonDown(0)) { skillselect = SSelect.none; Vector3 h = Vector3.zero; Vector3 v = Input.mousePosition; Ray r = Camera.main.ScreenPointToRay(v); RaycastHit[] hits = Physics.RaycastAll(r, 50f); TempVector1 = Vector3.zero; foreach (RaycastHit hit in hits) { if (hit.collider.tag.Equals("Terrain")) { isSkillIng = true; TheSplatManager.Cancel(); TheChampionData.UsedQ(); TempVector1 = hit.point; TempVector1.y = 0.5f; championAnimation.AnimationApply("Q", true); championAnimation.AnimationApply("Q", false, 0.5f); Invoke("Q", 0.2f); break; } } } } if (isW) { wTime -= Time.deltaTime; if (wTime < 0) { //if (Input.GetKeyDown(KeyCode.W)) //{ // HitEffectRPC("Mundo", "W"); // WSkillObj.SetActive(false); // SkillEnd(0f); // isW = false; // wTime = 1; // SkillEnd(0f); //} //else //{ wTime += 1; if (TheChampionData.totalstat.Hp - 2 < TheChampionData.mana_W) { HitEffectRPC("Mundo", "W"); WSkillObj.SetActive(false); isW = false; wTime = 1; SkillEnd(0f); } else { TheChampionData.totalstat.Hp -= TheChampionData.mana_W; } } } if (isE) { if (photonView.isMine) { eTime -= Time.deltaTime; float losedHpPercent = ((TheChampionData.totalstat.MaxHp - TheChampionData.totalstat.Hp) / TheChampionData.totalstat.MaxHp); float minimalSkillAD = skillData.eDamage[TheChampionData.skill_E - 1] / 2f; TheChampionData.skillPlusAtkDam = minimalSkillAD + (minimalSkillAD * losedHpPercent); if (TheChampionAtk.skillKey.Equals("MundoE") && TheChampionAtk.skillKeyNum > 0) { int e = TheChampionData.skill_E - 1; TheChampionData.skillPlusAtkDam += TheChampionData.totalstat.MaxHp * (0.03f + (float)e * 0.005f); } TheChampionData.skillPlusAtkDam = Mathf.Round(TheChampionData.skillPlusAtkDam); if (eTime <= 0) { HitEffectRPC("Mundo", "E"); E(); } TheChampionData.TotalStatDamDefUpdate(); TheChampionData.UIStat.Refresh(); } } if (isR) { if (photonView.isMine) { if (TheChampionBehaviour.isDead) { RSkillObj.SetActive(false); TheChampionData.totalstat.Hp = 0; ChampionSound.instance.TempAudio.Stop(); ChampionSound.instance.TempAudio.loop = false; ChampionSound.instance.TempAudio.clip = null; if (photonView.isMine) { TheChampionData.skillPlusSpeed = 0; TheChampionData.TotalStatSpeedUpdate(); TheChampionData.UIStat.Refresh(); } return; } rTime -= Time.deltaTime; if (rTime <= 0) { rTime = 1f; TheChampionData.totalstat.Hp += rHealValue; if (--rCount == 0) { HitEffectRPC("Mundo", "R"); R(); } } } } }
private void Update() { if (IAmAshe == null) { if (gameObject.tag.Equals("Player")) { IAmAshe = true; } else { IAmAshe = false; } } if (IAmAshe == true) { if (beforeELv.Equals(0)) { if (TheChampionData.skill_E > 0) { if (TheStackImage == null) { TheStackImage = GameObject.FindGameObjectWithTag("StackImage").GetComponent <StackImage>(); } beforeELv = 1; if (AsheHawkCount > 0) { TheStackImage.ImageDic["AsheE"].gameObject.SetActive(true); TheStackImage.TextDic["AsheE"].text = AsheHawkCount.ToString(); } } } } if (TheChampionData.skill_Q > 0) { if (TheStackImage == null) { TheStackImage = GameObject.FindGameObjectWithTag("StackImage").GetComponent <StackImage>(); } if (isQ) { qTIme -= Time.deltaTime; if (qTIme <= 0) { isQ = false; qTIme = 4f; if (photonView.isMine) { TheChampionData.skillPlusAtkDam = 0; TheChampionData.TotalStatDamDefUpdate(); TheChampionData.UIStat.Refresh(); } QSkillObj.SetActive(false); } } else if (qStackCount > 0) { keepQStackTime -= Time.deltaTime; if (keepQStackTime < 0) { reduceQStackTime -= Time.deltaTime; if (reduceQStackTime < 0) { --qStackCount; if (IAmAshe == true) { if (qStackCount.Equals(0)) { TheStackImage.TextDic["AsheQ"].text = ""; TheStackImage.ImageDic["AsheQ"].gameObject.SetActive(false); } else { TheStackImage.TextDic["AsheQ"].text = qStackCount.ToString(); } } reduceQStackTime = 0.75f; } } } } if (TheChampionData.skill_E > 0 && AsheHawkCount < 2) { AsheHawkChargeTime -= Time.deltaTime; if (AsheHawkChargeTime < 0) { AsheHawkChargeTime = 100 - (TheChampionData.skill_E * 10); ++AsheHawkCount; if (IAmAshe == true) { if (AsheHawkCount.Equals(1)) { TheStackImage.ImageDic["AsheE"].gameObject.SetActive(true); } TheStackImage.TextDic["AsheE"].text = AsheHawkCount.ToString(); } } } if (Input.GetMouseButtonDown(1) || Input.GetKeyDown(KeyCode.Escape)) {//스킬선택해제 CancelSkill(); } if (skillselect.Equals(SSelect.E)) { if (Input.GetMouseButtonDown(0)) { skillselect = SSelect.none; Vector3 h = Vector3.zero; Vector3 v = Input.mousePosition; Ray r = Camera.main.ScreenPointToRay(v); RaycastHit[] hits = Physics.RaycastAll(r, 50f); TempVector1 = Vector3.zero; foreach (RaycastHit hit in hits) { if (hit.collider.tag.Equals("Terrain")) { isSkillIng = true; TheSplatManager.Cancel(); TheChampionData.UsedE(); TempVector1 = hit.point; TempVector1.y = 0.5f; Invoke("E", 0.1f); championAnimation.AnimationApply("E", true); championAnimation.AnimationApply("E", false, 0.7f); break; } } } } if (skillselect.Equals(SSelect.R)) { if (Input.GetMouseButtonDown(0)) { skillselect = SSelect.none; if (audio != null) { ChampionSound.instance.Skill(PlayerData.Instance.championName, 3, audio); } Vector3 h = Vector3.zero; Vector3 v = Input.mousePosition; Ray r = Camera.main.ScreenPointToRay(v); RaycastHit[] hits = Physics.RaycastAll(r, 50f); TempVector1 = Vector3.zero; foreach (RaycastHit hit in hits) { if (hit.collider.tag.Equals("Terrain")) { isSkillIng = true; TheSplatManager.Cancel(); TheChampionData.UsedR(); TempVector1 = hit.point; TempVector1.y = 0.5f; Invoke("R", 0.1f); championAnimation.AnimationApply("R", true); championAnimation.AnimationApply("R", false, 0.8f); break; } } } } if (skillselect.Equals(SSelect.W)) { if (Input.GetMouseButtonDown(0)) { skillselect = SSelect.none; Vector3 h = Vector3.zero; Vector3 v = Input.mousePosition; Ray r = Camera.main.ScreenPointToRay(v); RaycastHit[] hits = Physics.RaycastAll(r, 50f); TempVector1 = Vector3.zero; foreach (RaycastHit hit in hits) { if (hit.collider.tag.Equals("Terrain")) { isSkillIng = true; TheSplatManager.Cancel(); TheChampionData.UsedW(); TempVector1 = hit.point; TempVector1.y = 0.5f; Invoke("W", 0.1f); championAnimation.AnimationApply("W", true); championAnimation.AnimationApply("W", false, 0.8f); break; } } } } }
/// <summary> /// 현재 Q의 스택을 확인하고 시간이 지나면 감소시키는 함수 /// </summary> private void CheckQStackAndTime() { // Q 스킬을 찍어두었는지 검사 if (TheChampionData.skill_Q > 0) { if (TheStackImage == null) { TheStackImage = GameObject.FindGameObjectWithTag("StackImage").GetComponent <StackImage>(); } // Q 스킬을 사용중이라면 시간을 계산 if (isQ) { qTIme -= Time.deltaTime; // Q 스킬 지속시간이 끝나면 스킬을 해제한다. if (qTIme <= 0) { isQ = false; qTIme = 4f; if (photonView.isMine) { TheChampionData.skillPlusAtkDam = 0; TheChampionData.TotalStatDamDefUpdate(); TheChampionData.UIStat.Refresh(); } qSkillObj.SetActive(false); } } else if (qStackCount > 0) {//Q 스택이 1개 이상일 때 keepQStackTime -= Time.deltaTime; //시간을 계산하여 Q 스택을 감소시킨다. if (keepQStackTime < 0) { reduceQStackTime -= Time.deltaTime; if (reduceQStackTime < 0) { --qStackCount; if (isIAmAshe == true) { if (qStackCount.Equals(0)) { TheStackImage.TextDic["AsheQ"].text = ""; TheStackImage.ImageDic["AsheQ"].gameObject.SetActive(false); } else { TheStackImage.TextDic["AsheQ"].text = qStackCount.ToString(); } } reduceQStackTime = 0.75f; } } } } }