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(); } }
public override void RCasting() { //HitEffectRPC("Alistar", "R", 14, 0.5f); //for (int i = 0; i < 14; ++i) // Invoke("R", 0.5f * i); //한개로 나오게 바꿈 HitEffectRPC("Alistar", "R", 1, 0.5f); Invoke("R", 0.5f); TheChampionData.UsedR(); switch (TheChampionData.skill_R) { case 1: rSkillTempVal = 122; break; //55% -> 45 = 10000/(100+x) -> x = 1100/9 = 122.2222222222 case 2: rSkillTempVal = 186; break; //65% -> 35 = 10000/(100+x) -> x = 1300/7 = 185.7142857142 case 3: rSkillTempVal = 300; break; //75% -> 25 = 10000/(100+x) -> x = 300 } TheChampionData.totalstat.Ability_Def += rSkillTempVal; TheChampionData.totalstat.Attack_Def += rSkillTempVal; if (!TheUIStat) { FindUICanvas(); } TheUIStat.Refresh(); Invoke("DownDefence", 7f); }
public override void QCasting() { isSkillIng = true; skillselect = SSelect.none; TheSplatManager.Cancel(); Q(); TheChampionData.UsedQ(); SkillEnd(1f); }
public override void RCasting() { isSkillIng = true; skillselect = SSelect.none; TheSplatManager.Cancel(); HitEffectRPC("Mundo", "R"); TheChampionData.UsedR(); R(); SkillEnd(0f); }
public override void ECasting() { isSkillIng = true; skillselect = SSelect.E; for (int i = 0; i < 10; ++i) { Invoke("E", 0.5f * i); } SkillEnd(5); TheChampionData.UsedE(); }
public override void QCasting() { isSkillIng = true; skillselect = SSelect.none; TheSplatManager.Cancel(); HitEffectRPC("Alistar", "Q"); Q(); TheChampionData.UsedQ(); SkillEnd(1f); championAnimation.AnimationApply("Q", true); championAnimation.AnimationApply("Q", false, 0.7f); }
/// <summary> /// ChampionData에 스킬을 사용했음을 알리는 함수 /// </summary> /// <param name="skillKey">사용한 스킬 단축키("Q", "W", "E", "R")</param> private void CallChampDataUsedSkill(string skillKey) { switch (skillKey) { case "Q": TheChampionData.UsedQ(); break; case "W": TheChampionData.UsedW(); break; case "E": TheChampionData.UsedE(); break; case "R": TheChampionData.UsedR(); break; } }
public override void QCasting() { if (qStackCount > 3) { isSkillIng = true; qStackCount = 0; if (IAmAshe == true) { TheStackImage.TextDic["AsheQ"].text = ""; TheStackImage.ImageDic["AsheQ"].gameObject.SetActive(false); } TheSplatManager.Cancel(); TheChampionData.UsedQ(); HitEffectRPC("Ashe", "Q"); Q(); SkillEnd(0f); } }
public override void RCasting() { for (int i = 0; i < 14; ++i) { Invoke("R", 0.5f * i); } TheChampionData.UsedR(); switch (TheChampionData.skill_R) { case 1: rSkillTempVal = 122; break; //55% -> 45 = 10000/(100+x) -> x = 1100/9 = 122.2222222222 case 2: rSkillTempVal = 186; break; //65% -> 35 = 10000/(100+x) -> x = 1300/7 = 185.7142857142 case 3: rSkillTempVal = 300; break; //75% -> 25 = 10000/(100+x) -> x = 300 } TheChampionData.mystat.Ability_Def += rSkillTempVal; TheChampionData.mystat.Attack_Def += rSkillTempVal; TheUIStat.Refresh(); Invoke("DownDefence", 7f); }
private void Update() { if (Input.GetKeyDown(KeyCode.Escape)) {//스킬선택해제 TheSplatManager.Cancel(); InitTempValue(); skillselect = SSelect.none; isSkillIng = false; } if (skillselect.Equals(SSelect.W)) { if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit[] r = Physics.RaycastAll(ray, 280); foreach (RaycastHit rc in r) {//미니언일때부터 분류. 챔피언은 나중에 추가 if (rc.transform.tag.Equals("Minion")) { if (Vector3.Distance(transform.position, rc.transform.position) <= TheSplatManager.Point.Range) { isSkillIng = true; TheSplatManager.Cancel(); TheAIPath.isStopped = true; TempObject1 = rc.transform.gameObject; TempVector1 = transform.position; TempVector2 = rc.transform.position; TheChampionData.UsedW(); transform.DOMove(TempVector2, 0.1f); Invoke("W", 0.1f); SkillEnd(0.1f); break; } } } } } }
private void Update() { if (Input.GetMouseButtonDown(1) || Input.GetKeyDown(KeyCode.Escape)) {//스킬선택해제 TheSplatManager.Cancel(); InitTempValue(); skillselect = SSelect.none; isSkillIng = false; } if (skillselect.Equals(SSelect.W)) { if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); int layerMask = (-1) - ((1 << LayerMask.NameToLayer("WallCollider"))); RaycastHit[] r = Physics.RaycastAll(ray, 280, layerMask); bool isEnemyClick = false; foreach (RaycastHit rc in r) {//미니언일때부터 분류. 챔피언은 나중에 추가 //if (rc.transform.tag.Equals("Minion") || rc.collider.gameObject.layer.Equals(LayerMask.NameToLayer("Champion"))) if (rc.transform.tag.Equals("Minion")) { if (!rc.transform.name.Contains(TheChampionBehaviour.Team)) { if (rc.transform.GetComponent <FogOfWarEntity>().isCanTargeting) { isEnemyClick = true; } } } else if (rc.collider.gameObject.layer.Equals(LayerMask.NameToLayer("Champion"))) { if (!rc.transform.GetComponent <ChampionBehavior>().Team.Equals(TheChampionBehaviour.Team)) { if (rc.transform.GetComponent <FogOfWarEntity>().isCanTargeting) { isEnemyClick = true; } } } else if (rc.collider.gameObject.layer.Equals(LayerMask.NameToLayer("Monster"))) { if (rc.transform.GetComponent <FogOfWarEntity>().isCanTargeting) { isEnemyClick = true; } } if (isEnemyClick) { if (Vector3.Distance(transform.position, rc.transform.position) <= TheSplatManager.Point.Range) { isSkillIng = true; TheSplatManager.Cancel(); TheAIPath.isStopped = true; TempObject1 = rc.transform.gameObject; TempVector1 = transform.position; TempVector2 = rc.transform.position; TheChampionData.UsedW(); transform.DOLookAt(TempVector2, 0.1f); transform.DOMove(TempVector2, 0.1f); Invoke("W", 0.1f); SkillEnd(0.1f); break; } } else { TheSplatManager.Cancel(); InitTempValue(); skillselect = SSelect.none; isSkillIng = false; } } } } }
/// <summary> /// R 스킬 함수 /// </summary> public override void R() { // 스킬을 켜고 끄는 것을 R 함수 하나가 담당하게 하기 위해 bool 값을 토글시킴 isR = !isR; if (isR) { rTime = 1f; rCount = 12; rSkillObj.SetActive(true); ChampionSound.instance.TempAudio.loop = true; ChampionSound.instance.TempAudio.clip = ChampionSound.instance.Mundo_RActive; ChampionSound.instance.TempAudio.Play(); float hpPercent = TheChampionData.totalStat.MaxHp; // 스킬 레벨에 따라 회복량을 설정 if (TheChampionData.skill_R.Equals(2)) { hpPercent *= 0.75f; } else if (TheChampionData.skill_R.Equals(1)) { hpPercent *= 0.5f; } // 12회에 걸쳐 회복시킴 rHealValue = hpPercent / 12f; if (photonView.isMine) { float percent = 0.15f + ((float)(TheChampionData.skill_R - 1) * 0.1f); TheChampionData.skillPlusSpeed = (TheChampionData.myStat.MoveSpeed + TheChampionData.itemStat.movementSpeed) * percent; TheChampionData.TotalStatSpeedUpdate(); TheChampionData.UIStat.Refresh(); for (int i = 0; i < rSkillOnlyFirstEffect.Length; ++i) { rSkillOnlyFirstEffect[i].SetActive(true); } } else {// 현재 플레이어의 위치에 따라 스킬 이펙트가 누구에게 보이는지 계산 // 적이 시야 범위에 있음 if (myFogEntity.isInTheSightRange) { // 시야 범위 내의 부쉬 안에 있음 if (myFogEntity.isInTheBush) { // 그 부쉬에 우리 팀도 있으면 보임 if (myFogEntity.isInTheBushMyEnemyToo) { for (int i = 0; i < rSkillOnlyFirstEffect.Length; ++i) { rSkillOnlyFirstEffect[i].SetActive(true); } } else// 그 부쉬에 우리 팀이 없으면 안보임 { for (int i = 0; i < rSkillOnlyFirstEffect.Length; ++i) { rSkillOnlyFirstEffect[i].SetActive(false); } } } else// 시야 범위 내인데 부쉬에도 없으면 보임 { for (int i = 0; i < rSkillOnlyFirstEffect.Length; ++i) { rSkillOnlyFirstEffect[i].SetActive(true); } } } else// 적이 시야 범위에 없으면 안보임 { for (int i = 0; i < rSkillOnlyFirstEffect.Length; ++i) { rSkillOnlyFirstEffect[i].SetActive(false); } } } } else {// 스킬을 해제함 rSkillObj.SetActive(false); 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(); } } }
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; } } } } }
public override void W() { InitTempValue(); OnMove(); HitEffectRPC("Alistar", "W"); GameObject obj = SkillObj["W"][0]; if (obj.activeInHierarchy) { Pooling(QSkillprefab, "W", 10); obj = SkillObj["W"][0]; } SkillObj["W"].RemoveAt(0); SkillObj["W"].Add(obj); obj.transform.position = transform.position; obj.SetActive(true); if (TempObject1.tag.Equals("Minion")) { MinionBehavior mB = TempObject1.GetComponent <MinionBehavior>(); if (!TempObject1.gameObject.name.Contains(TheChampionBehaviour.Team)) { MinionAtk mA = mB.minAtk; //mA.PushMe(Vector3.up * 3 + TempObject1.transform.position // + (((TempObject1.transform.position - TempVector1).normalized) * 5), 0.5f); Vector3 direction = (TempObject1.transform.position - TempVector1).normalized; Vector3 v = TempObject1.transform.position + (direction * 10);; RaycastHit hit; if (Physics.Raycast(mA.transform.position, direction, out hit, 12, 1 << LayerMask.NameToLayer("WallCollider"))) { float dis = Vector3.Distance(hit.point, TempObject1.transform.position); v = TempObject1.transform.position + (direction * (dis - 1f)); } v.y = 0; mA.PushMe(v, 0.5f); mA.PauseAtk(1f, true); float damage = skillData.wDamage[TheChampionData.skill_W - 1] + Acalculate(skillData.wAstat, skillData.wAvalue); if (mB != null) { int viewID = mB.GetComponent <PhotonView>().viewID; HitRPC(viewID, damage, "AP", "Push"); if (mB.HitMe(damage, "AP", gameObject)) { //여기에는 나중에 평타 만들면 플레이어의 현재 공격 타겟이 죽었을 시 초기화해주는 것을 넣자. TheChampionAtk.ResetTarget(); // 스킬쏜애 주인이 나면 킬올리자 if (GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player)) { TheChampionData.Kill_CS_Gold_Exp(TempObject1.gameObject.name, 1, TempObject1.transform.position); } } } } } //else if (TempObject1.tag.Equals("Player")) else if (TempObject1.layer.Equals(LayerMask.NameToLayer("Champion"))) { ChampionBehavior cB = TempObject1.GetComponent <ChampionBehavior>(); if (cB.Team != TheChampionBehaviour.Team) { ChampionAtk cA = cB.myChampAtk; Vector3 direction = (TempObject1.transform.position - TempVector1).normalized; Vector3 v = TempObject1.transform.position + (direction * 5);; RaycastHit hit; if (Physics.Raycast(cA.transform.position, direction, out hit, 6, 1 << LayerMask.NameToLayer("WallCollider"))) { float dis = Vector3.Distance(hit.point, TempObject1.transform.position); v = TempObject1.transform.position + (direction * (dis - 1f)); } v.y = 0.5f; cA.PushMe(v, 0.5f); cA.PauseAtk(1f, true); float damage = skillData.wDamage[TheChampionData.skill_W - 1] + Acalculate(skillData.wAstat, skillData.wAvalue); if (cB != null) { int viewID = cB.GetComponent <PhotonView>().viewID; HitRPC(viewID, damage, "AP", "Push"); if (cB.HitMe(damage, "AP", gameObject, gameObject.name)) { TheChampionAtk.ResetTarget(); if (!sysmsg) { sysmsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent <SystemMessage>(); } //sysmsg.sendKillmsg("alistar", TempObject1.GetComponent<ChampionData>().ChampionName, TheChampionBehaviour.Team.ToString()); // 스킬쏜애 주인이 나면 킬올리자 //if (GetComponent<PhotonView>().owner.Equals(PhotonNetwork.player)) //{ // TheChampionData.Kill_CS_Gold_Exp(TempObject1.gameObject.name, 0, TempObject1.transform.position); //} } } } } else if (TempObject1.layer.Equals(LayerMask.NameToLayer("Monster"))) { MonsterBehaviour mB = TempObject1.GetComponent <MonsterBehaviour>(); MonsterAtk mA = mB.monAtk; Vector3 direction = (TempObject1.transform.position - TempVector1).normalized; Vector3 v = TempObject1.transform.position + (direction * 5);; RaycastHit hit; if (Physics.Raycast(mA.transform.position, direction, out hit, 6, 1 << LayerMask.NameToLayer("WallCollider"))) { float dis = Vector3.Distance(hit.point, TempObject1.transform.position); v = TempObject1.transform.position + (direction * (dis - 1f)); } v.y = 0; mA.PushMe(v, 0.5f); mA.PauseAtk(1f, true); float damage = skillData.wDamage[TheChampionData.skill_W - 1] + Acalculate(skillData.wAstat, skillData.wAvalue); if (mB != null) { int viewID = mB.GetComponent <PhotonView>().viewID; HitRPC(viewID, damage, "AP", "Push"); if (mB.HitMe(damage, "AP", gameObject)) { TheChampionAtk.ResetTarget(); //// 스킬쏜애 주인이 나면 킬올리자 //if (GetComponent<PhotonView>().owner.Equals(PhotonNetwork.player)) //{ // TheChampionData.Kill_CS_Gold_Exp(TempObject1.gameObject.name, 3, TempObject1.transform.position); //} } } } skillselect = SSelect.none; }
public override void R() { isR = !isR; if (isR) { rTime = 1f; rCount = 12; RSkillObj.SetActive(true); ChampionSound.instance.TempAudio.loop = true; ChampionSound.instance.TempAudio.clip = ChampionSound.instance.Mundo_RActive; ChampionSound.instance.TempAudio.Play(); float hpPerc = TheChampionData.totalstat.MaxHp; if (TheChampionData.skill_R.Equals(2)) { hpPerc *= 0.75f; } else if (TheChampionData.skill_R.Equals(1)) { hpPerc *= 0.5f; } rHealValue = hpPerc / 12f; if (photonView.isMine) { float perc = 0.15f + ((float)(TheChampionData.skill_R - 1) * 0.1f); TheChampionData.skillPlusSpeed = (TheChampionData.mystat.Move_Speed + TheChampionData.itemstat.movement_speed) * perc; TheChampionData.TotalStatSpeedUpdate(); TheChampionData.UIStat.Refresh(); for (int i = 0; i < RSkillOnlyFirstEffect.Length; ++i) { RSkillOnlyFirstEffect[i].SetActive(true); } } else { if (myFogEntity.isInTheSightRange) { //적이 시야 범위에 있음 if (myFogEntity.isInTheBush) { //시야 범위 내의 부쉬 안에 있음 if (myFogEntity.isInTheBushMyEnemyToo) { //그 부쉬에 우리 팀도 있으면 보임 for (int i = 0; i < RSkillOnlyFirstEffect.Length; ++i) { RSkillOnlyFirstEffect[i].SetActive(true); } } else {//그 부쉬에 우리 팀이 없으면 안보임 for (int i = 0; i < RSkillOnlyFirstEffect.Length; ++i) { RSkillOnlyFirstEffect[i].SetActive(false); } } } else {//시야 범위 내인데 부쉬에도 없으면 보임 for (int i = 0; i < RSkillOnlyFirstEffect.Length; ++i) { RSkillOnlyFirstEffect[i].SetActive(true); } } } else {//적이 시야 범위에 없으면 안보임 for (int i = 0; i < RSkillOnlyFirstEffect.Length; ++i) { RSkillOnlyFirstEffect[i].SetActive(false); } } } } else { RSkillObj.SetActive(false); 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(); } } }