37个文件已修改
15个文件已删除
7 文件已复制
8个文件已添加
1 文件已重命名
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年8月5日
|
| | | // [ Date ]: 2025年8月8日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | }
|
| | |
|
| | | public int NPCID;
|
| | | public int NPCType;
|
| | | public string MODE;
|
| | | public string charName;
|
| | | public int NPCLV;
|
| | | public float ModleHeight;
|
| | | public float ModelRadius;
|
| | | public float ModeProportion;
|
| | | public Vector3 UIModeLOffset;
|
| | | public float UIModeLProportion;
|
| | | public Vector3 UIModelRotation;
|
| | | public int CanDeadFly;
|
| | | public string NPCName;
|
| | | public int Country;
|
| | | public int MinAtk;
|
| | | public int MaxAtk;
|
| | | public int Def;
|
| | | public int Realm;
|
| | | public int PoisionAtk;
|
| | | public int FireAtk;
|
| | | public int IceAtk;
|
| | | public int PoisionDef;
|
| | | public int IceDef;
|
| | | public int ThunderDef;
|
| | | public int AtkInterval;
|
| | | public int Hit;
|
| | | public int MissRate;
|
| | | public int SuperHiteRate;
|
| | | public int OrgSpeed;
|
| | | public int MoveType;
|
| | | public int AtkDist;
|
| | | public int Skill1;
|
| | | public int Skill2;
|
| | | public int Skill3;
|
| | | public int Skill4;
|
| | | public int Skill5;
|
| | | public int Skill6;
|
| | | public int Skill7;
|
| | | public int Skill8;
|
| | | public int AtkType;
|
| | | public int Sight;
|
| | | public int MoveArea;
|
| | | public int DHP;
|
| | | public int MaxHPEx;
|
| | | public int IsBoss;
|
| | | public int SP;
|
| | | public int AIType;
|
| | | public int CanAttack;
|
| | | public float weight;
|
| | | public string HeadPortrait;
|
| | | public int Show;
|
| | | public int AtkFeedback;
|
| | | public int hurtFeedback;
|
| | | public int AutomaticFace;
|
| | | public int Dig;
|
| | | public int[] Sounds;
|
| | | public int LifeBarCount;
|
| | | public int NPCEffect;
|
| | | public int NPCSpeakID;
|
| | | public string Equips;
|
| | | public int AtkDistType;
|
| | | public int LV;
|
| | | public int SkinID;
|
| | | public float ModelScale;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | | string[] tables = input.Split('\t');
|
| | | int.TryParse(tables[0],out NPCID);
|
| | |
|
| | | int.TryParse(tables[1],out NPCType); |
| | | NPCName = tables[1];
|
| | |
|
| | | MODE = tables[2];
|
| | | int.TryParse(tables[2],out Country); |
| | |
|
| | | charName = tables[3];
|
| | | int.TryParse(tables[3],out AtkDistType); |
| | |
|
| | | int.TryParse(tables[4],out NPCLV); |
| | | int.TryParse(tables[4],out LV); |
| | |
|
| | | float.TryParse(tables[5],out ModleHeight); |
| | | int.TryParse(tables[5],out SkinID); |
| | |
|
| | | float.TryParse(tables[6],out ModelRadius); |
| | |
|
| | | float.TryParse(tables[7],out ModeProportion); |
| | |
|
| | | UIModeLOffset=tables[8].Vector3Parse();
|
| | |
|
| | | float.TryParse(tables[9],out UIModeLProportion); |
| | |
|
| | | UIModelRotation=tables[10].Vector3Parse();
|
| | |
|
| | | int.TryParse(tables[11],out CanDeadFly); |
| | |
|
| | | int.TryParse(tables[12],out Country); |
| | |
|
| | | int.TryParse(tables[13],out MinAtk); |
| | |
|
| | | int.TryParse(tables[14],out MaxAtk); |
| | |
|
| | | int.TryParse(tables[15],out Def); |
| | |
|
| | | int.TryParse(tables[16],out Realm); |
| | |
|
| | | int.TryParse(tables[17],out PoisionAtk); |
| | |
|
| | | int.TryParse(tables[18],out FireAtk); |
| | |
|
| | | int.TryParse(tables[19],out IceAtk); |
| | |
|
| | | int.TryParse(tables[20],out PoisionDef); |
| | |
|
| | | int.TryParse(tables[21],out IceDef); |
| | |
|
| | | int.TryParse(tables[22],out ThunderDef); |
| | |
|
| | | int.TryParse(tables[23],out AtkInterval); |
| | |
|
| | | int.TryParse(tables[24],out Hit); |
| | |
|
| | | int.TryParse(tables[25],out MissRate); |
| | |
|
| | | int.TryParse(tables[26],out SuperHiteRate); |
| | |
|
| | | int.TryParse(tables[27],out OrgSpeed); |
| | |
|
| | | int.TryParse(tables[28],out MoveType); |
| | |
|
| | | int.TryParse(tables[29],out AtkDist); |
| | |
|
| | | int.TryParse(tables[30],out Skill1); |
| | |
|
| | | int.TryParse(tables[31],out Skill2); |
| | |
|
| | | int.TryParse(tables[32],out Skill3); |
| | |
|
| | | int.TryParse(tables[33],out Skill4); |
| | |
|
| | | int.TryParse(tables[34],out Skill5); |
| | |
|
| | | int.TryParse(tables[35],out Skill6); |
| | |
|
| | | int.TryParse(tables[36],out Skill7); |
| | |
|
| | | int.TryParse(tables[37],out Skill8); |
| | |
|
| | | int.TryParse(tables[38],out AtkType); |
| | |
|
| | | int.TryParse(tables[39],out Sight); |
| | |
|
| | | int.TryParse(tables[40],out MoveArea); |
| | |
|
| | | int.TryParse(tables[41],out DHP); |
| | |
|
| | | int.TryParse(tables[42],out MaxHPEx); |
| | |
|
| | | int.TryParse(tables[43],out IsBoss); |
| | |
|
| | | int.TryParse(tables[44],out SP); |
| | |
|
| | | int.TryParse(tables[45],out AIType); |
| | |
|
| | | int.TryParse(tables[46],out CanAttack); |
| | |
|
| | | float.TryParse(tables[47],out weight); |
| | |
|
| | | HeadPortrait = tables[48];
|
| | |
|
| | | int.TryParse(tables[49],out Show); |
| | |
|
| | | int.TryParse(tables[50],out AtkFeedback); |
| | |
|
| | | int.TryParse(tables[51],out hurtFeedback); |
| | |
|
| | | int.TryParse(tables[52],out AutomaticFace); |
| | |
|
| | | int.TryParse(tables[53],out Dig); |
| | |
|
| | | if (tables[54].Contains("[")) |
| | | { |
| | | Sounds = JsonMapper.ToObject<int[]>(tables[54]); |
| | | } |
| | | else |
| | | { |
| | | string[] SoundsStringArray = tables[54].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | Sounds = new int[SoundsStringArray.Length]; |
| | | for (int i=0;i<SoundsStringArray.Length;i++) |
| | | { |
| | | int.TryParse(SoundsStringArray[i],out Sounds[i]); |
| | | } |
| | | }
|
| | |
|
| | | int.TryParse(tables[55],out LifeBarCount); |
| | |
|
| | | int.TryParse(tables[56],out NPCEffect); |
| | |
|
| | | int.TryParse(tables[57],out NPCSpeakID); |
| | |
|
| | | Equips = tables[58];
|
| | | float.TryParse(tables[6],out ModelScale); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | return; |
| | | } |
| | | |
| | | // 技能包 |
| | | var skillAction = CreateSkillAction(); |
| | | if (null != skillAction) |
| | | { |
| | | battleField.PlayRecord(skillAction); |
| | | } |
| | | } |
| | | |
| | | public SkillRecordAction CreateSkillAction() |
| | | { |
| | | BattleField battleField = BattleManager.Instance.GetBattleField(guid); |
| | | |
| | | if (null == battleField) |
| | | { |
| | | Debug.LogError("BattleField not found for guid: " + guid); |
| | | return null; |
| | | } |
| | | |
| | | if (startTag.Tag.StartsWith("Skill_")) |
| | | { |
| | | H0604_tagUseSkillAttack skill = packList[0] as H0604_tagUseSkillAttack; |
| | | BattleObject caster = battleField.battleObjMgr.GetBattleObject((int)skill.ObjID); |
| | | // 注意处理packList |
| | | SkillRecordAction skillRecordAction = new SkillRecordAction(battleField, caster, skill, packList); |
| | | battleField.PlayRecord(skillRecordAction); |
| | | HB427_tagSCUseSkill skill = packList[0] as HB427_tagSCUseSkill; |
| | | BattleObject _caster = battleField.battleObjMgr.GetBattleObject((int)skill.ObjID); |
| | | SkillRecordAction skillAction = new SkillRecordAction(battleField, _caster, skill, packList); |
| | | return skillAction; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
| | |
| | | //04 07 NPC消失#tagNPCDisappear |
| | | |
| | | public class DTC0407_tagNPCDisappear : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | H0407_tagNPCDisappear vNetData = vNetPack as H0407_tagNPCDisappear; |
| | | |
| | |
| | | //04 07 NPC消失#tagNPCDisappear 中的字段NPCID实际上同步的是ObjID,只是命名问题 |
| | | // 提前结束战斗 删除NPCID()实际上是对象的ObjID |
| | | battleField.NPCDisappear(vNetData.NPCID); |
| | | battleField.DistributeNextPackage(); |
| | | |
| | | } |
| | | } |
| | |
| | | UpdateBattleField(vNetData); |
| | | break; |
| | | default: |
| | | Debug.LogError("DTC0418_tagObjInfoRefresh 服务端同步了一个未知类型的ObjType的刷新 " + vNetData.ObjType); |
| | | break; |
| | | } |
| | | } |
| | |
| | | //_player.UpdateData(vNetData); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void UpdateBattleField(H0418_tagObjInfoRefresh vNetData) |
| | | { |
| | | BattleField battleField = BattleManager.Instance.GetBattleField(vNetData.packUID); |
| | | battleField.ObjInfoRefresh(vNetData); |
| | | battleField.DistributeNextPackage(); |
| | | } |
| | | } |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B4 18 对象属性刷新展示 #tagSCObjPropertyRefreshView |
| | | |
| | | public class DTCB418_tagSCObjPropertyRefreshView : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HB418_tagSCObjPropertyRefreshView vNetData = vNetPack as HB418_tagSCObjPropertyRefreshView; |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB418_tagSCObjPropertyRefreshView.cs.meta
File was copied from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6f36552c258dcd14fb30a3366bb16cf1 |
| | | guid: a41a3888866561f46bf02d8943cd5cc9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B4 27 使用技能 #tagSCUseSkill |
| | | |
| | | public class DTCB427_tagSCUseSkill : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HB427_tagSCUseSkill vNetData = vNetPack as HB427_tagSCUseSkill; |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB427_tagSCUseSkill.cs.meta
File was copied from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6f36552c258dcd14fb30a3366bb16cf1 |
| | | guid: 88b19efc6dc41c54da0a86efa91e2ee6 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B4 28 Buff刷新 #tagSCBuffRefresh |
| | | |
| | | public class DTCB428_tagSCBuffRefresh : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HB428_tagSCBuffRefresh vNetData = vNetPack as HB428_tagSCBuffRefresh; |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB428_tagSCBuffRefresh.cs.meta
File was copied from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6f36552c258dcd14fb30a3366bb16cf1 |
| | | guid: bbdd35a17a2229046a33c75f4bd536c6 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B4 29 Buff消失 #tagSCBuffDel |
| | | |
| | | public class DTCB429_tagSCBuffDel : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HB429_tagSCBuffDel vNetData = vNetPack as HB429_tagSCBuffDel; |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB429_tagSCBuffDel.cs.meta
File was copied from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6f36552c258dcd14fb30a3366bb16cf1 |
| | | guid: 18ef61012c08d0742a2a50763b38c4ee |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | Register(typeof(HA709_tagObjInfoListRefresh), typeof(DTCA709_tagObjInfoListRefresh)); |
| | | Register(typeof(H0113_tagServerHeart), typeof(DTC0113_tagServerHeart)); |
| | | Register(typeof(H0111_tagOnlineReply), typeof(DTC0111_tagOnlineReply)); |
| | | Register(typeof(H0605_tagObjAddBuff), typeof(DTC0605_tagObjAddBuff)); |
| | | Register(typeof(H0606_tagObjDelBuff), typeof(DTC0606_tagObjDelBuff)); |
| | | Register(typeof(HB428_tagSCBuffRefresh), typeof(DTCB428_tagSCBuffRefresh)); |
| | | Register(typeof(HB429_tagSCBuffDel), typeof(DTCB429_tagSCBuffDel)); |
| | | Register(typeof(H0608_tagNPCDie), typeof(DTC0608_tagNPCDie)); |
| | | Register(typeof(H0612_tagClearObjBuff), typeof(DTC0612_tagClearObjBuff)); |
| | | Register(typeof(HA3A1_tagMCModuleFightPowerInfo), typeof(DTCA3A1_tagMCModuleFightPowerInfo)); |
| | |
| | | Register(typeof(HB425_tagSCTurnFightReportSign), typeof(DTCB425_tagSCTurnFightReportSign)); |
| | | Register(typeof(HB430_tagSCTurnFightReport), typeof(DTCB430_tagSCTurnFightReport)); |
| | | Register(typeof(H0407_tagNPCDisappear), typeof(DTC0407_tagNPCDisappear)); |
| | | Register(typeof(H0423_tagObjPropertyRefreshView), typeof(DTC0423_tagObjPropertyRefreshView)); |
| | | Register(typeof(H0604_tagUseSkillAttack), typeof(DTC0604_tagUseSkillAttack)); |
| | | Register(typeof(HB418_tagSCObjPropertyRefreshView), typeof(DTCB418_tagSCObjPropertyRefreshView)); |
| | | Register(typeof(HB427_tagSCUseSkill), typeof(DTCB427_tagSCUseSkill)); |
| | | Register(typeof(HB124_tagSCLineupInfo), typeof(DTCB124_tagSCLineupInfo)); |
| | | Register(typeof(HA207_tagSCPackBuyInfo), typeof(DTCA207_tagSCPackBuyInfo)); |
| | | } |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B4 18 对象属性刷新展示 #tagSCObjPropertyRefreshView |
| | | |
| | | public class HB418_tagSCObjPropertyRefreshView : GameNetPackBasic { |
| | | public uint ObjID; |
| | | public ushort RefreshType; // 同0418刷新类型,如血量、怒气 |
| | | public uint Value; // 更新值 |
| | | public uint ValueEx; // 更新值,如果是大数值的此值为整除亿部分 |
| | | public byte DiffType; // 变化类型,0-减少;1-增加 |
| | | public uint DiffValue; // 变化值 |
| | | public uint DiffValueEx; // 变化值,如果是大数值的此值为整除亿部分 |
| | | public uint SkillID; // 使用的技能表ID |
| | | public uint RelatedSkillID; // 关联的技能ID,一般是主技能ID,非主技能额外触发的为0 |
| | | |
| | | public HB418_tagSCObjPropertyRefreshView () { |
| | | _cmd = (ushort)0xB418; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out ObjID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out RefreshType, vBytes, NetDataType.WORD); |
| | | TransBytes (out Value, vBytes, NetDataType.DWORD); |
| | | TransBytes (out ValueEx, vBytes, NetDataType.DWORD); |
| | | TransBytes (out DiffType, vBytes, NetDataType.BYTE); |
| | | TransBytes (out DiffValue, vBytes, NetDataType.DWORD); |
| | | TransBytes (out DiffValueEx, vBytes, NetDataType.DWORD); |
| | | TransBytes (out SkillID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out RelatedSkillID, vBytes, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
File was renamed from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6f36552c258dcd14fb30a3366bb16cf1 |
| | | guid: 90ecbff2c649bc74f8a6d199342eda64 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B4 27 使用技能 #tagSCUseSkill |
| | | |
| | | public class HB427_tagSCUseSkill : GameNetPackBasic { |
| | | public uint ObjID; |
| | | public byte PMType; // 物法类型 0或1-物理;2-法术 |
| | | public byte BattleType; // 战斗类型 0-常规;1-连击;2-反击;3-追击 |
| | | public uint CurHP; // 释放技能后剩余血量,吸血、反弹可能引起变化,求余亿部分 |
| | | public uint CurHPEx; // 释放技能后剩余血量,吸血、反弹可能引起变化,整除亿部分 |
| | | public uint SkillID; |
| | | public byte HurtCount; //伤害数目 |
| | | public tagSCUseSkillHurt[] HurtList; //size = HurtCount |
| | | |
| | | public HB427_tagSCUseSkill () { |
| | | _cmd = (ushort)0xB427; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out ObjID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out PMType, vBytes, NetDataType.BYTE); |
| | | TransBytes (out BattleType, vBytes, NetDataType.BYTE); |
| | | TransBytes (out CurHP, vBytes, NetDataType.DWORD); |
| | | TransBytes (out CurHPEx, vBytes, NetDataType.DWORD); |
| | | TransBytes (out SkillID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out HurtCount, vBytes, NetDataType.BYTE); |
| | | HurtList = new tagSCUseSkillHurt[HurtCount]; |
| | | for (int i = 0; i < HurtCount; i ++) { |
| | | HurtList[i] = new tagSCUseSkillHurt(); |
| | | TransBytes (out HurtList[i].ObjID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out HurtList[i].AttackTypes, vBytes, NetDataType.DWORD); |
| | | TransBytes (out HurtList[i].HurtHP, vBytes, NetDataType.DWORD); |
| | | TransBytes (out HurtList[i].HurtHPEx, vBytes, NetDataType.DWORD); |
| | | TransBytes (out HurtList[i].CurHP, vBytes, NetDataType.DWORD); |
| | | TransBytes (out HurtList[i].CurHPEx, vBytes, NetDataType.DWORD); |
| | | TransBytes (out HurtList[i].SuckHP, vBytes, NetDataType.DWORD); |
| | | TransBytes (out HurtList[i].BounceHP, vBytes, NetDataType.DWORD); |
| | | } |
| | | } |
| | | |
| | | public struct tagSCUseSkillHurt { |
| | | public uint ObjID; |
| | | public uint AttackTypes; // 飘血类型汇总,支持多种类型并存,如无视防御且暴击同时被格挡,二进制或运算最终值;0-失败;1-普通;2-回血;5-格挡;6-无视防御;7-暴击;9-闪避 |
| | | public uint HurtHP; // 飘血值,求余亿部分 |
| | | public uint HurtHPEx; // 飘血值,整除亿部分 |
| | | public uint CurHP; // 更新剩余血量,求余亿部分 |
| | | public uint CurHPEx; // 更新剩余血量,整除亿部分 |
| | | public uint SuckHP; // 本次伤害转化的吸血量 |
| | | public uint BounceHP; // 本次伤害反弹的伤害量 |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HB4_FightDefine/HB427_tagSCUseSkill.cs.meta
File was copied from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6f36552c258dcd14fb30a3366bb16cf1 |
| | | guid: e5c311adce9738447b17d657a67f711e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B4 28 Buff刷新 #tagSCBuffRefresh |
| | | |
| | | public class HB428_tagSCBuffRefresh : GameNetPackBasic { |
| | | public uint ObjID; // 谁身上的buff |
| | | public uint BuffID; // buffID,某个obj上的唯一buffID,不同的buffID可能skillID相同 |
| | | public uint SkillID; // 该buff对应技能表ID |
| | | public uint RelatedSkillID; // 关联的技能ID,一般是主技能ID或由于某个技能释放引起的buff变更 |
| | | public uint LastTime; // 剩余时长毫秒/回合数 |
| | | public ushort Layer; // 层数,不需要默认0 |
| | | public uint OwnerID; // buff来源者,即施法方 |
| | | |
| | | public HB428_tagSCBuffRefresh () { |
| | | _cmd = (ushort)0xB428; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out ObjID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out BuffID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out SkillID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out RelatedSkillID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out LastTime, vBytes, NetDataType.DWORD); |
| | | TransBytes (out Layer, vBytes, NetDataType.WORD); |
| | | TransBytes (out OwnerID, vBytes, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HB4_FightDefine/HB428_tagSCBuffRefresh.cs.meta
File was copied from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6f36552c258dcd14fb30a3366bb16cf1 |
| | | guid: de6aee33096382147b9b96764707a505 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B4 29 Buff消失 #tagSCBuffDel |
| | | |
| | | public class HB429_tagSCBuffDel : GameNetPackBasic { |
| | | public uint ObjID; |
| | | public uint BuffID; |
| | | public uint RelatedSkillID; // 关联的技能ID,一般是主技能ID或由于某个技能释放引起的buff变更 |
| | | |
| | | public HB429_tagSCBuffDel () { |
| | | _cmd = (ushort)0xB429; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out ObjID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out BuffID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out RelatedSkillID, vBytes, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HB4_FightDefine/HB429_tagSCBuffDel.cs.meta
File was copied from Main/Core/NetworkPackage/ServerPack/H06_PlayerVsNPC/H0605_tagObjAddBuff.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6f36552c258dcd14fb30a3366bb16cf1 |
| | | guid: 474e26ca749e647429ea52a7eb429c59 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | } |
| | | effectDict.Clear(); |
| | | } |
| | | |
| | | public void Release() |
| | | { |
| | | foreach (var effect in effectDict) |
| | | { |
| | | foreach (var effectPlayer in effect.Value) |
| | | { |
| | | if (effectPlayer != null) |
| | | { |
| | | GameObject.DestroyImmediate(effectPlayer.gameObject); |
| | | } |
| | | } |
| | | } |
| | | |
| | | effectDict.Clear(); |
| | | } |
| | | } |
| | |
| | | public virtual void Release() |
| | | { |
| | | battleObjMgr.Release(); |
| | | battleEffectMgr.Release(); |
| | | battleTweenMgr.Release(); |
| | | recordPlayer.Release(); |
| | | } |
| | | |
| | | public virtual void Run() |
| | |
| | | } |
| | | } |
| | | |
| | | public void ObjPropertyRefreshView(H0423_tagObjPropertyRefreshView vNetData) |
| | | public void ObjPropertyRefreshView(HB418_tagSCObjPropertyRefreshView vNetData) |
| | | { |
| | | |
| | | } |
| | |
| | | public virtual void Destroy() |
| | | { |
| | | // 销毁全部内容 |
| | | BattleManager.Instance.DestroyBattleField(this); |
| | | } |
| | | |
| | | public void NPCDisappear(uint[] ObjIDArr) |
| | |
| | | } |
| | | |
| | | // 播放战斗开始的特效 |
| | | var efplayer = battleEffectMgr.PlayEffect(0, BattleConst.BattleStartEffectID, battleRootNode.transform); |
| | | efplayer.onDestroy += a => onMoveComplete(); |
| | | // var efplayer = battleEffectMgr.PlayEffect(0, BattleConst.BattleStartEffectID, battleRootNode.transform); |
| | | // efplayer.onDestroy += a => onMoveComplete(); |
| | | |
| | | onMoveComplete?.Invoke(); |
| | | }; |
| | | } |
| | | |
| | |
| | | //无论如何图层应该在人物上面 所以这里应该有个挂点 |
| | | // YYL TODO |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | public void OnObjReborn(HB423_tagMCTurnFightObjReborn vNetData) |
| | |
| | | { |
| | | return IsBattleFinish; |
| | | } |
| | | |
| | | public virtual void DistributeNextPackage() |
| | | { |
| | | |
| | | } |
| | | } |
| | |
| | | // 通过主界面的按钮推动(调用)DoNext |
| | | public override void DoNext() |
| | | { |
| | | Debug.LogError("HandModeOperationAgent DoNext"); |
| | | |
| | | base.DoNext(); |
| | | |
| | | // 当前没有在播放战斗录像 |
| | | if (!battleField.recordPlayer.IsPlaying()) |
| | | { |
| | | Debug.LogError("HandModeOperationAgent DoNext 1"); |
| | | // 没有下一个包可以发了 |
| | | if (!BattleManager.Instance.DistributeNextPackage()) |
| | | { |
| | |
| | | |
| | | // 检查一下锤子的消耗 |
| | | //FightPoint 用于记录消耗战锤倍数,小于等于1时默认1倍,大于1时为对应消耗倍值,0418刷新类型22 |
| | | Debug.LogError("HandModeOperationAgent DoNext 2"); |
| | | ulong costRate = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.FightPoint); |
| | | |
| | | ulong cost = (costRate > 1 ? costRate : 1) * 1; // 1是默认消耗 |
| | | |
| | | // 检查一下锤子的消耗 |
| | | if (!ItemLogicUtility.CheckCurrencyCount(41, cost, true)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | |
| | | Debug.LogError("HandModeOperationAgent DoNext 3"); |
| | | byte reqType; |
| | | |
| | | if (storyBattleField.battleState == StoryBattleState.Break) |
| | |
| | | return; |
| | | } |
| | | |
| | | Debug.LogError("HandModeOperationAgent DoNext 4 reqType is " + reqType); |
| | | |
| | | // 检查一下锤子的消耗 |
| | | if (!ItemLogicUtility.CheckCurrencyCount(41, cost, true)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | // 如果请求的是2 说明要初始化一下战场 |
| | | BattleManager.Instance.MainFightRequest(reqType); |
| | | |
| | | // 初始化战场后本来不会自动打 那么就需要再请求一次4继续战斗 来开始战斗 |
| | | if (reqType == 2) |
| | | { |
| | | BattleManager.Instance.MainFightRequest(4); |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | |
| | | private bool isCast = false; |
| | | |
| | | public SkillRecordAction(BattleField _battleField, BattleObject _caster, H0604_tagUseSkillAttack vNetData, List<GameNetPackBasic> packList) |
| | | public SkillRecordAction(BattleField _battleField, BattleObject _caster, HB427_tagSCUseSkill vNetData, List<GameNetPackBasic> packList) |
| | | : base(RecordActionType.Skill, _battleField, _caster) |
| | | { |
| | | skillBase = SkillFactory.CreateSkill(_caster, vNetData, packList, _battleField); |
| | |
| | | } |
| | | |
| | | public override void OnBattleEnd(JsonData turnFightStateData) |
| | | { |
| | | { |
| | | base.OnBattleEnd(turnFightStateData); |
| | | } |
| | | |
| | |
| | | |
| | | // base.Run(); |
| | | // } |
| | | |
| | | public override void DistributeNextPackage() |
| | | { |
| | | // 不要调用base的函数 |
| | | BattleManager.Instance.DistributeNextPackage(); |
| | | } |
| | | } |
| | |
| | | return battleField; |
| | | } |
| | | |
| | | public void DestroyBattleField(BattleField battleField) |
| | | { |
| | | if (battleField == null) |
| | | { |
| | | Debug.LogError("DestroyBattleField called with null battleField"); |
| | | return; |
| | | } |
| | | |
| | | string guid = battleField.guid; |
| | | |
| | | if (battleFields.ContainsKey(guid)) |
| | | { |
| | | battleFields.Remove(guid); |
| | | } |
| | | |
| | | if (storyBattleField == battleField) |
| | | { |
| | | storyBattleField = null; |
| | | } |
| | | } |
| | | |
| | | |
| | | // 目前支持 BYTE ReqType; // 0-停止战斗回城;1-设置消耗倍值;2-挑战关卡小怪;3-挑战关卡boss;4-继续战斗; |
| | | // 0-停止战斗回城 - 玩家主动点击回城时发送 |
| | |
| | | for (int i = 0; i < teamBase.serverHeroes.Length; i++) |
| | | { |
| | | TeamHero teamHero = teamBase.serverHeroes[i]; |
| | | if (teamHero != null) |
| | | if (teamHero != null && teamHero.heroId > 0) |
| | | { |
| | | |
| | | BattleObject battleObj = BattleObjectFactory.CreateBattleObject(battleField, posNodeList, teamHero, _Camp); |
| | | allBattleObjDict.Add(battleObj.ObjID, battleObj); |
| | | campDict.Add(teamHero.positionNum, battleObj); |
| | |
| | | } |
| | | } |
| | | |
| | | public List<BattleObject> GetBattleObjList(H0604_tagUseSkillAttack tagUseSkillAttack) |
| | | public List<BattleObject> GetBattleObjList(HB427_tagSCUseSkill tagUseSkillAttack) |
| | | { |
| | | List<BattleObject> retList = new List<BattleObject>(); |
| | | foreach (var hurt in tagUseSkillAttack.HurtList) |
| | |
| | | { |
| | | DestroyTeam(redCampDict); |
| | | DestroyTeam(blueCampDict); |
| | | allBattleObjDict.Clear(); |
| | | } |
| | | |
| | | public void Run() |
| | |
| | | return true; |
| | | } |
| | | |
| | | public virtual void Hurt(List<long> damageValues, long _totalDamage, int attackType) |
| | | public virtual void Hurt(List<long> damageValues, long _totalDamage, uint attackType) |
| | | { |
| | | PopDamage(teamHero.curHp, damageValues, attackType); |
| | | |
| | |
| | | } |
| | | |
| | | // 伤害还要看 是否闪避 暴击 and so on 需要有一个DamageType 服务器应该会给 |
| | | protected virtual void PopDamage(long curHp, List<long> damageValues, int attackType) |
| | | protected virtual void PopDamage(long curHp, List<long> damageValues, uint attackType) |
| | | { |
| | | // 其实应该通知出去给UI界面解耦 让UI界面自己来显示的 YYL TODO |
| | | // 播放伤害数字 |
| | |
| | | |
| | | private static float modelScaleRate => float.Parse(FuncConfigConfig.Get("BattleModelScale").Numerical1); |
| | | |
| | | // 这里报错了检查一下 |
| | | public static BattleObject CreateBattleObject(BattleField _battleField, List<GameObject> posNodeList, TeamHero teamHero, BattleCamp _Camp) |
| | | { |
| | | HeroSkinConfig skinCfg = teamHero.skinConfig; |
| | | if (skinCfg == null) |
| | | { |
| | | Debug.LogError(teamHero.heroId + "BattleObjectFactory.CreateBattleObject: skinCfg is null for " + teamHero.SkinID); |
| | | return null; |
| | | } |
| | | |
| | | GameObject battleGO = ResManager.Instance.LoadAsset<GameObject>("Hero/SpineRes", "Hero_001"/*skinCfg.SpineRes*/); |
| | | |
| | | if (battleGO == null) |
| | | { |
| | | Debug.LogError("BattleObjectFactory.CreateBattleObject: battleGO is null for " + teamHero.heroId); |
| | | return null; |
| | | } |
| | | |
| | | GameObject goParent = posNodeList[teamHero.positionNum]; |
| | | BattleObject battleObject = new BattleObject(_battleField); |
| | | battleObject.ObjID = teamHero.ObjID; |
| | | |
| | | GameObject realGO = GameObject.Instantiate(battleGO, goParent.transform); |
| | | SkeletonGraphic skeletonGraphic = realGO.GetComponentInChildren<SkeletonGraphic>(); |
| | | skeletonGraphic.skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/", skinCfg.SpineRes); |
| | | SkeletonGraphic skeletonGraphic = realGO.GetComponentInChildren<SkeletonGraphic>(true); |
| | | |
| | | var skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/", skinCfg.SpineRes); |
| | | if (skeletonDataAsset == null) |
| | | { |
| | | Debug.LogError("BattleObjectFactory.CreateBattleObject: skeletonDataAsset is null for " + skinCfg.SpineRes); |
| | | return null; |
| | | } |
| | | |
| | | float finalScaleRate = modelScaleRate * teamHero.modelScale; |
| | | |
| | | skeletonGraphic.skeletonDataAsset = skeletonDataAsset; |
| | | skeletonGraphic.Initialize(true); |
| | | realGO.name = battleObject.ObjID.ToString(); |
| | | realGO.transform.localScale = new Vector3((_Camp == BattleCamp.Red ? 1 : -1f) * modelScaleRate, modelScaleRate, modelScaleRate); |
| | | realGO.transform.localScale = new Vector3((_Camp == BattleCamp.Red ? 1 : -1f) * finalScaleRate, finalScaleRate, finalScaleRate); |
| | | battleObject.Init(realGO, teamHero, _Camp); |
| | | return battleObject; |
| | | } |
| | |
| | | } |
| | | tweenList.Clear(); |
| | | } |
| | | |
| | | public void Release() |
| | | { |
| | | foreach (var tween in tweenList) |
| | | { |
| | | if (tween != null && !tween.IsComplete()) |
| | | { |
| | | tween.Kill(); |
| | | } |
| | | } |
| | | tweenList.Clear(); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | // 增加buff |
| | | public void AddBuff(H0605_tagObjAddBuff vNetData) |
| | | public void AddBuff(HB428_tagSCBuffRefresh vNetData) |
| | | { |
| | | // BuffBase buffBase = BuffFactory.CreateBuff(vNetData, battleObject); |
| | | // if (null == buffBase) |
| | |
| | | // } |
| | | |
| | | // buffBase.OnAdd(); |
| | | |
| | | } |
| | | |
| | | // 删除buff |
| | | public void RemoveBuff(H0606_tagObjDelBuff vNetData) |
| | | public void RemoveBuff(HB429_tagSCBuffDel vNetData) |
| | | { |
| | | |
| | | // buffBase.OnRemove(); |
| | |
| | | // public int DurationRound { get; protected set; } // 持续回合数 |
| | | // public int ElapsedRound { get; protected set; } // 已经过的回合数 |
| | | |
| | | protected H0605_tagObjAddBuff h0605_TagObjAddBuff; |
| | | protected HB428_tagSCBuffRefresh TagObjAddBuff; |
| | | |
| | | public BuffBase(H0605_tagObjAddBuff _h0605_TagObjAddBuff) |
| | | public BuffBase(HB428_tagSCBuffRefresh _TagObjAddBuff) |
| | | { |
| | | h0605_TagObjAddBuff = _h0605_TagObjAddBuff; |
| | | TagObjAddBuff = _TagObjAddBuff; |
| | | // BuffId = buffId; |
| | | // Owner = owner; |
| | | // DurationRound = durationRound; |
| | |
| | | /// </summary> |
| | | public static class BuffFactory |
| | | { |
| | | public static BuffBase CreateBuff(H0605_tagObjAddBuff vNetData, BattleObject owner) |
| | | public static BuffBase CreateBuff(HB428_tagSCBuffRefresh vNetData, BattleObject owner) |
| | | { |
| | | // int buffId = vNetData.buffId; |
| | | // int durationRound = vNetData.durationRound; |
| | |
| | | |
| | | public void PlayRecord(RecordAction recordAction) |
| | | { |
| | | Debug.LogError("Enqueue record action " + recordAction.GetType()); |
| | | recordActionQueue.Enqueue(recordAction); |
| | | } |
| | | |
| | |
| | | { |
| | | for (int i = 0; i < recordActions.Count; i++) |
| | | { |
| | | recordActionQueue.Enqueue(recordActions[i]); |
| | | PlayRecord(recordActions[i]); |
| | | } |
| | | } |
| | | |
| | |
| | | if (recordActionQueue.Count > 0) |
| | | { |
| | | currentRecordAction = recordActionQueue.Dequeue(); |
| | | Debug.LogError("play record action " + currentRecordAction.GetType()); |
| | | } |
| | | } |
| | | } |
| | |
| | | currentRecordAction = null; |
| | | recordActionQueue.Clear(); |
| | | } |
| | | |
| | | public void Release() |
| | | { |
| | | currentRecordAction = null; |
| | | recordActionQueue.Clear(); |
| | | } |
| | | } |
| | |
| | | protected SkillEffect skillEffect; |
| | | |
| | | public DirectlyDamageSkill(BattleObject _caster, SkillConfig _skillCfg, |
| | | H0604_tagUseSkillAttack _vNetData, List<GameNetPackBasic> _packList, BattleField _battleField) |
| | | HB427_tagSCUseSkill _vNetData, List<GameNetPackBasic> _packList, BattleField _battleField) |
| | | : base(_caster, _skillCfg, _vNetData, _packList, _battleField) |
| | | { |
| | | foreach (var pack in packList) |
| | |
| | | } |
| | | } |
| | | |
| | | protected override void OnHitTargets(int _hitIndex, List<H0604_tagUseSkillAttack.tagSkillHurtObj> hitList) |
| | | protected override void OnHitTargets(int _hitIndex, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hitList) |
| | | { |
| | | base.OnHitTargets(_hitIndex, hitList); |
| | | } |
| | | |
| | | protected override void OnHitEachTarget(BattleObject target, long totalDamage, List<long> damageList, ref H0604_tagUseSkillAttack.tagSkillHurtObj hurt) |
| | | protected override void OnHitEachTarget(BattleObject target, long totalDamage, List<long> damageList, ref HB427_tagSCUseSkill.tagSCUseSkillHurt hurt) |
| | | { |
| | | base.OnHitEachTarget(target, totalDamage, damageList, ref hurt); |
| | | } |
| | |
| | | protected SkillEffect skillEffect; |
| | | |
| | | public DirectlyHealSkill(BattleObject _caster, SkillConfig _skillCfg, |
| | | H0604_tagUseSkillAttack _vNetData, List<GameNetPackBasic> _packList, BattleField _battleField) |
| | | HB427_tagSCUseSkill _vNetData, List<GameNetPackBasic> _packList, BattleField _battleField) |
| | | : base(_caster, _skillCfg, _vNetData, _packList, _battleField) |
| | | { |
| | | foreach (var pack in packList) |
| | |
| | | } |
| | | } |
| | | |
| | | protected override void OnHitTargets(int _healIndex, List<H0604_tagUseSkillAttack.tagSkillHurtObj> healList) |
| | | protected override void OnHitTargets(int _healIndex, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> healList) |
| | | { |
| | | base.OnHitTargets(_healIndex, healList); |
| | | } |
| | | |
| | | protected override void OnHitEachTarget(BattleObject target, long totalDamage, List<long> damageList, ref H0604_tagUseSkillAttack.tagSkillHurtObj hurt) |
| | | protected override void OnHitEachTarget(BattleObject target, long totalDamage, List<long> damageList, ref HB427_tagSCUseSkill.tagSCUseSkillHurt hurt) |
| | | { |
| | | base.OnHitEachTarget(target, totalDamage, damageList, ref hurt); |
| | | } |
| | |
| | | protected SkillEffect skillEffect; |
| | | |
| | | public RebornSkill(BattleObject _caster, SkillConfig _skillCfg, |
| | | H0604_tagUseSkillAttack _vNetData, List<GameNetPackBasic> _packList, BattleField _battleField) |
| | | HB427_tagSCUseSkill _vNetData, List<GameNetPackBasic> _packList, BattleField _battleField) |
| | | : base(_caster, _skillCfg, _vNetData, _packList, _battleField) |
| | | { |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | protected override void OnHitTargets(int _hitIndex, List<H0604_tagUseSkillAttack.tagSkillHurtObj> hitList) |
| | | protected override void OnHitTargets(int _hitIndex, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hitList) |
| | | { |
| | | base.OnHitTargets(_hitIndex, hitList); |
| | | } |
| | | |
| | | protected override void OnHitEachTarget(BattleObject target, long totalDamage, List<long> damageList, ref H0604_tagUseSkillAttack.tagSkillHurtObj hurt) |
| | | protected override void OnHitEachTarget(BattleObject target, long totalDamage, List<long> damageList, ref HB427_tagSCUseSkill.tagSCUseSkillHurt hurt) |
| | | { |
| | | base.OnHitEachTarget(target, totalDamage, damageList, ref hurt); |
| | | } |
| | |
| | | |
| | | public class SkillBase |
| | | { |
| | | protected H0604_tagUseSkillAttack tagUseSkillAttack; |
| | | protected HB427_tagSCUseSkill tagUseSkillAttack; |
| | | |
| | | protected SkillConfig skillConfig; |
| | | |
| | |
| | | |
| | | protected List<GameNetPackBasic> packList; |
| | | |
| | | protected SkillBase otherSkill; |
| | | protected SkillRecordAction otherSkillAction; |
| | | |
| | | protected List<H0704_tagRolePackRefresh> dropPackList = new List<H0704_tagRolePackRefresh>(); |
| | | |
| | | protected List<HB405_tagMCAddExp> expPackList = new List<HB405_tagMCAddExp>(); |
| | | |
| | | public SkillBase(BattleObject _caster, SkillConfig _skillCfg, H0604_tagUseSkillAttack vNetData, List<GameNetPackBasic> _packList, BattleField _battleField = null) |
| | | public SkillBase(BattleObject _caster, SkillConfig _skillCfg, HB427_tagSCUseSkill vNetData, List<GameNetPackBasic> _packList, BattleField _battleField = null) |
| | | { |
| | | caster = _caster; |
| | | skillConfig = _skillCfg; |
| | |
| | | battleField = _battleField; |
| | | packList = _packList; |
| | | |
| | | } |
| | | } |
| | | |
| | | public virtual void Run() |
| | | { |
| | |
| | | { |
| | | curFrame++; |
| | | } |
| | | |
| | | if (otherSkillAction != null) |
| | | { |
| | | if (otherSkillAction.IsFinished()) |
| | | { |
| | | otherSkillAction = null; |
| | | OnSkillFinished(); |
| | | } |
| | | else |
| | | { |
| | | otherSkillAction.Run(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | protected virtual void OnActiveSkillFrame() |
| | | { |
| | |
| | | break; |
| | | case SkillCastMode.Target: |
| | | // 目标是敌方主目标 |
| | | BattleObject mainTarget = battleField.battleObjMgr.GetBattleObject((int)tagUseSkillAttack.AttackID); |
| | | if (tagUseSkillAttack.HurtCount <= 0) |
| | | { |
| | | Debug.LogError("技能攻击包没有目标 HurtCount <= 0"); |
| | | OnSkillFinished(); |
| | | return; |
| | | } |
| | | |
| | | var mainHurt = tagUseSkillAttack.HurtList[0]; |
| | | |
| | | BattleObject mainTarget = battleField.battleObjMgr.GetBattleObject((int)mainHurt.ObjID); |
| | | if (mainTarget == null) |
| | | { |
| | | Debug.LogError("目标为空 mainTarget == null AttackID : " + tagUseSkillAttack.AttackID); |
| | | Debug.LogError("目标为空 mainTarget == null ObjID : " + mainHurt.ObjID); |
| | | OnSkillFinished(); |
| | | return; |
| | | } |
| | |
| | | } |
| | | |
| | | // 命中目标后的回调 正常是以各技能的方式来处理的 |
| | | protected virtual void OnHitTargets(int _hitIndex, List<H0604_tagUseSkillAttack.tagSkillHurtObj> hitList) |
| | | protected virtual void OnHitTargets(int _hitIndex, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hitList) |
| | | { |
| | | for (int i = 0; i < hitList.Count; i++) |
| | | { |
| | | H0604_tagUseSkillAttack.tagSkillHurtObj hurt = hitList[i]; |
| | | HB427_tagSCUseSkill.tagSCUseSkillHurt hurt = hitList[i]; |
| | | |
| | | BattleObject target = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID); |
| | | if (target == null) |
| | |
| | | return fixedDamageList; |
| | | } |
| | | |
| | | protected virtual void OnHitEachTarget(BattleObject target, long totalDamage, List<long> damageList, ref H0604_tagUseSkillAttack.tagSkillHurtObj hurt) |
| | | protected virtual void OnHitEachTarget(BattleObject target, long totalDamage, List<long> damageList, ref HB427_tagSCUseSkill.tagSCUseSkillHurt hurt) |
| | | { |
| | | target.Hurt(damageList, totalDamage, hurt.AttackType); |
| | | target.Hurt(damageList, totalDamage, hurt.AttackTypes); |
| | | |
| | | // 击中目标的时候,不管近战远程 都确认一下是否有爆炸特效 然后播放 |
| | | if (skillConfig.ExplosionEffectId > 0) |
| | |
| | | |
| | | public void OnSkillFinished() |
| | | { |
| | | while (packList.Count > 0) |
| | | { |
| | | var pack = packList[0]; |
| | | packList.RemoveAt(0); |
| | | |
| | | if (pack is CustomHB426CombinePack) |
| | | { |
| | | var combinePack = pack as CustomHB426CombinePack; |
| | | if (combinePack.startTag.Tag.StartsWith("Skill_")) |
| | | { |
| | | otherSkillAction = combinePack.CreateSkillAction(); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | PackageRegedit.Distribute(pack); |
| | | } |
| | | |
| | | isFinished = true; |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | public static SkillBase CreateSkill(BattleObject _caster, H0604_tagUseSkillAttack vNetData, List<GameNetPackBasic> packList, BattleField battleField) |
| | | public static SkillBase CreateSkill(BattleObject _caster, HB427_tagSCUseSkill vNetData, List<GameNetPackBasic> packList, BattleField battleField) |
| | | { |
| | | SkillConfig skillConfig = SkillConfig.Get(vNetData.SkillID); |
| | | SkillConfig skillConfig = SkillConfig.Get((int)vNetData.SkillID); |
| | | |
| | | SkillBase skill = null; |
| | | switch (skillConfig.SkillType) |
| | |
| | | private Vector2 end; |
| | | private Vector2 control; |
| | | |
| | | public BezierBulletCurve(BattleObject caster, SkillConfig skillConfig, EffectPlayer effectPlayer, RectTransform target, Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> onHit) |
| | | public BezierBulletCurve(BattleObject caster, SkillConfig skillConfig, EffectPlayer effectPlayer, RectTransform target, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | : base(caster, skillConfig, effectPlayer, target, onHit) { } |
| | | |
| | | public override void Reset() |
| | |
| | | /// </summary> |
| | | public class BounceBulletCurve : BulletCurve |
| | | { |
| | | private List<H0604_tagUseSkillAttack.tagSkillHurtObj> hurtList; |
| | | private List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hurtList; |
| | | private int curIndex = 0; |
| | | private Vector2 start; |
| | | private Vector2 end; |
| | |
| | | private float bounceElapsed = 0f; |
| | | |
| | | public BounceBulletCurve(BattleObject caster, SkillConfig skillConfig, EffectPlayer effectPlayer, |
| | | RectTransform target, H0604_tagUseSkillAttack tagUseSkillAttack, Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> onHit) |
| | | RectTransform target, HB427_tagSCUseSkill tagUseSkillAttack, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | : base(caster, skillConfig, effectPlayer, target, onHit) |
| | | { |
| | | this.hurtList = new List<H0604_tagUseSkillAttack.tagSkillHurtObj>(tagUseSkillAttack.HurtList); |
| | | this.hurtList = new List<HB427_tagSCUseSkill.tagSCUseSkillHurt>(tagUseSkillAttack.HurtList); |
| | | } |
| | | |
| | | public override void Reset() |
| | |
| | | protected EffectPlayer bulletEffect; |
| | | protected RectTransform bulletTrans; // 子弹的RectTransform |
| | | protected RectTransform target; |
| | | protected Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> onHit; |
| | | protected Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit; |
| | | |
| | | protected bool finished = false; |
| | | protected float duration = 0f; |
| | |
| | | |
| | | public BulletCurve() { } |
| | | |
| | | public BulletCurve(BattleObject caster, SkillConfig skillConfig, EffectPlayer bulletEffect, RectTransform target, Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> onHit) |
| | | public BulletCurve(BattleObject caster, SkillConfig skillConfig, EffectPlayer bulletEffect, RectTransform target, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | { |
| | | this.caster = caster; |
| | | this.skillConfig = skillConfig; |
| | |
| | | SkillConfig skillConfig, |
| | | EffectPlayer bulletEffect, |
| | | RectTransform target, |
| | | H0604_tagUseSkillAttack tagUseSkillAttack, |
| | | Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> onHit) |
| | | HB427_tagSCUseSkill tagUseSkillAttack, |
| | | Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | { |
| | | switch (skillConfig.BulletPath) |
| | | { |
| | |
| | | private Vector2 outPos; // 屏幕外延长点(本地坐标) |
| | | private bool hitTriggered = false; // 是否已触发onHit |
| | | |
| | | public PenetrateBulletCurve(BattleObject caster, SkillConfig skillConfig, EffectPlayer effectPlayer, RectTransform target, Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> onHit) |
| | | public PenetrateBulletCurve(BattleObject caster, SkillConfig skillConfig, EffectPlayer effectPlayer, RectTransform target, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | : base(caster, skillConfig, effectPlayer, target, onHit) { } |
| | | |
| | | /// <summary> |
| | |
| | | private Vector2 start; |
| | | private Vector2 end; |
| | | |
| | | public StraightBulletCurve(BattleObject caster, SkillConfig skillConfig, EffectPlayer bulletEffect, RectTransform target, Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> onHit) |
| | | public StraightBulletCurve(BattleObject caster, SkillConfig skillConfig, EffectPlayer bulletEffect, RectTransform target, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | : base(caster, skillConfig, bulletEffect, target, onHit) { } |
| | | |
| | | public override void Reset() |
| | |
| | | |
| | | protected List<BulletCurve> bulletCurves = new List<BulletCurve>(); |
| | | |
| | | public BulletSkillEffect(SkillConfig _skillConfig, BattleObject _caster, H0604_tagUseSkillAttack _tagUseSkillAttack) |
| | | public BulletSkillEffect(SkillConfig _skillConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | : base(_skillConfig, _caster, _tagUseSkillAttack) |
| | | { |
| | | |
| | |
| | | |
| | | |
| | | |
| | | public override void Play(Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> _onHit) |
| | | public override void Play(Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> _onHit) |
| | | { |
| | | // 弹射 另外的做法了 |
| | | if (skillConfig.effectType == SkillEffectType.Bullet && skillConfig.BulletPath == 4) |
| | |
| | | // 普通的做法 |
| | | else |
| | | { |
| | | Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> onHitFormation = (_hitIndex, _hurtList) => |
| | | Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHitFormation = (_hitIndex, _hurtList) => |
| | | { |
| | | _onHit?.Invoke(_hitIndex, tagUseSkillAttack.HurtList.ToList()); |
| | | }; |
| | |
| | | } |
| | | } |
| | | |
| | | protected void ShotToFormation(RectTransform target, Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> _onHit) |
| | | protected void ShotToFormation(RectTransform target, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> _onHit) |
| | | { |
| | | EffectPlayer effectPlayer = caster.battleField.battleEffectMgr.PlayEffect(caster.ObjID, skillConfig.BulletEffectId, caster.effectNode); |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | protected void ShotToTarget(BattleObject target, Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> _onHit) |
| | | protected void ShotToTarget(BattleObject target, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> _onHit) |
| | | { |
| | | EffectPlayer effectPlayer = caster.battleField.battleEffectMgr.PlayEffect(caster.ObjID, skillConfig.BulletEffectId, caster.effectNode); |
| | | RectTransform effectTrans = effectPlayer.transform as RectTransform; |
| | |
| | | // protected BattleObject caster; |
| | | // protected List<BattleObject> targets; // 目标列表 |
| | | |
| | | public NormalSkillEffect(SkillConfig _skillConfig, BattleObject _caster, H0604_tagUseSkillAttack _tagUseSkillAttack) |
| | | public NormalSkillEffect(SkillConfig _skillConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | : base(_skillConfig, _caster, _tagUseSkillAttack) |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | public override void Play(Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> _onHit) |
| | | public override void Play(Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> _onHit) |
| | | { |
| | | |
| | | // // 特效炸开在阵容的中间的回调 |
| | | // Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> onHitLineUpCenter = (_hitIndex, _hurtList) => |
| | | // Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHitLineUpCenter = (_hitIndex, _hurtList) => |
| | | // { |
| | | // _onHit?.Invoke(_hitIndex, tagUseSkillAttack.HurtList.ToList()); |
| | | // }; |
| | |
| | | // continue; |
| | | // } |
| | | |
| | | // CastInTarget(target.heroGo.transform as RectTransform, (index, list) => _onHit(0, new List<H0604_tagUseSkillAttack.tagSkillHurtObj>() { hurt })); |
| | | // CastInTarget(target.heroGo.transform as RectTransform, (index, list) => _onHit(0, new List<HB427_tagSCUseSkill.tagSCUseSkillHurt>() { hurt })); |
| | | // } |
| | | // } |
| | | // else if (skillConfig.effectAnchor == SkillEffectAnchor.AlliesCenter) |
| | |
| | | // } |
| | | } |
| | | |
| | | protected void CastInTarget(RectTransform target, Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> _onHit) |
| | | protected void CastInTarget(RectTransform target, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> _onHit) |
| | | { |
| | | // EffectPlayer effectPlayer = caster.battleField.battleEffectMgr.PlayEffect(caster.ObjID, skillConfig.EffectId, caster.effectNode); |
| | | |
| | |
| | | { |
| | | protected SkillConfig skillConfig; |
| | | protected BattleObject caster; |
| | | protected H0604_tagUseSkillAttack tagUseSkillAttack;// 目标列表 |
| | | protected HB427_tagSCUseSkill tagUseSkillAttack;// 目标列表 |
| | | |
| | | public SkillEffect(SkillConfig _skillConfig, BattleObject _caster, H0604_tagUseSkillAttack _tagUseSkillAttack) |
| | | public SkillEffect(SkillConfig _skillConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | { |
| | | skillConfig = _skillConfig; |
| | | caster = _caster; |
| | |
| | | } |
| | | |
| | | // |
| | | public virtual void Play(Action<int, List<H0604_tagUseSkillAttack.tagSkillHurtObj>> _onHit) |
| | | public virtual void Play(Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> _onHit) |
| | | { |
| | | |
| | | } |
| | |
| | | |
| | | public static class SkillEffectFactory |
| | | { |
| | | public static SkillEffect CreateSkillEffect(BattleObject caster, SkillConfig skillConfig, H0604_tagUseSkillAttack tagUseSkillAttack) |
| | | public static SkillEffect CreateSkillEffect(BattleObject caster, SkillConfig skillConfig, HB427_tagSCUseSkill tagUseSkillAttack) |
| | | { |
| | | // switch (skillConfig.effectType) |
| | | // { |
| | |
| | | { |
| | | if (team.tempHeroes[i] == null) |
| | | continue; |
| | | var country = (HeroCountry)team.tempHeroes[i].heroConfig.Country; |
| | | var country = (HeroCountry)team.tempHeroes[i].Country; |
| | | |
| | | if (!heroCountryCount.ContainsKey(country)) |
| | | { |
| | |
| | | NPCConfig cfg = NPCConfig.Get(id); |
| | | if (cfg != null) |
| | | { |
| | | return cfg.charName; |
| | | return cfg.NPCName; |
| | | } |
| | | } |
| | | } |
| | |
| | | public partial class TeamHero |
| | | { |
| | | public int heroId; |
| | | public HeroConfig heroConfig; |
| | | |
| | | public HeroCountry Country; |
| | | public int SkinID; |
| | | public HeroSkinConfig skinConfig; |
| | | public string guid; |
| | | public string guid; |
| | | |
| | | public float modelScale = 1f; |
| | | |
| | | |
| | | public TeamBase teamBase |
| | |
| | | // 服务器来的构造 |
| | | public TeamHero(HB424_tagSCTurnFightInit.tagSCTurnFightObj fightObj, TeamBase _teamBase) |
| | | { |
| | | // 判断一下是npc还是玩家 |
| | | heroId = (int)fightObj.HeroID; |
| | | heroConfig = HeroConfig.Get(heroId); |
| | | SkinID = (int)fightObj.SkinID; |
| | | skinConfig = HeroSkinConfig.Get(SkinID); |
| | | |
| | | if (fightObj.NPCID > 0) |
| | | { |
| | | //走NPC的逻辑 |
| | | NPCConfig npcConfig = NPCConfig.Get((int)fightObj.NPCID); |
| | | Country = (HeroCountry)npcConfig.Country; |
| | | SkinID = npcConfig.SkinID; |
| | | modelScale = npcConfig.ModelScale; |
| | | } |
| | | else |
| | | { |
| | | //走玩家逻辑 |
| | | var heroConfig = HeroConfig.Get(heroId); |
| | | Country = (HeroCountry)heroConfig.Country; |
| | | SkinID = (int)fightObj.SkinID; |
| | | modelScale = 1f; |
| | | } |
| | | |
| | | |
| | | skinConfig = HeroSkinConfig.Get(SkinID); |
| | | teamBase = _teamBase; |
| | | |
| | | ObjID = (int)fightObj.ObjID; |
| | |
| | | public TeamHero(HeroInfo heroInfo, int posNum, TeamBase _teamBase) |
| | | { |
| | | heroId = heroInfo.itemHero.config.ID; |
| | | heroConfig = HeroConfig.Get(heroId); |
| | | SkinID = heroInfo.SkinID; |
| | | skinConfig = heroInfo.skinConfig; |
| | | |