Exemplo n.º 1
0
 public static void MissionNameMarkerTargetVMConstructorPostfix(MissionNameMarkerTargetVM __instance, Agent agent)
 {
     if (MissionHelpers.InSiegeMission() || MissionHelpers.InFieldBattleMission() || MissionHelpers.InHideOutMission())
     {
         if (Agent.Main != null && agent.IsEnemyOf(Agent.Main) || agent.Team.IsEnemyOf(Mission.Current.PlayerTeam))
         {
             __instance.MarkerType = 2;
         }
         else if (Agent.Main != null && agent.IsFriendOf(Agent.Main) || agent.Team.IsFriendOf(Mission.Current.PlayerTeam))
         {
             __instance.MarkerType = 0;
         }
     }
 }
Exemplo n.º 2
0
        public override void OnMissionBehaviourInitialize(Mission mission)
        {
            try
            {
                // Add the marker overlay for appropriate mission types
                if (mission.GetMissionBehaviour <MissionNameMarkerUIHandler>() == null &&
                    (MissionHelpers.InSiegeMission() ||
                     MissionHelpers.InFieldBattleMission() ||
                     Mission.Current?.GetMissionBehaviour <TournamentFightMissionController>() != null))
                {
                    mission.AddMissionBehaviour(SandBoxViewCreator.CreateMissionNameMarkerUIHandler(mission));
                }

                mission.AddMissionBehaviour(new BLTAdoptAHeroCommonMissionBehavior());
                mission.AddMissionBehaviour(new BLTAdoptAHeroCustomMissionBehavior());
                mission.AddMissionBehaviour(new BLTSummonBehavior());
                mission.AddMissionBehaviour(new BLTRemoveAgentsBehavior());
                mission.AddMissionBehaviour(new BLTHeroPowersMissionBehavior());
            }
            catch (Exception e)
            {
                Log.Exception(nameof(OnMissionBehaviourInitialize), e);
            }
        }