Exemplo n.º 1
0
 protected override void Update()
 {
     base.UpdatePlugins();
     if (this._state == State.Idle)
     {
         this._destroyTimer.Core(1f);
         if (this._destroyTimer.isTimeUp)
         {
             if ((base.config.PropArguments.OnDestroyEffectPattern != null) && base.gameObject.activeSelf)
             {
                 this.FireEffect(base.config.PropArguments.OnDestroyEffectPattern);
             }
             if (!string.IsNullOrEmpty(base.config.PropArguments.AnimEventIDForHit) && this._toExplode)
             {
                 string animEventIDForHit   = base.config.PropArguments.AnimEventIDForHit;
                 ConfigPropAnimEvent event2 = SharedAnimEventData.ResolveAnimEvent(base.config, animEventIDForHit);
                 event2.AttackPattern.patternMethod(animEventIDForHit, event2.AttackPattern, this, (((int)1) << InLevelData.MONSTER_HITBOX_LAYER) | (((int)1) << InLevelData.AVATAR_HITBOX_LAYER));
             }
             this._destroyTimer.Reset(true);
             this._destroyTimer.timespan = 0.1f;
             this._state = State.WaitingForDestroy;
         }
     }
     else if (this._state == State.WaitingForDestroy)
     {
         this._destroyTimer.Core(1f);
         if (this._destroyTimer.isTimeUp)
         {
             this._destroyTimer.Reset(false);
             base._isToBeRemove = true;
         }
     }
 }
Exemplo n.º 2
0
        public void AbilityBeingHit(EvtBeingHit evt)
        {
            if ((this.abilityState & AbilityState.WitchTimeSlowed) != AbilityState.None)
            {
                float resumeTime = 0.5f;
                if ((evt.animEventID != null) && (Singleton <RuntimeIDManager> .Instance.ParseCategory(evt.sourceID) == 3))
                {
                    AvatarActor actor = Singleton <EventManager> .Instance.GetActor <AvatarActor>(evt.sourceID);

                    if ((actor != null) && (actor.config != null))
                    {
                        ConfigAvatarAnimEvent event2 = SharedAnimEventData.ResolveAnimEvent(actor.config, evt.animEventID);
                        if ((event2 != null) && (event2.WitchTimeResume != null))
                        {
                            resumeTime = event2.WitchTimeResume.ResumeTime;
                        }
                    }
                }
                if (evt.attackData.isAnimEventAttack && (evt.attackData.hitEffect > AttackResult.AnimatorHitEffect.Light))
                {
                    this.entity.SetTimeScale(1f, 1);
                    this._witchTimeResumeTimer.timespan = resumeTime;
                    this._witchTimeResumeTimer.Reset(true);
                }
            }
        }
Exemplo n.º 3
0
 public void RefillAttackDataDamagePercentage(string animEventID, ref AttackData attackData)
 {
     if ((this.uniqueMonsterID != 0) && !SharedAnimEventData.IsSharedAnimEventID(animEventID))
     {
         List <float>          aTKRatios     = MonsterData.GetUniqueMonsterMetaData(this.uniqueMonsterID).ATKRatios;
         List <List <string> > aTKRatioNames = this.config.ATKRatioNames;
         int num = -1;
         for (int i = 0; i < aTKRatioNames.Count; i++)
         {
             List <string> list3 = aTKRatioNames[i];
             foreach (string str in list3)
             {
                 if (str == animEventID)
                 {
                     num = i;
                     break;
                 }
             }
             if (num != -1)
             {
                 break;
             }
         }
         if ((num != -1) && (num < aTKRatios.Count))
         {
             attackData.attackerAttackPercentage *= aTKRatios[num];
         }
     }
 }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
 public static string GetAnimIDAttackPropertyOutput(BaseActor actor, string animEventID)
 {
     if (actor != null)
     {
         if (actor is AvatarActor)
         {
             return(SharedAnimEventData.ResolveAnimEvent(((AvatarActor)actor).config, animEventID).AttackProperty.GetDebugOutput());
         }
         if (actor is MonsterActor)
         {
             return(SharedAnimEventData.ResolveAnimEvent(((MonsterActor)actor).config, animEventID).AttackProperty.GetDebugOutput());
         }
         if (actor is PropObjectActor)
         {
             return(SharedAnimEventData.ResolveAnimEvent(((PropObjectActor)actor).config, animEventID).AttackProperty.GetDebugOutput());
         }
     }
     return(string.Format("<!null attack proeprty {0} on {1}>", GetDebugActorName(actor), animEventID));
 }
Exemplo n.º 6
0
        private bool ListenKill(EvtKilled evt)
        {
            if (Singleton <RuntimeIDManager> .Instance.ParseCategory(evt.targetID) == 4)
            {
                BaseMonoAvatar avatar = Singleton <AvatarManager> .Instance.TryGetAvatarByRuntimeID(evt.killerID);

                if (avatar == null)
                {
                    return(true);
                }
                Singleton <MissionModule> .Instance.TryToUpdateKillAnyEnemy();

                MonsterActor actor = (MonsterActor)Singleton <EventManager> .Instance.GetActor(evt.targetID);

                if (actor != null)
                {
                    if (actor.uniqueMonsterID != 0)
                    {
                        Singleton <MissionModule> .Instance.TryToUpdateKillUniqueMonsterMission(actor.uniqueMonsterID);
                    }
                    else
                    {
                        int monsterID = MonsterUIMetaDataReaderExtend.GetMonsterUIMetaDataByName(actor.metaConfig.subTypeName).monsterID;
                        Singleton <MissionModule> .Instance.TryToUpdateKillMonsterMission(monsterID);
                    }
                    Singleton <MissionModule> .Instance.TryToUpdateKillMonsterWithCategoryName(actor.metaConfig.categoryName);
                }
                ConfigAvatarAnimEvent event2 = SharedAnimEventData.ResolveAnimEvent(avatar.config, evt.killerAnimEventID);
                if (((event2 != null) && (event2.AttackProperty != null)) && (event2.AttackProperty.CategoryTag != null))
                {
                    AttackResult.AttackCategoryTag[] categoryTag = event2.AttackProperty.CategoryTag;
                    if (categoryTag.Length > 0)
                    {
                        Singleton <MissionModule> .Instance.TryToUpdateKillByAttackCategoryTag(categoryTag);
                    }
                }
            }
            return(true);
        }
Exemplo n.º 7
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;
                        }
                    }
                }
            }
        }
Exemplo n.º 8
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]);
            }
        }
Exemplo n.º 9
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);
 }
Exemplo n.º 10
0
        public override void TriggerAttackPattern(string animEventID, LayerMask layerMask)
        {
            ConfigPropAnimEvent event2 = SharedAnimEventData.ResolveAnimEvent(this.config, animEventID);

            event2.AttackPattern.patternMethod(animEventID, event2.AttackPattern, this, layerMask);
        }
Exemplo n.º 11
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();
                }
            }
        }