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.DestoryIndicatePrefab(); 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, this.sourceActor); 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 RecoverSkillSlot(SkillSlotType _slotType) { SkillSlot skillSlot = null; if (this.sourceActor.get_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.get_handle().SkillControl.InitSkillSlot((int)_slotType, initSkillID, initPassiveSkillID); if (this.sourceActor.get_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[] expr_136_cp_0 = this.changeSkillSlot; expr_136_cp_0[(int)_slotType].changeCount = expr_136_cp_0[(int)_slotType].changeCount - 1; } }
public void ChangeSkillSlot(SkillSlotType _slotType, int _skillID, int _orgSkillID = 0) { int skillID = 0; SkillSlot slot = null; if (this.sourceActor.handle.SkillControl.TryGetSkillSlot(_slotType, out slot)) { int ornamentSwitchCD = 0; if (_slotType == SkillSlotType.SLOT_SKILL_7) { SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext(); if (curLvelContext != null) { ornamentSwitchCD = curLvelContext.m_ornamentSwitchCD; } } else { ornamentSwitchCD = (int)slot.CurSkillCD; } int skillLevel = slot.GetSkillLevel(); if (slot.SkillObj != null) { skillID = slot.SkillObj.SkillID; } if ((_orgSkillID == 0) || (skillID == _orgSkillID)) { slot.DestoryIndicatePrefab(); this.sourceActor.handle.SkillControl.InitSkillSlot((int)_slotType, _skillID, 0); if (this.sourceActor.handle.SkillControl.TryGetSkillSlot(_slotType, out slot)) { slot.CurSkillCD = ornamentSwitchCD; slot.IsCDReady = ornamentSwitchCD == 0; slot.SetSkillLevel(skillLevel); DefaultSkillEventParam param = new DefaultSkillEventParam(_slotType, 0, this.sourceActor); Singleton <GameSkillEventSys> .GetInstance().SendEvent <DefaultSkillEventParam>(GameSkillEventDef.Event_UpdateSkillUI, this.sourceActor, ref param, GameSkillEventChannel.Channel_HostCtrlActor); if (this.changeSkillSlot[(int)_slotType].changeCount == 0) { this.changeSkillSlot[(int)_slotType].initSkillID = skillID; } this.changeSkillSlot[(int)_slotType].changeSkillID = _skillID; this.changeSkillSlot[(int)_slotType].changeCount++; } } } }
public void ChangeSkillSlot(SkillSlotType _slotType, int _skillID, int _orgSkillID = 0) { int num = 0; int num2 = 0; SkillSlot skillSlot = null; if (this.sourceActor.handle.SkillControl.TryGetSkillSlot(_slotType, out skillSlot)) { int num3 = 0; if (_slotType == SkillSlotType.SLOT_SKILL_7) { SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext(); if (curLvelContext != null) { if ((long)this.sourceActor.handle.SkillControl.ornamentFirstSwitchCdEftTime >= (long)Singleton <FrameSynchr> .instance.LogicFrameTick) { num3 = curLvelContext.m_ornamentFirstSwitchCd; } else { num3 = curLvelContext.m_ornamentSwitchCD; } this.sourceActor.handle.SkillControl.ornamentFirstSwitchCdEftTime = 0; } } else { num3 = skillSlot.CurSkillCD; } int skillLevel = skillSlot.GetSkillLevel(); if (skillSlot.SkillObj != null) { num = skillSlot.SkillObj.SkillID; } if (skillSlot.PassiveSkillObj != null) { num2 = skillSlot.PassiveSkillObj.SkillID; } if (_orgSkillID != 0 && num != _orgSkillID) { return; } skillSlot.DestoryIndicatePrefab(); this.sourceActor.handle.SkillControl.InitSkillSlot((int)_slotType, _skillID, num2); if (this.sourceActor.handle.SkillControl.TryGetSkillSlot(_slotType, out skillSlot)) { skillSlot.CurSkillCD = num3; skillSlot.IsCDReady = (num3 == 0); skillSlot.SetSkillLevel(skillLevel); DefaultSkillEventParam defaultSkillEventParam = new DefaultSkillEventParam(_slotType, 0, this.sourceActor); Singleton <GameSkillEventSys> .GetInstance().SendEvent <DefaultSkillEventParam>(GameSkillEventDef.Event_UpdateSkillUI, this.sourceActor, ref defaultSkillEventParam, GameSkillEventChannel.Channel_HostCtrlActor); if (this.changeSkillSlot[(int)_slotType].changeCount == 0) { this.changeSkillSlot[(int)_slotType].initSkillID = num; this.changeSkillSlot[(int)_slotType].initPassiveSkillID = num2; } this.changeSkillSlot[(int)_slotType].changeSkillID = _skillID; ChangeSkillSlot[] array = this.changeSkillSlot; array[(int)_slotType].changeCount = array[(int)_slotType].changeCount + 1; } } }