private bool OnEvadeSuccess(EvtEvadeSuccess evt)
 {
     if (evt.attackerID == base.entity.GetRuntimeID())
     {
         base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.BeEvadeSuccessActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.targetID), evt);
     }
     return(true);
 }
Ejemplo n.º 2
0
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            Vector3 vector;

            if (this._blackHoleTimer.isActive)
            {
                this.KillBlackHole(true);
            }
            BaseMonoEntity entity = null;

            if (evt.otherID != 0)
            {
                BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.otherID);

                if ((actor != null) && (actor.entity != null))
                {
                    entity = actor.entity;
                }
            }
            if (entity != null)
            {
                vector = entity.XZPosition + new Vector3(0f, 0.5f, 0f);
            }
            else
            {
                Vector3 origin = base.entity.XZPosition + new Vector3(0f, 0.5f, 0f);
                vector = CollisionDetectPattern.GetRaycastPoint(origin, base.entity.transform.forward, base.instancedAbility.Evaluate(this.config.CreationZOffset), 0.2f, ((int)1) << InLevelData.STAGE_COLLIDER_LAYER);
            }
            this._fieldActor = Singleton <DynamicObjectManager> .Instance.CreateAbilityTriggerField(vector, base.entity.transform.forward, base.actor, base.instancedAbility.Evaluate(this.config.Radius), MixinTargetting.Enemy, Singleton <DynamicObjectManager> .Instance.GetNextSyncedDynamicObjectRuntimeID(), false);

            if ((this.config.CreationEffect != null) && (this.config.CreationEffect.EffectPattern != null))
            {
                this._blackHoleEffectIx = Singleton <EffectManager> .Instance.CreateIndexedEntityEffectPattern(this.config.CreationEffect.EffectPattern, this._fieldActor.triggerField);
            }
            if (this.config.ApplyAttackerWitchTimeRatio && (evt.TriggerEvent != null))
            {
                EvtEvadeSuccess triggerEvent = evt.TriggerEvent as EvtEvadeSuccess;
                if (triggerEvent != null)
                {
                    MonsterActor actor2 = Singleton <EventManager> .Instance.GetActor <MonsterActor>(triggerEvent.attackerID);

                    if (actor2 != null)
                    {
                        ConfigMonsterAnimEvent event2 = SharedAnimEventData.ResolveAnimEvent(actor2.config, triggerEvent.skillID);
                        if (event2 != null)
                        {
                            this._blackHoleTimer.timespan *= event2.AttackProperty.WitchTimeRatio;
                        }
                    }
                }
            }
            this._blackHoleTimer.Reset(true);
        }
Ejemplo n.º 3
0
 protected virtual bool OnEvadeSuccess(EvtEvadeSuccess evt)
 {
     if (this._state != State.Evading)
     {
         return(false);
     }
     this._state = State.EvadeSuccessed;
     this._extendedBlockAttackTimer.Reset(true);
     base.instancedAbility.CurrentTriggerEvent = evt;
     base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.EvadeSuccessActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.attackerID), evt);
     return(true);
 }
Ejemplo n.º 4
0
 private bool ListenEvadeSuccess(EvtEvadeSuccess evt)
 {
     if (this.isUpdating)
     {
         AvatarStastics avatarStastics = this.GetAvatarStastics(evt.targetID);
         if (avatarStastics != null)
         {
             avatarStastics.avatarEvadeSuccessTimes = SafeInt32.op_Increment(avatarStastics.avatarEvadeSuccessTimes);
         }
         this.evadeSuccessTimes++;
     }
     return(true);
 }
        protected override bool OnEvadeSuccess(EvtEvadeSuccess evt)
        {
            if (base.selfIdentity.isAuthority)
            {
                RecordInvokeEntryContext context;
                base.StartRecordMixinInvokeEntry(out context, 0);
                Offset <MixinArg_Evade> offset = MixinArg_Evade.CreateMixinArg_Evade(context.builder, EvadeAction.SuccessEvade);
                context.Finish <MixinArg_Evade>(offset, AbilityInvokeArgument.MixinArg_Evade);
                Singleton <MPEventManager> .Instance.MarkEventReplicate(evt);

                return(base.OnEvadeSuccess(evt));
            }
            return(false);
        }
Ejemplo n.º 6
0
        protected override bool OnEvadeSuccess(EvtEvadeSuccess evt)
        {
            if (base.selfIdentity.isAuthority)
            {
                this._recvStates[evt.fromPeerID] = PeerReceiveState.Successed;
                if (this._firstSuccess == null)
                {
                    this._firstSuccess = evt;
                }
                Singleton <MPEventManager> .Instance.MarkEventReplicate(evt);

                this.OnAuthorityPeerEvadeStateChanged();
            }
            return(true);
        }
Ejemplo n.º 7
0
 public static EvtEvadeSuccess Deserialize(Packet_Event_EvtEvadeSuccess table, EvtEvadeSuccess obj)
 {
     if (obj == null)
     {
         obj = new EvtEvadeSuccess();
     }
     obj.targetID   = table.TargetID;
     obj.attackerID = table.AttackerID;
     obj.skillID    = table.SkillID;
     if (table.GetAttackData(GetCachedTable <MPAttackData>()) != null)
     {
         obj.attackData = Deserialize(GetCachedTable <MPAttackData>(), new AttackData());
     }
     return(obj);
 }
Ejemplo n.º 8
0
 public override void OnAbilityTriggered(EvtAbilityStart evt)
 {
     if (base.selfIdentity.isAuthority)
     {
         RecordInvokeEntryContext context;
         this.RecvStart();
         base.StartRecordMixinInvokeEntry(out context, 0);
         Offset <MixinArg_Evade> offset = MixinArg_Evade.CreateMixinArg_Evade(context.builder, EvadeAction.StartEvade);
         context.Finish <MixinArg_Evade>(offset, AbilityInvokeArgument.MixinArg_Evade);
         for (int i = 1; i < this._recvStates.Length; i++)
         {
             this._recvStates[i] = PeerReceiveState.Started;
         }
         this._firstSuccess = null;
     }
 }
Ejemplo n.º 9
0
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            this.CreateField(evt);
            this.StartCreateEffect();
            if (this.config.ApplyAttackerWitchTimeRatio && (evt.TriggerEvent != null))
            {
                EvtEvadeSuccess triggerEvent = evt.TriggerEvent as EvtEvadeSuccess;
                if (triggerEvent != null)
                {
                    MonsterActor actor = Singleton <EventManager> .Instance.GetActor <MonsterActor>(triggerEvent.attackerID);

                    if (actor != null)
                    {
                        ConfigMonsterAnimEvent event2 = SharedAnimEventData.ResolveAnimEvent(actor.config, triggerEvent.skillID);
                        if (event2 != null)
                        {
                            this._timer.timespan = base.instancedAbility.Evaluate(this.config.Duration) * event2.AttackProperty.WitchTimeRatio;
                        }
                    }
                }
            }
        }
Ejemplo n.º 10
0
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            if ((this._state == State.SpawningMirrors) || (this._state == State.MirrorActive))
            {
                for (int j = 0; j < this._mirrorDatas.Length; j++)
                {
                    if (this._mirrorDatas[j].mirrorRuntimeID != 0)
                    {
                        this.KillSingleMirror(j);
                    }
                }
            }
            this._state       = State.SpawningMirrors;
            this._curMirrorIx = 0;
            this._delayTimer.SetActive(true);
            this._mirrorLifespan = base.instancedAbility.Evaluate(this.config.MirrorLastingTime);
            if (this.config.ApplyAttackerWitchTimeRatio && (evt.TriggerEvent != null))
            {
                EvtEvadeSuccess triggerEvent = evt.TriggerEvent as EvtEvadeSuccess;
                if (triggerEvent != null)
                {
                    MonsterActor actor = Singleton <EventManager> .Instance.GetActor <MonsterActor>(triggerEvent.attackerID);

                    if (actor != null)
                    {
                        ConfigMonsterAnimEvent event2 = SharedAnimEventData.ResolveAnimEvent(actor.config, triggerEvent.skillID);
                        if (event2 != null)
                        {
                            this._mirrorLifespan *= event2.AttackProperty.WitchTimeRatio;
                        }
                    }
                }
            }
            for (int i = 0; i < this.config.SelfModifiers.Length; i++)
            {
                base.actor.abilityPlugin.ApplyModifier(base.instancedAbility, this.config.SelfModifiers[i]);
            }
        }
Ejemplo n.º 11
0
        public static Offset <Packet_Event_EvtEvadeSuccess> Serialize(FlatBufferBuilder builder, EvtEvadeSuccess obj)
        {
            StringOffset skillIDOffset = new StringOffset();

            if (obj.skillID != null)
            {
                skillIDOffset = builder.CreateString(obj.skillID);
            }
            Offset <MPAttackData> attackDataOffset = new Offset <MPAttackData>();

            if (obj.attackData != null)
            {
                attackDataOffset = Serialize(builder, obj.attackData);
            }
            Packet_Event_EvtEvadeSuccess.StartPacket_Event_EvtEvadeSuccess(builder);
            Packet_Event_EvtEvadeSuccess.AddTargetID(builder, obj.targetID);
            Packet_Event_EvtEvadeSuccess.AddAttackerID(builder, obj.attackerID);
            Packet_Event_EvtEvadeSuccess.AddSkillID(builder, skillIDOffset);
            Packet_Event_EvtEvadeSuccess.AddAttackData(builder, attackDataOffset);
            return(Packet_Event_EvtEvadeSuccess.EndPacket_Event_EvtEvadeSuccess(builder));
        }
Ejemplo n.º 12
0
 public static object DeserializeToObject(Table table, object obj)
 {
     if (table.GetType() == typeof(MoleMole.MPProtocol.MPStageData))
     {
         if (obj == null)
         {
             obj = new MoleMole.MPStageData();
         }
         return(Deserialize((MoleMole.MPProtocol.MPStageData)table, (MoleMole.MPStageData)obj));
     }
     if (table.GetType() == typeof(MoleMole.MPProtocol.MPAvatarDataItem))
     {
         if (obj == null)
         {
             obj = new MoleMole.MPAvatarDataItem();
         }
         return(Deserialize((MoleMole.MPProtocol.MPAvatarDataItem)table, (MoleMole.MPAvatarDataItem)obj));
     }
     if (table.GetType() == typeof(Packet_Event_EvtHittingOther))
     {
         if (obj == null)
         {
             obj = new EvtHittingOther();
         }
         return(Deserialize((Packet_Event_EvtHittingOther)table, (EvtHittingOther)obj));
     }
     if (table.GetType() == typeof(Packet_Event_EvtBeingHit))
     {
         if (obj == null)
         {
             obj = new EvtBeingHit();
         }
         return(Deserialize((Packet_Event_EvtBeingHit)table, (EvtBeingHit)obj));
     }
     if (table.GetType() == typeof(Packet_Event_EvtAttackLanded))
     {
         if (obj == null)
         {
             obj = new EvtAttackLanded();
         }
         return(Deserialize((Packet_Event_EvtAttackLanded)table, (EvtAttackLanded)obj));
     }
     if (table.GetType() == typeof(Packet_Event_EvtEvadeSuccess))
     {
         if (obj == null)
         {
             obj = new EvtEvadeSuccess();
         }
         return(Deserialize((Packet_Event_EvtEvadeSuccess)table, (EvtEvadeSuccess)obj));
     }
     if (table.GetType() == typeof(Packet_Event_EvtBulletHit))
     {
         if (obj == null)
         {
             obj = new EvtBulletHit();
         }
         return(Deserialize((Packet_Event_EvtBulletHit)table, (EvtBulletHit)obj));
     }
     if (table.GetType() == typeof(MPAttackData))
     {
         if (obj == null)
         {
             obj = new AttackData();
         }
         return(Deserialize((MPAttackData)table, (AttackData)obj));
     }
     if (table.GetType() == typeof(MPAttackResult))
     {
         if (obj == null)
         {
             obj = new AttackResult();
         }
         return(Deserialize((MPAttackResult)table, (AttackResult)obj));
     }
     if (table.GetType() != typeof(MPHitCollision))
     {
         return(obj);
     }
     if (obj == null)
     {
         obj = new AttackResult.HitCollsion();
     }
     return(Deserialize((MPHitCollision)table, (AttackResult.HitCollsion)obj));
 }