void CreateEffect(uint runID) { BuffDataBase db = GetBuffDataBase(runID); if (db == null) { // Log.Error("读取Buff配置数据出错:{0}", runID); return; } for (int i = 0; i < db.buffEffect.Count; i++) { var item = db.buffEffect[i]; if (item == 0) { continue; } FxResDataBase edb = GameTableManager.Instance.GetTableItem <FxResDataBase>(item); if (edb == null) { // Log.Error("get FxResDataBase is null id is " + item.ToString()); return; } if (!IsHideFx()) { int nEffectID = (int)EffectViewFactory.Instance().CreateEffect(m_Master.GetUID(), item); if (!effectDic.ContainsKey(runID)) { effectDic.Add(runID, nEffectID); } } } }
public static EffectViewFactory Instance() { if (null == s_Inst) { s_Inst = new EffectViewFactory(); } return(s_Inst); }
// 移除buff表现特效效果 void RemoveBuffEffect(uint buffID, uint runID) { //BuffDataBase db = GetBuffDataBase(runID); //if(db==null) //{ // Log.Error("读取Buff配置数据出错:{0}", buffID); // return; //} if (effectDic.ContainsKey(runID)) { uint effectID = (uint)effectDic[runID]; EffectViewFactory.Instance().RemoveEffect(m_Master.GetUID(), effectID); effectDic.Remove(runID); } }
void RemoveEntityBuff(uint baseID, uint thisID) { uint stateID = baseID; ChangeCreatureByBuff(m_Master, stateID, false); BuffDataBase db = GameTableManager.Instance.GetTableItem <BuffDataBase>(stateID); if (db != null) { if (db.dwShield == 1) {//不显示的直接跳过 return; } } uint cancleBuffThisID = thisID; BuffDataBase baseBuffData = GetBuffDataBase(cancleBuffThisID); if (baseBuffData == null) { // Log.Error("getbuffdatabase error buffthisid is " + cancleBuffThisID.ToString()); return; } if (baseBuffData.buffRemoveEffect != 0) { if (!IsHideFx()) { EffectViewFactory.Instance().CreateEffect(m_Master.GetUID(), baseBuffData.buffRemoveEffect); } } if (baseBuffData.buffBigType == (int)BuffBigType.Control) { if (m_Master != null) { //Log.Error( "buff cancle" ); if (!m_Master.IsDead()) { Engine.Utility.Log.LogGroup("ZDY", " CreatureState.Normal "); m_Master.ChangeState(CreatureState.Normal, null); } else { Engine.Utility.Log.LogGroup("ZDY", "CreatureState.Dead ****"); m_Master.ChangeState(CreatureState.Dead, null); } } } stBuffData buffData; if (buffDic.TryGetValue(cancleBuffThisID, out buffData)) { buffData.buffDataDic.Remove(cancleBuffThisID); } if (buffData.buffDataDic.Count <= 0) { RemoveBuffEffect(stateID, cancleBuffThisID); buffDic.Remove(cancleBuffThisID); if (m_Master != null) { stRemoveBuff removeBuff = new stRemoveBuff(); removeBuff.buffid = stateID; removeBuff.uid = m_Master.GetUID(); removeBuff.buffThisID = cancleBuffThisID; EventEngine.Instance().DispatchEvent((int)GameEventID.BUFF_DELETETARGETBUFF, removeBuff); } } }
/// <summary> /// 播放防御者受击动作 /// </summary> /// <param name="cmd"></param> private bool PlayDefenerAni(GameCmd.stMultiAttackDownMagicUserCmd_S cmd) { if (cmd == null) { return(false); } SkillDatabase db = GameTableManager.Instance.GetTableItem <SkillDatabase>(cmd.wdSkillID, 1); if (db != null) { for (int i = 0; i < db.beAttactEffect.Count; i++) { var effectid = db.beAttactEffect[i]; FxResDataBase edb = GameTableManager.Instance.GetTableItem <FxResDataBase>(effectid); if (edb != null) { if (cmd != null) { for (int j = 0; j < cmd.data.Count; j++) { var item = cmd.data[j]; string aniName = edb.targetAniName; IEntity defender = EntityHelper.GetEntity(item.byDefencerType, item.dwDefencerID); if (defender == null) { //Log.Error( "死亡状态不能播放受击动作" ); return(false); } if (defender is INPC) { INPC npc = defender as INPC; if (npc != null) { if (npc.IsTrap()) { return(false); } } } if (edb.playAudio != 0) { ResourceDataBase rdb = GameTableManager.Instance.GetTableItem <ResourceDataBase>(edb.playAudio); if (rdb != null) { Transform trans = defender.GetTransForm(); if (trans == null) { return(false); } PlayAudio(trans.gameObject, rdb.strPath); } } EffectViewFactory.Instance().CreateEffect(defender.GetUID(), effectid); if (item.byDamType != (uint)GameCmd.AttackType.ATTACK_TYPE_HD) { SendPlayDefenerAniMessage(defender, aniName); } } } } } } return(true); }