public void qCountUp() { if (TheChampionData.skill_Q > 0) { if (TheStackImage == null) { TheStackImage = GameObject.FindGameObjectWithTag("StackImage").GetComponent <StackImage>(); } if (qStackCount < 4) { ++qStackCount; if (IAmAshe == true) { if (qStackCount.Equals(1)) { TheStackImage.ImageDic["AsheQ"].gameObject.SetActive(true); } TheStackImage.TextDic["AsheQ"].text = qStackCount.ToString(); } } else if (qStackCount.Equals(4)) { qStackCount = 4; } keepQStackTime = 4f; reduceQStackTime = 0.75f; } }
protected void trace(int address, Func <string> message) { if (Tracing) { table.Value.Add(address.ToString("D5"), message().Truncate(80), StackImage.Truncate(80)); } }
/// <summary> /// 애쉬가 일반 공격을 할 때, Q 스킬의 스택을 쌓아주는 함수 /// </summary> public void QCountUp() { //Q 스킬을 찍어두었는지 검사 if (TheChampionData.skill_Q > 0) { if (TheStackImage == null) { TheStackImage = GameObject.FindGameObjectWithTag("StackImage").GetComponent <StackImage>(); } //Q 스택이 4개 미만인 경우 if (qStackCount < 4) { //Q 스택을 하나 올린다. ++qStackCount; if (isIAmAshe == true) { if (qStackCount.Equals(1)) { TheStackImage.ImageDic["AsheQ"].gameObject.SetActive(true); } TheStackImage.TextDic["AsheQ"].text = qStackCount.ToString(); } } else if (qStackCount.Equals(4)) //Q 스택이 4개면 4로 유지한다. { qStackCount = 4; } // Q 스택이 앞으로 유지될 시간과 감소될 시간을 초기화한다. keepQStackTime = 4f; reduceQStackTime = 0.75f; } }
public void ItemCheck() { if (Input.GetKeyDown(KeyCode.Alpha1)) { PotionCheck(1); } if (Input.GetKeyDown(KeyCode.Alpha2)) { PotionCheck(2); } if (Input.GetKeyDown(KeyCode.Alpha3)) { PotionCheck(3); } if (Input.GetKeyDown(KeyCode.Alpha5)) { PotionCheck(4); } if (Input.GetKeyDown(KeyCode.Alpha6)) { PotionCheck(5); } if (Input.GetKeyDown(KeyCode.Alpha7)) { PotionCheck(6); } if (hpPotion) { if (!effectOnce) { effectOnce = true; playerSpell.SendEffect("HealPotion", transform.position, PhotonNetwork.player.GetTeam().ToString().ToLower(), myPhotonView.viewID); if (theStackImage == null) { theStackImage = GameObject.FindGameObjectWithTag("StackImage").GetComponent <StackImage>(); } if (!theStackImage.ImageDic["HPPotion"].gameObject.activeInHierarchy) { theStackImage.ImageDic["HPPotion"].gameObject.SetActive(true); } } // 15초동안 150회복. 초당 10회복. 0.5초당 5회복 hpPotionCycle -= Time.deltaTime; if (hpPotionCycle < 0) { if (totalStat.Hp < totalStat.MaxHp) { totalStat.Hp += 5; } if (totalStat.Hp > totalStat.MaxHp) { totalStat.Hp = totalStat.MaxHp; } hpPotionCycle = 0.5f; } // 15초가 다 지나면 포션사용가능 hpPotionTimeCheck -= Time.deltaTime; theStackImage.TextDic["HPPotion"].text = Mathf.FloorToInt(hpPotionTimeCheck).ToString(); if (hpPotionTimeCheck < 0) { effectOnce = false; hpPotionTimeCheck = 15.0f; hpPotion = false; theStackImage.TextDic["HPPotion"].text = ""; theStackImage.ImageDic["HPPotion"].gameObject.SetActive(false); } } if (mpPotion) { if (!effectOnce2) { effectOnce2 = true; playerSpell.SendEffect("HealPotion", transform.position, PhotonNetwork.player.GetTeam().ToString().ToLower(), myPhotonView.viewID); if (theStackImage == null) { theStackImage = GameObject.FindGameObjectWithTag("StackImage").GetComponent <StackImage>(); } if (!theStackImage.ImageDic["MPPotion"].gameObject.activeInHierarchy) { theStackImage.ImageDic["MPPotion"].gameObject.SetActive(true); } } // 15초동안 100회복. 초당 6.666회복. 0.5초당 3.3333회복 mpPotionCycle -= Time.deltaTime; if (mpPotionCycle < 0) { if (totalStat.Mp < totalStat.MaxMp) { totalStat.Mp += 5; } if (totalStat.Mp > totalStat.MaxMp) { totalStat.Mp = totalStat.MaxMp; } mpPotionCycle = 0.5f; } // 15초가 다 지나면 포션사용가능 mpPotionTimeCheck -= Time.deltaTime; theStackImage.TextDic["MPPotion"].text = Mathf.FloorToInt(mpPotionTimeCheck).ToString(); if (mpPotionTimeCheck < 0) { effectOnce2 = false; mpPotionTimeCheck = 15.0f; mpPotion = false; theStackImage.TextDic["MPPotion"].text = ""; theStackImage.ImageDic["MPPotion"].gameObject.SetActive(false); } } }
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; } } } } }
private void Update() { // 현재 플레이어의 챔피언이 애쉬인지 확인 if (isIAmAshe == null) { if (gameObject.tag.Equals("Player")) { isIAmAshe = true; } else { isIAmAshe = false; } } // 애쉬인 경우 if (isIAmAshe == true) { // E 스킬을 새로 찍었는지 검사 if (beforeELv.Equals(0)) { // E 스킬을 찍었다면 E 스킬에 관한 이미지와 텍스트를 불러온다. 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(); } } } } // Q 스킬의 스택 수와 딜레이 타임 확인 CheckQStackAndTime(); // 매 날리기 스킬을 찍었는데 매의 수가 2개 미만인 경우 if (TheChampionData.skill_E > 0 && asheHawkCount < 2) { //시간을 계산해 일정 시간이 되면 매의 수를 하나 늘린다. asheHawkChargeTime -= Time.deltaTime; if (asheHawkChargeTime < 0) { asheHawkChargeTime = 100 - (TheChampionData.skill_E * 10); ++asheHawkCount; if (isIAmAshe == true) { if (asheHawkCount.Equals(1)) { TheStackImage.ImageDic["AsheE"].gameObject.SetActive(true); } TheStackImage.TextDic["AsheE"].text = asheHawkCount.ToString(); } } } //우클릭하거나 esc키를 누르면 스킬 선택이 해제된다. if (Input.GetMouseButtonDown(1) || Input.GetKeyDown(KeyCode.Escape)) { CancelSkill(); } // E 스킬을 선택한 후 마우스 왼쪽 버튼을 클릭 if (skillSelect.Equals(SkillSelect.E)) { if (Input.GetMouseButtonDown(0)) { SkillingClick("E"); } } // R 스킬을 선택한 후 마우스 왼쪽 버튼을 클릭 if (skillSelect.Equals(SkillSelect.R)) { if (Input.GetMouseButtonDown(0)) { if (audio != null) { ChampionSound.instance.Skill(PlayerData.Instance.championName, 3, audio); } SkillingClick("R"); } } // W 스킬을 선택한 후 마우스 왼쪽 버튼을 클릭 if (skillSelect.Equals(SkillSelect.W)) { if (Input.GetMouseButtonDown(0)) { SkillingClick("W"); } } }
/// <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; } } } } }