public void init(PveEntity _pveEntity) { pveEntity = _pveEntity; if (addType == 2) { changeValue = (int)(pveEntity.PropertyDic[baseType] * changeValue / 100); } changeByBuff(); }
/// <summary> /// ////////// /// </summary> /// <param name="pveentity">对攻击的对象.</param> public void attackEntity(PveEntity pveentity) { if (pveHero == null) { return; } ischeckBout = false; hideAllHeroSelect(); hideAllMonsterSelect(); ///////////////////////////////////////////////////////////////// JsonObject jo = pveHero.selectSkill; if (jo != null && jo.ContainsKey("skillType")) //选择的是技能 { int skillType = int.Parse(jo["skillType"].ToString()); int attacNum = int.Parse(jo["attackNum"].ToString()); int isUseActionStep = int.Parse(jo["isUseActionStep"].ToString()); ///////////////////////技能释放后 添加BUFF效果//////////////////////////////// int buffId = int.Parse(jo["buff"].ToString()); if (DataManager.getInstance().buffJson.ContainsKey(buffId)) { JsonObject buffData = DataManager.getInstance().buffJson [buffId]; if (buffData != null) { Buff buff = new Buff(buffData); pveentity.addBuff(buff); } } /////////////////////////////////////////////////////////// if (isUseActionStep == 0) { actIndex--; actIndex = actIndex < 0 ? 0 : actIndex; } //if (buff.targetEntity) { //} //pvescene.pveHero.updateSkillTurn (); switch (skillType) { case 1: pveentity.onHit(pveHero.getSelectedSkillDamage(true), attacNum); break; case 2: attackAllMonster(pveHero.getSelectedSkillDamage(true), attacNum); break; case 201: pveentity.onHit(-pveHero.getSelectedSkillDamage(true), attacNum); break; case 202: attackAllHero(-pveHero.getSelectedSkillDamage(true), attacNum); break; default: break; } } else //选择的是武器 { Effect effect = (Effect)PoolManager.getInstance().getGameObject("Effect"); effect.transform.SetParent(pveentity.transform); effect.transform.localPosition = Vector3.zero; effect.init("skill/pugong"); pveentity.onHit(pveHero.getEquipDamage(true)); } Vector3 scale = selectKuang.transform.parent.localScale; iTween.ScaleTo(selectKuang.transform.parent.gameObject, iTween.Hash("y", scale.y + 0.2f, "x", scale.x + 0.2f, "easeType", iTween.EaseType.linear, "loopType", "none", "time", 0.1)); iTween.ScaleTo(selectKuang.transform.parent.gameObject, iTween.Hash("y", scale.y, "x", scale.x, "easeType", iTween.EaseType.linear, "loopType", "none", "delay", 0.1, "time", 0.1)); //pvescene.checkBout (); ///////////////////////////////////////////////////////////////////// }