public void OnDead() { for (int i = 0; i < 10; i++) { SkillSlot skillSlot = this.SkillSlotArray[i]; if (skillSlot != null && skillSlot.skillChangeEvent != null && skillSlot.skillChangeEvent.IsActive()) { skillSlot.skillChangeEvent.Abort(); } } if (this.CurUseSkill != null) { this.CurUseSkill.Stop(); } for (int j = 0; j < this.SpawnedBullets.get_Count(); j++) { BulletSkill bulletSkill = this.SpawnedBullets.get_Item(j); if (bulletSkill.IsDeadRemove) { bulletSkill.Stop(); bulletSkill.Release(); this.SpawnedBullets.RemoveAt(j); j--; } } }
public static ActorRoot GetTarget(SkillSlot UseSlot) { bool flag = Singleton <SkillSelectControl> .GetInstance().IsLowerHpMode(); int srchR; if (UseSlot.SkillObj.AppointType == 1) { srchR = UseSlot.SkillObj.GetMaxSearchDistance(UseSlot.GetSkillLevel()); } else { srchR = UseSlot.SkillObj.cfgData.iMaxAttackDistance; } ActorRoot result; if (flag) { result = Singleton <TargetSearcher> .GetInstance().GetLowestHpTarget(UseSlot.Actor.get_handle(), srchR, TargetPriority.TargetPriority_Hero, UseSlot.SkillObj.cfgData.dwSkillTargetFilter, true, true); } else { result = Singleton <TargetSearcher> .GetInstance().GetNearestEnemy(UseSlot.Actor.get_handle(), srchR, TargetPriority.TargetPriority_Hero, UseSlot.SkillObj.cfgData.dwSkillTargetFilter, true); } return(result); }
public override void Uninit() { base.Uninit(); for (int i = 0; i < this.SpawnedBullets.get_Count(); i++) { if (this.SpawnedBullets.get_Item(i).isFinish) { this.SpawnedBullets.get_Item(i).Release(); } else { this.SpawnedBullets.get_Item(i).bManaged = false; } } this.SpawnedBullets.Clear(); for (int j = 0; j < 10; j++) { SkillSlot skillSlot = this.SkillSlotArray[j]; if (skillSlot != null && skillSlot.PassiveSkillObj != null && skillSlot.PassiveSkillObj.passiveEvent != null) { skillSlot.PassiveSkillObj.passiveEvent.UnInit(); } } if (this.talentSystem != null) { this.talentSystem.UnInit(); } if (this.stSkillStat != null) { this.stSkillStat.UnInit(); } }
private void StartSkillGestureEffectShared(SkillSlotType inSlotType, string guidePath) { if (!this.actorPtr) { return; } SkillSlot skillSlot = this.actor.SkillControl.GetSkillSlot(inSlotType); if (skillSlot == null) { return; } this.EndSkillGestureEffect(); Quaternion rot = Quaternion.LookRotation(Vector3.right); Vector3 position = this.actor.myTransform.position; position.y += 0.3f; GameObject pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(guidePath, true, SceneObjType.ActionRes, position, rot); if (pooledGameObjLOD != null) { pooledGameObjLOD.transform.SetParent(this.actor.myTransform); pooledGameObjLOD.SetActive(true); skillSlot.skillIndicator.SetPrefabScaler(pooledGameObjLOD, skillSlot.SkillObj.cfgData.iGuideDistance); } this.m_skillGestureGuide = pooledGameObjLOD; }
public void RecoverSkillSlot(SkillSlotType _slotType) { SkillSlot skillSlot = null; if (this.sourceActor.handle.SkillControl.TryGetSkillSlot(_slotType, out skillSlot)) { if (this.changeSkillSlot[(int)_slotType].changeCount == 1) { int initSkillID = this.changeSkillSlot[(int)_slotType].initSkillID; int initPassiveSkillID = this.changeSkillSlot[(int)_slotType].initPassiveSkillID; int num = skillSlot.CurSkillCD; int skillLevel = skillSlot.GetSkillLevel(); skillSlot.DestoryIndicatePrefab(); this.sourceActor.handle.SkillControl.InitSkillSlot((int)_slotType, initSkillID, initPassiveSkillID); if (this.sourceActor.handle.SkillControl.TryGetSkillSlot(_slotType, out skillSlot)) { skillSlot.SetSkillLevel(skillLevel); skillSlot.CurSkillCD = num; skillSlot.IsCDReady = (num == 0); DefaultSkillEventParam defaultSkillEventParam = new DefaultSkillEventParam(_slotType, 0, this.sourceActor); Singleton <GameSkillEventSys> .GetInstance().SendEvent <DefaultSkillEventParam>(GameSkillEventDef.Event_UpdateSkillUI, this.sourceActor, ref defaultSkillEventParam, GameSkillEventChannel.Channel_HostCtrlActor); } this.changeSkillSlot[(int)_slotType].initSkillID = 0; this.changeSkillSlot[(int)_slotType].changeSkillID = 0; this.changeSkillSlot[(int)_slotType].initPassiveSkillID = 0; } ChangeSkillSlot[] array = this.changeSkillSlot; array[(int)_slotType].changeCount = array[(int)_slotType].changeCount - 1; } }
public static int OnDamageExtraEffect(ref HurtDataInfo _hurt, int _hurtValue) { SkillSlot skillSlot = null; if (!_hurt.atker || _hurt.atker.handle.ActorControl.IsDeadState) { return(_hurtValue); } BufferLogicEffect logicEffect = _hurt.atker.handle.BuffHolderComp.logicEffect; List <PoolObjHandle <BuffSkill> > list = logicEffect.GetExtraHurtList(); for (int i = 0; i < list.get_Count(); i++) { if (!_hurt.target) { return(_hurtValue); } BuffSkill buffSkill = list.get_Item(i); int skillFuncParam = buffSkill.GetSkillFuncParam(72, 0, false); if (_hurt.atkSlot == (SkillSlotType)skillFuncParam && _hurt.atker.handle.SkillControl.TryGetSkillSlot(_hurt.atkSlot, out skillSlot)) { int skillFuncParam2 = buffSkill.GetSkillFuncParam(72, 1, false); int skillFuncParam3 = buffSkill.GetSkillFuncParam(72, 2, false); int skillFuncParam4 = buffSkill.GetSkillFuncParam(72, 3, false); int skillFuncParam5 = buffSkill.GetSkillFuncParam(72, 4, false); logicEffect.SetSkillSlotUseTime(_hurt.atkSlot, skillFuncParam5); logicEffect.SetSkillSlotUseCount(_hurt.atkSlot, skillSlot.GetSkillUseCount()); return(logicEffect.DamageExtraEffect(ref _hurt, _hurtValue, skillFuncParam2, skillFuncParam3, skillFuncParam4)); } } return(_hurtValue); }
public override void UpdateLogic(int nDelta) { if (this.CurUseSkill != null && this.CurUseSkill.isFinish) { this.CurUseSkill = null; this.CurUseSkillSlot = null; } for (int i = 0; i < this.SpawnedBullets.Count; i++) { BulletSkill bulletSkill = this.SpawnedBullets[i]; if (bulletSkill != null) { bulletSkill.UpdateLogic(nDelta); if (bulletSkill.isFinish) { bulletSkill.Release(); this.SpawnedBullets.RemoveAt(i); } } } for (int j = 0; j < 10; j++) { SkillSlot skillSlot = this.SkillSlotArray[j]; if (skillSlot != null) { skillSlot.UpdateLogic(nDelta); } } if (this.talentSystem != null) { this.talentSystem.UpdateLogic(nDelta); } }
public void RecoverSkillSlot(SkillSlotType _slotType) { SkillSlot slot = null; if (this.sourceActor.handle.SkillControl.TryGetSkillSlot(_slotType, out slot)) { if (this.changeSkillSlot[(int)_slotType].changeCount == 1) { int initSkillID = this.changeSkillSlot[(int)_slotType].initSkillID; int curSkillCD = (int)slot.CurSkillCD; int skillLevel = slot.GetSkillLevel(); slot.CancelUseSkill(); this.sourceActor.handle.SkillControl.InitSkillSlot((int)_slotType, initSkillID, 0); if (this.sourceActor.handle.SkillControl.TryGetSkillSlot(_slotType, out slot)) { slot.SetSkillLevel(skillLevel); slot.CurSkillCD = curSkillCD; slot.IsCDReady = curSkillCD == 0; DefaultSkillEventParam param = new DefaultSkillEventParam(_slotType, 0); Singleton <GameSkillEventSys> .GetInstance().SendEvent <DefaultSkillEventParam>(GameSkillEventDef.Event_UpdateSkillUI, this.sourceActor, ref param, GameSkillEventChannel.Channel_HostCtrlActor); } this.changeSkillSlot[(int)_slotType].initSkillID = 0; this.changeSkillSlot[(int)_slotType].changeSkillID = 0; } this.changeSkillSlot[(int)_slotType].changeCount--; } }
public void InitSkillFuncContext() { if (this.inBuffSkill != 0) { if (this.inBuffSkill.handle.cfgData.bGrowthType == 0) { if ((this.inOriginator != 0) && (this.inOriginator.handle.SkillControl != null)) { SkillSlot skillSlot = null; skillSlot = this.inOriginator.handle.SkillControl.GetSkillSlot(this.inUseContext.SlotType); if (skillSlot != null) { this.inSkillLevel = skillSlot.GetSkillLevel(); } else if (this.inOriginator.handle.ValueComponent != null) { this.inSkillLevel = this.inOriginator.handle.ValueComponent.actorSoulLevel; } } } else if (((this.inBuffSkill.handle.cfgData.bGrowthType == 1) && (this.inOriginator != 0)) && (this.inOriginator.handle.ValueComponent != null)) { this.inSkillLevel = this.inOriginator.handle.ValueComponent.actorSoulLevel; } } }
public SkillSlot GetSkillSlot(SkillSlotType slot) { SkillSlot slot2 = null; this.TryGetSkillSlot(slot, out slot2); return(slot2); }
public static int OnDamageExtraEffect(ref HurtDataInfo _hurt, int _hurtValue) { BuffSkill skill = null; SkillSlot slot = null; BufferLogicEffect logicEffect = null; List<PoolObjHandle<BuffSkill>> extraHurtList = null; if ((_hurt.atker != 0) && !_hurt.atker.handle.ActorControl.IsDeadState) { logicEffect = _hurt.atker.handle.BuffHolderComp.logicEffect; extraHurtList = logicEffect.GetExtraHurtList(); for (int i = 0; i < extraHurtList.Count; i++) { if (_hurt.target == 0) { return _hurtValue; } skill = extraHurtList[i]; int num = skill.GetSkillFuncParam(0x48, 0, false); if ((_hurt.atkSlot == num) && _hurt.atker.handle.SkillControl.TryGetSkillSlot(_hurt.atkSlot, out slot)) { int num2 = skill.GetSkillFuncParam(0x48, 1, false); int num3 = skill.GetSkillFuncParam(0x48, 2, false); int num4 = skill.GetSkillFuncParam(0x48, 3, false); int num5 = skill.GetSkillFuncParam(0x48, 4, false); logicEffect.SetSkillSlotUseTime(_hurt.atkSlot, num5); logicEffect.SetSkillSlotUseCount(_hurt.atkSlot, slot.GetSkillUseCount()); return logicEffect.DamageExtraEffect(ref _hurt, _hurtValue, num2, num3, num4); } } } return _hurtValue; }
public override VInt3 SelectSkillDirection(SkillSlot _slot) { VInt3 one = VInt3.one; Skill arg_22_0 = (_slot.NextSkillObj == null) ? _slot.SkillObj : _slot.NextSkillObj; return((VInt3)_slot.skillIndicator.GetUseSkillDirection()); }
public void OnDead() { SkillSlot slot = null; for (int i = 0; i < 8; i++) { slot = this.SkillSlotArray[i]; if (((slot != null) && (slot.skillChangeEvent != null)) && slot.skillChangeEvent.IsActive()) { slot.skillChangeEvent.Abort(); } } if (this.CurUseSkill != null) { this.CurUseSkill.Stop(); } for (int j = 0; j < this.SpawnedBullets.Count; j++) { BulletSkill skill = this.SpawnedBullets[j]; if (skill.IsDeadRemove) { skill.Stop(); skill.Release(); this.SpawnedBullets.RemoveAt(j); j--; } } }
public override uint SelectSkillTarget(SkillSlot _slot) { uint num = this.lockTargetID; SelectEnemyType selectEnemyType = SelectEnemyType.SelectLowHp; Player ownerPlayer = ActorHelper.GetOwnerPlayer(ref this.actorPtr); SkillSelectControl instance = Singleton <SkillSelectControl> .GetInstance(); Skill skill = (_slot.NextSkillObj == null) ? _slot.SkillObj : _slot.NextSkillObj; uint dwSkillTargetFilter = skill.cfgData.dwSkillTargetFilter; if (skill.cfgData.bSkillTargetRule == 2) { num = this.actor.ObjID; } else { ActorRoot useSkillTargetLockAttackMode = _slot.skillIndicator.GetUseSkillTargetLockAttackMode(); if (useSkillTargetLockAttackMode != null) { if (this.IsValidLockTargetID(useSkillTargetLockAttackMode.ObjID)) { num = useSkillTargetLockAttackMode.ObjID; Singleton <NetLockAttackTarget> .GetInstance().SendLockAttackTarget(num); } } else if (!this.IsValidLockTargetID(this.lockTargetID)) { if (ownerPlayer != null) { selectEnemyType = ownerPlayer.AttackTargetMode; } int srchR; if (skill.AppointType == 1) { srchR = skill.GetMaxSearchDistance(_slot.GetSkillLevel()); } else { srchR = skill.cfgData.iMaxAttackDistance; } if (selectEnemyType == SelectEnemyType.SelectLowHp) { num = Singleton <AttackModeTargetSearcher> .GetInstance().SearchLowestHpTarget(ref this.actorPtr, srchR, dwSkillTargetFilter, true, SearchTargetPriority.CommonAttack); } else { num = Singleton <AttackModeTargetSearcher> .GetInstance().SearchNearestTarget(ref this.actorPtr, srchR, dwSkillTargetFilter, true, SearchTargetPriority.CommonAttack); } if (this.IsValidLockTargetID(num)) { Singleton <NetLockAttackTarget> .GetInstance().SendLockAttackTarget(num); } } else if (!this.IsValidSkillTargetID(num, dwSkillTargetFilter)) { num = 0u; } } return(num); }
public override void Reactive() { base.Reactive(); this.CurUseSkill = null; this.CurUseSkillSlot = null; this.RecordPosition = VInt3.zero; this.SpawnedBullets.Clear(); this.m_iSkillPoint = 0; this.bZeroCd = false; this.ResetAllSkillSlot(); this.ResetSkillCD(); for (int i = 0; i < 8; i++) { this.DisableSkill[i] = 0; } if (this.SkillSlotArray != null) { for (int j = 0; j < this.SkillSlotArray.Length; j++) { SkillSlot slot = this.SkillSlotArray[j]; if (slot != null) { slot.Reset(); } } } if (this.talentSystem != null) { this.talentSystem.Reset(); } }
public override void Uninit() { base.Uninit(); for (int i = 0; i < this.SpawnedBullets.Count; i++) { if (this.SpawnedBullets[i].isFinish) { this.SpawnedBullets[i].Release(); } else { this.SpawnedBullets[i].bManaged = false; } } this.SpawnedBullets.Clear(); for (int j = 0; j < 8; j++) { SkillSlot slot = this.SkillSlotArray[j]; if (((slot != null) && (slot.PassiveSkillObj != null)) && (slot.PassiveSkillObj.passiveEvent != null)) { slot.PassiveSkillObj.passiveEvent.UnInit(); } } if (this.talentSystem != null) { this.talentSystem.UnInit(); } if (this.stSkillStat != null) { this.stSkillStat.UnInit(); } }
private void SkillInfoStatistic(ref SkillSlot stSkillSlot) { if (stSkillSlot == null) { return; } this.stSkillStat.SkillStatistictInfo[(int)stSkillSlot.SlotType].uiUsedTimes += 1u; this.stSkillStat.SkillStatistictInfo[(int)stSkillSlot.SlotType].bIsCurUseSkillHitHero = false; if (this.stSkillStat.SkillStatistictInfo[(int)stSkillSlot.SlotType].iSkillCfgID == 0 || this.stSkillStat.SkillStatistictInfo[(int)stSkillSlot.SlotType].iSkillCfgID == stSkillSlot.SkillObj.cfgData.iCfgID) { this.stSkillStat.SkillStatistictInfo[(int)stSkillSlot.SlotType].iSkillCfgID = stSkillSlot.SkillObj.cfgData.iCfgID; this.stSkillStat.SkillStatistictInfo[(int)stSkillSlot.SlotType].iAttackDistanceMax = Math.Max(this.stSkillStat.SkillStatistictInfo[(int)stSkillSlot.SlotType].iAttackDistanceMax, stSkillSlot.SkillObj.cfgData.iMaxAttackDistance); long num = (long)(Time.realtimeSinceStartup * 1000f); uint num2 = (uint)(num - stSkillSlot.lLastUseTime); if (stSkillSlot.lLastUseTime != 0L) { uint num3 = this.stSkillStat.SkillStatistictInfo[(int)stSkillSlot.SlotType].uiCDIntervalMin; num3 = Math.Min(num3, num2); this.stSkillStat.SkillStatistictInfo[(int)stSkillSlot.SlotType].uiCDIntervalMin = num3; uint num4 = this.stSkillStat.SkillStatistictInfo[(int)stSkillSlot.SlotType].uiCDIntervalMax; num4 = Math.Max(num4, num2); this.stSkillStat.SkillStatistictInfo[(int)stSkillSlot.SlotType].uiCDIntervalMax = num4; } stSkillSlot.lLastUseTime = num; } }
public SkillSlot GetSkillSlot(SkillSlotType slot) { SkillSlot result = null; this.TryGetSkillSlot(slot, out result); return(result); }
public override VInt3 SelectSkillDirection(SkillSlot _slot) { SkillSelectControl instance = Singleton <SkillSelectControl> .GetInstance(); Skill skill = (_slot.NextSkillObj == null) ? _slot.SkillObj : _slot.NextSkillObj; return((VInt3)_slot.skillIndicator.GetUseSkillDirection()); }
public override ActorRoot SelectTarget(SkillSlot UseSlot) { if (UseSlot.SlotType == SkillSlotType.SLOT_SKILL_4) { SkillChooseTargetEventParam prm = new SkillChooseTargetEventParam(UseSlot.Actor, UseSlot.Actor, 1); Singleton <GameEventSys> .instance.SendEvent <SkillChooseTargetEventParam>(GameEventDef.Event_ActorBeChosenAsTarget, ref prm); } return(UseSlot.Actor.handle); }
public SkillControlIndicator(SkillSlot _skillSlot) { this.pressTime = 0; this.effectHideFrameNum = 0; this.bControlMove = false; this.skillSlot = _skillSlot; this.bUseAdvanceSelect = true; this.targetActor = null; }
public override uint SelectSkillTarget(SkillSlot _slot) { int iMaxSearchDistance = 0; int dwSkillTargetFilter = 0; ActorRoot useSkillTargetLockAttackMode = null; uint lockTargetID = this.lockTargetID; SelectEnemyType selectLowHp = SelectEnemyType.SelectLowHp; Player ownerPlayer = ActorHelper.GetOwnerPlayer(ref this.actorPtr); SkillSelectControl instance = Singleton <SkillSelectControl> .GetInstance(); Skill skill = (_slot.NextSkillObj == null) ? _slot.SkillObj : _slot.NextSkillObj; if (skill.cfgData.dwSkillTargetRule == 2) { return(base.actor.ObjID); } useSkillTargetLockAttackMode = _slot.skillIndicator.GetUseSkillTargetLockAttackMode(); if (useSkillTargetLockAttackMode != null) { if (this.IsValidLockTargetID(useSkillTargetLockAttackMode.ObjID)) { lockTargetID = useSkillTargetLockAttackMode.ObjID; Singleton <NetLockAttackTarget> .GetInstance().SendLockAttackTarget(lockTargetID); } return(lockTargetID); } if (!this.IsValidLockTargetID(this.lockTargetID)) { if (ownerPlayer != null) { selectLowHp = ownerPlayer.AttackTargetMode; } dwSkillTargetFilter = (int)skill.cfgData.dwSkillTargetFilter; if (skill.AppointType == SkillRangeAppointType.Target) { iMaxSearchDistance = skill.cfgData.iMaxSearchDistance; } else { iMaxSearchDistance = (int)skill.cfgData.iMaxAttackDistance; } if (selectLowHp == SelectEnemyType.SelectLowHp) { lockTargetID = Singleton <AttackModeTargetSearcher> .GetInstance().SearchLowestHpTarget(ref this.actorPtr, iMaxSearchDistance, dwSkillTargetFilter); } else { lockTargetID = Singleton <AttackModeTargetSearcher> .GetInstance().SearchNearestTarget(ref this.actorPtr, iMaxSearchDistance, dwSkillTargetFilter); } if (this.IsValidLockTargetID(lockTargetID)) { Singleton <NetLockAttackTarget> .GetInstance().SendLockAttackTarget(lockTargetID); } } return(lockTargetID); }
public bool Detection(SkillUseRule ruleType, SkillSlot slot) { SkillBaseDetection detection; if (this._registedRule.TryGetValue((uint)ruleType, out detection)) { return(detection.Detection(slot)); } return(true); }
private bool IsIngnoreDisableSkill(SkillSlotType _type) { SkillSlot slot = null; if ((_type < SkillSlotType.SLOT_SKILL_0) || (_type >= SkillSlotType.SLOT_SKILL_COUNT)) { return(false); } return((this.TryGetSkillSlot(_type, out slot) && (slot.SkillObj != null)) && ((slot.SkillObj.cfgData != null) && (slot.SkillObj.cfgData.bBIngnoreDisable == 1))); }
public ActorRoot SelectTarget(SkillTargetRule ruleType, SkillSlot slot) { SkillBaseSelectTarget target; if (this.registedRule.TryGetValue((uint)ruleType, out target)) { return(target.SelectTarget(slot)); } return(null); }
public VInt3 SelectTargetDir(SkillTargetRule ruleType, SkillSlot slot) { SkillBaseSelectTarget target; if (this.registedRule.TryGetValue((uint)ruleType, out target)) { return(target.SelectTargetDir(slot)); } return(slot.Actor.handle.forward); }
public VInt3 SelectTargetDir(SkillTargetRule ruleType, SkillSlot slot) { SkillBaseSelectTarget skillBaseSelectTarget; if (this.registedRule.TryGetValue(ruleType, ref skillBaseSelectTarget)) { return(skillBaseSelectTarget.SelectTargetDir(slot)); } return(slot.Actor.get_handle().forward); }
public bool TryGetSkillSlot(SkillSlotType _type, out SkillSlot _slot) { if (this.SkillSlotArray == null || _type < SkillSlotType.SLOT_SKILL_0 || _type >= SkillSlotType.SLOT_SKILL_COUNT) { _slot = null; return(false); } _slot = this.SkillSlotArray[(int)_type]; return(_slot != null); }
public void ResetSkillCD() { for (int i = 0; i < 10; i++) { SkillSlot skillSlot = this.SkillSlotArray[i]; if (skillSlot != null) { this.SkillSlotArray[i].ResetSkillCD(); } } }
public override void Init() { base.Init(); SkillSlot skillSlot = this.actor.SkillControl.GetSkillSlot(SkillSlotType.SLOT_SKILL_0); if (skillSlot != null) { this.attackDistSqr = skillSlot.SkillObj.cfgData.iMaxAttackDistance; this.attackDistSqr *= this.attackDistSqr; } }