/// <summary> /// 加BUFF飘字(移动速度,攻击速度) /// </summary> /// <param name="buff_info"></param> public void AddBuffWord(DBBuffSev.DBBuffInfo buff_info) { if (this.Owner == null || this.Owner.IsLocalPlayer == false) { return; } if (buff_info == null) { return; } if (buff_info.add_eff == null || buff_info.add_eff.Count == 0) { return; } for (int index = 0; index < buff_info.add_eff.Count; ++index) { DBSkillEffect dbEffect = DBManager.GetInstance().GetDB <DBSkillEffect>(); DBSkillEffect.SkillEffectInfo info = dbEffect.GetSkillEffectInfo(buff_info.add_eff[index]); if (info != null) { if (info.attr == "speed_add") {//移动速度,绝对数字 if (info.p1 > 0) { mOwner.ShowDamageEffect(FightEffectHelp.FightEffectType.Accelerate, 0, Mathf.CeilToInt(info.p1), false); } } else if (info.attr == "speed") {//移动速度,表中是万分比,显示内容百分比 if (info.p1 > 0) { mOwner.ShowDamageEffect(FightEffectHelp.FightEffectType.Accelerate, 0, Mathf.CeilToInt(100 * info.p1 * GlobalConst.AttrConvert), true); } } else if (info.attr == "atk_speed") {//攻击速度,表中是万分比,显示内容百分比 if (info.p1 > 0) { mOwner.ShowDamageEffect(FightEffectHelp.FightEffectType.AttackSp, 0, Mathf.CeilToInt(100 * info.p1 * GlobalConst.AttrConvert), true); } } else if (info.attr == "atk_speed_base" && info.p2_potentialParam != null) {//攻击速度(只显示潜力格式),表中是常量,显示内容 = 表数据/100 if (LuaScriptMgr.Instance != null) { float final_num = info.p1;// + info.p2_potentialParam.value * level; if (final_num > 0) { mOwner.ShowDamageEffect(FightEffectHelp.FightEffectType.AttackSp, 0, Mathf.CeilToInt(final_num), false); } } } } } }
static int _s_set_max_count(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { DBBuffSev.DBBuffInfo __cl_gen_to_be_invoked = (DBBuffSev.DBBuffInfo)translator.FastGetCSObj(L, 1); __cl_gen_to_be_invoked.max_count = LuaAPI.xlua_tointeger(L, 2); } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(0); }
static int _s_set_period_time(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { DBBuffSev.DBBuffInfo __cl_gen_to_be_invoked = (DBBuffSev.DBBuffInfo)translator.FastGetCSObj(L, 1); __cl_gen_to_be_invoked.period_time = (float)LuaAPI.lua_tonumber(L, 2); } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(0); }
static int _s_set_add_eff(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { DBBuffSev.DBBuffInfo __cl_gen_to_be_invoked = (DBBuffSev.DBBuffInfo)translator.FastGetCSObj(L, 1); __cl_gen_to_be_invoked.add_eff = (System.Collections.Generic.List <uint>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List <uint>)); } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(0); }
static int _s_set_attr_effect_type(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { DBBuffSev.DBBuffInfo __cl_gen_to_be_invoked = (DBBuffSev.DBBuffInfo)translator.FastGetCSObj(L, 1); __cl_gen_to_be_invoked.attr_effect_type = (int[])translator.GetObject(L, 2, typeof(int[])); } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(0); }
static int _g_get_hide_countDown(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { DBBuffSev.DBBuffInfo __cl_gen_to_be_invoked = (DBBuffSev.DBBuffInfo)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushboolean(L, __cl_gen_to_be_invoked.hide_countDown); } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(1); }
static int _g_get_bind_pos(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { DBBuffSev.DBBuffInfo __cl_gen_to_be_invoked = (DBBuffSev.DBBuffInfo)translator.FastGetCSObj(L, 1); translator.PushDBBuffSevBindPos(L, __cl_gen_to_be_invoked.bind_pos); } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(1); }
static int _s_set_bind_pos(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { DBBuffSev.DBBuffInfo __cl_gen_to_be_invoked = (DBBuffSev.DBBuffInfo)translator.FastGetCSObj(L, 1); DBBuffSev.BindPos __cl_gen_value; translator.Get(L, 2, out __cl_gen_value); __cl_gen_to_be_invoked.bind_pos = __cl_gen_value; } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(0); }
static int __CreateInstance(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { if (LuaAPI.lua_gettop(L) == 1) { DBBuffSev.DBBuffInfo __cl_gen_ret = new DBBuffSev.DBBuffInfo(); translator.Push(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to DBBuffSev.DBBuffInfo constructor!")); }
/// <summary> /// 响应删除buff的消息 /// </summary> public static void HandleNotifyDeleteBuff(ushort protocol, byte[] data) { S2CNwarBuffDel kMsg = S2CPackBase.DeserializePack <S2CNwarBuffDel>(data); Actor kTarget = ActorManager.Instance.GetPlayer(kMsg.act_id); if (kTarget == null) { mBuffActorUID.obj_idx = kMsg.act_id; var cache_info = ActorManager.Instance.GetUnitCacheInfo(mBuffActorUID); if (cache_info != null && cache_info.CacheType == UnitCacheInfo.EType.ET_Create) { if (cache_info.UnitType == EUnitType.UNITTYPE_PLAYER) { if (cache_info.AOIPlayer.leave_buff_id_list != null) { var find_data = cache_info.AOIPlayer.leave_buff_id_list.Find((a) => { return(a.id == kMsg.buff_id); }); if (find_data != null) { cache_info.AOIPlayer.leave_buff_id_list.Remove(find_data); } } } else if (cache_info.UnitType == EUnitType.UNITTYPE_MONSTER) { if (cache_info.AOIMonster.leave_buff_id_list != null) { var find_data = cache_info.AOIMonster.leave_buff_id_list.Find((a) => { return(a.id == kMsg.buff_id); }); if (find_data != null) { cache_info.AOIMonster.leave_buff_id_list.Remove(find_data); } } } } return; } DBBuffSev.DBBuffInfo kInfo = DBBuffSev.GetInstance().GetBuffInfo(kMsg.buff_id); if (kInfo != null) { kTarget.BuffCtrl.DelBuff(kMsg.buff_id); } }
static int _m_AddBuffWord(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); xc.BuffCtrl __cl_gen_to_be_invoked = (xc.BuffCtrl)translator.FastGetCSObj(L, 1); try { { DBBuffSev.DBBuffInfo buff_info = (DBBuffSev.DBBuffInfo)translator.GetObject(L, 2, typeof(DBBuffSev.DBBuffInfo)); __cl_gen_to_be_invoked.AddBuffWord(buff_info); return(0); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
static int _m_HasFlag(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); DBBuffSev.DBBuffInfo __cl_gen_to_be_invoked = (DBBuffSev.DBBuffInfo)translator.FastGetCSObj(L, 1); try { { xc.Buff.BuffFlags kTargetFlag; translator.Get(L, 2, out kTargetFlag); bool __cl_gen_ret = __cl_gen_to_be_invoked.HasFlag(kTargetFlag); LuaAPI.lua_pushboolean(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
static int _m_GetBuffInfo(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); DBBuffSev __cl_gen_to_be_invoked = (DBBuffSev)translator.FastGetCSObj(L, 1); try { { uint uiID = LuaAPI.xlua_touint(L, 2); DBBuffSev.DBBuffInfo __cl_gen_ret = __cl_gen_to_be_invoked.GetBuffInfo(uiID); translator.Push(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
/// <summary> /// 增加buff的特效 /// </summary> public void AddEffectObj(DBBuffSev.DBBuffInfo buff_info) { if (buff_info == null) { return; } if (mEffectObjs.ContainsKey(buff_info.buff_id)) { return; } if (buff_info.effect_file == string.Empty) { return; } int effect_max_count = GameConstHelper.GetInt("GAME_BUFF_EFFECT_MAX_COUNT"); if (effect_max_count == 0) { effect_max_count = 5; } bool can_show = true; if (buff_info.other_hide) // 其他玩家需要隐藏的特效 { can_show = !ShieldManager.Instance.IsHideBuffEffect(mOwner); } if (can_show && buff_info.force_show == false)// 需要通过顶替规则进行显示的特效 { // 统计当前可能被顶替的特效数量 int current_count = 0; uint low_priority_buff = 0; uint low_priority = uint.MaxValue; bool del_low_priority = false; foreach (uint id in mEffectObjs.Keys) { DBBuffSev.DBBuffInfo t_buff_info = DBBuffSev.GetInstance().GetBuffInfo(id); if (t_buff_info.force_show == false) { if (buff_info.priority > t_buff_info.priority) //可顶替 { if (low_priority > t_buff_info.priority) // 寻找最低优先级的特效 { low_priority = t_buff_info.priority; low_priority_buff = id; } } current_count++; } if (current_count >= effect_max_count) { del_low_priority = true; } } if (del_low_priority) { if (low_priority_buff != 0) { DestroyEffectObj(low_priority_buff); } else { can_show = false; } } } if (can_show) { BindEffectInfo new_effect = mOwner.InitBindEffectInfo(buff_info.effect_file, buff_info.bind_pos, buff_info.follow_target, buff_info.scale, buff_info.auto_scale, buff_info.max_count); new_effect.CreateInstance(); mEffectObjs.Add(buff_info.buff_id, new_effect); } }