/// <summary> /// 根据神兽ID取得技能攻击的特效 /// </summary> /// <param name="beastId"></param> /// <param name="attackerEffectId"></param> /// <param name="beAttackerEffectId"></param> /// <returns></returns> public bool GetEffectId(long beastId, ref int attackerEffectId, ref int beAttackerEffectId) { Beast beast = Singleton <BeastManager> .singleton.GetBeastById(beastId); if (null == beast) { return(false); } //如果普通攻击的话,要根据神兽类型id * 100取得DataSkillShow else if (this.m_unskillId == 1) { DataSkillShow data = beast.GetSkillShow(beast.BeastTypeId * 100); if (data != null) { attackerEffectId = data.AttackerEffectId; beAttackerEffectId = data.BeAttackerEffectId; return(true); } else { this.m_log.Debug("找不到该技能"); } } else { DataSkillShow data = beast.GetSkillShow(this.m_unskillId); if (data != null) { attackerEffectId = data.AttackerEffectId; beAttackerEffectId = data.BeAttackerEffectId; return(true); } } return(false); }
public virtual void OnCastSkillEffect(CastSkillParam castSkillParam) { if (castSkillParam != null) { Beast beast = Singleton <BeastManager> .singleton.GetBeastById(castSkillParam.m_unMasterBeastId); if (beast != null) { DataSkillShow data = beast.GetSkillShow(this.m_unskillId); int attackEffectId = 0; int beAttackEffectId = 0; this.GetEffectId(beast.Id, ref attackEffectId, ref beAttackEffectId); if (castSkillParam.listTargetRoleID.Count == 1) { this.m_nEffectId = EffectManager.Instance.PlayEffect(attackEffectId, beast.Id, Hexagon.GetHex3DPos(this.GetHeroPosByCastSkillParam(castSkillParam), Space.World) , null, castSkillParam.listTargetRoleID[0], Hexagon.GetHex3DPos(castSkillParam.vec3TargetPos, Space.World), null, Vector3.zero); } if (data != null && data.IsEffectForward) { this.AdjustAttackDirection(castSkillParam, beast); } } } }
public override void Trigger() { int attackEftId = 0; int beAttackEftId = 0; SkillGameManager.GetSkillAttackEffectId(this.SkillId, this.AttackerId, ref attackEftId, ref beAttackEftId); Beast beast = Singleton <BeastManager> .singleton.GetBeastById(this.AttackerId); if (beast != null) { DataSkillShow data = beast.GetSkillShow(this.SkillId); if (!this.MainBeAttacker && data != null) { if (data.SubHitEffectId != 0) { beAttackEftId = data.SubHitEffectId; } } if (bShowMissEffect) { //显示MIss漂浮字样 } else if (beAttackEftId > 0) { //取得被攻击者的位置,然后播放特效 Vector3 vTargetPos = this.BeAttackPos.Count > 0 ? Hexagon.GetHex3DPos(this.BeAttackPos[0], Space.World) : Vector3.zero; EffectManager.Instance.PlayEffect(beAttackEftId, this.BeAttackerId, Vector3.zero, null, 0L, vTargetPos, null, Vector3.zero); } } }
public float BuildSkillAction() { float allTime = this.LastAnimEndTime; float fLastAnimTime = this.LastAnimEndTime; Beast attackBeast = Singleton <BeastManager> .singleton.GetBeastById(this.AttackerId); DataSkillShow data; if (attackBeast != null) { data = attackBeast.GetSkillShow(this.SkillId); } else { data = new DataSkillShow(); } //allTime = this.BuildScreenBlurShow(allTime, data, true); //float fCameraAnimEndTime = 0f; //allTime = this.BuildCameraAnimShow(allTime, ref fCameraAnimEndTime, data); this.BuildAttackSkillAnimShow(allTime, ref fLastAnimTime, data); float fSkillEffectTime = this.BuildAttackSkillEffectShow(allTime); this.BuildAttackPosChangeShow(allTime, ref fLastAnimTime, data); bool flag = true; bool beAttackEffect = data != null && data.BeAttackEffectHitPoint; foreach (long current in this.BeAttackerList) { float fBeAttackAnimStartTime = 0; float beAttackTime = this.BuildBeAttackSkillAnimShow(current, allTime, flag, data, ref fBeAttackAnimStartTime); if (beAttackEffect) { fSkillEffectTime = fBeAttackAnimStartTime; } this.BuildBeAttackSkillEffectShow(fSkillEffectTime, true, current); float beAttackPosChangeTime = this.BuildBeAttackPosChangeShow(current, allTime, data, ref fLastAnimTime); float time = Mathf.Max(beAttackTime, beAttackPosChangeTime); time = this.BuildBeAttackDeadShow(current, time); flag = false; allTime = Mathf.Max(allTime, time); } return(allTime); }
/// <summary> /// 取得技能动作的时间延迟 /// </summary> /// <param name="attakerId"></param> /// <param name="beAttacker"></param> /// <param name="targetPos"></param> /// <returns></returns> public virtual float GetDuration(long attakerId, List <long> beAttacker, Vector3 targetPos) { float result = 0; Beast beast = Singleton <BeastManager> .singleton.GetBeastById(attakerId); if (beast != null) { DataSkillShow data = beast.GetSkillShow(this.m_unskillId); if (data != null && data.SkillAction == 1) { if (string.IsNullOrEmpty(data.AttackAction)) { result = beast.GetAnimPlayTime(this.GetSkillAnimName(attakerId)); } else { result = beast.GetAnimPlayTime(data.AttackAction); } } } return(result); }
/// <summary> /// 技能释放表现 /// </summary> /// <param name="param"></param> public virtual void OnCastAction(CastSkillParam param) { if (param != null) { long masterBeastId = param.m_unMasterBeastId; XLog.Log.Debug("OnCast:" + this.m_unskillId); Beast beast = Singleton <BeastManager> .singleton.GetBeastById(masterBeastId); if (beast != null) { DataSkillShow data = beast.GetSkillShow(this.m_unskillId); if (data != null) { if (this.IsActive) { if (!data.IsEffectForward) { this.AdjustAttackDirection(param, beast); } this.AdjustBeAttackerDirection(param, beast); } if (data.SkillAction == 1) { if (string.IsNullOrEmpty(data.AttackAction)) { beast.PlayAnim(this.GetSkillAnimName(masterBeastId)); } else { beast.PlayAnim(data.AttackAction); } } } } } }