Ejemplo n.º 1
0
        // Token: 0x06003B3E RID: 15166 RVA: 0x0010EFB0 File Offset: 0x0010D1B0
        public static ProBusinessCard ToProtocol(BusinessCard businessCard)
        {
            ProBusinessCard proBusinessCard = new ProBusinessCard();

            proBusinessCard.UserId          = businessCard.UserId;
            proBusinessCard.HeadIcon        = businessCard.HeadIcon;
            proBusinessCard.Name            = businessCard.Name;
            proBusinessCard.Level           = businessCard.Level;
            proBusinessCard.ArenaPoints     = businessCard.ArenaPoints;
            proBusinessCard.Likes           = businessCard.Likes;
            proBusinessCard.IsOnLine        = businessCard.IsOnLine;
            proBusinessCard.SetInfo         = BusinessCardInfoSet.ToProtocol(businessCard.SetInfo);
            proBusinessCard.StatisticalData = BusinessCardStatisticalData.ToProtocol(businessCard.StatisticalData);
            foreach (BattleHero battleHero in businessCard.Heroes)
            {
                proBusinessCard.Heroes.Add(BattleHero.BattleHeroToPBBattleHero(battleHero));
            }
            foreach (BattleHero battleHero2 in businessCard.MostSkilledHeroes)
            {
                proBusinessCard.MostSkilledHeroes.Add(BattleHero.BattleHeroToPBBattleHero(battleHero2));
            }
            foreach (TrainingTech trainingTech in businessCard.Techs)
            {
                proBusinessCard.Techs.Add(trainingTech.ToPro());
            }
            return(proBusinessCard);
        }
        // Token: 0x060031C8 RID: 12744 RVA: 0x000C3E94 File Offset: 0x000C2094
        public bool SwapHeros(int playerIdx, int heroPos1, int heroPos2, bool checkPos2HeroExist)
        {
            if (heroPos1 < 0 || heroPos1 >= this.m_battleHeroSetupInfos.Count)
            {
                return(false);
            }
            if (heroPos2 < 0 || heroPos2 >= this.m_battleHeroSetupInfos.Count)
            {
                return(false);
            }
            if (this.m_battleHeroSetupInfos[heroPos1].PlayerIndex != playerIdx)
            {
                return(false);
            }
            if (this.m_battleHeroSetupInfos[heroPos2].PlayerIndex != playerIdx)
            {
                return(false);
            }
            if (this.m_battleHeroSetupInfos[heroPos1].Hero == null)
            {
                return(false);
            }
            if (checkPos2HeroExist && this.m_battleHeroSetupInfos[heroPos2].Hero == null)
            {
                return(false);
            }
            BattleHero hero = this.m_battleHeroSetupInfos[heroPos1].Hero;

            this.m_battleHeroSetupInfos[heroPos1].Hero = this.m_battleHeroSetupInfos[heroPos2].Hero;
            this.m_battleHeroSetupInfos[heroPos2].Hero = hero;
            this.UpdateBattleHeroActionPositionIndex(heroPos1);
            this.UpdateBattleHeroActionPositionIndex(heroPos2);
            return(true);
        }
Ejemplo n.º 3
0
        // Token: 0x06003B3F RID: 15167 RVA: 0x0010F144 File Offset: 0x0010D344
        public static BusinessCard FromProtocol(ProBusinessCard pbBusinessCard)
        {
            BusinessCard businessCard = new BusinessCard();

            businessCard.UserId          = pbBusinessCard.UserId;
            businessCard.HeadIcon        = pbBusinessCard.HeadIcon;
            businessCard.Name            = pbBusinessCard.Name;
            businessCard.Level           = pbBusinessCard.Level;
            businessCard.ArenaPoints     = pbBusinessCard.ArenaPoints;
            businessCard.Likes           = pbBusinessCard.Likes;
            businessCard.IsOnLine        = pbBusinessCard.IsOnLine;
            businessCard.SetInfo         = BusinessCardInfoSet.FromProtocol(pbBusinessCard.SetInfo);
            businessCard.StatisticalData = BusinessCardStatisticalData.FromProtocol(pbBusinessCard.StatisticalData);
            foreach (ProBattleHero pbBattleHero in pbBusinessCard.Heroes)
            {
                businessCard.Heroes.Add(BattleHero.PBBattleHeroToBattleHero(pbBattleHero));
            }
            foreach (ProBattleHero pbBattleHero2 in pbBusinessCard.MostSkilledHeroes)
            {
                businessCard.MostSkilledHeroes.Add(BattleHero.PBBattleHeroToBattleHero(pbBattleHero2));
            }
            foreach (ProTrainingTech tech in pbBusinessCard.Techs)
            {
                businessCard.Techs.Add(TrainingTech.FromDataSection(tech));
            }
            return(businessCard);
        }
Ejemplo n.º 4
0
        // Token: 0x06003190 RID: 12688 RVA: 0x000C25D8 File Offset: 0x000C07D8
        public static BattleHero HeroToBattleHero(Hero hero)
        {
            BattleHero battleHero = new BattleHero();

            battleHero.HeroId              = hero.HeroId;
            battleHero.ActionValue         = hero.ActionValue;
            battleHero.ActionPositionIndex = hero.ActionPositionIndex;
            battleHero.Level             = hero.Level;
            battleHero.StarLevel         = hero.StarLevel;
            battleHero.SelectedSoldierId = hero.SelectedSoldierId;
            battleHero.SelectedSkillList.AddRange(hero.SelectedSkills);
            battleHero.ActiveHeroJobRelatedId = hero.ActiveHeroJobRelatedId;
            battleHero.Power = hero.BattlePower;
            HeroJob heroJob = hero.Jobs.Find((HeroJob m) => m.JobRelatedId == hero.ActiveHeroJobRelatedId);

            battleHero.ModelSkinId           = heroJob.ModelSkinId;
            battleHero.CharSkinId            = hero.CharSkinId;
            battleHero.SelectedSoldierSkinId = hero.GetSoldierSkinId(hero.SelectedSoldierId);
            foreach (HeroJob heroJob2 in hero.Jobs)
            {
                battleHero.Jobs.Add(BattleHeroJob.HeroJobToBattleHeroJob(heroJob2));
            }
            foreach (KeyValuePair <int, int> keyValuePair in hero.Fetters)
            {
                battleHero.Fetters.Add(keyValuePair.Key, keyValuePair.Value);
            }
            return(battleHero);
        }
Ejemplo n.º 5
0
        // Token: 0x06003192 RID: 12690 RVA: 0x000C2968 File Offset: 0x000C0B68
        public static ProBattleHero BattleHeroToPBBattleHero(BattleHero battleHero)
        {
            ProBattleHero proBattleHero = new ProBattleHero();

            proBattleHero.HeroId = battleHero.HeroId;
            proBattleHero.ActionPositionIndex = battleHero.ActionPositionIndex;
            proBattleHero.Level             = battleHero.Level;
            proBattleHero.StarLevel         = battleHero.StarLevel;
            proBattleHero.ActionValue       = battleHero.ActionValue;
            proBattleHero.SelectedSoldierId = battleHero.SelectedSoldierId;
            proBattleHero.SelectedSkillList.AddRange(battleHero.SelectedSkillList);
            proBattleHero.ActiveHeroJobRelatedId = battleHero.ActiveHeroJobRelatedId;
            proBattleHero.Power                 = battleHero.Power;
            proBattleHero.ModelSkinId           = battleHero.ModelSkinId;
            proBattleHero.CharSkinId            = battleHero.CharSkinId;
            proBattleHero.SelectedSoldierSkinId = battleHero.SelectedSoldierSkinId;
            foreach (BattleHeroJob battleHeroJob in battleHero.Jobs)
            {
                proBattleHero.Jobs.Add(BattleHeroJob.BattleHeroJobToPBBattleHeroJob(battleHeroJob));
            }
            foreach (BattleHeroEquipment equipment in battleHero.Equipments)
            {
                proBattleHero.Equipments.Add(BattleHeroEquipment.BattleHeroEquipmentToPBBattleHeroEquipment(equipment));
            }
            foreach (KeyValuePair <int, int> keyValuePair in battleHero.Fetters)
            {
                proBattleHero.Fetters.Add(new ProHeroFetter
                {
                    FetterId = keyValuePair.Key,
                    Level    = keyValuePair.Value
                });
            }
            return(proBattleHero);
        }
Ejemplo n.º 6
0
        // Token: 0x06003191 RID: 12689 RVA: 0x000C27B0 File Offset: 0x000C09B0
        public static BattleHero PBBattleHeroToBattleHero(ProBattleHero pbBattleHero)
        {
            BattleHero battleHero = new BattleHero();

            battleHero.HeroId              = pbBattleHero.HeroId;
            battleHero.ActionValue         = pbBattleHero.ActionValue;
            battleHero.ActionPositionIndex = pbBattleHero.ActionPositionIndex;
            battleHero.Level             = pbBattleHero.Level;
            battleHero.StarLevel         = pbBattleHero.StarLevel;
            battleHero.SelectedSoldierId = pbBattleHero.SelectedSoldierId;
            battleHero.SelectedSkillList.AddRange(pbBattleHero.SelectedSkillList);
            battleHero.ActiveHeroJobRelatedId = pbBattleHero.ActiveHeroJobRelatedId;
            battleHero.Power                 = pbBattleHero.Power;
            battleHero.ModelSkinId           = pbBattleHero.ModelSkinId;
            battleHero.CharSkinId            = pbBattleHero.CharSkinId;
            battleHero.SelectedSoldierSkinId = pbBattleHero.SelectedSoldierSkinId;
            foreach (ProBattleHeroJob pbBattleHeroJob in pbBattleHero.Jobs)
            {
                battleHero.Jobs.Add(BattleHeroJob.PBBattleHeroJobToBattleHeroJob(pbBattleHeroJob));
            }
            foreach (ProBattleHeroEquipment pbEquipment in pbBattleHero.Equipments)
            {
                battleHero.Equipments.Add(BattleHeroEquipment.PBBattleHeroEquipmentToBattleHeroEquipment(pbEquipment));
            }
            foreach (ProHeroFetter proHeroFetter in pbBattleHero.Fetters)
            {
                battleHero.Fetters.Add(proHeroFetter.FetterId, proHeroFetter.Level);
            }
            return(battleHero);
        }
Ejemplo n.º 7
0
        // Token: 0x06003B15 RID: 15125 RVA: 0x0010D7B0 File Offset: 0x0010B9B0
        public static BattleHero CreateDefaultConfigBattleHero(ConfigDataHeroInfo heroInfo)
        {
            if (heroInfo == null)
            {
                return(null);
            }
            BattleHero battleHero = new BattleHero();

            battleHero.HeroId = heroInfo.ID;
            battleHero.ActiveHeroJobRelatedId = heroInfo.JobConnection_ID;
            battleHero.Level     = 1;
            battleHero.StarLevel = heroInfo.Star;
            BattleHeroJob battleHeroJob = new BattleHeroJob();

            battleHeroJob.JobRelatedId = heroInfo.JobConnection_ID;
            battleHeroJob.JobLevel     = 0;
            battleHero.Jobs.Add(battleHeroJob);
            battleHero.SelectedSoldierId = heroInfo.Soldier_ID;
            int num = 0;

            while (num < heroInfo.Skills_ID.Count && num < 3)
            {
                battleHero.SelectedSkillList.Add(heroInfo.Skills_ID[num]);
                num++;
            }
            return(battleHero);
        }
Ejemplo n.º 8
0
 // Token: 0x060031D6 RID: 12758 RVA: 0x000C4320 File Offset: 0x000C2520
 public static BattleHeroSetupInfo PbBattleHeroSetupInfoToProBattleHeroSetupInfo(ProBattleHeroSetupInfo pbInfo)
 {
     return(new BattleHeroSetupInfo
     {
         PlayerIndex = pbInfo.PlayerIndex,
         Position = pbInfo.Position,
         Hero = ((pbInfo.Hero == null) ? null : BattleHero.PBBattleHeroToBattleHero(pbInfo.Hero)),
         Flag = (SetupBattleHeroFlag)pbInfo.Flag
     });
 }
Ejemplo n.º 9
0
 // Token: 0x06003193 RID: 12691 RVA: 0x000C2B38 File Offset: 0x000C0D38
 public static ProBattleHero ViewBattleHeroToPBBattleHero(BattleHero battleHero)
 {
     return(new ProBattleHero
     {
         HeroId = battleHero.HeroId,
         ActionPositionIndex = battleHero.ActionPositionIndex,
         ActiveHeroJobRelatedId = battleHero.ActiveHeroJobRelatedId,
         ModelSkinId = battleHero.ModelSkinId
     });
 }
Ejemplo n.º 10
0
 // Token: 0x060031D5 RID: 12757 RVA: 0x000C42C4 File Offset: 0x000C24C4
 public static ProBattleHeroSetupInfo BattleHeroSetupInfoToPbProBattleHeroSetupInfo(BattleHeroSetupInfo info)
 {
     return(new ProBattleHeroSetupInfo
     {
         PlayerIndex = info.PlayerIndex,
         Position = info.Position,
         Hero = ((info.Hero == null) ? null : BattleHero.BattleHeroToPBBattleHero(info.Hero)),
         Flag = (int)info.Flag
     });
 }
Ejemplo n.º 11
0
        // Token: 0x06004E1E RID: 19998 RVA: 0x0017C108 File Offset: 0x0017A308
        public static ProArenaBattleReport ArenaBattleReportToPBArenaBattleReport(ArenaBattleReport arenaBattleReport, bool isBattleData)
        {
            ProArenaBattleReport proArenaBattleReport = new ProArenaBattleReport();

            proArenaBattleReport.Version    = arenaBattleReport.Version;
            proArenaBattleReport.InstanceId = arenaBattleReport.InstanceId;
            if (isBattleData)
            {
                proArenaBattleReport.BattleType          = (int)arenaBattleReport.BattleType;
                proArenaBattleReport.BattleId            = arenaBattleReport.BattleId;
                proArenaBattleReport.RandomSeed          = arenaBattleReport.RandomSeed;
                proArenaBattleReport.ArenaDefenderRuleId = arenaBattleReport.ArenaDefenderRuleId;
                foreach (BattleCommand battleCommand in arenaBattleReport.Commands)
                {
                    proArenaBattleReport.Commands.Add(BattleCommand.BattleCommandToPBBattleCommand(battleCommand));
                }
                foreach (BattleHero battleHero in arenaBattleReport.AttackerHeroes)
                {
                    proArenaBattleReport.AttackerHeroes.Add(BattleHero.BattleHeroToPBBattleHero(battleHero));
                }
                foreach (BattleHero battleHero2 in arenaBattleReport.DefenderHeroes)
                {
                    proArenaBattleReport.DefenderHeroes.Add(BattleHero.BattleHeroToPBBattleHero(battleHero2));
                }
                foreach (TrainingTech trainingTech in arenaBattleReport.AttackerTechs)
                {
                    proArenaBattleReport.AttackerTechs.Add(trainingTech.ToPro());
                }
                foreach (TrainingTech trainingTech2 in arenaBattleReport.DefenderTechs)
                {
                    proArenaBattleReport.DefenderTechs.Add(trainingTech2.ToPro());
                }
            }
            else
            {
                proArenaBattleReport.Status                 = (int)arenaBattleReport.Status;
                proArenaBattleReport.AttackerUserId         = arenaBattleReport.AttackerUserId;
                proArenaBattleReport.AttackerLevel          = arenaBattleReport.AttackerLevel;
                proArenaBattleReport.AttackerName           = arenaBattleReport.AttackerName;
                proArenaBattleReport.DefenderUserId         = arenaBattleReport.DefenderUserId;
                proArenaBattleReport.DefenderLevel          = arenaBattleReport.DefenderLevel;
                proArenaBattleReport.DefenderName           = arenaBattleReport.DefenderName;
                proArenaBattleReport.CreateTime             = arenaBattleReport.CreateTime;
                proArenaBattleReport.AttackerGotArenaPoints = arenaBattleReport.AttackerGotArenaPoints;
                proArenaBattleReport.DefenderGotArenaPoints = arenaBattleReport.DefenderGotArenaPoints;
                proArenaBattleReport.OpponentHeadIcon       = arenaBattleReport.OpponentHeadIcon;
            }
            return(proArenaBattleReport);
        }
Ejemplo n.º 12
0
        // Token: 0x06004E1D RID: 19997 RVA: 0x0017BE64 File Offset: 0x0017A064
        public static ArenaBattleReport PBArenaBattleReportToArenaBattleReport(ProArenaBattleReport pbArenaBattleReport, bool isBattleData)
        {
            ArenaBattleReport arenaBattleReport = new ArenaBattleReport();

            arenaBattleReport.InstanceId = pbArenaBattleReport.InstanceId;
            arenaBattleReport.Version    = pbArenaBattleReport.Version;
            if (isBattleData)
            {
                arenaBattleReport.BattleType          = (BattleType)pbArenaBattleReport.BattleType;
                arenaBattleReport.BattleId            = pbArenaBattleReport.BattleId;
                arenaBattleReport.RandomSeed          = pbArenaBattleReport.RandomSeed;
                arenaBattleReport.ArenaDefenderRuleId = pbArenaBattleReport.ArenaDefenderRuleId;
                foreach (ProBattleCommand pbBattleCommand in pbArenaBattleReport.Commands)
                {
                    arenaBattleReport.Commands.Add(BattleCommand.PBBattleCommandToBattleCommand(pbBattleCommand));
                }
                foreach (ProBattleHero pbBattleHero in pbArenaBattleReport.AttackerHeroes)
                {
                    arenaBattleReport.AttackerHeroes.Add(BattleHero.PBBattleHeroToBattleHero(pbBattleHero));
                }
                foreach (ProBattleHero pbBattleHero2 in pbArenaBattleReport.DefenderHeroes)
                {
                    arenaBattleReport.DefenderHeroes.Add(BattleHero.PBBattleHeroToBattleHero(pbBattleHero2));
                }
                foreach (ProTrainingTech tech in pbArenaBattleReport.AttackerTechs)
                {
                    arenaBattleReport.AttackerTechs.Add(TrainingTech.FromDataSection(tech));
                }
                foreach (ProTrainingTech tech2 in pbArenaBattleReport.DefenderTechs)
                {
                    arenaBattleReport.DefenderTechs.Add(TrainingTech.FromDataSection(tech2));
                }
            }
            else
            {
                arenaBattleReport.Status                 = (ArenaBattleReportStatus)pbArenaBattleReport.Status;
                arenaBattleReport.AttackerUserId         = pbArenaBattleReport.AttackerUserId;
                arenaBattleReport.AttackerLevel          = pbArenaBattleReport.AttackerLevel;
                arenaBattleReport.AttackerName           = pbArenaBattleReport.AttackerName;
                arenaBattleReport.DefenderUserId         = pbArenaBattleReport.DefenderUserId;
                arenaBattleReport.DefenderLevel          = pbArenaBattleReport.DefenderLevel;
                arenaBattleReport.DefenderName           = pbArenaBattleReport.DefenderName;
                arenaBattleReport.CreateTime             = pbArenaBattleReport.CreateTime;
                arenaBattleReport.AttackerGotArenaPoints = pbArenaBattleReport.AttackerGotArenaPoints;
                arenaBattleReport.DefenderGotArenaPoints = pbArenaBattleReport.DefenderGotArenaPoints;
                arenaBattleReport.OpponentHeadIcon       = pbArenaBattleReport.OpponentHeadIcon;
            }
            return(arenaBattleReport);
        }
        // Token: 0x0600510C RID: 20748 RVA: 0x00182584 File Offset: 0x00180784
        public static ProRealTimePVPBattleReportPlayerData ToPro(this RealTimePVPBattleReportPlayerData Data)
        {
            ProRealTimePVPBattleReportPlayerData proRealTimePVPBattleReportPlayerData = new ProRealTimePVPBattleReportPlayerData
            {
                HeadIcon  = Data.HeadIcon,
                Level     = Data.Level,
                Name      = Data.Name,
                UserId    = Data.UserId,
                ScoreDiff = Data.ScoreDiff
            };

            foreach (BattleHero battleHero in Data.Heroes)
            {
                proRealTimePVPBattleReportPlayerData.Heroes.Add(BattleHero.BattleHeroToPBBattleHero(battleHero));
            }
            foreach (TrainingTech trainingTech in Data.Techs)
            {
                proRealTimePVPBattleReportPlayerData.Techs.Add(trainingTech.ToPro());
            }
            return(proRealTimePVPBattleReportPlayerData);
        }
        // Token: 0x0600510B RID: 20747 RVA: 0x00182480 File Offset: 0x00180680
        public static RealTimePVPBattleReportPlayerData ToMemory(this ProRealTimePVPBattleReportPlayerData Data)
        {
            RealTimePVPBattleReportPlayerData realTimePVPBattleReportPlayerData = new RealTimePVPBattleReportPlayerData
            {
                HeadIcon  = Data.HeadIcon,
                Level     = Data.Level,
                Name      = Data.Name,
                UserId    = Data.UserId,
                ScoreDiff = Data.ScoreDiff
            };

            foreach (ProBattleHero pbBattleHero in Data.Heroes)
            {
                realTimePVPBattleReportPlayerData.Heroes.Add(BattleHero.PBBattleHeroToBattleHero(pbBattleHero));
            }
            foreach (ProTrainingTech tech in Data.Techs)
            {
                realTimePVPBattleReportPlayerData.Techs.Add(TrainingTech.FromDataSection(tech));
            }
            return(realTimePVPBattleReportPlayerData);
        }
Ejemplo n.º 15
0
 // Token: 0x06003B1B RID: 15131 RVA: 0x0010DFE4 File Offset: 0x0010C1E4
 public static int AppendPveMyNpcBattleActorSetups(IConfigDataLoader configDataLoader, ConfigDataBattleInfo battleInfo, int monsterLevel, List <BattleActorSetup> actors)
 {
     for (int i = 0; i < battleInfo.NpcActors.Count; i++)
     {
         BattlePosActor battlePosActor = battleInfo.NpcActors[i];
         int            id             = battlePosActor.ID;
         int            num            = battlePosActor.Level;
         int            behaviorId     = 0;
         if (battleInfo.NpcActorsBehavior.Count > i)
         {
             behaviorId = battleInfo.NpcActorsBehavior[i];
         }
         int groupId = 0;
         if (battleInfo.NpcGroups.Count > i)
         {
             groupId = battleInfo.NpcGroups[i];
         }
         if (num == 0)
         {
             num = monsterLevel;
         }
         ConfigDataHeroInfo configDataHeroInfo = configDataLoader.GetConfigDataHeroInfo(id);
         if (configDataHeroInfo == null)
         {
             return(-618);
         }
         BattleHero       hero             = BattleUtility.CreateDefaultConfigBattleHero(configDataHeroInfo);
         BattleActorSetup battleActorSetup = BattleUtility.CreateBattleActorSetupFromBattleHero(configDataLoader, hero, num, behaviorId, groupId);
         battleActorSetup.Position.x = battlePosActor.X;
         battleActorSetup.Position.y = battlePosActor.Y;
         battleActorSetup.Direction  = 0;
         if (battleInfo.NpcDirs.Count > i)
         {
             battleActorSetup.Direction = battleInfo.NpcDirs[i];
         }
         battleActorSetup.IsNpc = true;
         actors.Add(battleActorSetup);
     }
     return(0);
 }
        // Token: 0x06004DE1 RID: 19937 RVA: 0x0017B7E8 File Offset: 0x001799E8
        public static ProArenaDefensiveBattleInfo DefensiveBattleInfoToPBDefensiveBattleInfo(ArenaOpponentDefensiveBattleInfo defensiveBattleInfo)
        {
            ProArenaDefensiveBattleInfo proArenaDefensiveBattleInfo = new ProArenaDefensiveBattleInfo();

            proArenaDefensiveBattleInfo.BattleExpiredTime        = defensiveBattleInfo.BattleExpiredTime;
            proArenaDefensiveBattleInfo.RandomSeed               = defensiveBattleInfo.BattleRandomSeed;
            proArenaDefensiveBattleInfo.ArenaOpponentPointZoneId = defensiveBattleInfo.ArenaOpponentPointZoneId;
            ArenaPlayerDefensiveTeamSnapshot battleTeamSnapshot = defensiveBattleInfo.BattleTeamSnapshot;

            proArenaDefensiveBattleInfo.BattleId            = battleTeamSnapshot.BattleId;
            proArenaDefensiveBattleInfo.ArenaDefenderRuleId = battleTeamSnapshot.ArenaDefenderRuleId;
            proArenaDefensiveBattleInfo.PlayerLevel         = battleTeamSnapshot.PlayerLevel;
            foreach (BattleHero battleHero in battleTeamSnapshot.DefenderHeroes)
            {
                proArenaDefensiveBattleInfo.DefenderHeroes.Add(BattleHero.BattleHeroToPBBattleHero(battleHero));
            }
            foreach (TrainingTech trainingTech in battleTeamSnapshot.Techs)
            {
                proArenaDefensiveBattleInfo.Techs.Add(trainingTech.ToPro());
            }
            return(proArenaDefensiveBattleInfo);
        }
 // Token: 0x060031C7 RID: 12743 RVA: 0x000C3E0C File Offset: 0x000C200C
 public bool SetHero(int playerIdx, int heroPos, BattleHero hero, bool checkHeroDup = true)
 {
     if (heroPos < 0 || heroPos >= this.m_battleHeroSetupInfos.Count)
     {
         return(false);
     }
     if (this.m_battleHeroSetupInfos[heroPos].PlayerIndex != playerIdx)
     {
         return(false);
     }
     if (hero != null && checkHeroDup)
     {
         int num = this.FindHeroPosition(playerIdx, hero.HeroId);
         if (num >= 0 && num != heroPos)
         {
             return(false);
         }
     }
     this.m_battleHeroSetupInfos[heroPos].Hero = hero;
     this.UpdateBattleHeroActionPositionIndex(heroPos);
     return(true);
 }
Ejemplo n.º 18
0
 // Token: 0x0600319F RID: 12703 RVA: 0x000C332C File Offset: 0x000C152C
 public LuaExportHelper(BattleHero owner)
 {
     this.m_owner = owner;
 }
Ejemplo n.º 19
0
        // Token: 0x06003B17 RID: 15127 RVA: 0x0010DC90 File Offset: 0x0010BE90
        public static BattleActorSetup CreatePveMyBattleActorSetup(IConfigDataLoader configDataLoader, ConfigDataBattleInfo battleInfo, int position, BattleHero hero)
        {
            BattleActorSetup battleActorSetup = BattleUtility.CreateBattleActorSetupFromBattleHero(configDataLoader, hero, 0, -1, 0);

            battleActorSetup.Position.x = battleInfo.AllyPositions[position].X;
            battleActorSetup.Position.y = battleInfo.AllyPositions[position].Y;
            battleActorSetup.Direction  = 0;
            if (battleInfo.AllyDirs.Count > position)
            {
                battleActorSetup.Direction = battleInfo.AllyDirs[position];
            }
            battleActorSetup.IsNpc = false;
            return(battleActorSetup);
        }
Ejemplo n.º 20
0
        // Token: 0x06003B1A RID: 15130 RVA: 0x0010DEF4 File Offset: 0x0010C0F4
        public static BattleActorSetup CreateRealtimePvpBattleActorSetup(IConfigDataLoader configDataLoader, int team, ConfigDataRealTimePVPBattleInfo battleInfo, int position, BattleHero hero)
        {
            BattleActorSetup battleActorSetup = BattleUtility.CreateBattleActorSetupFromBattleHero(configDataLoader, hero, 0, -1, 0);

            if (team == 0)
            {
                battleActorSetup.Position.x = battleInfo.AttackPositions[position].X;
                battleActorSetup.Position.y = battleInfo.AttackPositions[position].Y;
                if (battleInfo.AttackDirs.Count > position)
                {
                    battleActorSetup.Direction = battleInfo.AttackDirs[position];
                }
            }
            else
            {
                if (team != 1)
                {
                    return(null);
                }
                battleActorSetup.Position.x = battleInfo.DefendPositions[position].X;
                battleActorSetup.Position.y = battleInfo.DefendPositions[position].Y;
                if (battleInfo.DefendDirs.Count > position)
                {
                    battleActorSetup.Direction = battleInfo.DefendDirs[position];
                }
            }
            battleActorSetup.IsNpc = false;
            return(battleActorSetup);
        }
Ejemplo n.º 21
0
        // Token: 0x06003B1C RID: 15132 RVA: 0x0010E104 File Offset: 0x0010C304
        public static int AppendPveOpponentBattleActorSetups(IConfigDataLoader configDataLoader, ConfigDataBattleInfo battleInfo, int monsterLevel, int randomSeed, List <BattleActorSetup> actors)
        {
            List <RandomArmyActor> list = null;

            if (battleInfo.BattleRandomEnemies_ID.Count > 0)
            {
                RandomNumber randomNumber = new RandomNumber();
                randomNumber.SetSeed(randomSeed);
                int randomBattleArmyActors = BattleUtility.GetRandomBattleArmyActors(configDataLoader, battleInfo.BattleRandomEnemies_ID, randomNumber, out list);
                if (randomBattleArmyActors != 0)
                {
                    return(randomBattleArmyActors);
                }
            }
            List <ConfigDataSkillInfo> list2 = null;

            if (battleInfo.EnemyRandomTalentProbilities.Count > 0)
            {
                RandomNumber randomNumber2 = new RandomNumber();
                randomNumber2.SetSeed(randomSeed);
                BattleUtility.GetRandomTalentSkills(configDataLoader, battleInfo.EnemyRandomTalent_ID, battleInfo.EnemyRandomTalentProbilities, randomNumber2, out list2);
            }
            for (int i = 0; i < battleInfo.EnemyActors.Count; i++)
            {
                BattlePosActor battlePosActor = battleInfo.EnemyActors[i];
                int            key            = battlePosActor.ID;
                int            num            = battlePosActor.Level;
                int            behaviorId     = 0;
                if (battleInfo.EnemyActorsBehavior.Count > i)
                {
                    behaviorId = battleInfo.EnemyActorsBehavior[i];
                }
                int groupId = 0;
                if (battleInfo.EnemyGroups.Count > i)
                {
                    groupId = battleInfo.EnemyGroups[i];
                }
                if (list != null && i < list.Count && list[i] != null)
                {
                    key        = list[i].HeroID;
                    num        = list[i].Level;
                    behaviorId = list[i].AI;
                }
                if (num == 0)
                {
                    num = monsterLevel;
                }
                ConfigDataHeroInfo configDataHeroInfo = configDataLoader.GetConfigDataHeroInfo(key);
                if (configDataHeroInfo == null)
                {
                    return(-618);
                }
                BattleHero       hero             = BattleUtility.CreateDefaultConfigBattleHero(configDataHeroInfo);
                BattleActorSetup battleActorSetup = BattleUtility.CreateBattleActorSetupFromBattleHero(configDataLoader, hero, num, behaviorId, groupId);
                battleActorSetup.Position.x = battlePosActor.X;
                battleActorSetup.Position.y = battlePosActor.Y;
                battleActorSetup.Direction  = 0;
                if (battleInfo.EnemyDirs.Count > i)
                {
                    battleActorSetup.Direction = battleInfo.EnemyDirs[i];
                }
                battleActorSetup.IsNpc = false;
                if (list2 != null && i < list2.Count)
                {
                    battleActorSetup.ExtraTalentSkillInfo = list2[i];
                }
                actors.Add(battleActorSetup);
            }
            return(0);
        }
Ejemplo n.º 22
0
        // Token: 0x06003B16 RID: 15126 RVA: 0x0010D864 File Offset: 0x0010BA64
        public static BattleActorSetup CreateBattleActorSetupFromBattleHero(IConfigDataLoader configDataLoader, BattleHero hero, int level = 0, int behaviorId = -1, int groupId = 0)
        {
            BattleActorSetup battleActorSetup = new BattleActorSetup();

            battleActorSetup.HeroInfo          = configDataLoader.GetConfigDataHeroInfo(hero.HeroId);
            battleActorSetup.JobConnectionInfo = configDataLoader.GetConfigDataJobConnectionInfo(hero.ActiveHeroJobRelatedId);
            battleActorSetup.SoldierInfo       = configDataLoader.GetConfigDataSoldierInfo(hero.SelectedSoldierId);
            battleActorSetup.HeroStar          = hero.StarLevel;
            battleActorSetup.JobLevel          = hero.GetJob(hero.ActiveHeroJobRelatedId).JobLevel;
            battleActorSetup.SoldierCount      = configDataLoader.Const_SoldierCountMax;
            battleActorSetup.ActionValue       = hero.ActionValue;
            battleActorSetup.BehaviorId        = behaviorId;
            battleActorSetup.GroupId           = groupId;
            battleActorSetup.PlayerIndex       = -1;
            if (level > 0)
            {
                battleActorSetup.HeroLevel = level;
            }
            else
            {
                battleActorSetup.HeroLevel = hero.Level;
            }
            if (hero.SelectedSkillList.Count > 0)
            {
                List <ConfigDataSkillInfo> list = new List <ConfigDataSkillInfo>();
                foreach (int key in hero.SelectedSkillList)
                {
                    ConfigDataSkillInfo configDataSkillInfo = configDataLoader.GetConfigDataSkillInfo(key);
                    if (configDataSkillInfo != null)
                    {
                        list.Add(configDataSkillInfo);
                    }
                }
                if (list.Count > 0)
                {
                    battleActorSetup.SkillInfos = list.ToArray();
                }
            }
            if (hero.Jobs.Count > 0)
            {
                List <ConfigDataJobInfo> list2 = new List <ConfigDataJobInfo>();
                foreach (BattleHeroJob battleHeroJob in hero.Jobs)
                {
                    ConfigDataJobConnectionInfo configDataJobConnectionInfo = configDataLoader.GetConfigDataJobConnectionInfo(battleHeroJob.JobRelatedId);
                    if (configDataJobConnectionInfo.IsJobLevelMax(battleHeroJob.JobLevel))
                    {
                        list2.Add(configDataJobConnectionInfo.m_jobInfo);
                    }
                }
                if (list2.Count > 0)
                {
                    battleActorSetup.MasterJobInfos = list2.ToArray();
                }
            }
            if (hero.Fetters.Count > 0)
            {
                List <ConfigDataSkillInfo> list3 = new List <ConfigDataSkillInfo>();
                foreach (KeyValuePair <int, int> keyValuePair in hero.Fetters)
                {
                    ConfigDataHeroFetterInfo configDataHeroFetterInfo = configDataLoader.GetConfigDataHeroFetterInfo(keyValuePair.Key);
                    if (configDataHeroFetterInfo != null)
                    {
                        int num = keyValuePair.Value - 1;
                        if (num < configDataHeroFetterInfo.GotSkills_ID.Count)
                        {
                            ConfigDataSkillInfo configDataSkillInfo2 = configDataLoader.GetConfigDataSkillInfo(configDataHeroFetterInfo.GotSkills_ID[num]);
                            if (configDataSkillInfo2 != null)
                            {
                                list3.Add(configDataSkillInfo2);
                            }
                        }
                    }
                }
                if (list3.Count > 0)
                {
                    battleActorSetup.FetterSkillInfos = list3.ToArray();
                }
            }
            if (hero.Equipments.Count > 0)
            {
                List <BattleActorEquipment> list4 = new List <BattleActorEquipment>();
                foreach (BattleHeroEquipment battleHeroEquipment in hero.Equipments)
                {
                    ConfigDataEquipmentInfo configDataEquipmentInfo = configDataLoader.GetConfigDataEquipmentInfo(battleHeroEquipment.Id);
                    if (configDataEquipmentInfo != null)
                    {
                        BattleActorEquipment battleActorEquipment = new BattleActorEquipment();
                        battleActorEquipment.EquipmentInfo = configDataEquipmentInfo;
                        battleActorEquipment.Level         = battleHeroEquipment.Level;
                        if (battleHeroEquipment.EnchantProperties.Count > 0)
                        {
                            battleActorEquipment.EnchantProperties = new CommonBattleProperty[battleHeroEquipment.EnchantProperties.Count];
                            for (int i = 0; i < battleHeroEquipment.EnchantProperties.Count; i++)
                            {
                                battleActorEquipment.EnchantProperties[i] = battleHeroEquipment.EnchantProperties[i];
                            }
                        }
                        list4.Add(battleActorEquipment);
                    }
                }
                if (list4.Count > 0)
                {
                    battleActorSetup.Equipments = list4.ToArray();
                }
                List <ConfigDataSkillInfo> equipmentResonanceSkillInfos = BattleUtility.GetEquipmentResonanceSkillInfos(configDataLoader, hero.Equipments);
                if (equipmentResonanceSkillInfos.Count > 0)
                {
                    battleActorSetup.ResonanceSkillInfos = equipmentResonanceSkillInfos.ToArray();
                }
            }
            battleActorSetup.HeroCharImageSkinResourceInfo = hero.GetHeroCharImageSkinResourceInfo(configDataLoader);
            battleActorSetup.HeroModelSkinResourceInfo     = hero.GetHeroActiveJobModelSkinResourceInfo(configDataLoader);
            battleActorSetup.SoldierModelSkinResourceInfo  = hero.GetSelectedSoldierModelSkinResourceInfo(configDataLoader);
            return(battleActorSetup);
        }
        // Token: 0x06004DE0 RID: 19936 RVA: 0x0017B6C4 File Offset: 0x001798C4
        public static ArenaOpponentDefensiveBattleInfo PBDefensiveBattleInfoToDefensiveBattleInfo(ProArenaDefensiveBattleInfo pbDefensiveBattleInfo)
        {
            ArenaOpponentDefensiveBattleInfo arenaOpponentDefensiveBattleInfo = new ArenaOpponentDefensiveBattleInfo();

            arenaOpponentDefensiveBattleInfo.BattleExpiredTime                      = pbDefensiveBattleInfo.BattleExpiredTime;
            arenaOpponentDefensiveBattleInfo.BattleRandomSeed                       = pbDefensiveBattleInfo.RandomSeed;
            arenaOpponentDefensiveBattleInfo.BattleTeamSnapshot.BattleId            = pbDefensiveBattleInfo.BattleId;
            arenaOpponentDefensiveBattleInfo.BattleTeamSnapshot.ArenaDefenderRuleId = pbDefensiveBattleInfo.ArenaDefenderRuleId;
            arenaOpponentDefensiveBattleInfo.ArenaOpponentPointZoneId               = pbDefensiveBattleInfo.ArenaOpponentPointZoneId;
            arenaOpponentDefensiveBattleInfo.BattleTeamSnapshot.PlayerLevel         = pbDefensiveBattleInfo.PlayerLevel;
            foreach (ProBattleHero pbBattleHero in pbDefensiveBattleInfo.DefenderHeroes)
            {
                arenaOpponentDefensiveBattleInfo.BattleTeamSnapshot.DefenderHeroes.Add(BattleHero.PBBattleHeroToBattleHero(pbBattleHero));
            }
            foreach (ProTrainingTech tech in pbDefensiveBattleInfo.Techs)
            {
                arenaOpponentDefensiveBattleInfo.BattleTeamSnapshot.Techs.Add(TrainingTech.FromDataSection(tech));
            }
            return(arenaOpponentDefensiveBattleInfo);
        }