コード例 #1
0
        public AbilityTriggerField CreateAbilityTriggerField(Vector3 initPos, Vector3 initDir, BaseAbilityActor owner, float uniformScale, MixinTargetting targetting, uint runtimeID, bool followOwner = false)
        {
            MonoTriggerField    entity = this.CreateDynamicObjectEntityInstance <MonoTriggerField>(owner.runtimeID, "UnitField", initPos, initDir, runtimeID);
            AbilityTriggerField field2 = Singleton <EventManager> .Instance.CreateActor <AbilityTriggerField>(entity);

            field2.Setup(owner, uniformScale, targetting, followOwner);
            return(field2);
        }
コード例 #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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        private void StartAreaLastingBuff()
        {
            this._state      = State.Buffing;
            this._fieldActor = Singleton <DynamicObjectManager> .Instance.CreateAbilityTriggerField(base.entity.XZPosition, base.entity.transform.forward, base.actor, base.instancedAbility.Evaluate(this.config.Radius), this.config.Target, Singleton <DynamicObjectManager> .Instance.GetNextSyncedDynamicObjectRuntimeID(), true);

            if (!this.config.TriggerOnAdded)
            {
                this._buffTimer.Reset(true);
            }
            base.actor.abilityPlugin.ApplyModifier(base.instancedAbility, this.config.SelfLastingModifierName);
            Singleton <EventManager> .Instance.RegisterEventListener <EvtFieldEnter>(base.actor.runtimeID);

            Singleton <EventManager> .Instance.RegisterEventListener <EvtFieldExit>(base.actor.runtimeID);
        }
コード例 #5
0
        private void StartAreaLastingBuff()
        {
            this._isSmokeOn        = true;
            this._isSmokeAvaliable = true;
            this._position         = base.entity.XZPosition;
            this._dir = base.entity.transform.forward;
            this._insideAlliedActors.Clear();
            this._insideEnemyActors.Clear();
            this._alliedFieldActor = Singleton <DynamicObjectManager> .Instance.CreateAbilityTriggerField(this._position, base.entity.transform.forward, base.actor, base.instancedAbility.Evaluate(this.config.Radius), MixinTargetting.Allied, Singleton <DynamicObjectManager> .Instance.GetNextSyncedDynamicObjectRuntimeID(), false);

            this._enemyFieldActor = Singleton <DynamicObjectManager> .Instance.CreateAbilityTriggerField(this._position, base.entity.transform.forward, base.actor, base.instancedAbility.Evaluate(this.config.Radius), MixinTargetting.Enemy, Singleton <DynamicObjectManager> .Instance.GetNextSyncedDynamicObjectRuntimeID(), false);

            this.SetSmokeOnEffects();
            this._buffTimer.Reset(true);
            Singleton <EventManager> .Instance.RegisterEventListener <EvtFieldEnter>(base.actor.runtimeID);

            Singleton <EventManager> .Instance.RegisterEventListener <EvtFieldExit>(base.actor.runtimeID);
        }
コード例 #6
0
        public void InitWarningField(float warningRadius, float escapeRadius)
        {
            if ((this._warningFieldState == WarningFieldState.None) && ((warningRadius > 0f) && (escapeRadius >= warningRadius)))
            {
                this._warningRadius     = warningRadius;
                this._escapeRadius      = escapeRadius;
                this._warningFieldActor = Singleton <DynamicObjectManager> .Instance.CreateAbilityTriggerField(this._owner.monster.transform.position, this._owner.monster.transform.forward, this._owner, this._warningRadius, MixinTargetting.Enemy, Singleton <DynamicObjectManager> .Instance.GetNextNonSyncedDynamicObjectRuntimeID(), true);

                this._warningFieldState       = WarningFieldState.Outside;
                this._owner.monster.OrderMove = false;
                this._owner.monster.ClearHitTrigger();
                this._owner.monster.ClearAttackTriggers();
                this._owner.monster.SetUseAIController(false);
                Singleton <EventManager> .Instance.RegisterEventListener <EvtFieldEnter>(this._owner.runtimeID);

                Singleton <EventManager> .Instance.RegisterEventListener <EvtFieldExit>(this._owner.runtimeID);
            }
        }