Exemplo n.º 1
0
        public void factionTabChange(int tabID)
        {
            if ((this.lastFactionTabID == tabID) && (tabID != 9))
            {
                return;
            }
            InterfaceMgr.Instance.StopDrawing();
            InterfaceMgr.Instance.getFactionTabBar().updateShownTabs();
            this.lastFactionTabID = tabID;
            InterfaceMgr.Instance.clearControls();
            this.gameDisplayModeSubMode = GameDisplaySubModes.SUBMODE_DEFAULT;
            switch (tabID)
            {
                case 0:
                    this.GameDisplayMode = GameDisplays.DISPLAY_FACTIONS;
                    InterfaceMgr.Instance.addMainWindow(this.m_firstDrawFactions, true);
                    this.m_firstDrawFactions = false;
                    InterfaceMgr.Instance.initGloryTab();
                    goto Label_0142;

                case 1:
                    this.GameDisplayMode = GameDisplays.DISPLAY_FACTIONS;
                    if ((this.nextFactionPage < 0) || (this.nextFactionPage == 0x3e7))
                    {
                        if (RemoteServices.Instance.UserFactionID >= 0)
                        {
                            InterfaceMgr.Instance.showFactionPanel(RemoteServices.Instance.UserFactionID);
                        }
                        else
                        {
                            InterfaceMgr.Instance.setVillageTabSubMode(0x29, false);
                        }
                        break;
                    }
                    InterfaceMgr.Instance.setVillageTabSubMode(this.nextFactionPage, false);
                    break;

                case 2:
                    this.GameDisplayMode = GameDisplays.DISPLAY_FACTIONS;
                    if (this.nextFactionPage < 0)
                    {
                        InterfaceMgr.Instance.setVillageTabSubMode(0x33, false);
                    }
                    else
                    {
                        InterfaceMgr.Instance.setVillageTabSubMode(this.nextFactionPage, false);
                    }
                    this.nextFactionPage = -1;
                    goto Label_0142;

                default:
                    goto Label_0142;
            }
            this.nextFactionPage = -1;
            Label_0142:
            InterfaceMgr.Instance.StartDrawing();
        }
Exemplo n.º 2
0
        public void mainTabChange(int tabID)
        {
            UniversalDebugLog.Log("disabling blur on tabchange start " + tabID);
            InterfaceMgr.bgdBlurEnabled = false;
            if ((this.lastTabID == tabID) && (tabID != 9))
            {
                return;
            }
            if ((tabID == 1) && (InterfaceMgr.Instance.getSelectedMenuVillage() < 0))
            {
                InterfaceMgr.Instance.StopDrawing();
                InterfaceMgr.Instance.getMainTabBar().changeTab(this.lastTabID);
                InterfaceMgr.Instance.StartDrawing();
                return;
            }
            InterfaceMgr.Instance.StopDrawing();
            this.previousTabID = this.lastTabID;
            this.lastTabID = tabID;
            InterfaceMgr.Instance.clearControls();
            this.gameDisplayModeSubMode = GameDisplaySubModes.SUBMODE_DEFAULT;
            StatTrackingClient.Instance().ActivateTrigger(1, tabID);
            if (tabID != 1)
            {
                this.lastLoadedVillage = -1;
            }
            switch (tabID)
            {
                case 0:
                    this.GameDisplayMode = GameDisplays.DISPLAY_WORLD;
                    UniversalDebugLog.Log("disabling blur on select world tab");
                    InterfaceMgr.bgdBlurEnabled = false;
                    this.gfx.BGColor = WorldMap.SEACOLOR;
                    InterfaceMgr.Instance.initWorldTab();
                    InterfaceMgr.Instance.selectCurrentUserVillage();
                    goto Label_0689;

                case 1:
                    this.lastVillageTabID = -1;
                    InterfaceMgr.Instance.showVillageTabBar();
                    InterfaceMgr.Instance.getVillageTabBar().forceChangeTab(0);
                    goto Label_0689;

                case 2:
                {
                    int villageID = InterfaceMgr.Instance.getSelectedMenuVillage();
                    if (!InterfaceMgr.Instance.isSelectedVillageACapital())
                    {
                        int parishID = this.World.getParishFromVillageID(villageID);
                        int num4 = this.World.getParishCapital(parishID);
                        if (num4 >= 0)
                        {
                            this.lastVillageTabID = -1;
                            InterfaceMgr.Instance.showVillageTabBar();
                            InterfaceMgr.Instance.selectUserVillage(num4, false);
                            InterfaceMgr.Instance.getVillageTabBar().forceChangeTab(5);
                            this.MovedFromVillageID = villageID;
                        }
                        else
                        {
                            InterfaceMgr.Instance.getMainTabBar().changeTab(0);
                        }
                    }
                    else
                    {
                        this.lastVillageTabID = -1;
                        InterfaceMgr.Instance.showVillageTabBar();
                        InterfaceMgr.Instance.getVillageTabBar().forceChangeTab(5);
                        this.MovedFromVillageID = villageID;
                    }
                    goto Label_0689;
                }
                case 3:
                    this.GameDisplayMode = GameDisplays.DISPLAY_RESEARCH;
                    UniversalDebugLog.Log("adding blur before researchtab init");
                    InterfaceMgr.bgdBlurEnabled = true;
                    InterfaceMgr.Instance.addMainWindow(this.m_firstDrawResearch, true);
                    this.m_firstDrawResearch = false;
                    InterfaceMgr.Instance.initResearchTab();
                    goto Label_0689;

                case 4:
                    this.GameDisplayMode = GameDisplays.DISPLAY_RANKINGS;
                    InterfaceMgr.Instance.addMainWindow(this.m_firstDrawRank, true);
                    this.m_firstDrawRank = false;
                    InterfaceMgr.Instance.initRankingsTab();
                    goto Label_0689;

                case 5:
                    this.GameDisplayMode = GameDisplays.DISPLAY_QUESTS;
                    InterfaceMgr.Instance.addMainWindow(this.m_firstDrawQuest, true);
                    this.m_firstDrawQuest = false;
                    InterfaceMgr.Instance.initQuestsTab();
                    goto Label_0689;

                case 6:
                    this.GameDisplayMode = GameDisplays.DISPLAY_ARMIES;
                    InterfaceMgr.Instance.addMainWindow(this.m_firstDrawArmy, true);
                    this.m_firstDrawArmy = false;
                    InterfaceMgr.Instance.initAllArmiesTab();
                    goto Label_0689;

                case 7:
                    this.GameDisplayMode = GameDisplays.DISPLAY_REPORTS;
                    InterfaceMgr.Instance.addMainWindow(this.m_firstDrawReports, false);
                    this.m_firstDrawReports = false;
                    InterfaceMgr.Instance.initReportTab();
                    goto Label_0689;

                case 8:
                    this.lastVillageTabID = -1;
                    this.GameDisplayMode = GameDisplays.DISPLAY_FACTIONS;
                    InterfaceMgr.Instance.showFactionTabBar();
                    if (this.nextFactionPage >= 0)
                    {
                        if ((this.nextFactionPage == 0x34) || (this.nextFactionPage == 0x33))
                        {
                            InterfaceMgr.Instance.getFactionTabBar().forceChangeTab(2);
                        }
                        else
                        {
                            InterfaceMgr.Instance.getFactionTabBar().forceChangeTab(1);
                        }
                    }
                    else
                    {
                        InterfaceMgr.Instance.getFactionTabBar().forceChangeTab(0);
                    }
                    goto Label_0689;

                case 9:
                {
                    int dummyMode = MainTabBar2.DummyMode;
                    MainTabBar2.LastDummyMode = dummyMode;
                    MainTabBar2.DummyMode = 0;
                    int num7 = dummyMode;
                    if (num7 > 50)
                    {
                        switch (num7)
                        {
                            case 60:
                                InterfaceMgr.bgdBlurEnabled = true;
                                InterfaceMgr.Instance.setVillageTabSubMode(60);
                                goto Label_0689;

                            case 100:
                                this.gfx.BGColor = ARGBColors.Black;
                                InterfaceMgr.bgdBlurEnabled = true;
                                InterfaceMgr.Instance.showAllVillagesScreen();
                                goto Label_0689;
                        }
                        break;
                    }
                    switch (num7)
                    {
                        case -14:
                        case 14:
                            this.GameDisplayMode = GameDisplays.DISPLAY_WORLD;
                            this.gfx.BGColor = WorldMap.SEACOLOR;
                            InterfaceMgr.Instance.initWorldTab_monkSelect();
                            goto Label_0689;

                        case -13:
                        case 13:
                            this.GameDisplayMode = GameDisplays.DISPLAY_WORLD;
                            this.gfx.BGColor = WorldMap.SEACOLOR;
                            InterfaceMgr.Instance.initWorldTab_vassalSelect();
                            goto Label_0689;

                        case -11:
                        case 11:
                            this.GameDisplayMode = GameDisplays.DISPLAY_WORLD;
                            this.gfx.BGColor = WorldMap.SEACOLOR;
                            InterfaceMgr.Instance.initWorldTab_courtierTargetSelect();
                            goto Label_0689;

                        case -7:
                        case 7:
                            this.GameDisplayMode = GameDisplays.DISPLAY_WORLD;
                            this.gfx.BGColor = WorldMap.SEACOLOR;
                            InterfaceMgr.Instance.initWorldTab_scoutTargetSelect();
                            goto Label_0689;

                        case -5:
                        case 5:
                            this.GameDisplayMode = GameDisplays.DISPLAY_WORLD;
                            this.gfx.BGColor = WorldMap.SEACOLOR;
                            InterfaceMgr.Instance.initWorldTab_attackTargetSelect();
                            goto Label_0689;

                        case -4:
                        case 4:
                            this.GameDisplayMode = GameDisplays.DISPLAY_WORLD;
                            this.gfx.BGColor = WorldMap.SEACOLOR;
                            InterfaceMgr.Instance.initWorldTab_stockExchangeSelect();
                            goto Label_0689;

                        case -3:
                        case 3:
                            this.GameDisplayMode = GameDisplays.DISPLAY_WORLD;
                            this.gfx.BGColor = WorldMap.SEACOLOR;
                            InterfaceMgr.Instance.initWorldTab_tradingVillageSelect();
                            goto Label_0689;

                        case 1:
                        case 2:
                        case 6:
                            goto Label_0689;

                        case 10:
                            this.GameDisplayMode = GameDisplays.DISPLAY_AVATAR_EDITOR;
                            InterfaceMgr.bgdBlurEnabled = true;
                            InterfaceMgr.Instance.getTopRightMenu().showVillageTab(false);
                            InterfaceMgr.Instance.addMainWindow(this.m_firstDrawDummy, true);
                            this.m_firstDrawDummy = false;
                            InterfaceMgr.Instance.setVillageTabSubMode(10);
                            goto Label_0689;

                        case 0x15:
                            InterfaceMgr.bgdBlurEnabled = true;
                            if (InterfaceMgr.Instance.isMailDocked())
                            {
                                this.GameDisplayMode = GameDisplays.DISPLAY_MAIL;
                                InterfaceMgr.Instance.addMainWindow(this.m_firstDrawMail, true);
                                this.m_firstDrawMail = false;
                            }
                            InterfaceMgr.Instance.initMailSubTab(0);
                            goto Label_0689;

                        case 0x16:
                            InterfaceMgr.bgdBlurEnabled = true;
                            this.GameDisplayMode = GameDisplays.DISPLAY_LEADERBOARD;
                            InterfaceMgr.Instance.addMainWindow(this.m_firstDrawLeaderboard, true);
                            this.m_firstDrawLeaderboard = false;
                            InterfaceMgr.Instance.initReportsLeaderboard();
                            goto Label_0689;

                        case 50:
                            this.GameDisplayMode = GameDisplays.DISPLAY_VILLAGE;
                            this.gfx.BGColor = ARGBColors.Black;
                            InterfaceMgr.Instance.initVillageTabView();
                            goto Label_0689;
                    }
                    break;
                }
                default:
                    goto Label_0689;
            }
            InterfaceMgr.bgdBlurEnabled = true;
            InterfaceMgr.Instance.addMainWindow(this.m_firstDrawDummy, true);
            this.m_firstDrawDummy = false;
            Label_0689:
            InterfaceMgr.Instance.StartDrawing();
        }
Exemplo n.º 3
0
        public void villageTabChange(int tabID)
        {
            if ((this.lastVillageTabID != tabID) || (tabID == 9))
            {
                InterfaceMgr.Instance.StopDrawing();
                InterfaceMgr.Instance.getVillageTabBar().updateShownTabs();
                this.lastVillageTabID = tabID;
                if (tabID <= 1)
                {
                    InterfaceMgr.Instance.clearControls();
                }
                else
                {
                    InterfaceMgr.Instance.clearControls(false, false, true, true);
                }
                this.gameDisplayModeSubMode = GameDisplaySubModes.SUBMODE_DEFAULT;
                if (InterfaceMgr.Instance.getSelectedMenuVillage() != this.lastLoadedVillage)
                {
                    this.downloadCurrentVillage();
                }
                switch (tabID)
                {
                    case 0:
                    {
                        InterfaceMgr.bgdBlurEnabled = false;
                        this.GameDisplayMode = GameDisplays.DISPLAY_VILLAGE;
                        this.gfx.BGColor = ARGBColors.Black;
                        if (!this.skipVillageTab)
                        {
                            InterfaceMgr.Instance.initVillageTab();
                        }
                        VillageMap map = this.getVillage(InterfaceMgr.Instance.getSelectedMenuVillage());
                        if (map != null)
                        {
                            map.playEnvironmentalSounds();
                        }
                        this.skipVillageTab = false;
                        break;
                    }
                    case 1:
                        this.GameDisplayMode = GameDisplays.DISPLAY_CASTLE;
                        InterfaceMgr.bgdBlurEnabled = false;
                        StatTrackingClient.Instance().ActivateTrigger(2, null);
                        this.gfx.BGColor = ARGBColors.Black;
                        InterfaceMgr.Instance.initCastleTab();
                        this.World.handleQuestObjectiveHappening(0x2714);
                        break;

                    case 2:
                        this.GameDisplayMode = GameDisplays.DISPLAY_VILLAGE;
                        InterfaceMgr.Instance.initVillageTabTabBarsOnly();
                        if (InterfaceMgr.Instance.isSelectedVillageACapital())
                        {
                            InterfaceMgr.Instance.setVillageTabSubMode(0x3ed);
                            break;
                        }
                        InterfaceMgr.Instance.setVillageTabSubMode(5);
                        break;

                    case 3:
                        this.GameDisplayMode = GameDisplays.DISPLAY_VILLAGE;
                        InterfaceMgr.Instance.initVillageTabTabBarsOnly();
                        if (InterfaceMgr.Instance.isSelectedVillageACapital())
                        {
                            InterfaceMgr.Instance.setVillageTabSubMode(0x3eb);
                            break;
                        }
                        InterfaceMgr.Instance.setVillageTabSubMode(3);
                        break;

                    case 4:
                        this.GameDisplayMode = GameDisplays.DISPLAY_VILLAGE;
                        InterfaceMgr.Instance.initVillageTabTabBarsOnly();
                        if (InterfaceMgr.Instance.isSelectedVillageACapital())
                        {
                            InterfaceMgr.Instance.setVillageTabSubMode(0x3ec);
                            break;
                        }
                        InterfaceMgr.Instance.setVillageTabSubMode(4);
                        break;

                    case 5:
                        this.GameDisplayMode = GameDisplays.DISPLAY_VILLAGE;
                        InterfaceMgr.Instance.initVillageTabTabBarsOnly();
                        if (InterfaceMgr.Instance.isSelectedVillageACapital())
                        {
                            if (InterfaceMgr.Instance.isSelectedVillageAParishCapital())
                            {
                                InterfaceMgr.Instance.setVillageTabSubMode(0x3f0);
                            }
                            else if (InterfaceMgr.Instance.isSelectedVillageACountyCapital())
                            {
                                InterfaceMgr.Instance.setVillageTabSubMode(0x454);
                            }
                            else if (InterfaceMgr.Instance.isSelectedVillageAProvinceCapital())
                            {
                                InterfaceMgr.Instance.setVillageTabSubMode(0x4b8);
                            }
                            else if (InterfaceMgr.Instance.isSelectedVillageACountryCapital())
                            {
                                InterfaceMgr.Instance.setVillageTabSubMode(0x51c);
                            }
                            break;
                        }
                        InterfaceMgr.Instance.setVillageTabSubMode(0x12);
                        break;

                    case 6:
                        this.GameDisplayMode = GameDisplays.DISPLAY_VILLAGE;
                        InterfaceMgr.Instance.initVillageTabTabBarsOnly();
                        if (InterfaceMgr.Instance.isSelectedVillageACapital())
                        {
                            if (InterfaceMgr.Instance.isSelectedVillageAParishCapital())
                            {
                                InterfaceMgr.Instance.setVillageTabSubMode(0x3ee);
                            }
                            else if (InterfaceMgr.Instance.isSelectedVillageACountyCapital())
                            {
                                InterfaceMgr.Instance.setVillageTabSubMode(0x452);
                            }
                            else if (InterfaceMgr.Instance.isSelectedVillageAProvinceCapital())
                            {
                                InterfaceMgr.Instance.setVillageTabSubMode(0x4b6);
                            }
                            else if (InterfaceMgr.Instance.isSelectedVillageACountryCapital())
                            {
                                InterfaceMgr.Instance.setVillageTabSubMode(0x51a);
                            }
                            break;
                        }
                        InterfaceMgr.Instance.setVillageTabSubMode(1);
                        break;

                    case 7:
                        this.GameDisplayMode = GameDisplays.DISPLAY_VILLAGE;
                        InterfaceMgr.Instance.initVillageTabTabBarsOnly();
                        if (InterfaceMgr.Instance.isSelectedVillageACapital())
                        {
                            if (InterfaceMgr.Instance.isSelectedVillageAParishCapital())
                            {
                                InterfaceMgr.Instance.setVillageTabSubMode(0x3ef);
                            }
                            else if (InterfaceMgr.Instance.isSelectedVillageACountyCapital())
                            {
                                InterfaceMgr.Instance.setVillageTabSubMode(0x453);
                            }
                            else if (InterfaceMgr.Instance.isSelectedVillageAProvinceCapital())
                            {
                                InterfaceMgr.Instance.setVillageTabSubMode(0x4b7);
                            }
                            else if (InterfaceMgr.Instance.isSelectedVillageACountryCapital())
                            {
                                InterfaceMgr.Instance.setVillageTabSubMode(0x51b);
                            }
                            break;
                        }
                        InterfaceMgr.Instance.setVillageTabSubMode(8);
                        break;

                    case 8:
                        InterfaceMgr.Instance.initVillageTabTabBarsOnly();
                        break;
                }
                InterfaceMgr.Instance.StartDrawing();
            }
        }
Exemplo n.º 4
0
 public void InitCastleView(byte[] compressedCastleMap, byte[] compressedDefenderMap, int keepType, int campMode, int defencesResearch, int villageID, int landType)
 {
     InterfaceMgr.Instance.clearControls();
     this.castle_Battle = new CastleMap(-1, this.gfx, 3);
     this.castle_Battle.castleShown(false);
     this.castle_Battle.reInitGFX();
     this.castle_Battle.setCampMode(campMode);
     this.castle_Battle.clearTempAttackers();
     CastleResearchData defenderResearchData = new CastleResearchData {
         defences = defencesResearch
     };
     this.castle_Battle.launchBattle(compressedCastleMap, null, compressedDefenderMap, null, keepType, defenderResearchData, new CastleResearchData(), campMode, -1, -1, -1, landType, true, false);
     this.castle_Battle.returnToReports();
     this.castle_Battle.setRealBattleMode(false);
     this.GameDisplayMode = GameDisplays.DISPLAY_CASTLE;
     this.gameDisplayModeSubMode = GameDisplaySubModes.SUBMODE_BATTLE;
     this.gfx.BGColor = ARGBColors.Black;
     InterfaceMgr.Instance.initCastleBattleTab(false, villageID, false);
 }
Exemplo n.º 5
0
        public void InitCastleAttackSetup(byte[] castleMap, byte[] defenderMap, int keepLevel, int numPeasants, int numArchers, int numPikemen, int numSwordsmen, int numCatapults, int attackingVillage, int targetVillage, int attackType, int pillagePercent, int captainsCommand, int parentOfAttackingVillage, int numPeasantsInCastle, int numArchersInCastle, int numPikemenInCastle, int numSwordsmenInCastle, int targetUserID, string targetUserName, BattleHonourData honourData, int numCaptainsInCastle, int numCaptains, int landType, double capitalAttackRate)
        {
            try
            {
                InterfaceMgr.Instance.clearControls();
                if (this.castle_AttackerSetup == null)
                {
                    this.castle_AttackerSetup = new CastleMap(-1, this.gfx, 1);
                }
                this.castle_AttackerSetup.castleShown(false);
                this.castle_AttackerSetup.reInitGFX();
                int mode = 0;
                switch (this.World.getSpecial(targetVillage))
                {
                    case 3:
                        mode = 1;
                        break;

                    case 5:
                        mode = 2;
                        break;
                }
                this.castle_AttackerSetup.setCampMode(mode);
                this.castle_AttackerSetup.importDefenderSnapshot(castleMap, defenderMap, keepLevel, true, landType);
                this.castle_AttackerSetup.initRealSetup(attackingVillage, targetVillage, numPeasants, numArchers, numPikemen, numSwordsmen, numCatapults, attackType, pillagePercent, captainsCommand, parentOfAttackingVillage, numPeasantsInCastle, numArchersInCastle, numPikemenInCastle, numSwordsmenInCastle, targetUserID, targetUserName, honourData, numCaptainsInCastle, numCaptains, capitalAttackRate);
                this.GameDisplayMode = GameDisplays.DISPLAY_CASTLE;
                this.gameDisplayModeSubMode = GameDisplaySubModes.SUBMODE_CASTLE_ATTACKER_SETUP;
                this.gfx.BGColor = ARGBColors.Black;
                InterfaceMgr.Instance.initCastleAttackerSetupTab();
            }
            catch (Exception exception)
            {
                UniversalDebugLog.Log(string.Concat(new object[] {
                    exception.ToString(), " values = ", castleMap, defenderMap, keepLevel, numPeasants, numArchers, numPikemen, numSwordsmen, numCatapults, attackingVillage, targetVillage, attackType, pillagePercent, captainsCommand, parentOfAttackingVillage,
                    numPeasantsInCastle, numArchersInCastle
                 }));
            }
        }
Exemplo n.º 6
0
 public void InitCastleAttackSetup()
 {
     InterfaceMgr.Instance.clearControls();
     if (this.castle_AttackerSetup == null)
     {
         this.castle_AttackerSetup = new CastleMap(-1, this.gfx, 1);
     }
     this.castle_AttackerSetup.castleShown(false);
     this.castle_AttackerSetup.reInitGFX();
     if (this.castle == null)
     {
         this.castle_AttackerSetup.importDefenderSnapshot(null, null, 0, false, 0);
     }
     else
     {
         this.castle_AttackerSetup.importDefenderSnapshot(this.castle.generateCastleMapSnapshot(), this.castle.generateCastleTroopsSnapshot(), 0, false, 0);
     }
     this.castle_AttackerSetup.initFakeSetup();
     this.GameDisplayMode = GameDisplays.DISPLAY_CASTLE;
     this.gameDisplayModeSubMode = GameDisplaySubModes.SUBMODE_CASTLE_ATTACKER_SETUP;
     this.gfx.BGColor = ARGBColors.Black;
     InterfaceMgr.Instance.initCastleAttackerSetupTab();
 }
Exemplo n.º 7
0
 public void InitBattle(byte[] compressedCastleMap, byte[] compressedCastleDamageMap, byte[] compressedDefenderMap, byte[] compressedAttackerMap, int keepType, CastleResearchData defenderResearchData, CastleResearchData attackerResearchData, int campMode, int pillageInfo, int ransackCount, int raidCount, int attackType, int villageID, GetReport_ReturnType reportReturnData, int landType)
 {
     InterfaceMgr.Instance.clearControls();
     this.castle_Battle = new CastleMap(villageID, this.gfx, 3);
     this.castle_Battle.castleShown(false);
     this.castle_Battle.reInitGFX();
     this.castle_Battle.setCampMode(campMode);
     bool oldReport = false;
     if ((reportReturnData != null) && (reportReturnData.reportTime < CastlesCommon.PRE_FOREST_CHANGE_DATE))
     {
         oldReport = true;
     }
     this.castle_Battle.setReportData(reportReturnData);
     this.castle_Battle.launchBattle(compressedCastleMap, compressedCastleDamageMap, compressedDefenderMap, compressedAttackerMap, keepType, defenderResearchData, attackerResearchData, campMode, pillageInfo, ransackCount, raidCount, landType, false, oldReport);
     this.castle_Battle.returnToReports();
     this.GameDisplayMode = GameDisplays.DISPLAY_CASTLE;
     this.gameDisplayModeSubMode = GameDisplaySubModes.SUBMODE_BATTLE;
     this.gfx.BGColor = ARGBColors.Black;
     bool aIAttack = true;
     if (reportReturnData != null)
     {
         aIAttack = this.World.isSpecial(reportReturnData.attackingVillage);
     }
     InterfaceMgr.Instance.initCastleBattleTab(true, attackType, aIAttack);
 }
Exemplo n.º 8
0
        public void InitBattle(int keepType, int fakeDefensiveMode)
        {
            CastleResearchData defenderResearchData = new CastleResearchData();
            CastleResearchData attackerResearchData = new CastleResearchData();
            if (fakeDefensiveMode >= 0)
            {
                switch (fakeDefensiveMode)
                {
                    case 0:
                        defenderResearchData.catapult = 0;
                        defenderResearchData.conscription = 0;
                        defenderResearchData.longBow = 0;
                        defenderResearchData.pike = 0;
                        defenderResearchData.sword = 0;
                        keepType = 1;
                        break;

                    case 1:
                        defenderResearchData.defences = 4;
                        keepType = 3;
                        defenderResearchData.catapult = 2;
                        defenderResearchData.conscription = 2;
                        defenderResearchData.longBow = 2;
                        defenderResearchData.pike = 2;
                        defenderResearchData.sword = 2;
                        break;

                    case 2:
                        defenderResearchData.defences = 8;
                        defenderResearchData.sallyForth = 2;
                        keepType = 5;
                        defenderResearchData.catapult = 4;
                        defenderResearchData.conscription = 4;
                        defenderResearchData.longBow = 4;
                        defenderResearchData.pike = 4;
                        defenderResearchData.sword = 4;
                        break;

                    case 3:
                        defenderResearchData.defences = 10;
                        defenderResearchData.sallyForth = 4;
                        keepType = 10;
                        defenderResearchData.catapult = 6;
                        defenderResearchData.conscription = 6;
                        defenderResearchData.longBow = 6;
                        defenderResearchData.pike = 6;
                        defenderResearchData.sword = 6;
                        defenderResearchData.tunnel = 6;
                        break;
                }
            }
            attackerResearchData.defences = this.World.UserResearchData.Research_Defences;
            attackerResearchData.catapult = this.World.UserResearchData.Research_Catapult;
            attackerResearchData.sword = this.World.UserResearchData.Research_Sword;
            attackerResearchData.pike = this.World.UserResearchData.Research_Pike;
            attackerResearchData.longBow = this.World.UserResearchData.Research_LongBow;
            attackerResearchData.conscription = this.World.UserResearchData.Research_Conscription;
            attackerResearchData.sallyForth = this.World.UserResearchData.Research_SallyForth;
            attackerResearchData.vaults = this.World.UserResearchData.Research_Vaults;
            InterfaceMgr.Instance.clearControls();
            this.castle_Battle = new CastleMap(-1, this.gfx, 3);
            this.castle_Battle.castleShown(false);
            this.castle_Battle.reInitGFX();
            this.castle_Battle.setCampMode(0);
            if (keepType < 0)
            {
                keepType = 1;
            }
            this.castle_Battle.launchBattle(this.castle_AttackerSetup.generateCastleMapSnapshot(), null, this.castle_AttackerSetup.generateCastleTroopsSnapshot(), null, keepType, defenderResearchData, attackerResearchData, 0, -1, -1, -1, 0, false, false);
            this.GameDisplayMode = GameDisplays.DISPLAY_CASTLE;
            this.gameDisplayModeSubMode = GameDisplaySubModes.SUBMODE_BATTLE;
            this.gfx.BGColor = ARGBColors.Black;
            InterfaceMgr.Instance.initCastleBattleTab(true, -1, false);
        }