protected override void _Load() { m_dicData.Clear(); for (int i = 0; i < m_csv.GetRows(); i++) { SkillBuffCsvData data = new SkillBuffCsvData(); data.id = m_csv.GetIntData(i, (int)eSkillBuffCsv.id); data.name = m_csv.GetData(i, (int)eSkillBuffCsv.name); data.logicId = m_csv.GetIntData(i, (int)eSkillBuffCsv.logicId); data.logicIdDesc = m_csv.GetData(i, (int)eSkillBuffCsv.logicIdDesc); data.targetType = m_csv.GetIntData(i, (int)eSkillBuffCsv.targetType); data.IsCont = m_csv.GetBoolData(i, (int)eSkillBuffCsv.IsCont); data.IsInterval = m_csv.GetBoolData(i, (int)eSkillBuffCsv.IsInterval); data.ContinuanceTime = m_csv.GetIntData(i, (int)eSkillBuffCsv.ContinuanceTime); data.IntervalTime = m_csv.GetIntData(i, (int)eSkillBuffCsv.IntervalTime); data.ParamDesc1 = m_csv.GetData(i, (int)eSkillBuffCsv.ParamDesc1); string strParam = m_csv.GetData(i, (int)eSkillBuffCsv.ParamValue1); data.listParam = StringHelper.GetIntList(strParam); data.icon = m_csv.GetIntData(i, (int)eSkillBuffCsv.icon); data.effectId = m_csv.GetIntData(i, (int)eSkillBuffCsv.effectId); data.effectPoint = m_csv.GetIntData(i, (int)eSkillBuffCsv.effectPoint); data.animaId = m_csv.GetIntData(i, (int)eSkillBuffCsv.animaId); string color = m_csv.GetData(i, (int)eSkillBuffCsv.hitColor); if (!string.IsNullOrEmpty(color)) { data.hasColor = true; data.hitColor = StringHelper.GetColor(color); } data.des = m_csv.GetData(i, (int)eSkillBuffCsv.des); if (m_dicData.ContainsKey(data.id)) { Debug.LogError("buff id 重复:" + data.id); continue; } m_dicData.Add(data.id, data); } }
public BuffBase(int uid, SkillBuffCsvData data) { m_uid = uid; m_buffData = data; }
public static BuffBase AddBuff(CCreature caster, CCreature receiver, int buffId, Vector2d startPos, Vector2d skillPos, Vector2d dir, int skillIndex = 0, object obj = null) { // 接受者无敌时 if (receiver != null) { if (receiver.IsDie() || receiver.CheckState(eBuffState.WindBlowsUp)) { return(null); } if (caster != receiver && receiver.CheckState(eBuffState.God)) { return(null); } } // 非瞬间伤害的其他所有BUFF,如果是持续的,并且buffid相同时,重置生命时间 SkillBuffCsvData buffData = CsvManager.Inst.GetCsv <SkillBuffCsv>((int)eAllCSV.eAC_SkillBuff).GetData(buffId); if (buffData == null) { Debug.LogError("无buffid,策划检测检查配置表:" + buffId); return(null); } // 状态BUFF的处理 // 接受者霸体时,不再添加其他状态BUFF if (receiver != null && receiver.CheckState(eBuffState.SuperArmor)) { if (buffData.logicId == (int)eBuffType.state || buffData.logicId == (int)eBuffType.repel || buffData.logicId == (int)eBuffType.pullPos ) { return(null); } } // 相同BUFF的叠加处理 if (buffData.IsCont && receiver != null && buffData.logicId != (int)eBuffType.damage) { BuffBase stateBuff = receiver.GetBuffByCsvId(buffId); // 1.相同BUFFID // 2.相同施法者 // 3.相同施法者,相同触发器(暂无) if (stateBuff != null && stateBuff.m_caster == caster) { //Debug.Log("有相同buff。。。" + buffId); // 相同施法者的持续性BUFF,内部可以计算叠加次数和伤害 stateBuff.ResetTime(); return(stateBuff); } } BuffBase buff = CBuffMgr.Create(buffId); //Debug.Log("技能流程:创建BUFF:" + buffId + " " + buff.m_buffData.name + " 类型:" + (eBuffType)buff.m_buffData.logicId); if (buff == null) { Debug.LogError("添加BUFF为空:" + buffId); return(null); } // 最终的接收者,由配表决定 if (buff.m_buffData.targetType == 0) { } else if (buff.m_buffData.targetType == 1) { receiver = caster; } buff.m_caster = caster; buff.m_rec = receiver; buff.m_startPos = startPos; buff.m_skillIndex = skillIndex; buff.m_skillPos = skillPos; buff.m_skillDir = dir; buff.m_extendParam = obj; // 持续性的才加到人物身上,当角色挂掉时,要清除身上的BUFF if (buff.IsCont() && receiver != null) { // 因为BUFF改变的速度,攻击力等都是在初始化时,遍历BUFF增减数值,所以要先add receiver.AddBuff(buff); buff.Init(); } else { buff.Init(); buff.Destroy(); } return(buff); }
public Buff04(int uid, SkillBuffCsvData data) : base(uid, data) { }
/// <summary> /// /// </summary> /// <param name="buffId"></param> /// <returns></returns> public static BuffBase Create(int buffId) { SkillBuffCsvData buffData = CsvManager.Inst.GetCsv <SkillBuffCsv>((int)eAllCSV.eAC_SkillBuff).GetData(buffId); if (buffData == null) { Debug.LogError("BUFF为空 id:" + buffId); return(null); } if (buffData.logicId == 0) { Debug.LogError("BUFF配置错误 id:" + buffId + " 类型:" + buffData.logicId); return(null); } BuffBase obj = null; switch (buffData.logicId) { case (int)eBuffType.damage: obj = new Buff01(m_uid, buffData); break; case (int)eBuffType.contDamage: obj = new Buff02(m_uid, buffData); break; case (int)eBuffType.pullPos: obj = new Buff03(m_uid, buffData); break; case (int)eBuffType.atk: obj = new Buff04(m_uid, buffData); break; case (int)eBuffType.speed: obj = new Buff05(m_uid, buffData); break; case (int)eBuffType.repel: obj = new Buff06(m_uid, buffData); break; case (int)eBuffType.addHp: obj = new Buff07(m_uid, buffData); break; case (int)eBuffType.dp: obj = new Buff08(m_uid, buffData); break; case (int)eBuffType.modelScale: obj = new Buff09(m_uid, buffData); break; case (int)eBuffType.state: obj = new Buff10(m_uid, buffData); break; case (int)eBuffType.atkCreate: obj = new Buff11(m_uid, buffData); break; case (int)eBuffType.hitCreate: obj = new Buff12(m_uid, buffData); break; case (int)eBuffType.createTrigger: obj = new Buff20(m_uid, buffData); break; case (int)eBuffType.createSkill: obj = new Buff21(m_uid, buffData); break; case (int)eBuffType.createCreature: obj = new Buff22(m_uid, buffData); break; case (int)eBuffType.flash: obj = new Buff101(m_uid, buffData); break; } m_uid++; //Add(m_uid++, obj); m_listAdd.Add(obj); return(obj); }