Esempio n. 1
0
        private bool InternalUseSkill(SkillUseContext context, bool bImmediate = false)
        {
            SkillSlot slot;

            if (context == null)
            {
                return(false);
            }
            if (!this.TryGetSkillSlot(context.SlotType, out slot))
            {
                return(false);
            }
            slot.ReadySkillObj();
            Skill skillObj = slot.SkillObj;

            if (!skillObj.Use(base.actorPtr, context))
            {
                return(false);
            }
            if (!bImmediate)
            {
                this.CurUseSkill     = skillObj;
                this.CurUseSkillSlot = slot;
            }
            this.SkillInfoStatistic(ref slot);
            this.bIsLastAtkUseSkill = this.bIsCurAtkUseSkill;
            if (context.SlotType == SkillSlotType.SLOT_SKILL_0)
            {
                this.bIsCurAtkUseSkill = false;
            }
            else
            {
                this.bIsCurAtkUseSkill = true;
            }
            ActorSkillEventParam param = new ActorSkillEventParam(base.GetActor(), context.SlotType);

            Singleton <GameSkillEventSys> .GetInstance().SendEvent <ActorSkillEventParam>(GameSkillEventDef.Event_UseSkill, base.GetActor(), ref param, GameSkillEventChannel.Channel_AllActor);

            return(true);
        }
        private bool InternalUseSkill(ref SkillUseParam param, bool bImmediate = false)
        {
            SkillSlot skillSlot;

            if (!this.TryGetSkillSlot(param.SlotType, out skillSlot))
            {
                return(false);
            }
            skillSlot.ReadySkillObj();
            Skill skillObj = skillSlot.SkillObj;

            if (!bImmediate)
            {
                this.CurUseSkill     = skillObj;
                this.CurUseSkillSlot = skillSlot;
            }
            if (!skillObj.Use(this.actorPtr, ref param))
            {
                return(false);
            }
            skillSlot.AddSkillUseCount();
            skillSlot.NextSkillTargetIDs.Clear();
            this.SkillInfoStatistic(ref skillSlot);
            this.bIsLastAtkUseSkill = this.bIsCurAtkUseSkill;
            if (param.SlotType == SkillSlotType.SLOT_SKILL_0)
            {
                this.bIsCurAtkUseSkill = false;
            }
            else
            {
                this.bIsCurAtkUseSkill = true;
            }
            ActorSkillEventParam actorSkillEventParam = new ActorSkillEventParam(base.GetActor(), param.SlotType);

            Singleton <GameSkillEventSys> .GetInstance().SendEvent <ActorSkillEventParam>(GameSkillEventDef.AllEvent_UseSkill, base.GetActor(), ref actorSkillEventParam, GameSkillEventChannel.Channel_AllActor);

            return(true);
        }