public static Mission OpenBattleJustHero(string scene, string upgradeLevel) { MissionInitializerRecord record = new MissionInitializerRecord(scene) { PlayingInCampaignMode = Campaign.Current.GameMode == CampaignGameMode.Campaign, AtmosphereOnCampaign = (Campaign.Current.GameMode == CampaignGameMode.Campaign) ? Campaign.Current.Models.MapWeatherModel.GetAtmosphereModel(CampaignTime.Now, MobileParty.MainParty.GetLogicalPosition()) : null, SceneLevels = upgradeLevel }; MissionAgentSpawnLogic lc2 = new MissionAgentSpawnLogic(new IMissionTroopSupplier[] { new PartyGroupTroopSupplier(MapEvent.PlayerMapEvent, BattleSideEnum.Defender, null), new PartyGroupTroopSupplier(MapEvent.PlayerMapEvent, BattleSideEnum.Attacker, null) }, PartyBase.MainParty.Side); bool isPlayerSergeant = MobileParty.MainParty.MapEvent.IsPlayerSergeant(); bool isPlayerInArmy = MobileParty.MainParty.Army != null; List <string> heroesOnPlayerSideByPriority = HeroHelper.OrderHeroesOnPlayerSideByPriority(); return(MissionState.OpenNew("Battle", record, delegate(Mission mission) { List <MissionBehaviour> list = new List <MissionBehaviour>(); list.Add(new MissionOptionsComponent()); list.Add(new CampaignMissionComponent()); list.Add(new BattleEndLogic()); list.Add(new MissionCombatantsLogic(MobileParty.MainParty.MapEvent.InvolvedParties, PartyBase.MainParty, MobileParty.MainParty.MapEvent.GetLeaderParty(BattleSideEnum.Defender), MobileParty.MainParty.MapEvent.GetLeaderParty(BattleSideEnum.Attacker), Mission.MissionTeamAITypeEnum.FieldBattle, isPlayerSergeant)); list.Add(new BattleMissionStarterLogic()); //list.Add(new MissionDefaultCaptainAssignmentLogic()); list.Add(new BattleSpawnLogic("battle_set")); list.Add(new MissionAgentPanicHandler()); list.Add(new AgentBattleAILogic()); list.Add(new BattleObserverMissionLogic()); list.Add(lc2); list.Add(new MissionFightHandler()); list.Add(new AgentFadeOutLogic()); list.Add(new BattleAgentLogic()); list.Add(new AgentVictoryLogic()); list.Add(new MissionDebugHandler()); list.Add(new MissionHardBorderPlacer()); list.Add(new MissionBoundaryPlacer()); list.Add(new MissionBoundaryCrossingHandler()); list.Add(new BattleMissionAgentInteractionLogic()); list.Add(new HighlightsController()); list.Add(new BattleHighlightsController()); list.Add(new BattleHeroJustTroopSpawnHandler()); list.Add(new FieldBattleController()); //list.Add(new AgentMoraleInteractionLogic()); //list.Add(new AssignPlayerRoleInTeamMissionController(!isPlayerSergeant, isPlayerSergeant, isPlayerInArmy, heroesOnPlayerSideByPriority, FormationClass.NumberOfRegularFormations)); //int arg_190_1 = 25; Hero expr_152 = MapEvent.PlayerMapEvent.AttackerSide.LeaderParty.LeaderHero; string arg_18B_0 = (expr_152 != null) ? expr_152.Name.ToString() : null; Hero expr_177 = MapEvent.PlayerMapEvent.DefenderSide.LeaderParty.LeaderHero; list.Add(new CreateBodyguardMissionBehavior(arg_18B_0, (expr_177 != null) ? expr_177.Name.ToString() : null, null, null, true)); return list.ToArray(); }, true, true)); }
public static Mission OpenBattleNormal(string scene, string sceneLevels) { MissionAgentSpawnLogic lc = new MissionAgentSpawnLogic(new IMissionTroopSupplier[] { new PartyGroupTroopSupplier(MapEvent.PlayerMapEvent, BattleSideEnum.Defender, null), new PartyGroupTroopSupplier(MapEvent.PlayerMapEvent, BattleSideEnum.Attacker, null) }, PartyBase.MainParty.Side); bool isPlayerSergeant = MobileParty.MainParty.MapEvent.IsPlayerSergeant(); bool isPlayerInArmy = MobileParty.MainParty.Army != null; List <string> heroesOnPlayerSideByPriority = HeroHelper.OrderHeroesOnPlayerSideByPriority(); return(MissionState.OpenNew("Battle", SandBoxMissions.CreateSandBoxMissionInitializerRecord(scene, sceneLevels, false), delegate(Mission mission) { MissionBehaviour[] expr_07 = new MissionBehaviour[26]; expr_07[0] = new MissionOptionsComponent(); expr_07[1] = new CampaignMissionComponent(); expr_07[2] = new BattleEndLogic(); expr_07[3] = new MissionCombatantsLogic(MobileParty.MainParty.MapEvent.InvolvedParties, PartyBase.MainParty, MobileParty.MainParty.MapEvent.GetLeaderParty(BattleSideEnum.Defender), MobileParty.MainParty.MapEvent.GetLeaderParty(BattleSideEnum.Attacker), Mission.MissionTeamAITypeEnum.FieldBattle, isPlayerSergeant); expr_07[4] = new MissionDefaultCaptainAssignmentLogic(); expr_07[5] = new BattleMissionStarterLogic(); expr_07[6] = new BattleSpawnLogic("battle_set"); expr_07[7] = new AgentBattleAILogic(); expr_07[8] = lc; expr_07[9] = new BaseMissionTroopSpawnHandler(); expr_07[10] = new AgentFadeOutLogic(); expr_07[11] = new BattleObserverMissionLogic(); expr_07[12] = new BattleAgentLogic(); expr_07[13] = new AgentVictoryLogic(); expr_07[14] = new MissionDebugHandler(); expr_07[15] = new MissionAgentPanicHandler(); expr_07[16] = new MissionHardBorderPlacer(); expr_07[17] = new MissionBoundaryPlacer(); expr_07[18] = new MissionBoundaryCrossingHandler(); expr_07[19] = new BattleMissionAgentInteractionLogic(); expr_07[20] = new FieldBattleController(); expr_07[21] = new AgentMoraleInteractionLogic(); expr_07[22] = new HighlightsController(); expr_07[23] = new BattleHighlightsController(); expr_07[24] = new AssignPlayerRoleInTeamMissionController(!isPlayerSergeant, isPlayerSergeant, isPlayerInArmy, heroesOnPlayerSideByPriority, FormationClass.NumberOfRegularFormations); int arg_190_1 = 25; Hero expr_152 = MapEvent.PlayerMapEvent.AttackerSide.LeaderParty.LeaderHero; string arg_18B_0 = (expr_152 != null) ? expr_152.Name.ToString() : null; Hero expr_177 = MapEvent.PlayerMapEvent.DefenderSide.LeaderParty.LeaderHero; expr_07[arg_190_1] = new CreateBodyguardMissionBehavior(arg_18B_0, (expr_177 != null) ? expr_177.Name.ToString() : null, null, null, true); return expr_07; }, true, true)); }
public static Mission OpenCustomBattleMission(string scene, int PlayerTroopLimit, int AITroopLimit) { bool isPlayerSergeant = MobileParty.MainParty.MapEvent.IsPlayerSergeant(); bool isPlayerInArmy = MobileParty.MainParty.Army != null; List <string> heroesOnPlayerSideByPriority = HeroHelper.OrderHeroesOnPlayerSideByPriority(); return(MissionState.OpenNew("Battle", SandBoxMissions.CreateSandBoxMissionInitializerRecord(scene), (InitializeMissionBehvaioursDelegate)(mission => (IEnumerable <MissionBehaviour>) new MissionBehaviour[26] { (MissionBehaviour) new MissionOptionsComponent(), (MissionBehaviour) new CampaignMissionComponent(), (MissionBehaviour) new BattleEndLogic(), (MissionBehaviour) new MissionCombatantsLogic((IEnumerable <IBattleCombatant>)MobileParty.MainParty.MapEvent.InvolvedParties, (IBattleCombatant)PartyBase.MainParty, (IBattleCombatant)MobileParty.MainParty.MapEvent.GetLeaderParty(BattleSideEnum.Defender), (IBattleCombatant)MobileParty.MainParty.MapEvent.GetLeaderParty(BattleSideEnum.Attacker), Mission.MissionTeamAITypeEnum.FieldBattle, false), (MissionBehaviour) new MissionDefaultCaptainAssignmentLogic(), (MissionBehaviour) new BattleMissionStarterLogic(), (MissionBehaviour) new BattleSpawnLogic("battle_set"), (MissionBehaviour) new AgentBattleAILogic(), (MissionBehaviour) new MissionAgentSpawnLogic(new IMissionTroopSupplier[2] { (IMissionTroopSupplier) new PartyGroupTroopSupplier(MapEvent.PlayerMapEvent, BattleSideEnum.Defender), (IMissionTroopSupplier) new PartyGroupTroopSupplier(MapEvent.PlayerMapEvent, BattleSideEnum.Attacker) }, PartyBase.MainParty.Side), (MissionBehaviour) new CustomMissionTroopSpawnHandler(PlayerTroopLimit, AITroopLimit, false), (MissionBehaviour) new AgentFadeOutLogic(), (MissionBehaviour) new BattleObserverMissionLogic(), (MissionBehaviour) new BattleAgentLogic(), (MissionBehaviour) new AgentVictoryLogic(), (MissionBehaviour) new MissionDebugHandler(), (MissionBehaviour) new MissionAgentPanicHandler(), (MissionBehaviour) new MissionHardBorderPlacer(), (MissionBehaviour) new MissionBoundaryPlacer(), (MissionBehaviour) new MissionBoundaryCrossingHandler(), (MissionBehaviour) new BattleMissionAgentInteractionLogic(), (MissionBehaviour) new FieldBattleController(), (MissionBehaviour) new AgentMoraleInteractionLogic(), (MissionBehaviour) new HighlightsController(), (MissionBehaviour) new BattleHighlightsController(), (MissionBehaviour) new AssignPlayerRoleInTeamMissionController(!isPlayerSergeant, isPlayerSergeant, isPlayerInArmy, heroesOnPlayerSideByPriority), (MissionBehaviour) new CreateBodyguardMissionBehavior(MapEvent.PlayerMapEvent.AttackerSide.LeaderParty.LeaderHero?.Name.ToString(), MapEvent.PlayerMapEvent.DefenderSide.LeaderParty.LeaderHero?.Name.ToString()) }))); }