示例#1
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)
        {
            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;
                        }
                    }
                }
            }
        }
示例#3
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]);
            }
        }
示例#4
0
 public static AttackData CreateAttackDataFromAttackerAnimEvent(BaseActor from, string animEventID)
 {
     if (from is AvatarActor)
     {
         AvatarActor           actor  = (AvatarActor)from;
         ConfigAvatarAnimEvent event2 = SharedAnimEventData.ResolveAnimEvent(actor.config, animEventID);
         return(CreateAttackDataFromAttackProperty(from, event2.AttackProperty, event2.AttackEffect, event2.CameraShake));
     }
     if (from is MonsterActor)
     {
         MonsterActor           actor2     = (MonsterActor)from;
         ConfigMonsterAnimEvent event3     = SharedAnimEventData.ResolveAnimEvent(actor2.config, animEventID);
         AttackData             attackData = CreateAttackDataFromAttackProperty(from, event3.AttackProperty, event3.AttackEffect, event3.CameraShake);
         actor2.RefillAttackDataDamagePercentage(animEventID, ref attackData);
         return(attackData);
     }
     if (from is PropObjectActor)
     {
         PropObjectActor     actor3 = (PropObjectActor)from;
         ConfigPropAnimEvent event4 = SharedAnimEventData.ResolveAnimEvent(actor3.config, animEventID);
         return(CreateAttackDataFromAttackProperty(from, event4.AttackProperty, event4.AttackEffect, event4.CameraShake));
     }
     return(null);
 }
示例#5
0
        public override void Core()
        {
            base.Core();
            this._Timer += Time.deltaTime * base.entity.TimeScale;
            if (this._state != ArsenalState.None)
            {
                if (this._state == ArsenalState.Charge)
                {
                    if (this._chargeIndex < this._cannonList.Count)
                    {
                        CannonInfo cannon = this._cannonList[this._chargeIndex];
                        if (this._Timer >= cannon.delay)
                        {
                            Vector3 initDir = (Vector3)(Quaternion.FromToRotation(Vector3.forward, base.entity.transform.forward) * cannon.localForward);
                            Vector3 initPos = base.entity.XZPosition + (Quaternion.FromToRotation(Vector3.forward, base.entity.transform.forward) * cannon.localPosition);
                            cannon.position      = initPos;
                            cannon.forward       = initDir.normalized;
                            cannon.cannonEffects = Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(this.config.CannonEffects, initPos, initDir, Vector3.one, base.entity);

                            this.UpdateEffects(cannon.cannonEffects, initPos, initDir);
                            cannon.chargeEffects = Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(this.config.ChargeEffects, initPos, initDir, Vector3.one, base.entity);

                            this.UpdateEffects(cannon.chargeEffects, initPos, initDir);
                            Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(this.config.HintEffects, this.GetTargetPosition(cannon), Vector3.forward, Vector3.one, base.entity);

                            this._chargeIndex++;
                        }
                    }
                    if (this._Timer > this.config.ChargeTime)
                    {
                        this._state      = ArsenalState.Fire;
                        this._Timer      = 0f;
                        this._shakeTimer = this.config.FireIntervial;
                    }
                }
                else if (this._state == ArsenalState.Fire)
                {
                    for (int i = 0; i < this._cannonList.Count; i++)
                    {
                        CannonInfo info2 = this._cannonList[i];
                        info2.fireTimer -= Time.deltaTime * base.entity.TimeScale;
                        if (info2.fireTimer <= 0f)
                        {
                            List <MonoEffect> list = Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(this.config.ShootEffects, info2.position, info2.forward, Vector3.one, base.entity);

                            this.UpdateEffects(list, info2.position, info2.forward);
                            Vector2 vector3 = (Vector2)(UnityEngine.Random.insideUnitCircle * this.config.ExplodeRadius);
                            Vector3 vector4 = new Vector3(vector3.x, 0f, vector3.y);
                            Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(this.config.ExplodeEffects, this.GetTargetPosition(info2) + vector4, Vector3.forward, Vector3.one, base.entity);

                            this.CreateExplode(this.GetTargetPosition(info2));
                            info2.fireTimer = this.config.FireIntervial;
                        }
                    }
                    this._shakeTimer -= Time.deltaTime * base.entity.TimeScale;
                    if (this._shakeTimer <= 0f)
                    {
                        ConfigMonsterAnimEvent event2 = SharedAnimEventData.ResolveAnimEvent(this._monster.config, this.config.ShakeAnimEventID);
                        if (event2.CameraShake != null)
                        {
                            AttackPattern.ActCameraShake(event2.CameraShake);
                        }
                        this._shakeTimer = this.config.FireIntervial;
                    }
                    if (this._Timer > this.config.FireTime)
                    {
                        this._state = ArsenalState.Disappear;
                        this._Timer = 0f;
                    }
                }
                else if (this._Timer > this.config.ClearTime)
                {
                    this._state = ArsenalState.None;
                    this.ClearCannons();
                }
            }
        }