Esempio n. 1
0
 public static bool ShouldChargeToFormation(Agent agent)
 {
     return(agent.Formation != null && agent.Formation.MovementOrder.OrderType == OrderType.ChargeWithTarget &&
            CommandSystemConfig.Get().AttackSpecificFormation&&
            (QueryLibrary.IsCavalry(agent) ||
             QueryLibrary.IsRangedCavalry(agent) && agent.Formation.FiringOrder.OrderType == OrderType.HoldFire ||
             CommandSystemSubModule.EnableChargeToFormationForInfantry &&
             (QueryLibrary.IsInfantry(agent) || QueryLibrary.IsRanged(agent) && agent.Formation.FiringOrder.OrderType == OrderType.HoldFire)));
 }
Esempio n. 2
0
        public static bool GetSubstituteOrder_Prefix(MovementOrder __instance, ref MovementOrder __result,
                                                     Formation formation)
        {
            if (__instance.OrderType == OrderType.ChargeWithTarget && CommandSystemConfig.Get().AttackSpecificFormation)
            {
                var position = formation.QuerySystem.MedianPosition;
                position.SetVec2(formation.CurrentPosition);
                if (formation.Team == Mission.Current.PlayerTeam)
                {
                    Utility.DisplayFormationReadyMessage(formation);
                }
                __result = MovementOrder.MovementOrderMove(position);
                return(false);
            }

            return(true);
        }
Esempio n. 3
0
        public static void PrintOrderHint()
        {
            if (CommandSystemConfig.Get().ClickToSelectFormation)
            {
                MissionSharedLibrary.Utilities.Utility.DisplayMessage(GameTexts
                                                                      .FindText("str_rts_camera_command_system_click_to_select_formation_hint").SetTextVariable("KeyName",
                                                                                                                                                                MissionSharedLibrary.Utilities.Utility.TextForKey(CommandSystemGameKeyCategory.GetKey(GameKeyEnum.SelectFormation)))
                                                                      .ToString());
            }

            if (CommandSystemConfig.Get().AttackSpecificFormation)
            {
                MissionSharedLibrary.Utilities.Utility.DisplayMessage(GameTexts
                                                                      .FindText("str_rts_camera_command_system_attack_specific_formation_hint").SetTextVariable("KeyName",
                                                                                                                                                                MissionSharedLibrary.Utilities.Utility.TextForKey(CommandSystemGameKeyCategory.GetKey(GameKeyEnum.SelectFormation)))
                                                                      .ToString());
            }
        }
        public override void OnCreated(MissionView entranceView)
        {
            var config = CommandSystemConfig.Get();

            if (config.AttackSpecificFormation)
            {
                PatchChargeToFormation.Patch();
            }
            List <MissionBehaviour> list = new List <MissionBehaviour>
            {
                new CommandSystemLogic(),
                new CommandSystemOrderTroopPlacer(),
                new DragWhenCommandView()
            };

            foreach (var missionBehaviour in list)
            {
                MissionStartingManager.AddMissionBehaviour(entranceView, missionBehaviour);
            }
        }
Esempio n. 5
0
 public static bool ShouldHighlightWithOutline(this CommandSystemConfig config)
 {
     return(config.ClickToSelectFormation || config.AttackSpecificFormation);
 }