Beispiel #1
0
 public override void OnAbilityTriggered(EvtAbilityStart evt)
 {
     if (!this._isSmokeOn)
     {
         this.StartAreaLastingBuff();
     }
 }
Beispiel #2
0
        private void OnSummon(EvtAbilityStart evt)
        {
            MonsterSummonMixinArgument abilityArgument = evt.abilityArgument as MonsterSummonMixinArgument;
            BaseMonoAnimatorEntity     animEntity      = base.entity as BaseMonoAnimatorEntity;

            for (int i = 2; i < 6; i++)
            {
                if (animEntity != null)
                {
                    animEntity.StartFadeAnimatorLayerWeight(i, 0f, 0.01f);
                }
            }
            if (abilityArgument != null)
            {
                MixinSummonItem item = this.config.SummonMonsters[abilityArgument.SummonMonsterIndex];
                this.OrderSummonMonster(item.EffectDelay, item.SummonDelay, item, evt);
                this.SetAnimatorLayer(item, animEntity);
            }
            else
            {
                int index  = 0;
                int length = this.config.SummonMonsters.Length;
                while (index < length)
                {
                    MixinSummonItem item2 = this.config.SummonMonsters[index];
                    this.OrderSummonMonster(item2.EffectDelay, item2.SummonDelay, item2, evt);
                    this.SetAnimatorLayer(item2, animEntity);
                    index++;
                }
            }
        }
Beispiel #3
0
 public override void OnAbilityTriggered(EvtAbilityStart evt)
 {
     if (this.CheckAllowTeleport())
     {
         this.Teleport();
     }
 }
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            HitExplodeTracingBulletMixinArgument abilityArgument = evt.abilityArgument as HitExplodeTracingBulletMixinArgument;
            uint nextNonSyncedRuntimeID = Singleton <RuntimeIDManager> .Instance.GetNextNonSyncedRuntimeID(6);

            this.CreateBullet(abilityArgument, nextNonSyncedRuntimeID, evt.otherID);
        }
Beispiel #5
0
 public override void OnAbilityTriggered(EvtAbilityStart evt)
 {
     this._delayTimer = this.config.DelayTime;
     this._position   = base.entity.XZPosition;
     this._state      = State.Running;
     base.FireMixinEffect(this.config.TriggerEffect, base.entity, false);
 }
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            if (evt.abilityArgument != null)
            {
                base.OnAbilityTriggered(evt);
            }
            else
            {
                int index = (base._loopIx >= base._loopCount) ? (base._loopCount - 1) : base._loopIx;
                BaseAbilityActor[] enemyActorsOf = Singleton <EventManager> .Instance.GetEnemyActorsOf <BaseAbilityActor>(base.actor);

                int num2   = this.config.ChargeMissleAmount[index];
                int length = enemyActorsOf.Length;
                for (int i = 0; i < length; i++)
                {
                    BaseMonoEntity target = enemyActorsOf[i].entity;
                    this.TriggerAbility(target, this.config.AbilityName);
                }
                if (length > 0)
                {
                    for (int j = 0; j < (num2 - length); j++)
                    {
                        BaseMonoEntity entity = enemyActorsOf[UnityEngine.Random.Range(0, length)].entity;
                        this.TriggerAbility(entity, this.config.AbilityNameSub);
                    }
                }
                else
                {
                    for (int k = 0; k < (num2 - length); k++)
                    {
                        this.TriggerAbility(null, this.config.AbilityNameSub);
                    }
                }
            }
        }
 public override void OnAbilityTriggered(EvtAbilityStart evt)
 {
     if (this._state == State.Idle)
     {
         this.StartAreaLastingBuff();
     }
 }
Beispiel #8
0
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            float abilityArgument = (float)evt.abilityArgument;

            this._triggeredChargeTimer.timespan = abilityArgument;
            this._triggeredChargeTimer.Reset(true);
        }
 public override void OnAbilityTriggered(EvtAbilityStart evt)
 {
     if (this._defendActionTimer != null)
     {
         this._defendActionTimer.Reset(true);
     }
     this.StartDefend();
 }
Beispiel #10
0
 public override void OnAbilityTriggered(EvtAbilityStart evt)
 {
     for (int i = 0; i < this.config.BulletNum; i++)
     {
         base.OnAbilityTriggered(evt);
     }
     this._attackTarget = base.entity.GetAttackTarget();
     this._hitCount     = this.config.MaxHitNum;
 }
 public override void OnAbilityTriggered(EvtAbilityStart evt)
 {
     if (base.selfIdentity.isAuthority)
     {
         RecordInvokeEntryContext context;
         base.OnAbilityTriggered(evt);
         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);
     }
 }
Beispiel #12
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);
        }
 public override void OnAbilityTriggered(EvtAbilityStart evt)
 {
     base.OnAbilityTriggered(evt);
     if (this.config.IsRandomTarget)
     {
         this.SelectRandomTarget();
     }
     else
     {
         this._attackTarget = base.entity.GetAttackTarget();
     }
 }
        private void CreateField(EvtAbilityStart evt)
        {
            Vector3 vector;

            if (this._timer.isActive)
            {
                this.StopField();
            }
            BaseMonoEntity attackTarget = null;
            float          maxDistance  = base.instancedAbility.Evaluate(this.config.CreationZOffset);
            float          num2         = base.instancedAbility.Evaluate(this.config.CreationXOffset);

            switch (this.config.TriggerPositionType)
            {
            case TriggerFieldExMixin.PositionType.Caster:
                attackTarget = base.actor.entity;
                break;

            case TriggerFieldExMixin.PositionType.AttackTarget:
                attackTarget = base.entity.GetAttackTarget();
                if (attackTarget == null)
                {
                    maxDistance += base.instancedAbility.Evaluate(this.config.NoAttackTargetZOffset);
                }
                break;

            case TriggerFieldExMixin.PositionType.Target:
                if (evt.otherID != 0)
                {
                    BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.otherID);

                    if ((actor != null) && (actor.entity != null))
                    {
                        attackTarget = actor.entity;
                    }
                }
                break;
            }
            Vector3 vector2 = (Vector3)(Vector3.Cross(Vector3.up, base.entity.transform.forward).normalized *num2);

            if (attackTarget != null)
            {
                vector = (attackTarget.XZPosition + new Vector3(0f, 0.5f, 0f)) + vector2;
            }
            else
            {
                attackTarget = base.actor.entity;
                Vector3 origin = (base.entity.XZPosition + new Vector3(0f, 0.5f, 0f)) + vector2;
                vector = CollisionDetectPattern.GetRaycastPoint(origin, base.entity.transform.forward, maxDistance, 0.2f, ((int)1) << InLevelData.STAGE_COLLIDER_LAYER);
            }
            this._fieldActor = Singleton <DynamicObjectManager> .Instance.CreateAbilityTriggerField(vector, attackTarget.transform.forward, base.actor, base.instancedAbility.Evaluate(this.config.Radius), this.config.Targetting, Singleton <DynamicObjectManager> .Instance.GetNextSyncedDynamicObjectRuntimeID(), this.config.Follow);
        }
        private void TriggerAbility(BaseMonoEntity target, string ability)
        {
            EvtAbilityStart evt = new EvtAbilityStart(base.entity.GetRuntimeID(), null)
            {
                abilityName = ability
            };

            if (target != null)
            {
                evt.otherID = target.GetRuntimeID();
            }
            Singleton <EventManager> .Instance.FireEvent(evt, MPEventDispatchMode.Normal);
        }
 public override void OnAbilityTriggered(EvtAbilityStart evt)
 {
     if (this.config.LerpStartValue > 0f)
     {
         this._lerpStartValue = this.config.LerpStartValue;
     }
     else
     {
         this._lerpStartValue = (base.actor.entity as BaseMonoAnimatorEntity).GetLocomotionFloat(this.config.AnimatorParamName);
     }
     this._lerpEndValue = this.config.LerpEndValue;
     this._isInLerping  = true;
 }
Beispiel #17
0
 protected void TriggerEliteTeleport(float toDistance)
 {
     if (Mathf.Abs(toDistance) >= 0.5f)
     {
         string          str = "Elite_Teleport";
         EvtAbilityStart evt = new EvtAbilityStart(this._monster.GetRuntimeID(), null)
         {
             abilityName     = str,
             abilityArgument = toDistance
         };
         Singleton <EventManager> .Instance.FireEvent(evt, MPEventDispatchMode.Normal);
     }
 }
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.otherID);

            if ((actor != null) && (actor.entity != null))
            {
                Vector3 vector = actor.entity.XZPosition + ((Vector3)((Quaternion.AngleAxis(base.instancedAbility.Evaluate(this.config.Angle), Vector3.up) * actor.entity.transform.forward) * actor.commonConfig.CommonArguments.CollisionRadius));
                vector.y = 0f;
                base.entity.transform.position = vector;
                Vector3 vector2 = actor.entity.XZPosition - base.entity.XZPosition;
                vector2.y = 0f;
                base.entity.transform.forward = vector2;
            }
        }
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            if (base.selfIdentity.isAuthority)
            {
                RecordInvokeEntryContext             context;
                HitExplodeTracingBulletMixinArgument abilityArgument = evt.abilityArgument as HitExplodeTracingBulletMixinArgument;
                uint nextRuntimeID = Singleton <RuntimeIDManager> .Instance.GetNextRuntimeID(6);

                base.StartRecordMixinInvokeEntry(out context, 0);
                Offset <MixinArg_HitExplodeMixin> offset = MixinArg_HitExplodeMixin.CreateMixinArg_HitExplodeMixin(context.builder, HitExplodeBulletAction.Trigger, (abilityArgument == null) ? ((ushort)0) : ((ushort)IndexedConfig <HitExplodeTracingBulletMixinArgument> .Mapping.Get(abilityArgument)), nextRuntimeID, evt.otherID);
                context.Finish <MixinArg_HitExplodeMixin>(offset, AbilityInvokeArgument.MixinArg_HitExplodeMixin);
                this.CreateBullet(abilityArgument, nextRuntimeID, evt.otherID);
            }
        }
 public override void OnAbilityTriggered(EvtAbilityStart evt)
 {
     if (this.config.AlwaysSwitchOn)
     {
         this.TurnOnModifier();
     }
     else if (!this._state)
     {
         this.TurnOnModifier();
     }
     else
     {
         this.TurnOffModifier();
     }
 }
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            float abilityArgument = (float)evt.abilityArgument;

            if (abilityArgument != 0f)
            {
                this._triggeredChargeTimer.timespan = abilityArgument;
                this._triggeredChargeTimer.Reset(true);
                this._useTriggerTimeControl = true;
            }
            else
            {
                this._useTriggerTimeControl = false;
            }
        }
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            float abilityArgument = 1f;

            if (evt.abilityArgument != null)
            {
                abilityArgument = (float)evt.abilityArgument;
            }
            float signedDistance = abilityArgument * this._baselineDistance;

            if (this._monster.IsAnimatorInTag(MonsterData.MonsterTagGroup.IdleOrMovement))
            {
                this.Teleport(signedDistance);
            }
        }
Beispiel #23
0
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.DefendStartActions, base.instancedAbility, base.instancedModifier, null, null);
            Singleton <EventManager> .Instance.FireEvent(new EvtDefendStart(base.actor.runtimeID), MPEventDispatchMode.Normal);

            this._defendFailTimer.Reset(true);
            if (!string.IsNullOrEmpty(this.config.DefendDurationModifierName))
            {
                this._defendDurationModifier = base.actor.abilityPlugin.ApplyModifier(base.instancedAbility, this.config.DefendDurationModifierName);
            }
            if (this._state == State.Idle)
            {
                base.actor.AddAbilityState(AbilityState.BlockAnimEventAttack, true);
            }
            this._state = State.Defending;
        }
Beispiel #24
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;
     }
 }
Beispiel #25
0
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            string bulletTypeName = this.config.BulletTypeName;
            int    grenadeAmount  = this.config.GrenadeAmount;
            string hitAnimEventID = this.config.HitAnimEventID;
            GrenadesMixinArgument abilityArgument = evt.abilityArgument as GrenadesMixinArgument;

            if (abilityArgument != null)
            {
                grenadeAmount = abilityArgument.BulletAmount;
                if (!string.IsNullOrEmpty(abilityArgument.HitAnimEventID))
                {
                    hitAnimEventID = abilityArgument.HitAnimEventID;
                }
            }
            for (int i = 0; i < grenadeAmount; i++)
            {
                AbilityTriggerBullet bullet = Singleton <DynamicObjectManager> .Instance.CreateAbilityLinearTriggerBullet(bulletTypeName, base.actor, base.instancedAbility.Evaluate(this.config.BulletSpeed), this.config.Targetting, this.config.IgnoreTimeScale, Singleton <DynamicObjectManager> .Instance.GetNextSyncedDynamicObjectRuntimeID(), -1f);

                if ((this.config.BulletEffect != null) && (this.config.BulletEffect.EffectPattern != null))
                {
                    Singleton <EffectManager> .Instance.TriggerEntityEffectPattern(this.config.BulletEffect.EffectPattern, bullet.triggerBullet, this.config.BulletEffectGround);
                }
                BaseMonoEntity entity  = null;
                Vector3        forward = base.entity.transform.forward;
                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)
                {
                    bullet.triggerBullet.transform.position = entity.GetAttachPoint("RootNode").position;
                    forward = entity.transform.forward;
                    float angle = ((360 * i) / (this.config.GrenadeAmount + 1)) - 180;
                    forward = (Vector3)(Quaternion.AngleAxis(angle, Vector3.up) * forward);
                }
                this.InitBulletDirAndPos(bullet, forward);
                base._bulletAttackDatas.Add(bullet.runtimeID, DamageModelLogic.CreateAttackDataFromAttackerAnimEvent(base.actor, hitAnimEventID));
            }
        }
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            BaseMonoAvatar localAvatar = Singleton <AvatarManager> .Instance.GetLocalAvatar();

            if (localAvatar != null)
            {
                int count = localAvatar.SubAttackTargetList.Count;
                for (int i = 0; i < count; i++)
                {
                    string bulletTypeName = this.config.BulletTypeName;
                    HitExplodeTracingBulletMixinArgument abilityArgument = evt.abilityArgument as HitExplodeTracingBulletMixinArgument;
                    if (abilityArgument != null)
                    {
                        if (abilityArgument.BulletName != null)
                        {
                            bulletTypeName = abilityArgument.BulletName;
                        }
                        if (abilityArgument.RandomBulletNames != null)
                        {
                            bulletTypeName = abilityArgument.RandomBulletNames[UnityEngine.Random.Range(0, abilityArgument.RandomBulletNames.Length)];
                        }
                    }
                    AbilityTriggerBullet bullet = Singleton <DynamicObjectManager> .Instance.CreateAbilityLinearTriggerBullet(bulletTypeName, base.actor, base.instancedAbility.Evaluate(this.config.BulletPostionLinearSpeed), this.config.Targetting, this.config.IgnoreTimeScale, Singleton <DynamicObjectManager> .Instance.GetNextSyncedDynamicObjectRuntimeID(), -1f);

                    if ((this.config.BulletEffect != null) && (this.config.BulletEffect.EffectPattern != null))
                    {
                        Singleton <EffectManager> .Instance.TriggerEntityEffectPattern(this.config.BulletEffect.EffectPattern, bullet.triggerBullet, this.config.BulletEffectGround);
                    }
                    base._bulletAttackDatas.Add(bullet.runtimeID, DamageModelLogic.CreateAttackDataFromAttackerAnimEvent(base.actor, this.config.HitAnimEventID));
                    float   angle    = (180 / (count + 1)) * (i + 1);
                    float   num4     = base.instancedAbility.Evaluate(this.config.BulletPositionRadius);
                    float   duration = base.instancedAbility.Evaluate(this.config.BulletPositionDuration);
                    Vector3 vector   = Vector3.Cross(Vector3.up, base.entity.transform.forward);
                    vector = (Vector3)(Quaternion.AngleAxis(angle, base.entity.transform.forward) * vector);
                    Vector3 vector2  = (Vector3)(vector.normalized * num4);
                    Vector3 position = localAvatar.SubAttackTargetList[i].transform.position;
                    Vector3 up       = Vector3.up;
                    position += up;
                    bullet.triggerBullet.SetupPositioning(bullet.triggerBullet.transform.position, bullet.triggerBullet.transform.position + vector2, duration, base.instancedAbility.Evaluate(this.config.BulletSpeed), this.config.TracingLerpCoef, this.config.TracingLerpCoefAcc, position, this.config.PassBy);
                    this.InitBulletForward(bullet);
                }
            }
        }
Beispiel #27
0
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            BaseMonoEntity attackTarget = base.actor.entity.GetAttackTarget();

            if (attackTarget != null)
            {
                this._pullActor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(attackTarget.GetRuntimeID());
            }
            if (this._pullActor != null)
            {
                this._pullActor.entity.SetHasAdditiveVelocity(true);
                Vector3 vector = base.entity.transform.position - attackTarget.transform.position;
                if (vector.magnitude < base.instancedAbility.Evaluate(this.config.PullRadius))
                {
                    vector.Normalize();
                    this._pullActor.entity.SetAdditiveVelocity((Vector3)(vector * base.instancedAbility.Evaluate(this.config.PullVelocity)));
                }
            }
        }
Beispiel #28
0
 public override void OnAbilityTriggered(EvtAbilityStart evt)
 {
     if (evt.abilityArgument != null)
     {
         MonsterSuicideAttackMixinArgument abilityArgument = evt.abilityArgument as MonsterSuicideAttackMixinArgument;
         if (abilityArgument != null)
         {
             this._suicideTimer.timespan = abilityArgument.SuicideCountDown;
             this._warningTimer.timespan = abilityArgument.BeapInterval;
             this._isTouchExplode        = abilityArgument.SuicideOnTouch;
             if (!string.IsNullOrEmpty(abilityArgument.OnTouchTriggerID))
             {
                 this._onTouchTriggerID = abilityArgument.OnTouchTriggerID;
             }
         }
     }
     this._suicideTimer.Reset(true);
     this._warningTimer.Reset(true);
 }
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            this._bulletNum      = (this.config.Type != HitExplodeRandomPosBulletMixin.CreateType.CreateOne) ? this.config.RandomPosPool.Length : 1;
            this._bulletNumCount = 0;
            this._bulletName     = this.config.BulletTypeName;
            HitExplodeTracingBulletMixinArgument abilityArgument = evt.abilityArgument as HitExplodeTracingBulletMixinArgument;

            if (abilityArgument != null)
            {
                if (abilityArgument.BulletName != null)
                {
                    this._bulletName = abilityArgument.BulletName;
                }
                if (abilityArgument.RandomBulletNames != null)
                {
                    this._bulletName = abilityArgument.RandomBulletNames[UnityEngine.Random.Range(0, abilityArgument.RandomBulletNames.Length)];
                }
            }
            this._internalTimer = 0f;
            this.GeneralPosIndexOrderList(this.config.NeedShuffle);
        }
        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;
                        }
                    }
                }
            }
        }