예제 #1
0
        private void Calc9SlotHeroStandingPosition(CSDT_BATTLE_PLAYER_BRIEF stBattlePlayer)
        {
            Calc9SlotHeroData[]    heroes            = new Calc9SlotHeroData[3];
            IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticLobbyDataProvider);

            ActorStaticData actorData = new ActorStaticData();
            ActorMeta       actorMeta = new ActorMeta();

            if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo() != null)
            {
                for (int i = 0; (i < stBattlePlayer.astFighter[0].astChoiceHero.Length) && (i < 3); i++)
                {
                    uint dwHeroID = stBattlePlayer.astFighter[0].astChoiceHero[i].stBaseInfo.stCommonInfo.dwHeroID;
                    if (dwHeroID != 0)
                    {
                        actorMeta.ConfigId = (int)dwHeroID;
                        actorDataProvider.GetActorStaticData(ref actorMeta, ref actorData);
                        heroes[i].Level        = 1;
                        heroes[i].Quality      = 1;
                        heroes[i].RecommendPos = actorData.TheHeroOnlyInfo.RecommendStandPos;
                        heroes[i].Ability      = (uint)CHeroDataFactory.CreateHeroData(dwHeroID).combatEft;
                        heroes[i].ConfigId     = dwHeroID;
                        heroes[i].selected     = false;
                        heroes[i].BornIndex    = -1;
                    }
                }
                this.ImpCalc9SlotHeroStandingPosition(ref heroes);
                for (int j = 0; (j < stBattlePlayer.astFighter[0].astChoiceHero.Length) && (j < 3); j++)
                {
                    stBattlePlayer.astFighter[0].astChoiceHero[j].stHeroExtral.iHeroPos = heroes[j].BornIndex;
                }
                for (int k = 0; (k < stBattlePlayer.astFighter[1].astChoiceHero.Length) && (k < 3); k++)
                {
                    uint id = stBattlePlayer.astFighter[1].astChoiceHero[k].stBaseInfo.stCommonInfo.dwHeroID;
                    if (id != 0)
                    {
                        actorMeta.ConfigId = (int)id;
                        actorDataProvider.GetActorStaticData(ref actorMeta, ref actorData);
                        heroes[k].Level        = stBattlePlayer.astFighter[1].astChoiceHero[k].stBaseInfo.stCommonInfo.wLevel;
                        heroes[k].Quality      = stBattlePlayer.astFighter[1].astChoiceHero[k].stBaseInfo.stCommonInfo.stQuality.wQuality;
                        heroes[k].RecommendPos = actorData.TheHeroOnlyInfo.RecommendStandPos;
                        heroes[k].Ability      = (uint)CHeroDataFactory.CreateHeroData(id).combatEft;
                        heroes[k].ConfigId     = id;
                        heroes[k].selected     = false;
                        heroes[k].BornIndex    = -1;
                    }
                }
                this.ImpCalc9SlotHeroStandingPosition(ref heroes);
                for (int m = 0; (m < stBattlePlayer.astFighter[1].astChoiceHero.Length) && (m < 3); m++)
                {
                    stBattlePlayer.astFighter[1].astChoiceHero[m].stHeroExtral.iHeroPos = heroes[m].BornIndex;
                }
            }
        }
예제 #2
0
 private bool IsBetterHero(ref Calc9SlotHeroData heroe1, ref Calc9SlotHeroData heroe2)
 {
     return(((heroe1.ConfigId > 0) && !heroe1.selected) && (((((heroe2.ConfigId == 0) || heroe2.selected) || (heroe1.Ability > heroe2.Ability)) || ((heroe1.Ability == heroe2.Ability) && (heroe1.Level > heroe2.Level))) || (((heroe1.Ability == heroe2.Ability) && (heroe1.Level == heroe2.Level)) && (heroe1.Quality >= heroe2.Quality))));
 }