public void Bomb() { int _mp = Skill_Register.GetSkill("MagicSkill1").mp_use; if (Property_Controller.Instance.Get_CurrentMP() >= _mp && cd[0] <= 0) { used_skill = true; cd[0] = Skill_Register.GetSkill("MagicSkill1").cd; Property_Controller.Instance.Change_CurrentMP(-_mp); //mp-=20; animator.SetTrigger("bomb_trigger"); cols = Physics.OverlapSphere(character.transform.position, 5f); for (int i = 0; i < cols.Length; i++) { if (cols[i] != null && cols[i].tag == "monster") { Monster_Manage monster = cols[i].GetComponent <Monster_Manage>(); monster.Monster_Manage_Change_Hp(-Skill_Damage.Instance.GetDamage("MagicSkill1")); } } Instantiate(bomb_particle, character.transform.position, character.transform.rotation); character.transform.position -= character.transform.forward * 8f; } }
void Shackles() { cols = Physics.OverlapSphere(character.transform.position, 8f); int _mp = Skill_Register.GetSkill("MagicSkill4").mp_use; if (Property_Controller.Instance.Get_CurrentMP() >= _mp && TargetExist() && cd[3] <= 0) { used_skill = true; Property_Controller.Instance.Change_CurrentMP(-_mp); cd[3] = Skill_Register.GetSkill("MagicSkill4").cd; Property_Controller.Instance.Change_CurrentMP(-_mp); DestroyForTime_CSP destroy = shackle_particle.GetComponent <DestroyForTime_CSP>(); animator.SetTrigger("shackle_trigger"); float timer = Skill_Register.GetSkill("MagicSkill4").skill_level * 0.5f + 2f; destroy.timer = timer; for (int i = 0; i < cols.Length; i++) { if (cols[i] != null && cols[i].tag == "monster") { Monster_Manage monster = cols[i].GetComponent <Monster_Manage>(); monster.Monster_Manage_Change_Hp(-Skill_Damage.Instance.GetDamage("MagicSkill4")); Instantiate(shackle_particle, cols[i].transform.position, cols[i].transform.rotation); monster.stop = true; } } Collider[] temp_cols = cols; StartCoroutine(UnShackles(temp_cols, timer)); } }
public void Upgrade() { if (Property_Controller.Instance.Get_Skill_Point() > 0) { Skill_Register.GetSkill(DetailLoad.skill_name).skill_level++; Property_Controller.Instance.Change_Skill_Point(-1); } }
public void FlameClose() { if (cd[3] <= 0) { cd[3] = Skill_Register.GetSkill("SwordSkill3").cd; flame_mode = false; Skill_Register.GetSkill("SwordSkill3").effect = FlameOpen; Property_Controller.Instance.Change_AD(-ad_add); ad_add = 0; } }
public void FlameOpen() { int _mp = Skill_Register.GetSkill("SwordSkill3").mp_use; if (Property_Controller.Instance.Get_CurrentMP() >= _mp && cd[3] <= 0) { used_skill = true; cd[3] = Skill_Register.GetSkill("SwordSkill3").cd; Property_Controller.Instance.Change_CurrentMP(-_mp); flame_mode = true; Skill_Register.GetSkill("SwordSkill3").effect = FlameClose; } }
public void Orb() { int _mp = Skill_Register.GetSkill("MagicSkill3").mp_use; if (Property_Controller.Instance.Get_CurrentMP() >= _mp && cd[2] <= 0) { used_skill = true; Property_Controller.Instance.Change_CurrentMP(-_mp); cd[2] = Skill_Register.GetSkill("MagicSkill3").cd; animator.SetTrigger("orb_trigger"); Invoke("CreateOrb", 0.36f); } }
public void Lightning() { int _mp = Skill_Register.GetSkill("MagicSkill2").mp_use; cols = Physics.OverlapSphere(character.transform.position, 5f); if (Property_Controller.Instance.Get_CurrentMP() >= _mp && TargetExist() && cd[1] <= 0) { used_skill = true; Property_Controller.Instance.Change_CurrentMP(-_mp); cd[1] = Skill_Register.GetSkill("MagicSkill2").cd; animator.SetTrigger("lightning_trigger"); Invoke("CallLightning", 0.5f); Instantiate(lightning_sound, character.transform.position, character.transform.rotation); } }
public void detail() { if (Property_Controller.my_Property == null) { return; } UILabel label = GetComponent <UILabel>(); if (Property_Controller.my_Property.career == Career.Swordman) { GameObject temp = transform.Find("MP").gameObject; UILabel temp_label = temp.GetComponent <UILabel>(); temp_label.text = Skill_Register.GetSkill("SwordSkill" + (DescriptionShow.current_click + 1)).mp_use + " mp"; temp = transform.Find("CD").gameObject; temp_label = temp.GetComponent <UILabel>(); temp_label.text = Skill_Register.GetSkill("SwordSkill" + (DescriptionShow.current_click + 1)).cd + " seconds"; temp = transform.Find("Damage").gameObject; temp_label = temp.GetComponent <UILabel>(); temp_label.text = Skill_Register.GetSkill("SwordSkill" + (DescriptionShow.current_click + 1)).damage_des + " [FFFFFF]: [FF0000]" + Skill_Damage.Instance.GetDamage("SwordSkill" + (DescriptionShow.current_click + 1));; temp = transform.Find("Description").gameObject; temp_label = temp.GetComponent <UILabel>(); temp_label.text = Skill_Register.GetSkill("SwordSkill" + (DescriptionShow.current_click + 1)).des; } //label.text = "Lv" + Skill_Register.GetSkill("Sword" + name).skill_level; else if (Property_Controller.my_Property.career == Career.Magician) { GameObject temp = transform.Find("MP").gameObject; UILabel temp_label = temp.GetComponent <UILabel>(); temp_label.text = Skill_Register.GetSkill("MagicSkill" + (DescriptionShow.current_click + 1)).mp_use + " mp"; temp = transform.Find("CD").gameObject; temp_label = temp.GetComponent <UILabel>(); temp_label.text = Skill_Register.GetSkill("MagicSkill" + (DescriptionShow.current_click + 1)).cd + " seconds"; temp = transform.Find("Damage").gameObject; temp_label = temp.GetComponent <UILabel>(); temp_label.text = Skill_Register.GetSkill("MagicSkill" + (DescriptionShow.current_click + 1)).damage_des + " [FFFFFF]: [FF0000]" + Skill_Damage.Instance.GetDamage("SwordSkill" + (DescriptionShow.current_click + 1));; temp = transform.Find("Description").gameObject; temp_label = temp.GetComponent <UILabel>(); temp_label.text = Skill_Register.GetSkill("MagicSkill" + (DescriptionShow.current_click + 1)).des; } }
void SkillInit() { Skill_Register.GetSkill("SwordSkill1").effect = Blink; Skill_Register.GetSkill("SwordSkill2").effect = Strike; Skill_Register.GetSkill("SwordSkill3").effect = FlameOpen; Skill_Register.GetSkill("SwordSkill4").effect = Ultimate; Skill_Register.GetSkill("MagicSkill1").effect = Bomb; Skill_Register.GetSkill("MagicSkill2").effect = Lightning; Skill_Register.GetSkill("MagicSkill3").effect = Orb; Skill_Register.GetSkill("MagicSkill4").effect = Shackles; for (int i = 0; i < sword_skill_num; i++) { cd[i] = 0; cd[i] = 0; } }
public void lv() { if (Property_Controller.my_Property == null) { return; } UILabel label = GetComponent <UILabel>(); if (Property_Controller.my_Property.career == Career.Swordman) { label.text = "Lv" + Skill_Register.GetSkill("Sword" + name).skill_level; } else if (Property_Controller.my_Property.career == Career.Magician) { Debug.Log(Skill_Register.GetSkill("Magic" + name)); label.text = "Lv" + Skill_Register.GetSkill("Magic" + name).skill_level; } }
public void Ultimate() { int _mp = Skill_Register.GetSkill("SwordSkill4").mp_use; cols = Physics.OverlapSphere(character.transform.position + character.transform.forward * 3, 3f); if (Property_Controller.Instance.Get_CurrentMP() >= _mp && TargetExist() && cd[2] <= 0) { used_skill = true; cd[2] = Skill_Register.GetSkill("SwordSkill4").cd; Property_Controller.Instance.Change_CurrentMP(-_mp); int i; animator.SetTrigger("ultimate_trigger"); Invoke("CallSkyfire", 0.1f); Invoke("UltimateDamage", 0.1f); Invoke("CallSkyfire", 0.2f); for (i = 0; i < 5; i++) { Invoke("CallSkyfire", 0.5f); } Invoke("UltimateDamage", 0.5f); Invoke("CallSkyfire", 0.6f); Invoke("CallSkyfire", 0.75f); Invoke("CallSkyfire", 0.8f); for (i = 0; i < 5; i++) { Invoke("CallSkyfire", 1f); } Invoke("UltimateDamage", 1f); for (i = 0; i < 10; i++) { Invoke("CallSkyfire", 1.6f); } Invoke("UltimateDamage", 1.6f); } }
public void Missile() { int _mp = Skill_Register.GetSkill("MagicSkill4").mp_use; if (Property_Controller.Instance.Get_CurrentMP() >= _mp && cd[3] <= 0) { used_skill = true; Property_Controller.Instance.Change_CurrentMP(-_mp); cd[3] = Skill_Register.GetSkill("MagicSkill4").cd; Ray ray = new Ray(character.transform.position - character.transform.forward + Vector3.up, character.transform.forward); RaycastHit hit; for (int i = 0; i < 6; i++) { ray = new Ray(character.transform.position - character.transform.forward + Vector3.up, character.transform.forward + i * 0.1f * character.transform.right); if (Physics.Raycast(ray, out hit, 20f)) { Debug.DrawLine(ray.origin, hit.point, Color.red, 10); if (hit.collider.gameObject.tag == "monster") { hit.collider.gameObject.GetComponent <Monster_Manage>().Monster_Manage_Change_Hp(-Property_Controller.Instance.Get_AD()); break; } } ray = new Ray(character.transform.position - character.transform.forward + Vector3.up, character.transform.forward - i * 0.1f * character.transform.right); if (Physics.Raycast(ray, out hit, 20f)) { Debug.DrawLine(ray.origin, hit.point, Color.red, 10); if (hit.collider.gameObject.tag == "monster") { hit.collider.gameObject.GetComponent <Monster_Manage>().Monster_Manage_Change_Hp(-Property_Controller.Instance.Get_AD()); break; } } } } }
public void Strike() { int _mp = Skill_Register.GetSkill("SwordSkill2").mp_use; cols = Physics.OverlapSphere(character.transform.position + character.transform.forward * 3, 3f); if (Property_Controller.Instance.Get_CurrentMP() >= _mp && TargetExist() && cd[1] <= 0) { used_skill = true; cd[1] = Skill_Register.GetSkill("SwordSkill2").cd; Property_Controller.Instance.Change_CurrentMP(-_mp); int i; character.transform.Find("Swordman_Body001").SendMessage("hide"); character.transform.Find("Swordman_Sword").SendMessage("hide"); animator.SetTrigger("strike_trigger"); //GameObject child = character.transform.FindChild("Swordman_Body001")as GameObject; //GetComponentsInChildren<renderer> //if(child.renderer) // child.renderer.material.color = new Color(renderer.material.color.r,renderer.material.color.g,renderer.material.color.b,0); for (i = 0; i < cols.Length; i++) { Debug.Log(cols[i].name); if (cols[i] != null && cols[i].tag == "monster") { Instantiate(fen_shen, cols[i].transform.position - cols[i].transform.forward, cols[i].transform.rotation); Monster_Manage monster = cols[i].GetComponent <Monster_Manage>(); monster.stop = true; //Instantiate (slash_particle, cols[i].transform.position, cols[i].transform.rotation); //Instantiate (slash_particle, cols[i].transform.position, cols[i].transform.rotation); } } Invoke("StrikeDone", 1.2f); Collider[] temp_cols = cols; StartCoroutine(StrikeDone2(temp_cols)); } }
int Sword1() { int lv = Skill_Register.GetSkill("SwordSkill1").skill_level; return(5 + 3 * lv + 2 * ad); }
int Sword2() { int lv = Skill_Register.GetSkill("SwordSkill2").skill_level; return(20 + 8 * lv + 3 * ad); }
int Sword3() { int lv = Skill_Register.GetSkill("SwordSkill3").skill_level; return(12 + 5 * lv + 2 * ad); }
int Sword4() { int lv = Skill_Register.GetSkill("SwordSkill4").skill_level; return(8 + 3 * lv + (int)(0.1 * ad)); }
int Magic1() { int lv = Skill_Register.GetSkill("MagicSkill1").skill_level; return(3 * lv + 2 * ap); }
int Magic2() { int lv = Skill_Register.GetSkill("MagicSkill2").skill_level; return(10 + 3 * lv + 3 * ap); }
int Magic4() { int lv = Skill_Register.GetSkill("MagicSkill4").skill_level; return(25 + 5 * lv + 3 * ap); }
// Update is called once per frame void Update() { mask.fillAmount = Skill.cd[skillName[skillName.Length - 1] - '1'] / Skill_Register.GetSkill(skillName).cd; //Debug.Log(Skill.cd[skillName[skillName.Length - 1] - '1']); }
void onclick(GameObject g) { if (btn2[g.name[14] - '0'] == null) { return; } if (btn2 [g.name [14] - '0'] == ("icon-null")) { return; } //Debug.Log("use " + (g.name[14] - '0') + " " + btn2[g.name[14] - '0']); if (tp [g.name [14] - '0'] == 2) { if (cd[g.name[14] - '0'] > 0) { return; } if (!Property_Controller.Instance.Get_Bag().Use(btn2 [g.name [14] - '0'])) { for (int i = 1; i <= 5; i++) { if (i != g.name [14] - '0') { if (btn2[i] != null) { if (btn2[i] == btn2 [g.name [14] - '0']) { btn2[i] = "icon-null"; } } } } btn2 [g.name [14] - '0'] = "icon-null"; } for (int i = 1; i <= 5; i++) { if (btn2[i] != null && btn2 [g.name [14] - '0'] != "icon-null") { if (btn2[i] == btn2 [g.name [14] - '0']) { cdt[i] = 0.8f; cd[i] = 1; } } } if (UI_manager.m_BagUI != null) { UI_manager.m_BagUI.GetComponent <BagManager>().refresh(); } } else { Debug.Log(cd[g.name [14] - '0']); if (cd[g.name [14] - '0'] > 0) { return; } //Debug.Log(123); /* * if (btn2[g.name[14] - '0'].Equals("skill-01")) * { * cd[g.name[14] - '0'] = Skill.blink_cd; * cdt[g.name[14] - '0'] = Skill.blink_cd; * } * if (btn2[g.name[14] - '0'].Equals("skill-02")) * { * cd[g.name[14] - '0'] = Skill.strike_cd; * cdt[g.name[14] - '0'] = Skill.strike_cd; * } * if (btn2[g.name[14] - '0'].Equals("skill-03")) * { * cd[g.name[14] - '0'] = Skill.ultimate_cd; * cdt[g.name[14] - '0'] = Skill.ultimate_cd; * Debug.Log(cdt[g.name[14] - '0']); * } */ cdtt = Skill_Register.GetSkill(btn2[g.name[14] - '0']).cd; //cd[g.name[14] - '0'] = 1; Skill_Register.DoSkill(btn2[g.name [14] - '0']); used = btn2[g.name [14] - '0']; // Debug.Log(42324242342); } }
int Magic3() { int lv = Skill_Register.GetSkill("MagicSkill3").skill_level; return(5 + 3 * lv + 1 * ap); }