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); }
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); }
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); }