You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

503 lines
17 KiB

using System;
using System.Collections.Generic;
using ProtoCSStruct;
using Sog;
namespace Battle
{
public class HeroValue2
{
public BattleHero hero;
public int value;
public int value2;
}
public enum DmgImmuneSpellType
{
None = 0, //无
AllDmgExceptManual = 1, //免疫大招除外的伤害
}
public enum DmgImmuneLimitType
{
None = 0, //无
DmgGETargetMaxHpRate = 1, //伤害值需大于等于目标血量上限千分比
}
public class SpellCriModify
{
public uint buffObjId;
public int spellId;
public int criRateAdd;
public int condType;
public int condParam1;
public int condParam2;
public override string ToString()
{
return string.Format("spellid {0} criRateAdd {1} cond {2} param1 {3} param2 {4}", spellId, criRateAdd, condType, condParam1, condParam2);
}
}
//buff免疫
public class DmgImmuneEx
{
public int count = 0; // 伤害免疫次数 -1表示没有限制
public uint buffObjId = 0; // buffI objId
public DmgImmuneSpellType spellType; //技能类型
public DmgImmuneLimitType limitType; //限制类型
public int param; //限制参数
}
// 技能相关的扩展数据,正值为增加,负值为减少
public class HeroSpellExt
{
// 远程技能最大射程
public int addRemoteSpellMaxDist;
// 远程技能最大射程千分比
public int addRemoteSpellMaxDistRate;
// 对目标加增益buff时,buff持续时间根据下值修正
public int addPositiveBuffTime;
// 对目标加减益buff时,buff持续时间根据下值修正
public int addNegativeBuffTime;
// 被别人加增益buff时,buff持续时间根据下值修正
public int beAddPositiveBuffTime;
// 被别人加减益buff时,buff持续时间根据下值修正
public int beAddNegativeBuffTime;
//技能暴击率修正
public List<SpellCriModify> criModifyList = new List<SpellCriModify>();
// 免疫致死一击的次数
public int immuneDeadlyHitCount;
public int immuneDeadlyHitBuffId;
// 闪电链这类技能, 表现层需要逻辑层多次重复放同1个技能, 策划希望多次技能之间伤害/治疗增加
// 下面字段每次闪电链施放时填写, 施法结束清除
public int lightningChainSpellId;
public int lightningChainReviseDmgHealRate;
//伤害免疫
public List<DmgImmuneEx> dmgImmuneExList = new List<DmgImmuneEx>();
//增伤
//public List<IncSpellDmgObj> IncSpellDmgList = new List<IncSpellDmgObj>();
}
public class SpellRuneInfo
{
//public List<IDValue32IL> spellRuneList = new List<IDValue32IL>();
}
public class TDHeroData
{
public int outCost;
public bool outFight;
}
public class HeroPropChgNode
{
// 触发该节点生效的buffId
public int triggerBuffId;
// 该节点当前已经修改的属性值
public long targetPropChgVal;
// 剩余时长
public int remainTime;
}
// 当srcPropId变化时, 如果满足条件cond, 则根据规则rule修改targetPropId, 修改值保存在targetPropChgVal
// 每个node可配置一组条件, 规则, 持续时长, 同一个srcPropId可以配置多个node
// 例如: 当神射虎受到队友的攻击力加成时, 额外获得50%的攻速加成
public class HeroPropChgData
{
// 创造当前数据的技能id
public int createSpellId; // key 1
// 发生变化的属性id
public int srcPropId; // key 2
// 修改条件
public int cond;
public int condParam1;
public int condParam2;
// 修改规则
public int rule;
public int ruleParam1;
public int ruleParam2;
public int targetPropId;
// 表现buffId
public int showBuffId;
// 详细的属性变化信息
public List<HeroPropChgNode> chgPropList = new List<HeroPropChgNode>();
}
// 禅师熊猫治疗链
public class PandaHealChain
{
public BattleHero friend; //被治疗方
public BattleHero enemy; //被伤害方
public BattleHero caster; //施法者(熊猫)
public int dmgToHealRate; //伤害转治疗比例
public int enemyDieHealFriendRate; //敌方死亡时, 友方回血比例
public int friendDeadlyHitHealRate; //友方受到致死打击时, 回血比例
public int effectBuffId; // 功能buff id
public int effectBuffLevel; // 功能buff level
public int showBuffId; // 表现连线的buff id
public long secHealLimit; //每秒治疗限制
public long curSecStartMs; //当前秒起始帧
public long curSecHealTotal; //当前秒治疗总量
}
// 溢出吸血转护盾
public class OverflowStealShield
{
public int transRate;
public int buffId;
public long maxSheild;
//public BattleBuff srcBuff; //效果源buff
//public BattleBuff shieldBuff; //缓存护盾buff
}
// 溢出治疗转护盾
public class OverflowHealShield
{
public int transRate;
public int buffId;
public long maxSheild;
//public BattleBuff srcBuff; //效果源buff
//public BattleBuff shieldBuff; //缓存护盾buff
}
// 溢出治疗转护盾
public class AddDebuffRandomNode
{
public uint buffObjId; //buffId
public int rate; //概率
public int addTime; //增加时间
}
public class DelayDmgInfo
{
public uint buffObjId; //buffId
public int buffId; //buffDescId
public int maxCount; //最大次数
public int rate; //倍率
public List<long> dmgList = new List<long>();
}
// 额外buff伤害
public class BuffExtraDamage
{
public int buffId; //buffId
public int targetObjId; //对方objid
public long dmg; //额外伤害
public int effectIdx;
}
public class BattleHero
{
public BattleObj Battle;
public BattleHero(BattleObj battle)
{
Battle = battle;
hurtSeq = 1;
isHaveSurvieTime = false;
}
public int objId; //对象ID
public int DescId;
public string name;
public bool isBoss;
// 行动回合
public int actionRound;
// 眩晕回合, 在次回合结束前眩晕
public int stunRound;
public int pos;
public int roundComboNum;
// 阵营 A=1,B=2
public BattleSide initSide; //初始阵营,创建英雄的时候就确定了,不会变
public BattleSide fightSide; //作战阵营,逻辑实际处理时候用的阵营,有效果会改变这个。用接口BattleHeroSvc.CheckIsFriend()来判断敌友方
public RaceType race; //种族
public int level;
public HeroType heroType; //英雄类型,目前分为:英雄、怪物、召唤物,召唤物属于怪物
public int masterObjId; //主人objId
public int posX;
public int posZ;
public int facing;
// 属性
// public HeroProp prop = new HeroProp();
// 开场时属性
public long startPropAtk; //攻击力
public long startPropDef; //防御力
public int buffUpdateTimePass;
//成功选择目标id
public uint successTestTargetObjId;
// 技能相关的扩展数据
public HeroSpellExt spellExt = new HeroSpellExt();
public SpellRuneInfo spellRuneInfo = new SpellRuneInfo();
//不允许直接设置,请调用setdead
public bool isDead
{
get; private set;
}
// 正在复活
public bool reviving;
//记录被伤害值,用来恢复能量
public long hurtAddEnergyTotal;
//记录伤害
public long totalHurt;
//承受伤害
public long totalDamage;
//记录损失血量
public long lostHp;
//记录被攻击次数
public int attackedCount;
//记录被普攻伤害次数
public int beNormalHurtCount;
//记录获取能量
public long getEnergy;
//记录免疫掉的伤害
public long totalImmuneDamage;
// 技能调整规则
//public ISpellAdjustRuleData spellAdjustRuleData;
// 自增序列,战斗中伤害、治疗数据排序,这个排序代表HP的变化顺序
// 用于伤害数字的合并、伤害同时触发治疗时两个技能表现的合并
public int hurtSeq;
// 强制攻击目标同时只存在一个,新目标覆盖旧目标
public BattleHero forceAttackTarget;
public bool forceAttackOnlyNormalSpell;
public uint forceAttackBuffObjId;
// 协同攻击目标, 优先级低于forceAttackTarget
public BattleHero cooperativePartner;
public BattleHero cooperativeAttackTarget;
//技能施法
public int spellCastingInstCleanSeq;
//public BattleSpellCastingInst spellCastingInst;
//public BattleHeroAIData aiData;
public bool isHaveSurvieTime; //是否存在生存时间
public int survieTime; //生存时间
// 当前被几条灵魂链链接, 灵魂链接是AB之间双向平分伤害
public int soulChainCount;
//// 伤害传递是单向, A->B, 反之则不行, A掉100%血, B掉传递的百分比
//public List<DmgTransParam> dmgTransferList = new List<DmgTransParam>();
//// 伤害分担单向的, A->B A掉(100-X)%血, B掉分担的百分比
//public List<DmgBearParam> dmgBearList = new List<DmgBearParam>();
////直接掉血量上限参数
//public List<LoseHpMaxData> loseHpMaxDatas;
//更新的逻辑时间,加速减速会影响时间
public long updateLogicTime;
public TDHeroData tdHero = new TDHeroData();
public Fixed64Vector3 enterMapStopPos = new Fixed64Vector3();
//玩家英雄放大招,需要停滞其他英雄
public int castSuperSpellFreezeOther;
public int castSpellfreezeOtherTimeResumeTime;
//public List<EffectTarget> _manualSpellSelectTarget = new List<EffectTarget>();
////这个功能只支持一个,直接保存,提高效率,免得遍历buff
//public AbsorbDmgInfo absorbDmgInfo;
////保存,提高效率
//public BattleSpell normalSpell;
//public BattleSpell manualActiveSpell;
public Vector3IntFloat lastManualPos; //上次手动技能的位置
public uint lastDmgSpellTarget; //上次伤害技能的目标
public uint lastNormalSpellTarget; //上次普攻的目标
////英雄指定技能冷却缩减 seq--praram
//public Dictionary<long, CutSpellParam> cutSpellCdRateMap = new Dictionary<long, CutSpellParam>();
//public Dictionary<long, CutSpellParam> cutSpellCdTimeMap = new Dictionary<long, CutSpellParam>();
// 最低血量 >0 表示不会被击杀, 低于血量战斗胜利
public long minHpWin;
public List<HeroPropChgData> heroPropChgList = new List<HeroPropChgData>();
//public PropIconData propIconData = new PropIconData();
////特殊效果本回合触发次数
//public Dictionary<int, int> effectTriggerThisRound = new Dictionary<int, int>();
////特殊效果连续x回合未被触发计数,触发则设置0
//public Dictionary<int, int> effectUnTriggerRound = new Dictionary<int, int>();
////特殊效果触发几率加成
//public Dictionary<int, int> effectTriggerRateAdd = new Dictionary<int, int>();
//是否会闪避
public bool hurt_willDodge;
public bool hurt_willAtkBack;
public long roundHurt = 0;//本回合受到的伤害
public long roundDmg = 0;//本回合造成的伤害
//战斗中的临时参数
public Dictionary<string, long> param = new Dictionary<string, long>();
public void SetDead()
{
if(isDead)
{
return;
}
isDead = true;
Battle.deadHeros.Add(this);
}
public void SetRelive()
{
if (!isDead)
{
return;
}
isDead = false;
Battle.deadHeros.Remove(this);
}
//internal bool CanAtkBackAtStun()
//{
// return this.GetProp(CSPropIDType.AtkBackAtStun) == 1;
//}
public int lastAddStunTimeMs; //最后添加眩晕时间
public PandaHealChain pandaHealChain;
public bool isLeave = false; //是否离场 离场会消失,且update不会tick
public bool noEnergy = false; //禁止回能
//public LeaveBattleData leaveBattleData;
public int enterStopTime = 0; //进场需停止时间
//特殊统计
//public Dictionary<int, List<IDValue64IL>> statisticsDict = new Dictionary<int, List<IDValue64IL>>();
//受击时间
public Dictionary<uint, int> hurtTimeMap = new Dictionary<uint, int>();
//特征,属性id
public int featureConfigId;
public int propConfigId;
//单次受伤最大值
//public List<OneHurtMaxDmg> hurtMaxDmgList = new List<OneHurtMaxDmg>();
////单次掉血最大值
//public List<OneHurtMaxDmg> lostHpList = new List<OneHurtMaxDmg>();
//受到哪些英雄的伤害
public HashSet<uint> beHurtHeros = new HashSet<uint>();
public bool doDmgToShield; //需要处理伤害转护盾
public bool samePriorityRandSpell = false; //同优先级随机技能
//public Dictionary<int, List<BattleBuff> > buffEventMap; //BuffEffectEvent-List
//public Dictionary<int, List<BattleBuff> > removeBuffEventMap; //BuffRemoveEvent-list
//战斗数据
public OneFightInfo fightInfo;
public int showAtkSpeedModifyRate;
public int AtkSpeedModifyRate; //全局攻速修正
public int NormalSpeedModifyRate; //普攻速度修正
public int CastSpeedModifyRate; //施法速度修正
public int NormalSpeed = 1000; //普攻速度,正常是1000
public int CastSpeed = 1000; //施法速度,正常是1000
public long OneFrameAddTime;
//public EnterBattleType enterBattleType;
public int enterRandomNormalCd;
public bool skipEnter = false; //跳过入场阶段
//溢出吸血转护盾
public OverflowStealShield overflowStealShield;
//溢出治疗转护盾
public OverflowHealShield overflowHealShield;
//条件免疫伤害
//public List<ConditionImmuneDmgNode> conditionImmuneDmgNodes = new List<ConditionImmuneDmgNode>();
/// <summary>
/// 延迟伤害
/// </summary>
public DelayDmgInfo delayDmgInfo = new DelayDmgInfo();
public int lastAtkTarget = 0; //攻击目标修改,从最后切换的目标数目
public class Buff
{
public int buffid; // buffId
public int level; // buff等级
public int effectCount; //层数
public int effectRound; //生效回合
public int triggerParam;
public int endTriggerParam;
public int addRound = 0;
public int casterId; // 施法者Id, 有的效果需要用到施法者属性 但是生效时已经和施法者失去联系
public bool needRemove = false; //是否要移除
//public SkillDesc.Effect effect; //具体效果
public int effectIdx = 0;
public int targetId = 0;
public Dictionary<string, long> param = new Dictionary<string, long>();
//public override string ToString()
//{
// return "[buffid="+buffid+",level="+level+ ",effectCount="+effectCount+ ",effectRound="+ effectRound+ ",addRound="+ addRound +
// ",triggerParam = " + triggerParam + ",endParam="+endTriggerParam+ ",effectIdx=" +effectIdx+
// ",casterId="+casterId+",effectType="+effect.type+", param="+ param.Count+"]";
//}
}
public List<Buff> buffs = new List<Buff>();
// todo buff添加的属性备份 buff加的属性太杂要移除的时候用
public List<IDValue64> buffProp = new List<IDValue64>();
// 临时存储额外伤害,最后和普攻伤害汇总伤害下发
public List<BuffExtraDamage> buffExtraDmgList = new List<BuffExtraDamage>();
}
}