コード例 #1
0
        private void DoFlashExplode()
        {
            bool flag = false;

            foreach (BaseMonoAvatar avatar in Singleton <AvatarManager> .Instance.GetAllAvatars())
            {
                if (((avatar != null) && avatar.IsActive()) && (Vector3.Angle(this._position - avatar.XZPosition, avatar.transform.forward) <= this.config.Angle))
                {
                    BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(avatar.GetRuntimeID());

                    foreach (string str in this.config.ModifierNames)
                    {
                        actor.abilityPlugin.ApplyModifier(base.instancedAbility, str);
                    }
                    if (Singleton <AvatarManager> .Instance.IsLocalAvatar(avatar.GetRuntimeID()))
                    {
                        flag = true;
                        base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.SuccessActions, base.instancedAbility, base.instancedModifier, null, null);
                    }
                }
            }
            if (!flag)
            {
                base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.FailActions, base.instancedAbility, base.instancedModifier, null, null);
            }
        }
コード例 #2
0
        private bool OnHittingOtherResolve(EvtHittingOther evt)
        {
            BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.toID);

            if ((actor == null) || (actor.entity == null))
            {
                return(false);
            }
            if (!base.actor.abilityPlugin.EvaluateAbilityPredicate(this.config.Predicates, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.toID), evt))
            {
                return(false);
            }
            Vector3 vector = base.actor.entity.transform.position - actor.entity.transform.position;
            bool    flag   = vector.magnitude > base.instancedAbility.Evaluate(this.config.HitDistanceBeyond);

            if (this.config.Reverse)
            {
                flag = !flag;
            }
            if (flag)
            {
                evt.attackData.attackerCritChance       += base.instancedAbility.Evaluate(this.config.CriticalChanceRatioUp);
                evt.attackData.attackerCritDamageRatio  += base.instancedAbility.Evaluate(this.config.CriticalDamageRatioUp);
                evt.attackData.attackerAttackPercentage += base.instancedAbility.Evaluate(this.config.DamagePercentageUp);
                evt.attackData.attackerAniDamageRatio   += base.instancedAbility.Evaluate(this.config.AniDamageRatioUp);
                evt.attackData.attackerAttackValue      *= 1f + base.instancedAbility.Evaluate(this.config.AttackRatio);
                base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.Actions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.toID), evt);
            }
            return(true);
        }
コード例 #3
0
        private bool ListenFieldEnter(EvtFieldEnter evt)
        {
            if ((this._fieldActor == null) || (this._fieldActor.runtimeID != evt.targetID))
            {
                return(false);
            }
            BaseAbilityActor item = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.otherID);

            if ((item == null) || (item.gameObject == null))
            {
                return(false);
            }
            item.entity.SetHasAdditiveVelocity(true);
            if ((this.config.ModifierNames != null) && (this.config.ModifierNames.Length > 0))
            {
                int index  = 0;
                int length = this.config.ModifierNames.Length;
                while (index < length)
                {
                    item.abilityPlugin.ApplyModifier(base.instancedAbility, this.config.ModifierNames[index]);
                    index++;
                }
            }
            this._insideActors.Add(item);
            return(true);
        }
コード例 #4
0
        private bool ListenFieldExit(EvtFieldExit evt)
        {
            if ((this._fieldActor == null) || (this._fieldActor.runtimeID != evt.targetID))
            {
                return(false);
            }
            BaseAbilityActor item = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.otherID);

            if ((item != null) && (item.gameObject != null))
            {
                if (this._insideActors.Contains(item))
                {
                    this._insideActors.Remove(item);
                    this.RemoveAdditiveVelocity(item);
                }
                if ((this.config.ModifierNames != null) && (this.config.ModifierNames.Length > 0))
                {
                    int index  = 0;
                    int length = this.config.ModifierNames.Length;
                    while (index < length)
                    {
                        item.abilityPlugin.TryRemoveModifier(base.instancedAbility, this.config.ModifierNames[index]);
                        index++;
                    }
                }
            }
            return(true);
        }
コード例 #5
0
 public override void Core()
 {
     if (this._blackHoleTimer.isActive)
     {
         this._blackHoleTimer.Core(1f);
         if (this._blackHoleTimer.isTimeUp)
         {
             this.KillBlackHole(true);
         }
         else
         {
             for (int i = 0; i < this._insideActors.Count; i++)
             {
                 BaseAbilityActor targetActor = this._insideActors[i];
                 if ((targetActor != null) && targetActor.IsActive())
                 {
                     if ((this._pullVelocity > 0f) && (Miscs.DistancForVec3IgnoreY(targetActor.entity.XZPosition, this._fieldActor.triggerField.transform.position) < 0.3f))
                     {
                         this.RemoveAdditiveVelocity(targetActor);
                     }
                     else
                     {
                         Vector3 additiveVelocity = this._fieldActor.triggerField.transform.position - targetActor.entity.XZPosition;
                         additiveVelocity.y = 0f;
                         additiveVelocity.Normalize();
                         this.SetAdditiveVelocity(targetActor, additiveVelocity);
                     }
                 }
             }
         }
     }
 }
コード例 #6
0
        private EffectiveAttachModifier AttachLevelBuffModifier(PendingApplyModifierEntry entry)
        {
            BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(entry.ownerID);

            if (actor == null)
            {
                return(null);
            }
            ActorAbility instancedAbilityByID = actor.mpAbilityPlugin.GetInstancedAbilityByID(entry.instancedAbilityID);

            if (instancedAbilityByID == null)
            {
                return(null);
            }
            BaseAbilityActor other = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(entry.otherTargetID);

            EffectiveAttachModifier modifier = new EffectiveAttachModifier {
                ownerID            = entry.ownerID,
                config             = entry.config,
                instancedAbilityID = entry.instancedAbilityID
            };

            foreach (AttachModifier modifier2 in entry.config.AttachModifiers)
            {
                BaseAbilityActor   actor3;
                BaseAbilityActor[] actorArray;
                bool flag;
                actor.mpAbilityPlugin.ExternalResolveTarget(modifier2.Target, modifier2.TargetOption, instancedAbilityByID, other, out actor3, out actorArray, out flag);
                ConfigAbilityModifier modifier3 = instancedAbilityByID.config.Modifiers[modifier2.ModifierName];
                int localID = modifier3.localID;
                if (actor3 != null)
                {
                    Singleton <MPManager> .Instance.GetIdentity <BaseAbilityEntityIdentiy>(actor3.runtimeID).Command_TryApplyModifier(entry.ownerID, entry.instancedAbilityID, localID);

                    SubModifierLocater item = new SubModifierLocater {
                        modifierOwnerID = actor3.runtimeID,
                        modifierLocalID = localID
                    };
                    modifier.attachedModifiers.Add(item);
                }
                else if (actorArray != null)
                {
                    for (int i = 0; i < actorArray.Length; i++)
                    {
                        if (actorArray[i] != null)
                        {
                            Singleton <MPManager> .Instance.GetIdentity <BaseAbilityEntityIdentiy>(actorArray[i].runtimeID).Command_TryApplyModifier(entry.ownerID, entry.instancedAbilityID, localID);

                            SubModifierLocater locater2 = new SubModifierLocater {
                                modifierOwnerID = actorArray[i].runtimeID,
                                modifierLocalID = localID
                            };
                            modifier.attachedModifiers.Add(locater2);
                        }
                    }
                }
            }
            return(modifier);
        }
コード例 #7
0
        public void AttachBuffDebuffResistance(BaseAbilityActor target, MoleMole.Config.AttachBuffDebuffResistance resistance)
        {
            this.CheckInit <Tuple <BaseAbilityActor, ConfigBuffDebuffResistance> >(ref this._attachedResistanceBuffDebuffs);
            ConfigBuffDebuffResistance resistance2 = new ConfigBuffDebuffResistance(resistance.ResistanceBuffDebuffs, resistance.ResistanceRatio, resistance.ResistanceDurationRatio);

            this._attachedResistanceBuffDebuffs.Add(Tuple.Create <BaseAbilityActor, ConfigBuffDebuffResistance>(target, resistance2));
            target.AddBuffDebuffResistance(resistance2);
        }
コード例 #8
0
ファイル: BaseAbilityMixin.cs プロジェクト: slb1988/agame
 public BaseAbilityMixin(ActorAbility instancedAbility, ActorModifier instancedModifier, ConfigAbilityMixin config)
 {
     this.instancedAbility  = instancedAbility;
     this.instancedModifier = instancedModifier;
     this.actor             = (instancedModifier == null) ? instancedAbility.caster : instancedModifier.owner;
     this.entity            = this.actor.entity;
     this.mixinLocalID      = config.localID;
 }
コード例 #9
0
ファイル: LevelBuffWitchTime.cs プロジェクト: slb1988/agame
        protected void ApplyWitchTimeEffect(uint actorID)
        {
            BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(actorID);

            if (((actor.abilityState & AbilityState.WitchTimeSlowed) == AbilityState.None) && !actor.IsImmuneAbilityState(AbilityState.WitchTimeSlowed))
            {
                actor.AddAbilityState(AbilityState.WitchTimeSlowed, false);
            }
        }
コード例 #10
0
ファイル: LevelBuffWitchTime.cs プロジェクト: slb1988/agame
        protected void RemoveWitchTimeEffect(uint actorID)
        {
            BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(actorID);

            if (actor.abilityState.ContainsState(AbilityState.WitchTimeSlowed))
            {
                actor.RemoveAbilityState(AbilityState.WitchTimeSlowed);
            }
        }
コード例 #11
0
ファイル: AbilityTriggerBullet.cs プロジェクト: slb1988/agame
 public void Setup(BaseAbilityActor owner, float speed, MixinTargetting targetting, bool ignoreTimeScale, float aliveDuration = -1)
 {
     this._owner = owner;
     this.triggerBullet.SetCollisionMask(Singleton <EventManager> .Instance.GetAbilityHitboxTargettingMask(this._owner.runtimeID, targetting));
     this.triggerBullet.speed           = speed;
     this.triggerBullet.speedAdd        = Vector3.zero;
     this.triggerBullet.AliveDuration   = aliveDuration;
     this.triggerBullet.IgnoreTimeScale = ignoreTimeScale;
 }
コード例 #12
0
        private void KillBlackHole(bool doExplodeHit)
        {
            if ((this._fieldActor != null) && (this._fieldActor.triggerField != null))
            {
                List <uint> insideRuntimeIDs = this._fieldActor.GetInsideRuntimeIDs();
                this._fieldActor.triggerField.transform.position.y = 1f;
                for (int i = 0; i < insideRuntimeIDs.Count; i++)
                {
                    uint             runtimeID = insideRuntimeIDs[i];
                    BaseAbilityActor actor     = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(runtimeID);

                    if (((actor != null) && (actor.gameObject != null)) && ((this.config.ModifierNames != null) && (this.config.ModifierNames.Length > 0)))
                    {
                        int index  = 0;
                        int length = this.config.ModifierNames.Length;
                        while (index < length)
                        {
                            if (actor.abilityPlugin != null)
                            {
                                actor.abilityPlugin.TryRemoveModifier(base.instancedAbility, this.config.ModifierNames[index]);
                            }
                            index++;
                        }
                    }
                }
                if (doExplodeHit && (this.config.ExplodeAnimEventID != null))
                {
                    List <CollisionResult> list2 = CollisionDetectPattern.CylinderCollisionDetectBySphere(this._fieldActor.triggerField.XZPosition, this._fieldActor.triggerField.XZPosition, base.instancedAbility.Evaluate(this.config.Radius), 2f, Singleton <EventManager> .Instance.GetAbilityHitboxTargettingMask(base.actor.runtimeID, MixinTargetting.Enemy));
                    for (int j = 0; j < list2.Count; j++)
                    {
                        CollisionResult result = list2[j];
                        BaseMonoEntity  collisionResultEntity = AttackPattern.GetCollisionResultEntity(result.entity);
                        if (collisionResultEntity != null)
                        {
                            Singleton <EventManager> .Instance.FireEvent(new EvtHittingOther(base.actor.runtimeID, collisionResultEntity.GetRuntimeID(), this.config.ExplodeAnimEventID, result.hitPoint, result.hitForward), MPEventDispatchMode.Normal);
                        }
                    }
                }
                base.FireMixinEffect(this.config.DestroyEffect, this._fieldActor.triggerField, false);
                this._fieldActor.Kill();
                this._blackHoleTimer.timespan = base.instancedAbility.Evaluate(this.config.Duration);
                this._blackHoleTimer.Reset(false);
                if ((this.config.CreationEffect != null) && (this.config.CreationEffect.EffectPattern != null))
                {
                    Singleton <EffectManager> .Instance.SetDestroyIndexedEffectPattern(this._blackHoleEffectIx);
                }
                foreach (KeyValuePair <BaseAbilityActor, int> pair in this._addedVelocityActorsAndIndexDic)
                {
                    if ((pair.Key != null) && (pair.Key.entity != null))
                    {
                        pair.Key.entity.SetAdditiveVelocityOfIndex(Vector3.zero, pair.Value);
                        pair.Key.entity.SetHasAdditiveVelocity(false);
                    }
                }
                this._addedVelocityActorsAndIndexDic.Clear();
            }
        }
コード例 #13
0
        private bool OnBulletRefected(EvtAfterBulletReflected evt)
        {
            AbilityTriggerBullet bullet = Singleton <EventManager> .Instance.GetActor <AbilityTriggerBullet>(evt.bulletID);

            MonoTriggerBullet triggerBullet = bullet.triggerBullet;

            bullet.Setup(base.actor, triggerBullet.speed, MixinTargetting.All, triggerBullet.IgnoreTimeScale, triggerBullet.AliveDuration);
            evt.attackData.attackerAttackValue *= base.instancedAbility.Evaluate(this.config.DamageRatio);
            Vector3 position = Singleton <EventManager> .Instance.GetEntity(evt.launcherID).GetAttachPoint("RootNode").position;

            BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.launcherID);

            if (Vector3.Angle(base.instancedAbility.caster.entity.transform.forward, actor.entity.transform.position - base.instancedAbility.caster.entity.transform.position) < this.config.Angle)
            {
                if (this.config.IsReflectToLauncher)
                {
                    triggerBullet.SetupTracing(position, triggerBullet._traceLerpCoef, triggerBullet._traceLerpCoefAcc, false);
                    triggerBullet.transform.forward = -triggerBullet.transform.forward;
                }
                else
                {
                    position.y += UnityEngine.Random.Range((float)1f, (float)3f);
                    Vector3 rhs          = position - base.entity.XZPosition;
                    float   sqrMagnitude = rhs.sqrMagnitude;
                    rhs.y = 0f;
                    Vector3 onUnitSphere = UnityEngine.Random.onUnitSphere;
                    if (Vector3.Dot(onUnitSphere, rhs) < 0f)
                    {
                        onUnitSphere = -onUnitSphere;
                    }
                    onUnitSphere.y = Mathf.Abs(onUnitSphere.y);
                    triggerBullet.transform.forward = onUnitSphere;
                    triggerBullet.SetupTracing((Vector3)((onUnitSphere.normalized * sqrMagnitude) * 0.8f), triggerBullet._traceLerpCoef, triggerBullet._traceLerpCoefAcc, false);
                }
                if (this.config.ResetAliveDuration)
                {
                    triggerBullet.AliveDuration = this.config.NewAliveDuration;
                }
                base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.ReflectSuccessActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.launcherID), evt);
            }
            else
            {
                EvtBulletHit hit = new EvtBulletHit(triggerBullet.GetRuntimeID(), base.actor.runtimeID)
                {
                    ownerID           = base.actor.runtimeID,
                    cannotBeReflected = true
                };
                Vector3 vector4 = triggerBullet.transform.position - ((Vector3)((Time.deltaTime * triggerBullet.BulletTimeScale) * triggerBullet.transform.GetComponent <Rigidbody>().velocity));
                AttackResult.HitCollsion collsion = new AttackResult.HitCollsion {
                    hitPoint = vector4,
                    hitDir   = triggerBullet.transform.forward
                };
                hit.hitCollision = collsion;
                Singleton <EventManager> .Instance.FireEvent(hit, MPEventDispatchMode.Normal);
            }
            return(false);
        }
コード例 #14
0
 private void OnAlliedEnter(BaseAbilityActor actor)
 {
     this._insideAlliedActors.Add(actor);
     this.ApplyModifierOn(actor, this.config.Modifiers);
     if (this._isSmokeAvaliable)
     {
         this.ApplyModifierOn(actor, this.config.InSmokeModifiers);
     }
 }
コード例 #15
0
 private void ApplyModifierOn(BaseAbilityActor actor, string[] modifiers)
 {
     if ((actor != null) && actor.IsActive())
     {
         for (int i = 0; i < modifiers.Length; i++)
         {
             actor.abilityPlugin.ApplyModifier(base.instancedAbility, modifiers[i]);
         }
     }
 }
コード例 #16
0
 private void ApplyModifierOn(BaseAbilityActor actor)
 {
     if ((actor != null) && actor.IsActive())
     {
         for (int i = 0; i < this.config.TargetModifiers.Length; i++)
         {
             actor.abilityPlugin.ApplyModifier(base.instancedAbility, this.config.TargetModifiers[i]);
         }
     }
 }
コード例 #17
0
 private void RemoveAdditiveVelocity(BaseAbilityActor targetActor)
 {
     if (this._addedVelocityActorsAndIndexDic.ContainsKey(targetActor))
     {
         int index = this._addedVelocityActorsAndIndexDic[targetActor];
         targetActor.entity.SetAdditiveVelocityOfIndex(Vector3.zero, index);
         targetActor.entity.SetHasAdditiveVelocity(false);
         this._addedVelocityActorsAndIndexDic.Remove(targetActor);
     }
 }
コード例 #18
0
 private void SetAdditiveVelocity(BaseAbilityActor enemyActor, MonoAnimatedHitboxDetect hitbox)
 {
     if (((enemyActor != null) && (enemyActor.isAlive != 0)) && (enemyActor.entity != null))
     {
         Vector3 additiveVelocity = hitbox.collideCenterTransform.position - enemyActor.entity.XZPosition;
         additiveVelocity.y = 0f;
         additiveVelocity.Normalize();
         this.DoSetAdditiveVelocity(enemyActor, hitbox, additiveVelocity);
     }
 }
コード例 #19
0
 private void TryRemoveModifierOn(BaseAbilityActor actor)
 {
     if (actor != null)
     {
         for (int i = 0; i < this.config.TargetModifiers.Length; i++)
         {
             actor.abilityPlugin.TryRemoveModifier(base.instancedAbility, this.config.TargetModifiers[i]);
         }
     }
 }
コード例 #20
0
        public void Setup(BaseAbilityActor owner, float uniformScale, MixinTargetting targetting, bool followOwner = false)
        {
            this._owner = owner;
            this.triggerField.SetCollisionMask(Singleton <EventManager> .Instance.GetAbilityTargettingMask(this._owner.runtimeID, targetting));
            Vector3 vector = (Vector3)(Vector3.one * uniformScale);

            vector.y = 1f;
            this.triggerField.transform.localScale = vector;
            this._isFieldFollowOwner = followOwner;
        }
コード例 #21
0
 private void TryRemoveModifierOn(BaseAbilityActor actor, string[] modifiers)
 {
     if (actor != null)
     {
         for (int i = 0; i < modifiers.Length; i++)
         {
             actor.abilityPlugin.TryRemoveModifier(base.instancedAbility, modifiers[i]);
         }
     }
 }
コード例 #22
0
        private bool OnBeingHit(EvtBeingHit evt)
        {
            BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID);

            if ((actor != null) && (Vector3.Distance(actor.entity.transform.position, base.actor.entity.transform.position) > this._protectRange))
            {
                evt.attackData.damage *= 1f - this._damageReduceRatio;
                base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.OnRangeAttackProtectShieldSuccessActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.targetID), evt);
            }
            return(true);
        }
コード例 #23
0
        private bool OnAttackLanded(EvtAttackLanded evt)
        {
            BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.attackeeID);

            if (actor == null)
            {
                return(false);
            }
            AttackPattern.ActAttackEffects(this.config.AttackEffect, actor.entity, evt.attackResult.hitCollision.hitPoint, evt.attackResult.hitCollision.hitDir);
            return(true);
        }
コード例 #24
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);
        }
コード例 #25
0
        protected bool CheckAngle(EvtBeingHit evt)
        {
            BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID);

            bool flag = Vector3.Angle(base.actor.entity.transform.forward, actor.entity.transform.position - base.actor.entity.transform.position) < this.config.DefendAngle;

            if (this.config.ReverseAngle)
            {
                flag = !flag;
            }
            return(flag);
        }
コード例 #26
0
        public override void Core()
        {
            if (this._state == State.SpawningMirrors)
            {
                this._delayTimer.Core(1f);
                if (this._delayTimer.isTimeUp)
                {
                    this.SpawnSingleMirror(this._curMirrorIx);
                    this._curMirrorIx++;
                    if (this._curMirrorIx >= this._mirrorAmount)
                    {
                        this._state = State.MirrorActive;
                    }
                    else
                    {
                        this._delayTimer.timespan = this.config.PerMirrorDelayTime;
                        this._delayTimer.Reset(true);
                    }
                }
            }
            if ((this._state == State.SpawningMirrors) || (this._state == State.MirrorActive))
            {
                int num = 0;
                for (int i = 0; i < this._mirrorAmount; i++)
                {
                    if (this._mirrorDatas[i].mirrorRuntimeID != 0)
                    {
                        num++;
                        MirrorData data1 = this._mirrorDatas[i];
                        data1.mirrorLifetime += Time.deltaTime * base.entity.TimeScale;
                        if (this._mirrorDatas[i].mirrorLifetime > this._mirrorLifespan)
                        {
                            this.KillSingleMirror(i);
                        }
                        else if ((this._mirrorDatas[i].mirrorLifetime > (this._mirrorLifespan - this.config.AheadTime)) && !this._mirrorDatas[i].destroyAheadActionTriggered)
                        {
                            BaseAbilityActor other = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(this._mirrorDatas[i].mirrorRuntimeID);

                            base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.MirrorAheadDestroyActions, base.instancedAbility, base.instancedModifier, other, null);
                            this._mirrorDatas[i].destroyAheadActionTriggered = true;
                        }
                    }
                }
                if ((this._state == State.MirrorActive) && (num == 0))
                {
                    for (int j = 0; j < this.config.SelfModifiers.Length; j++)
                    {
                        base.actor.abilityPlugin.TryRemoveModifier(base.instancedAbility, this.config.SelfModifiers[j]);
                    }
                    this._state = State.Idle;
                }
            }
        }
コード例 #27
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);
        }
コード例 #28
0
        private void HitBoxTriggerEnterCallback(MonoAnimatedHitboxDetect hitbox, Collider other)
        {
            if (hitbox.entryName == this.config.ColliderEntryName)
            {
                BaseMonoEntity   componentInParent = other.GetComponentInParent <BaseMonoEntity>();
                BaseAbilityActor actor             = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(componentInParent.GetRuntimeID());

                if (actor != null)
                {
                    switch (Singleton <RuntimeIDManager> .Instance.ParseCategory(componentInParent.GetRuntimeID()))
                    {
                    case 3:
                    case 4:
                    {
                        HashSet <BaseAbilityActor> set = new HashSet <BaseAbilityActor>(Singleton <EventManager> .Instance.GetEnemyActorsOf <BaseAbilityActor>(actor));
                        if (set.Contains(base.actor))
                        {
                            bool flag = false;
                            foreach (Tuple <MonoAnimatedHitboxDetect, HashSet <BaseAbilityActor> > tuple in this._draggedEnemyList)
                            {
                                if (tuple.Item1 == hitbox)
                                {
                                    flag = true;
                                    break;
                                }
                            }
                            if (flag)
                            {
                                HashSet <uint> set2 = null;
                                foreach (Tuple <MonoAnimatedHitboxDetect, HashSet <uint> > tuple2 in this._touchedEnemyList)
                                {
                                    if (tuple2.Item1 == hitbox)
                                    {
                                        set2 = tuple2.Item2;
                                        if (tuple2.Item2.Contains(actor.runtimeID))
                                        {
                                            return;
                                        }
                                    }
                                }
                                if (set2 != null)
                                {
                                    set2.Add(actor.runtimeID);
                                }
                            }
                        }
                        break;
                    }
                    }
                }
            }
        }
コード例 #29
0
 private void OnEnemyEnter(BaseAbilityActor actor)
 {
     this._insideEnemyActors.Add(actor);
     if (this._isSmokeAvaliable)
     {
         this._isSmokeAvaliable = false;
         for (int i = 0; i < this._insideAlliedActors.Count; i++)
         {
             this.TryRemoveModifierOn(this._insideAlliedActors[i], this.config.InSmokeModifiers);
         }
         this.SetSmokeOffEffects();
     }
 }
コード例 #30
0
 private void OnEnemyExit(BaseAbilityActor actor)
 {
     this._insideEnemyActors.Remove(actor);
     if (!this._isSmokeAvaliable && (this._insideEnemyActors.Count == 0))
     {
         this._isSmokeAvaliable = true;
         for (int i = 0; i < this._insideAlliedActors.Count; i++)
         {
             this.ApplyModifierOn(this._insideAlliedActors[i], this.config.InSmokeModifiers);
         }
         this.SetSmokeOnEffects();
     }
 }