Exemplo n.º 1
0
        public override void DoGoodsLogic(uint avatarRuntimeID)
        {
            Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(base._entity.ownerID).abilityPlugin.AddOrGetAbilityAndTriggerOnTarget(AbilityData.GetAbilityConfig(this.abilityName), avatarRuntimeID, this.abilityArgument);

            base.Kill();
        }
Exemplo n.º 2
0
 public override void OnAdded()
 {
     this._actor.appliedAbilities.Add(Tuple.Create <ConfigAbility, Dictionary <string, object> >(AbilityData.GetAbilityConfig("MPTest_HitToBleedAlt"), AbilityData.EMPTY_OVERRIDE_MAP));
     if (Singleton <MPManager> .Instance.isMaster)
     {
         this._actor.onPostInitialized = (Action)Delegate.Combine(this._actor.onPostInitialized, new Action(this.OnInitializeDoneReplicate));
     }
 }
Exemplo n.º 3
0
        private void HandleAlreadyLoadedPrefabs()
        {
            RuntimeIDManager  instance         = Singleton <RuntimeIDManager> .Instance;
            StageEntry        stageEntryByName = StageData.GetStageEntryByName(this.stageDevData.stageName);
            MonoBasePerpStage perpStage        = UnityEngine.Object.FindObjectOfType <MonoBasePerpStage>();

            if (perpStage != null)
            {
                perpStage.Init(stageEntryByName, (string)null);
            }
            MonoStageEnv stageEnv = UnityEngine.Object.FindObjectOfType <MonoStageEnv>();

            Singleton <StageManager> .Instance.RegisterStage(stageEntryByName, perpStage, stageEnv);

            LevelActor actor = (LevelActor)Singleton <EventManager> .Instance.GetActor(0x21800001);

            actor.levelMode = this.LEVEL_MODE;
            BaseMonoAvatar avatar = UnityEngine.Object.FindObjectOfType <BaseMonoAvatar>();

            if (avatar != null)
            {
                DevAvatarData  devAvatarData  = this.avatarDevDatas[0];
                AvatarDataItem avatarDataItem = Singleton <AvatarModule> .Instance.GetDummyAvatarDataItem(this.avatarTypeNames[0], devAvatarData.avatarLevel, devAvatarData.avatarStar);

                this.SetUpAvatarDataItem(avatarDataItem, devAvatarData);
                uint nextRuntimeID = instance.GetNextRuntimeID(3);
                avatar.Init(true, nextRuntimeID, avatarDataItem.AvatarRegistryKey, avatarDataItem.GetWeapon().ID, avatar.transform.position, avatar.transform.forward, true);
                this.LoadAvatarWwiseSoundBank(avatar);
                AvatarActor actor2 = Singleton <EventManager> .Instance.CreateActor <AvatarActor>(avatar);

                actor2.InitAvatarDataItem(avatarDataItem, true, false, true, true);
                actor2.PostInit();
                Singleton <AvatarManager> .Instance.RegisterAvatar(avatar, true, true, false);

                this.SetUpAvatarSkill(actor2, devAvatarData);
                this.CheatForPariticleMode(actor2);
                for (int i = 1; i < this.avatarCount; i++)
                {
                    DevAvatarData  data2 = this.avatarDevDatas[i];
                    AvatarDataItem item2 = Singleton <AvatarModule> .Instance.GetDummyAvatarDataItem(this.avatarTypeNames[i], data2.avatarLevel, data2.avatarStar);

                    this.SetUpAvatarDataItem(item2, data2);
                    uint runtimeID = instance.GetNextRuntimeID(3);
                    Singleton <AvatarManager> .Instance.CreateAvatar(item2, false, avatar.XZPosition, avatar.FaceDirection, runtimeID, false, false, false, false);

                    AvatarActor actor3 = Singleton <EventManager> .Instance.GetActor <AvatarActor>(runtimeID);

                    this.SetUpAvatarSkill(actor3, data2);
                    this.CheatForPariticleMode(actor3);
                }
                if (this.useFakeHelper)
                {
                    this.CreateFakeFriendAvatar();
                }
                Singleton <CinemaDataManager> .Instance.Preload(avatar);
            }
            foreach (BaseMonoMonster monster in UnityEngine.Object.FindObjectsOfType <BaseMonoMonster>())
            {
                DevMonsterData data3      = null;
                int            instanceID = monster.gameObject.GetInstanceID();
                for (int j = 0; j < this.monsterInstanceIds.Count; j++)
                {
                    if (this.monsterInstanceIds[j] == instanceID)
                    {
                        data3 = this.monsterDevDatas[j];
                        break;
                    }
                }
                if (data3 == null)
                {
                    UnityEngine.Object.Destroy(monster.gameObject);
                }
                else
                {
                    string monsterName;
                    string typeName;
                    uint   num7 = instance.GetNextRuntimeID(4);
                    if (data3.uniqueMonsterID != 0)
                    {
                        UniqueMonsterMetaData uniqueMonsterMetaData = MonsterData.GetUniqueMonsterMetaData(data3.uniqueMonsterID);
                        monsterName = uniqueMonsterMetaData.monsterName;
                        typeName    = uniqueMonsterMetaData.typeName;
                    }
                    else
                    {
                        monsterName = data3.monsterName;
                        typeName    = data3.typeName;
                    }
                    bool isElite = data3.isElite;
                    monster.Init(monsterName, typeName, num7, monster.transform.position, data3.uniqueMonsterID, null, true, isElite, true, 0);
                    for (int k = 0; k < monster.config.CommonArguments.RequestSoundBankNames.Length; k++)
                    {
                        Singleton <WwiseAudioManager> .Instance.ManualPrepareBank(monster.config.CommonArguments.RequestSoundBankNames[k]);
                    }
                    MonsterActor actor4 = Singleton <EventManager> .Instance.CreateActor <MonsterActor>(monster);

                    actor4.InitLevelData(data3.level, data3.isElite);
                    actor4.PostInit();
                    Singleton <MonsterManager> .Instance.RegisterMonster(monster);

                    if (data3.abilities.Length > 0)
                    {
                        for (int m = 0; m < data3.abilities.Length; m++)
                        {
                            string str3 = data3.abilities[m];
                            if (!string.IsNullOrEmpty(str3))
                            {
                                actor4.abilityPlugin.InsertPreInitAbility(AbilityData.GetAbilityConfig(data3.abilities[m]));
                            }
                        }
                    }
                    if (data3.isStationary)
                    {
                        MonsterActor actor5 = Singleton <EventManager> .Instance.GetActor <MonsterActor>(monster.GetRuntimeID());

                        actor5.baseMaxHP = actor5.HP = actor5.maxHP = 999999f;
                        monster.GetActiveAIController().SetActive(false);
                    }
                }
            }
            Singleton <LevelManager> .Instance.levelActor.SuddenLevelStart();

            EvtStageReady evt = new EvtStageReady {
                isBorn = true
            };

            Singleton <EventManager> .Instance.FireEvent(evt, MPEventDispatchMode.Normal);

            Singleton <DetourManager> .Instance.LoadNavMeshRelatedLevel(this.stageDevData.stageName);

            Singleton <MainUIManager> .Instance.GetInLevelUICanvas().FadeInStageTransitPanel(0.18f, false, null, null);
        }
Exemplo n.º 4
0
        public virtual void HandleLocalPlayerAvatarDie(BaseMonoAvatar diedAvatar)
        {
            BaseMonoAvatar firstAliveAvatar = Singleton <AvatarManager> .Instance.GetFirstAliveAvatar();

            if (firstAliveAvatar != null)
            {
                diedAvatar.gameObject.SetActive(false);
                Singleton <LevelManager> .Instance.levelActor.SwapLocalAvatar(diedAvatar.GetRuntimeID(), firstAliveAvatar.GetRuntimeID());

                if (Singleton <LevelManager> .Instance.levelActor.levelMode == LevelActor.Mode.Single)
                {
                    Singleton <LevelManager> .Instance.levelActor.abilityPlugin.AddOrGetAbilityAndTriggerOnTarget(AbilityData.GetAbilityConfig("Level_AvatarReviveInvincible"), firstAliveAvatar.GetRuntimeID(), 2f);
                }
            }
            else
            {
                Singleton <WwiseAudioManager> .Instance.Post("BGM_PauseMenu_On", null, null, null);

                if (Singleton <LevelScoreManager> .Instance.LevelType == 4)
                {
                    Singleton <LevelManager> .Instance.SetPause(false);

                    Singleton <EventManager> .Instance.FireEvent(new EvtLevelState(EvtLevelState.State.EndLose, EvtLevelState.LevelEndReason.EndLoseAllDead, 0), MPEventDispatchMode.Normal);

                    Singleton <CameraManager> .Instance.GetMainCamera().SetFailPostFX(true);
                }
                else if (Singleton <LevelDesignManager> .Instance.state == LevelDesignManager.LDState.Running)
                {
                    Singleton <LevelManager> .Instance.SetPause(true);

                    Singleton <MainUIManager> .Instance.ShowDialog(new InLevelReviveDialogContext(Singleton <AvatarManager> .Instance.GetTeamLeader().GetRuntimeID(), diedAvatar.XZPosition, true), UIType.Any);

                    Singleton <CameraManager> .Instance.GetMainCamera().SetFailPostFX(true);
                }
            }
        }
Exemplo n.º 5
0
        public override void Init(BaseMonoEntity entity)
        {
            this.prop         = (BaseMonoPropObject)entity;
            this.config       = this.prop.config;
            base.commonConfig = this.config.CommonConfig;
            base.Init(entity);
            for (int i = 0; i < this.config.Abilities.Length; i++)
            {
                ConfigEntityAbilityEntry entry = this.config.Abilities[i];
                base.appliedAbilities.Add(Tuple.Create <ConfigAbility, Dictionary <string, object> >(AbilityData.GetAbilityConfig(entry.AbilityName, entry.AbilityOverride), new Dictionary <string, object>()));
            }
            if (this.config.PropArguments.IsTriggerField)
            {
                this._triggerFieldPlugin = new ActorTriggerFieldPlugin(this);
                base.AddPlugin(this._triggerFieldPlugin);
            }
            for (int j = 0; j < 0x1b; j++)
            {
                AbilityState state = (AbilityState)(((int)1) << j);
                if (((state & (AbilityState.Undamagable | AbilityState.MaxMoveSpeed | AbilityState.Immune | AbilityState.CritUp | AbilityState.Shielded | AbilityState.PowerUp | AbilityState.AttackSpeedUp | AbilityState.MoveSpeedUp | AbilityState.Endure)) != AbilityState.None) || ((state & (AbilityState.Tied | AbilityState.TargetLocked | AbilityState.Fragile | AbilityState.Weak | AbilityState.AttackSpeedDown | AbilityState.MoveSpeedDown | AbilityState.Frozen | AbilityState.Poisoned | AbilityState.Burn | AbilityState.Paralyze | AbilityState.Stun | AbilityState.Bleed)) != AbilityState.None))
                {
                    base.SetAbilityStateImmune(state, true);
                }
            }
            Singleton <EventManager> .Instance.RegisterEventListener <EvtLevelBuffState>(base.runtimeID);

            this._opacity = 1f;
        }
Exemplo n.º 6
0
 private void InitUniqueMonsterConfig(NPCLevelMetaData npcLevelMetaData)
 {
     if (this.uniqueMonsterID != 0)
     {
         UniqueMonsterMetaData uniqueMonsterMetaData = MonsterData.GetUniqueMonsterMetaData(this.uniqueMonsterID);
         base.baseMaxHP = base.maxHP = base.HP = (this.metaConfig.HP * uniqueMonsterMetaData.HPRatio) * npcLevelMetaData.HPRatio;
         base.defense   = (this.metaConfig.defense * uniqueMonsterMetaData.defenseRatio) * npcLevelMetaData.DEFRatio;
         base.attack    = (this.metaConfig.attack * uniqueMonsterMetaData.attackRatio) * npcLevelMetaData.ATKRatio;
         if (uniqueMonsterMetaData.abilities.Length > 0)
         {
             LuaState state = new LuaState();
             IDictionaryEnumerator enumerator = ((LuaTable)state.DoString(uniqueMonsterMetaData.abilities)[0]).GetEnumerator();
             try
             {
                 while (enumerator.MoveNext())
                 {
                     ConfigAbility   abilityConfig;
                     DictionaryEntry current     = (DictionaryEntry)enumerator.Current;
                     string          key         = (string)current.Key;
                     LuaTable        table2      = (LuaTable)current.Value;
                     string          monsterName = uniqueMonsterMetaData.monsterName;
                     if (monsterName == null)
                     {
                         abilityConfig = AbilityData.GetAbilityConfig(key);
                     }
                     else
                     {
                         abilityConfig = AbilityData.GetAbilityConfig(key, monsterName);
                     }
                     Dictionary <string, object> dictionary  = new Dictionary <string, object>();
                     IDictionaryEnumerator       enumerator2 = table2.GetEnumerator();
                     try
                     {
                         while (enumerator2.MoveNext())
                         {
                             DictionaryEntry entry2 = (DictionaryEntry)enumerator2.Current;
                             string          str3   = (string)entry2.Key;
                             if (entry2.Value is double)
                             {
                                 dictionary.Add(str3, (float)((double)entry2.Value));
                             }
                             else if (entry2.Value is string)
                             {
                                 dictionary.Add(str3, (string)entry2.Value);
                             }
                         }
                     }
                     finally
                     {
                         IDisposable disposable = enumerator2 as IDisposable;
                         if (disposable == null)
                         {
                         }
                         disposable.Dispose();
                     }
                     base.appliedAbilities.Add(Tuple.Create <ConfigAbility, Dictionary <string, object> >(abilityConfig, dictionary));
                 }
             }
             finally
             {
                 IDisposable disposable2 = enumerator as IDisposable;
                 if (disposable2 == null)
                 {
                 }
                 disposable2.Dispose();
             }
         }
     }
 }
Exemplo n.º 7
0
        public void InitLevelData(int level, bool isElite)
        {
            base.level = level;
            NPCLevelMetaData nPCLevelMetaDataByKey = NPCLevelMetaDataReader.GetNPCLevelMetaDataByKey(level);

            base.baseMaxHP = base.maxHP = base.HP = this.metaConfig.HP * nPCLevelMetaDataByKey.HPRatio;
            base.defense   = this.metaConfig.defense * nPCLevelMetaDataByKey.DEFRatio;
            base.attack    = this.metaConfig.attack * nPCLevelMetaDataByKey.ATKRatio;
            base.PushProperty("Actor_ResistAllElementAttackRatio", nPCLevelMetaDataByKey.ElementalResistRatio);
            this.isElite = isElite;
            if (isElite)
            {
                base.baseMaxHP = base.maxHP = base.HP = base.maxHP * this.config.EliteArguments.HPRatio;
                base.defense  *= this.config.EliteArguments.DefenseRatio;
                base.attack   *= this.config.EliteArguments.AttackRatio;
            }
            foreach (KeyValuePair <string, ConfigEntityAbilityEntry> pair in this.config.Abilities)
            {
                base.abilityIDMap.Add(pair.Key, pair.Value.AbilityName);
                if (pair.Value.AbilityName != "Noop")
                {
                    base.appliedAbilities.Add(Tuple.Create <ConfigAbility, Dictionary <string, object> >(AbilityData.GetAbilityConfig(pair.Value.AbilityName, pair.Value.AbilityOverride), AbilityData.EMPTY_OVERRIDE_MAP));
                }
            }
            this.InitUniqueMonsterConfig(nPCLevelMetaDataByKey);
        }