public void onHurt(Variant d) { Vector3 headPos = this.getHeadPos(); bool flag = d.ContainsKey("ft"); if (flag) { bool flag2 = d.ContainsKey("criatk"); if (flag2) { FightText.play(d["ft"], headPos, d["dmg"], d["criatk"], -1); } else { FightText.play(d["ft"], headPos, d["dmg"], false, -1); } } bool flag3 = d.ContainsKey("hurteff"); if (flag3) { bool flag4 = this.middleoffset == Vector3.zero; if (flag4) { this.middleoffset = new Vector3(0f, this.m_char.chaHeight * 0.5f, 0f); } bool flag5 = this.pTrans == null; if (!flag5) { bool flag6 = !this.lgAvatar.IsDie() && !this.lgAvatar.m_bSinging; if (flag6) { bool flag7 = this.m_char.curAnimName == "idle" || this.m_char.curAnimName == "run" || this.m_char.curAnimName == "hurt"; if (flag7) { this.setAni("hurt", 1); } } uint id = 1001u; bool flag8 = d.ContainsKey("skill_id"); if (flag8) { id = d["skill_id"]; } SkillHitedXml hitxml = ModelBase <SkillModel> .getInstance().getSkillXml(id).hitxml; bool flag9 = hitxml != null; if (flag9) { this.m_char.setMtlColor(gameST.HIT_Rim_Color_nameID, hitxml.rimColor); this.m_char.setMtlColor(gameST.HIT_Main_Color_nameID, hitxml.mainColor); this.m_bhitFlashGoUp = true; this.m_bDoHitFlash = true; } MapEffMgr.getInstance().play("hurt", this.pTrans.position + this.middleoffset, this.pTrans.eulerAngles, 0f); } } }
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()); }