public override void DoSkill(SkillDataSon skillDataSon, CharHandler charHandler, List <CharHandler> targets, int skillInstId) { List <SkillData> skillDatas = skillDataSon.GetSkillDataList(); switch (skillDatas[0].m_eSkillSonType) { case SkillEnum.SkillSonType.SkillRelease: ReleaseSkill(skillDataSon, charHandler, targets); break; case SkillEnum.SkillSonType.CleanBuff: CleanBuff(skillDataSon, charHandler, targets); break; case SkillEnum.SkillSonType.CleanDebuff: CleanDebuff(skillDataSon, charHandler, targets); break; case SkillEnum.SkillSonType.CleanBuffDebuff: CleanBuffDebuff(skillDataSon, charHandler, targets); break; case SkillEnum.SkillSonType.ReviveHero: ReviveHero(skillDatas[0], charHandler, targets); break; default: break; } }
private void CleanBuffDebuff(SkillDataSon skillDataSon, CharHandler charHandler, List <CharHandler> targets) { for (int i = 0; i < targets.Count; ++i) { targets[i].m_CharTick.CancelAll(); } }
private void CleanDebuff(SkillDataSon skillDataSon, CharHandler charHandler, List <CharHandler> targets) { for (int i = 0; i < targets.Count; ++i) { targets[i].m_CharTick.CancelByType(SkillEnum.SkillType.Debuff); } }
private void TypeRandom(CharHandler charHandler, SkillDataSon skillDataSon, List <List <CharHandler> > lists, List <CharHandler> listRet) { int totalNum = 0; for (int i = 0; i < lists.Count; ++i) { totalNum += lists[i].Count; } if (totalNum > skillDataSon.m_iCatchNum) { List <CharHandler> tmpList = new List <CharHandler>(); AddAllChar(lists, tmpList); for (int i = 0; i < skillDataSon.m_iCatchNum; ++i) { int index = Random.Range(0, tmpList.Count); listRet.Add(tmpList[index]); tmpList.RemoveAt(index); } } else { AddAllChar(lists, listRet); } CharHandler con = GetConcentrate(charHandler, skillDataSon.m_eAimSide); if (null != con && !listRet.Contains(con)) { listRet[0] = con; } }
public SkillEnum.SkillSonType m_eSkillSonType; //子技能类型 public SkillData(int sonSkillId, ConfigRow rowData, SkillDataSon parent) { m_Parent = parent; m_iSonSkillID = sonSkillId; HandleSkillType(rowData); SetEffectExpress(rowData.GetValue("EffectExpress")); }
private void OnDoSkill(SkillDataSon skillDataSon, CharHandler charHandler, List <CharHandler> targets, int skillInstId) { switch (skillDataSon.m_eSkillType) { case SkillEnum.SkillType.Buff: case SkillEnum.SkillType.Debuff: case SkillEnum.SkillType.SuperBuff: case SkillEnum.SkillType.SuperDebuff: _skillBuff.DoSkill(skillDataSon, charHandler, targets, skillInstId); break; case SkillEnum.SkillType.Property: _skillProperty.DoSkill(skillDataSon, charHandler, targets, skillInstId); break; case SkillEnum.SkillType.Bullet: _skillBullet.DoSkill(skillDataSon, charHandler, targets, skillInstId); break; case SkillEnum.SkillType.Special: _skillSpecial.DoSkill(skillDataSon, charHandler, targets, skillInstId); break; default: break; } }
private void TypeDistanceNear(CharHandler charHandler, SkillDataSon skillDataSon, List <List <CharHandler> > lists, List <CharHandler> listRet) { CharHandler con = GetConcentrate(charHandler, skillDataSon.m_eAimSide); if (null == con) { for (int i = 0; i < lists.Count; ++i) { GetCharNearest(charHandler, 360f, skillDataSon.m_iDistance, lists[i], listRet); } } else { listRet.Add(con); } if (listRet.Count > 0) { charHandler.m_CharSkill.m_vecDistancePos = listRet[0].m_ParentTrans.position; } else { charHandler.m_CharSkill.m_vecDistancePos = charHandler.m_ParentTrans.position; } }
private void TypeHPLeast(CharHandler charHandler, SkillDataSon skillDataSon, List <List <CharHandler> > lists, List <CharHandler> listRet) { CharHandler con = GetConcentrate(charHandler, skillDataSon.m_eAimSide); if (null == con) { for (int i = 0; i < lists.Count; ++i) { for (int j = 0; j < lists[i].Count; ++j) { CharHandler tmpChar = lists[i][j]; if (!tmpChar.IsInexistence()) { if (0 == listRet.Count) { listRet.Add(lists[i][j]); } else if (tmpChar.m_CharData.CurHP < listRet[0].m_CharData.CurHP) { listRet[0] = tmpChar; } } } } } else { listRet.Add(con); } }
private void ReleaseSkill(SkillDataSon skillDataSon, CharHandler charHandler, List <CharHandler> targets) { for (int i = 0; i < targets.Count; ++i) { targets[i].ReleaseSkill(targets[i].m_CharData.SkillIDs[0]); } }
public void BeHit(float hurt, CharHandler srcHandler, SkillDataSon srcSkillDataSon, bool bDirect) { if (CheckCanBeHit()) { hurt = Mathf.Max(1f, hurt); if (_charHandler.m_CharData.Rebound.Value > 0 && bDirect) { _BeHit(hurt, srcHandler, srcSkillDataSon, bDirect); Rebound(hurt, srcHandler); } else if (_charHandler.m_CharData.Absorb.Value > 0) { Absorb(hurt, srcHandler); } else { _BeHit(hurt, srcHandler, srcSkillDataSon, bDirect); if (null != srcHandler && srcHandler.m_CharData.AbsorbHP.Value > 0) { AbsorbHP(hurt, srcHandler); } } } }
public override void DoSkill(SkillDataSon skillDataSon, CharHandler charHandler, List <CharHandler> targets, int skillInstId) { for (int i = 0; i < targets.Count; ++i) { TickData tickData = new TickData(charHandler, targets[i], skillDataSon, i, skillInstId); targets[i].m_CharTick.AddTick(tickData); } }
public TickData(CharHandler charHandler, CharHandler aimCharHandler, SkillDataSon skillDataSon, int aimCharIndex, int skillInstId) { m_iInstanceID = ++iTickDataInstanceID; _CharHandler = charHandler; _AimCharHandler = aimCharHandler; m_SkillDataSon = skillDataSon; m_eBuffType = skillDataSon.GetSkillDataList()[0].m_eSkillSonType; _iAimCharIndex = aimCharIndex; float fTotalSecOri; if (float.TryParse(m_SkillDataSon.m_sTimeLong, out fTotalSecOri)) { m_fTotalSec = fTotalSecOri; } else { fTotalSecOri = Mathf.Ceil(BattleCalculate.ExcuteFormula(m_SkillDataSon.m_sTimeLong, m_SkillDataSon.m_sTimeMaxLong, charHandler, aimCharHandler)); m_fTotalSec = ChangeProperty.RatioCoefficient(fTotalSecOri, skillDataSon.m_Parent.m_eSkillKind, charHandler, aimCharHandler); } if (skillDataSon.m_bDeliver) { fTotalSecOri *= aimCharIndex + 1; } switch (m_eBuffType) { case SkillEnum.SkillSonType.Stun: m_fTotalSec = fTotalSecOri * (1 - aimCharHandler.m_CharData.StunDefRatio); //1 - 抗晕 break; case SkillEnum.SkillSonType.SkillForbid: m_fTotalSec = fTotalSecOri * (1 - aimCharHandler.m_CharData.ForbidDefRatio); //1 - 抗封 break; default: m_fTotalSec = fTotalSecOri; break; } if (m_fTotalSec > 0f) { m_fUnitSec = m_SkillDataSon.m_fTimeUnit; if (m_fUnitSec > 0f) { m_fTotalSec = m_fTotalSec - m_fTotalSec % m_fUnitSec; } else { m_fUnitSec = m_fTotalSec; } SetFunction(skillInstId); } }
protected override List <CharHandler> GetTargets(CharHandler charHandler, SkillDataSon skillDataSon = null, int index = -1) { List <CharHandler> ret = null; List <List <CharHandler> > lists = GetTargetsByAimSideType(charHandler, skillDataSon); ret = GetTargetsByCatchType(charHandler, skillDataSon, lists, index); CheckRate(skillDataSon.m_Parent, charHandler, ref ret); return(ret); }
private void HPLosted(float hurt, CharHandler srcHandler, SkillDataSon srcSkillDataSon = null) { //受击特效 SetEffect(srcSkillDataSon, _charHandler.m_ParentTrans.position); if (_charHandler.m_CharData.CurHP <= 0) { _charHandler.ToDead(); if (BattleEnum.Enum_CharType.Monster == _charHandler.m_CharData.m_eType) { BattleManager.GetInst().m_CharInScene.AddMPAll(_MPData.m_fAddMPFromMonsterDead); } else { BattleManager.GetInst().m_CharInScene.AddMPAll(_MPData.m_fAddMPFromHeroDead); } } if (BattleEnum.Enum_CharType.Monster == _charHandler.m_CharData.m_eType) { //击退 if (null != srcHandler && (null == srcSkillDataSon || srcSkillDataSon.m_Parent.m_bHitBackward)) { float t = Time.time; if (t - m_fBackwardClock > ApplicationConst.fBackwardCD) { Vector3 dir = (_charHandler.m_ParentTrans.position - srcHandler.m_ParentTrans.position).normalized * 1f; _charHandler.m_ParentTrans.Translate(dir, Space.World); m_fBackwardClock = t; } } } else { //全局加魔 _iLoseHpTemp += hurt; if (_iLoseHpTemp >= _charHandler.m_CharData.MaxHP * _MPData.m_fHPLosePercent) { int mult = Mathf.FloorToInt(_iLoseHpTemp / (_charHandler.m_CharData.MaxHP * _MPData.m_fHPLosePercent)); _iLoseHpTemp -= _charHandler.m_CharData.MaxHP * _MPData.m_fHPLosePercent * mult; BattleManager.GetInst().m_CharInScene.AddMPAll(_MPData.m_fAddMPFromHPLose * mult); } //单人加魔 _iLoseHpSingleTemp += hurt; if (_iLoseHpSingleTemp >= _charHandler.m_CharData.MaxHP * _MPData.m_fHPLosePercentSingle) { int mult = Mathf.FloorToInt(_iLoseHpSingleTemp / (_charHandler.m_CharData.MaxHP * _MPData.m_fHPLosePercentSingle)); _iLoseHpSingleTemp -= _charHandler.m_CharData.MaxHP * _MPData.m_fHPLosePercentSingle * mult; _charHandler.m_CharData.CurMP += _MPData.m_fAddMPFromHPLoseSingle * mult; } //损血Trigger BattleManager.GetInst().m_TriggerManager.HPChanged(Mathf.CeilToInt(_charHandler.m_CharData.CurHP * 100 / _charHandler.m_CharData.MaxHP), _charHandler); } }
private void TypeDistanceFixed(CharHandler charHandler, SkillDataSon skillDataSon, List <List <CharHandler> > lists, List <CharHandler> listRet) { CharHandler con = GetConcentrate(charHandler, skillDataSon.m_eAimSide); if (null != con) { charHandler.m_ParentTrans.LookAt(con.m_ParentTrans); } charHandler.m_CharSkill.m_vecDistancePos = charHandler.m_ParentTrans.position + charHandler.m_ParentTrans.forward * skillDataSon.m_iDistance; }
private void SetEffect(SkillDataSon skillDataSon, Vector3 pos) { string recepEffectPath = skillDataSon.m_Parent.m_sBulletPath; if (!recepEffectPath.Equals(string.Empty)) { Transform effectTrans = BattleScenePool.GetInst().PopEffect(recepEffectPath); effectTrans.position = pos; BattleScenePool.GetInst().PushEffect(recepEffectPath, effectTrans, 5); } }
public override void DoSkill(SkillDataSon skillDataSon, CharHandler charHandler, List <CharHandler> targets, int skillInstId) { List <SkillData> skillDatas = skillDataSon.GetSkillDataList(); for (int i = 0; i < targets.Count; ++i) { CharHandler aimHandler = targets[i]; BulletBase bullet = charHandler.m_CharEffect.GetSkillBulletObj(charHandler.m_CharData.m_iCurSkillID).GetComponent <BulletBase>(); bullet.Shoot(charHandler, targets[i], () => { ChangeProperty.Change(skillDatas[0], charHandler, aimHandler, 0); }); } }
private List <CharHandler> GetTargetsByCatchType(CharHandler charHandler, SkillDataSon skillDataSon, List <List <CharHandler> > lists, int index = -1) { _lstTargets.Clear(); switch (skillDataSon.m_eCatchType) { case SkillEnum.CatchType.Randoms: TypeRandom(charHandler, skillDataSon, lists, _lstTargets); break; case SkillEnum.CatchType.Friend: TypeFriend(charHandler, skillDataSon, lists, _lstTargets); break; case SkillEnum.CatchType.HPLeast: TypeHPLeast(charHandler, skillDataSon, lists, _lstTargets); break; case SkillEnum.CatchType.Scope: TypeScope(charHandler, skillDataSon, lists, _lstTargets); break; case SkillEnum.CatchType.Rect: TypeRect(charHandler, skillDataSon, lists, _lstTargets); break; case SkillEnum.CatchType.Nearest: TypeNearest(charHandler, skillDataSon, lists, _lstTargets); break; case SkillEnum.CatchType.DistanceNear: if (0 == index) { TypeDistanceNear(charHandler, skillDataSon, lists, _lstTargets); SetEffect(skillDataSon, charHandler.m_CharSkill.m_vecDistancePos); } TypeDistance(charHandler, charHandler.m_CharSkill.m_vecDistancePos, skillDataSon, lists, _lstTargets); break; case SkillEnum.CatchType.DistanceFixed: if (0 == index) { TypeDistanceFixed(charHandler, skillDataSon, lists, _lstTargets); SetEffect(skillDataSon, charHandler.m_CharSkill.m_vecDistancePos); } TypeDistance(charHandler, charHandler.m_CharSkill.m_vecDistancePos, skillDataSon, lists, _lstTargets); break; default: AddAllChar(lists, _lstTargets); break; } return(_lstTargets); }
public override void DoSkill(SkillDataSon skillDataSon, CharHandler charHandler, List <CharHandler> targets, int skillInstId) { List <SkillData> skillDatas = skillDataSon.GetSkillDataList(); for (int i = 0; i < targets.Count; ++i) { for (int j = 0; j < skillDatas.Count; ++j) { ChangeProperty.Change(skillDatas[j], charHandler, targets[i], i); } } }
private void TypeRect(CharHandler charHandler, SkillDataSon skillDataSon, List <List <CharHandler> > lists, List <CharHandler> listRet) { CharHandler con = GetConcentrate(charHandler, skillDataSon.m_eAimSide); if (null != con) { charHandler.m_ParentTrans.LookAt(con.m_ParentTrans); } for (int i = 0; i < lists.Count; ++i) { GetCharInRect(charHandler, skillDataSon.m_iA, skillDataSon.m_iB, lists[i], listRet); } }
private void TypeFriend(CharHandler charHandler, SkillDataSon skillDataSon, List <List <CharHandler> > lists, List <CharHandler> listRet) { for (int i = 0; i < lists.Count; ++i) { for (int j = 0; j < lists[i].Count; ++j) { CharHandler tmpChar = lists[i][j]; if (tmpChar != charHandler && !tmpChar.IsInexistence()) { listRet.Add(lists[i][j]); } } } }
protected override List <CharHandler> GetTargets(CharHandler charHandler, SkillDataSon skillDataSon = null, int index = -1) { _lstTargets.Clear(); _lstTargetLists.Clear(); BattleEnum.Enum_CharSide side = charHandler.m_CharData.GetOppositeSide(); BattleManager.GetInst().m_CharInScene.GetAllChar(side, _lstTargetLists); for (int i = 0; i < _lstTargetLists.Count; ++i) { GetCharInSector(charHandler, charHandler.m_CharData.m_fAtkRadian, charHandler.m_CharData.m_fAtkRange + 2f, _lstTargetLists[i], _lstTargets); } return(_lstTargets); }
private void SetEffect(SkillDataSon skillDataSon, Vector3 pos) { if (null == skillDataSon) { return; } string recepEffectPath = skillDataSon.m_ReceptorEffect[0]; if (!recepEffectPath.Equals(string.Empty)) { Transform effectTrans = BattleScenePool.GetInst().PopEffect(recepEffectPath); effectTrans.position = pos; BattleScenePool.GetInst().PushEffect(recepEffectPath, effectTrans, 1); } }
private void TypeNearest(CharHandler charHandler, SkillDataSon skillDataSon, List <List <CharHandler> > lists, List <CharHandler> listRet) { CharHandler con = GetConcentrate(charHandler, skillDataSon.m_eAimSide); if (null == con) { for (int i = 0; i < lists.Count; ++i) { GetCharNearest(charHandler, skillDataSon.m_iA, skillDataSon.m_iB, lists[i], listRet); } } else { listRet.Add(con); } }
protected override List <CharHandler> GetTargets(CharHandler charHandler, SkillDataSon skillDataSon = null, int index = -1) { List <CharHandler> ret = new List <CharHandler>(); CharHandler ch = GetConcentrate(charHandler, SkillEnum.AimSide.Aim); if (null == ch) { float dis = 0xffff; ch = BattleManager.GetInst().m_CharInScene.GetNearestChar(charHandler, charHandler.m_CharData.GetOppositeSide(), ref dis); if (null != ch) { ret.Add(ch); } } else { ret.Add(ch); } return(ret); }
private void _BeHit(float hurt, CharHandler srcHandler, SkillDataSon srcSkillDataSon, bool bDirect) { _charHandler.m_CharData.CurHP -= hurt; if (bDirect) { CharHandler c; List <ConnectLine> connectList = BattleManager.GetInst().m_TriggerManager.GetConnectList(_charHandler.m_CharData.m_eSide); for (int i = 0; i < connectList.Count; ++i) { if (connectList[i].HasChar(_charHandler)) { for (int j = 0; j < connectList[i].m_lstCharHandler.Count; ++j) { c = connectList[i].m_lstCharHandler[j]; if (c == _charHandler) { continue; } c.BeHit(hurt * connectList[i].m_lstPercent[j], srcHandler, srcSkillDataSon, false); } } } } HPLosted(hurt, srcHandler, srcSkillDataSon); if (srcSkillDataSon == null) { HUDTextMgr.GetInst().NewText(Mathf.FloorToInt(0 - hurt).ToString(), _charHandler, HUDTextMgr.HUDTextType.NormalHit); } else { HUDTextMgr.GetInst().NewText(Mathf.FloorToInt(0 - hurt).ToString(), _charHandler, HUDTextMgr.HUDTextType.SkillHit); } }
public void BeHit(float hurt, CharHandler srcHandler, SkillDataSon srcSkillDataSon = null, bool bDirect = true) //bDirect是否是直接伤害(非反弹、连锁、传递之类) { m_CharDefence.BeHit(hurt, srcHandler, srcSkillDataSon, bDirect); }
private List <CharHandler> GetTargetsByScope(CharHandler charHandler, SkillDataSon skillDataSon, List <List <CharHandler> > lists) { return(_lstTargets); }
public virtual void DoSkill(SkillDataSon skillDataSon, CharHandler charHandler, List <CharHandler> targets, int skillInstId = -1) { }
private List <List <CharHandler> > GetTargetsByAimSideType(CharHandler charHandler, SkillDataSon skillDataSon) { _lstTargetLists.Clear(); BattleEnum.Enum_CharSide side = SkillEnum.AimSide.Self == skillDataSon.m_eAimSide ? charHandler.m_CharData.m_eSide : charHandler.m_CharData.GetOppositeSide(); switch (skillDataSon.m_eAimSideType) { case SkillEnum.AimSideType.All: BattleManager.GetInst().m_CharInScene.GetAllChar(side, _lstTargetLists); break; case SkillEnum.AimSideType.General: BattleManager.GetInst().m_CharInScene.GetGeneral(side, _lstTargetLists); break; case SkillEnum.AimSideType.Official: BattleManager.GetInst().m_CharInScene.GetOfficial(side, _lstTargetLists); break; case SkillEnum.AimSideType.Hero: BattleManager.GetInst().m_CharInScene.GetAllHero(side, _lstTargetLists); break; case SkillEnum.AimSideType.Dead: BattleManager.GetInst().m_CharInScene.GetDeadGeneral(side, _lstTargetLists); break; case SkillEnum.AimSideType.Monster: BattleManager.GetInst().m_CharInScene.GetAllMonster(_lstTargetLists); break; case SkillEnum.AimSideType.Presence: BattleManager.GetInst().m_CharInScene.GetPresence(side, _lstTargetLists); break; case SkillEnum.AimSideType.Self: _lstTargetLists.Add(new List <CharHandler>() { charHandler }); break; default: break; } return(_lstTargetLists); }