コード例 #1
0
        protected void AddSkillWarningMessage(SkillWarningMessage message)
        {
            if (message.caster == null)
            {
                return;
            }
            if (message.target == null)
            {
                return;
            }
            if (message.caster.Camp == this.owner.Camp)
            {
                return;
            }
            Skill skill = DataReader <Skill> .Get(message.skillID);

            if (skill == null)
            {
                return;
            }
            if (skill.aiSkillMove != 1)
            {
                return;
            }
            this.ClearWarningMessage();
            this.MarkWarningMessageByDynamicWarningArea(message.caster, message.target, skill.dynamicWarningArea);
            using (Dictionary <int, XPoint> .Enumerator enumerator = message.effectMessage.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    KeyValuePair <int, XPoint> current = enumerator.get_Current();
                    this.MarkWarningMessageByEffect(message.caster, current.get_Key(), current.get_Value());
                }
            }
        }
コード例 #2
0
        public virtual void ClientHandleSkillByID(int skillID)
        {
            Skill skill = DataReader <Skill> .Get(skillID);

            if (skill == null)
            {
                return;
            }
            this.CurSkillID = skillID;
            this.MarkCD(skill);
            this.ownerActor.IsRotating = false;
            if (skill.autoAim == 1 && this.owner.AITarget != null && this.owner.AITarget.Actor)
            {
                this.ownerActor.ForceSetDirection(new Vector3(this.owner.AITarget.Actor.FixTransform.get_position().x - this.ownerActor.FixTransform.get_position().x, 0f, this.owner.AITarget.Actor.FixTransform.get_position().z - this.ownerActor.FixTransform.get_position().z));
                this.ownerActor.ApplyMovingDirAsForward();
            }
            for (int i = 0; i < skill.effect.get_Count(); i++)
            {
                this.MarkStaticEffectMessage(skill.effect.get_Item(i), true);
            }
            if (!string.IsNullOrEmpty(skill.attAction))
            {
                List <int> actionEffects = XUtility.GetActionEffects(this.ownerActor.FixAnimator.get_runtimeAnimatorController(), skill.attAction);
                for (int j = 0; j < actionEffects.get_Count(); j++)
                {
                    this.MarkStaticEffectMessage(actionEffects.get_Item(j), true);
                }
            }
            if (skill.aiSkillMove == 1 && this.owner.AITarget != null)
            {
                SkillWarningMessage skillWarningMessage = new SkillWarningMessage();
                skillWarningMessage.caster        = this.owner;
                skillWarningMessage.target        = this.owner.AITarget;
                skillWarningMessage.skillID       = skillID;
                skillWarningMessage.effectMessage = new Dictionary <int, XPoint>();
                if (skill.effect != null)
                {
                    for (int k = 0; k < skill.effect.get_Count(); k++)
                    {
                        int num = skill.effect.get_Item(k);
                        if (this.effectMessageCache.ContainsKey(num) && !skillWarningMessage.effectMessage.ContainsKey(num))
                        {
                            skillWarningMessage.effectMessage.Add(num, this.effectMessageCache.get_Item(num).basePoint);
                        }
                    }
                }
                List <int> actionEffects2 = XUtility.GetActionEffects(this.ownerActor.FixAnimator.get_runtimeAnimatorController(), skill.attAction);
                for (int l = 0; l < actionEffects2.get_Count(); l++)
                {
                    int num2 = actionEffects2.get_Item(l);
                    if (this.effectMessageCache.ContainsKey(num2) && !skillWarningMessage.effectMessage.ContainsKey(num2))
                    {
                        skillWarningMessage.effectMessage.Add(num2, this.effectMessageCache.get_Item(num2).basePoint);
                    }
                }
                EventDispatcher.BroadcastAsync <SkillWarningMessage>(WarningManagerEvent.AddSkillWarningMessage, skillWarningMessage);
            }
            bool flag = this.CheckSkillTrustee(skill);

            if (flag)
            {
                this.owner.IsSkillInTrustee = true;
                this.serverTrusteeSkillActionStatusName.Add(new KeyValuePair <string, int>(skill.attAction, 0));
                if (string.IsNullOrEmpty(skill.attAction))
                {
                    this.ServerTrusteeSkillActionEnd(string.Empty, this.owner.ID);
                }
            }
            if (skill.actionPriority != 0)
            {
                this.ownerActor.ActionPriorityTable[skill.attAction] = skill.actionPriority;
            }
            this.ownerActor.CastAction(skill.attAction, true, skill.changeSpeed, (!string.IsNullOrEmpty(skill.attAction)) ? skillID : 0, skill.combo, skill.eventTag);
            if (skill.superArmor == 1)
            {
                int fxID = FXManager.Instance.PlayFX(93, this.ownerActor.FixTransform, this.ownerActor.FixTransform.get_position(), this.ownerActor.FixTransform.get_rotation(), 1f, 1f, 0, false, 0, null, null, 1f, FXClassification.Normal);
                this.ownerActor.FixFXSystem.AddActionFX(fxID);
            }
            if (skill.skillWarningTime != 0 && this.owner.AITarget != null)
            {
                WarningGraghHandler.AddWarningGragh(new SkillWarningGraghMessage
                {
                    casterActor = this.ownerActor,
                    targetPoint = (!this.owner.AITarget.Actor) ? null : new XPoint
                    {
                        position = this.owner.AITarget.Actor.FixTransform.get_position(),
                        rotation = this.owner.AITarget.Actor.FixTransform.get_rotation()
                    },
                    skillID = skillID
                });
            }
            GlobalBattleNetwork.Instance.SendUseSkill(this.owner.ID, skillID, (this.owner.AITarget != null) ? this.owner.AITarget.ID : 0L, flag, this.ownerActor.FixTransform.get_position(), this.ownerActor.FixTransform.get_forward());
            this.ClientLogicTriggerEffect(skill);
        }