public void jump(SkillXmlData jumpDta, LGAvatarGameInst to_lc) { base.stop(); base.RotationToPt(to_lc.x, to_lc.y); Transform transform = to_lc.gameObj.transform; this.pGameobject.transform.position = transform.position; this.setPos(to_lc.x, to_lc.y); Vector3 position = this.gameObj.transform.position; Vector3 position2 = transform.position; float num = Vector3.Distance(position, position2); Vector3 end = Vector3.Lerp(position, position2, (float)((double)num - 1.5) / num); bool flag = jumpDta.jump_canying != "null"; if (flag) { MapEffMgr.getInstance().playMoveto(jumpDta.jump_canying, position, end, 0.4f); } bool flag2 = jumpDta.eff != "null"; if (flag2) { MapEffMgr.getInstance().play(jumpDta.eff, transform.position, transform.rotation, 0f, null); } }
public void jump(SkillXmlData jumpDta, float gezi_distance) { base.stop(); LGMap lGMap = GRClient.instance.g_gameM.getObject("LG_MAP") as LGMap; Vec2 farthestGPosByOri = lGMap.getFarthestGPosByOri(this.x, this.y, this.lg_ori_angle * 3.14159274f / 180f, gezi_distance); this.setPos(farthestGPosByOri.x * 32f, farthestGPosByOri.y * 32f); }
public void playSong(uint skillid) { bool flag = this.pTrans == null; if (!flag) { SkillXmlData skillXml = ModelBase <SkillModel> .getInstance().getSkillXml(skillid); MapEffMgr.getInstance().play(skillXml.eff + "_song", this.pTrans, UnityEngine.Random.Range(0f, 359f), 0f); } }
protected virtual void playSkill(uint sid, int sex, uint toIID, float tx = 0f, float ty = 0f) { bool destroy = base.destroy; if (!destroy) { SkillXmlData skillXml = ModelBase <SkillModel> .getInstance().getSkillXml(sid); bool flag = skillXml.target_type == 1; if (flag) { LGAvatarGameInst lGAvatarGameInst = base.get_Character_by_iid(toIID); bool useJump = skillXml.useJump; if (useJump) { bool flag2 = lGAvatarGameInst != null; if (flag2) { this.jump(skillXml, lGAvatarGameInst); } } else { bool flag3 = toIID > 0u; if (flag3) { bool flag4 = lGAvatarGameInst != null && lGAvatarGameInst != this; if (flag4) { base.RotationToPt(lGAvatarGameInst.x, lGAvatarGameInst.y); } } this.playSkillAction(sid, (sex == 0) ? skillXml.eff : skillXml.eff_female, lGAvatarGameInst); } } bool flag5 = skillXml.target_type == 2; if (flag5) { bool useJump2 = skillXml.useJump; if (useJump2) { this.jump(skillXml, tx, ty); this.playSkillAction(sid, null, null); } else { base.RotationToPt(tx, ty); this.playSkillAction(sid, (sex == 0) ? skillXml.eff : skillXml.eff_female, null); } } } }
public void jump(SkillXmlData jumpDta, float tx, float ty) { base.stop(); Vector3 position = this.gameObj.transform.position; Vector3 vector = new Vector3(tx / 53.333f, GRClient.instance.getZ(tx, ty), ty / 53.333f); float num = Vector3.Distance(position, vector); Vector3 end = Vector3.Lerp(position, vector, (float)((double)num - 1.5) / num); bool flag = jumpDta.jump_canying != "null"; if (flag) { MapEffMgr.getInstance().playMoveto(jumpDta.jump_canying, position, end, 0.4f); } bool flag2 = jumpDta.eff != "null"; if (flag2) { MapEffMgr.getInstance().play(jumpDta.eff, vector, this.gameObj.transform.rotation, 0f, null); } this.setPos(tx, ty); }
public void initXml() { this.skillHitXmls = new Dictionary <uint, SkillHitedXml>(); SXML sXML = XMLMgr.instance.GetSXML("skill.hited", null); bool flag = sXML == null; if (flag) { Debug.Log("config [skill.hited] is missing"); } else { do { SkillHitedXml skillHitedXml = new SkillHitedXml(); string[] array = sXML.getString("rim_Color").Split(new string[] { "," }, StringSplitOptions.None); bool flag2 = array.Length == 3; if (flag2) { Color rimColor = new Color(float.Parse(array[0]), float.Parse(array[1]), float.Parse(array[2])); array = sXML.getString("main_Color").Split(new string[] { "," }, StringSplitOptions.None); bool flag3 = array.Length == 3; if (flag3) { Color mainColor = new Color(float.Parse(array[0]), float.Parse(array[1]), float.Parse(array[2])); skillHitedXml.rimColor = rimColor; skillHitedXml.mainColor = mainColor; this.skillHitXmls[sXML.getUint("id")] = skillHitedXml; } } }while (sXML.nextOne()); this.skillXMl = new Dictionary <uint, SkillXmlData>(); sXML = XMLMgr.instance.GetSXML("skill.skill", null); do { uint @uint = sXML.getUint("id"); SkillXmlData skillXmlData = default(SkillXmlData); skillXmlData.id = @uint; skillXmlData.skill_name = sXML.getString("skill_name"); skillXmlData.eff = sXML.getString("eff"); skillXmlData.eff_female = sXML.getString("eff_female"); skillXmlData.target_type = sXML.getInt("skill_targettype"); SXML node = sXML.GetNode("jump", null); skillXmlData.useJump = false; skillXmlData.hitfall = (sXML.getInt("hitfall") == 1); bool flag4 = node != null; if (flag4) { skillXmlData.useJump = true; skillXmlData.jump_canying = node.getString("canying"); } uint uint2 = sXML.getUint("hide_id"); bool flag5 = this.skillHitXmls.ContainsKey(uint2); if (flag5) { skillXmlData.hitxml = this.skillHitXmls[uint2]; } skillXmlData.lv = new Dictionary <uint, SkillLvXmlData>(); node = sXML.GetNode("Level", null); bool flag6 = node != null; if (flag6) { do { SkillLvXmlData skillLvXmlData = default(SkillLvXmlData); uint uint3 = node.getUint("level"); skillLvXmlData.range = (float)(node.getInt("range") + 32) / 53.333f; skillLvXmlData.range_gezi = (int)skillLvXmlData.range / 32; skillLvXmlData.cd = node.getUint("cd_time"); skillLvXmlData.desc = node.getString("description"); skillLvXmlData.pvp_param = node.getInt("pvp_param"); skillLvXmlData.needMoney = node.getInt("need_money"); skillLvXmlData.attr = node.getInt("skill_attribute"); skillLvXmlData.needExp = node.getInt("need_exp"); skillXmlData.lv[uint3] = skillLvXmlData; }while (node.nextOne()); } this.skillXMl[@uint] = skillXmlData; }while (sXML.nextOne()); } }
public void initXml() { skillHitXmls = new Dictionary <uint, SkillHitedXml>(); SkillHitedXml skillhitxml; SXML s_xml = XMLMgr.instance.GetSXML("skill.hited", null); if (s_xml == null) { debug.Log("config [skill.hited] is missing"); return; } do { skillhitxml = new SkillHitedXml(); string[] arr = s_xml.getString("rim_Color").Split(new string[] { "," }, StringSplitOptions.None); Color c1; Color c2; if (arr.Length == 3) { c1 = new Color(float.Parse(arr[0]), float.Parse(arr[1]), float.Parse(arr[2])); } else { continue; } arr = s_xml.getString("main_Color").Split(new string[] { "," }, StringSplitOptions.None); if (arr.Length == 3) { c2 = new Color(float.Parse(arr[0]), float.Parse(arr[1]), float.Parse(arr[2])); } else { continue; } skillhitxml.rimColor = c1; skillhitxml.mainColor = c2; skillHitXmls[s_xml.getUint("id")] = skillhitxml; } while (s_xml.nextOne()); skillXMl = new Dictionary <uint, SkillXmlData>(); s_xml = XMLMgr.instance.GetSXML("skill.skill", null); SkillXmlData tempXml = null; SkillLvXmlData tempLvXml; SXML tempxml; do { uint id = s_xml.getUint("id"); tempXml = new SkillXmlData(); tempXml.id = id; tempXml.skill_name = s_xml.getString("skill_name"); tempXml.eff = s_xml.getString("eff"); tempXml.eff_female = s_xml.getString("eff_female"); tempXml.target_type = s_xml.getInt("skill_targettype"); tempxml = s_xml.GetNode("jump", null); tempXml.useJump = false; tempXml.hitfall = s_xml.getInt("hitfall") == 1; if (tempxml != null) { tempXml.useJump = true; tempXml.jump_canying = tempxml.getString("canying"); } uint hidedid = s_xml.getUint("hide_id"); if (skillHitXmls.ContainsKey(hidedid)) { tempXml.hitxml = skillHitXmls[hidedid]; } tempXml.lv = new Dictionary <uint, SkillLvXmlData>(); tempxml = s_xml.GetNode("Level", null); if (tempxml != null) { do { tempLvXml = new SkillLvXmlData(); uint lv = tempxml.getUint("level"); tempLvXml.range = (tempxml.getInt("range") + (int)GameConstant.GEZI) / GameConstant.PIXEL_TRANS_UNITYPOS; tempLvXml.range_gezi = (int)tempLvXml.range / (int)GameConstant.GEZI; tempLvXml.cd = tempxml.getUint("cd_time"); tempLvXml.desc = tempxml.getString("description"); tempLvXml.pvp_param = tempxml.getInt("pvp_param"); tempLvXml.needMoney = tempxml.getInt("need_money"); tempLvXml.attr = tempxml.getInt("skill_attribute"); tempLvXml.needExp = tempxml.getInt("need_exp"); tempXml.lv[lv] = tempLvXml; } while (tempxml.nextOne()); } skillXMl[id] = tempXml; } while (s_xml.nextOne()); }
public void OnHurt(Variant data, LGAvatarGameInst frm_c) { bool flag = base.isMainPlayer(); bool flag2 = false; bool flag3 = false; bool flag4 = frm_c != null; if (flag4) { flag2 = frm_c.isMainPlayer(); flag3 = (frm_c is LGAvatarHero && ((LGAvatarHero)frm_c).isUserOwnHero); } int id = data.ContainsKey("skill_id") ? data["skill_id"]._int : 0; bool flag5 = data.ContainsKey("isdie") && data["isdie"]._bool; bool flag6 = data.ContainsKey("dmg") && data["dmg"]._int != 0; if (flag6) { int num = -data["dmg"]._int; int num2 = 0; bool flag7 = data.ContainsKey("hprest"); if (flag7) { num2 = data["hprest"]; } bool flag8 = flag; if (flag8) { ModelBase <PlayerModel> .getInstance().modHp(num2); SkillXmlData skillXml = ModelBase <SkillModel> .getInstance().getSkillXml((uint)id); bool hitfall = skillXml.hitfall; if (hitfall) { base.setMeshAni("hitfall", 1); } } else { bool flag9 = this is LGAvatarHero; if (flag9) { uint mid = this.getMid(); } } this.modHp(num2); } else { bool flag10 = data.ContainsKey("hpadd"); if (flag10) { int @int = data["hpadd"]._int; int hprest = data["hprest"]; this.modHp(data["hprest"]); bool flag11 = flag; if (flag11) { ModelBase <PlayerModel> .getInstance().modHp(hprest); } } } bool flag12 = flag5; if (flag12) { bool flag13 = !flag2 && !flag3; if (flag13) { this.Die(data); } } bool flag14 = this._isCastingSkill && this._curCastingTm + this._castingTm < (float)this.g_mgr.g_netM.CurServerTimeStampMS; if (flag14) { this._isCastingSkill = false; } bool flag15 = !flag && (flag2 | flag3); if (flag15) { data["hurteff"] = true; } }