示例#1
0
 /// <summary>Initializes a blank Goal</summary>
 /// <remarks>All <see cref="Triggers"/> set to <b>"never (FALSE)"</b>, <see cref="AndOr"/> values set to <b>true</b> (OR)</remarks>
 public Goal()
 {
     for (int i = 0; i < 12; i++) _strings[i / 3, i % 3] = "";
     for (int i = 0; i < 4; i++) { _triggers[i] = new Mission.Trigger(); _triggers[i].Condition = 10; }
     for (int i = 0; i < 3; i++) _andOrs[i] = true;
     _triggerStrings = new StringsIndexer(this);
 }
示例#2
0
 /// <summary>Initializes a new FlightGroup</summary>
 /// <remarks>All <see cref="Orders"/> set to <b>100%</b> <see cref="BaseFlightGroup.BaseOrder.Throttle"/> (16 total, 4 per Region), <see cref="Goals"/> set to <b>NONE</b>, SP1 <b>Enabled</b>, most <see cref="Unknowns"/> <b>0/false</b>, <see cref="UnknownValues.Unknown1"/> to <b>2</b></remarks>
 public FlightGroup()
 {
     for (int i = 0; i < 6; i++)
     {
         _arrDepTriggers[i] = new Mission.Trigger();
     }
     for (int i = 0; i < 4; i++)
     {
         _waypoints[i] = new Waypoint();
     }
     for (int i = 0; i < 16; i++)
     {
         _orders[i / 4, i % 4] = new Order();
     }
     for (int i = 0; i < 8; i++)
     {
         _goals[i] = new Goal();
     }
     _optLoadout[0]        = true;
     _optLoadout[9]        = true;
     _optLoadout[13]       = true;
     _waypoints[0].Enabled = true;
     Unknowns.Unknown1     = 2;
     _loadoutIndexer       = new LoadoutIndexer(_optLoadout);
 }
示例#3
0
 /// <summary>Initializes a new FlightGroup</summary>
 /// <remarks>All <see cref="Orders"/> set to <b>100%</b> <see cref="BaseFlightGroup.BaseOrder.Throttle"/> (16 total, 4 per Region), <see cref="Goals"/> set to <b>NONE</b>, SP1 <b>Enabled</b>, most <see cref="Unknowns"/> <b>0/false</b>, <see cref="UnknownValues.Unknown1"/> to <b>2</b></remarks>
 public FlightGroup()
 {
     for (int i = 0; i < 6; i++)
     {
         ArrDepTriggers[i] = new Mission.Trigger();
     }
     for (int i = 0; i < 4; i++)
     {
         Waypoints[i] = new Waypoint();
     }
     for (int i = 0; i < 16; i++)
     {
         Orders[i / 4, i % 4] = new Order();
     }
     for (int i = 0; i < 8; i++)
     {
         Goals[i] = new Goal();
     }
     _optLoadout[0]       = true;
     _optLoadout[9]       = true; //[JB] Adjusted these indexes for added Energy Beam, Cluster Mine
     _optLoadout[14]      = true;
     Waypoints[0].Enabled = true;
     Unknowns.Unknown1    = 2;
     OptLoadout           = new LoadoutIndexer(_optLoadout);
     EnableDesignation1   = 255; //[JB] Set to disabled
     EnableDesignation2   = 255;
 }
示例#4
0
 /// <summary>Creates a new Message object</summary>
 /// <remarks>Sent to Team 1 by default</remarks>
 public Message()
 {
     for (int i = 0; i < 6; i++)
     {
         Triggers[i] = new Mission.Trigger();
     }
     SentTo[0] = true;
 }
示例#5
0
 /// <summary>Creates a new Message object</summary>
 /// <remarks>Sent to Team 1 by default</remarks>
 public Message()
 {
     _lengthLimit = 0x44;
     for (int i = 0; i < 6; i++)
     {
         Triggers[i] = new Mission.Trigger();
     }
     SentTo[0] = true;
 }
示例#6
0
 void initialize()
 {
     for (int i = 0; i < 8; i++)
     {
         _waypoints[i] = new Waypoint();
     }
     _skipTriggers[0]           = new Mission.Trigger();
     _skipTriggers[1]           = new Mission.Trigger();
     _skipTriggers[0].Condition = 10;
     _skipTriggers[1].Condition = 10;
     SkipT1AndOrT2 = true;
 }
示例#7
0
 void initialize()
 {
     for (int i = 0; i < 8; i++)
     {
         _waypoints[i] = new Waypoint();
     }
     _skipTriggers[0] = new Mission.Trigger();
     _skipTriggers[1] = new Mission.Trigger();
     //[JB] This modified code is redundant since everything is initialized to zero by default.
     //_skipTriggers[0].Condition = 0;  //[JB] For some reason these must be set to always(TRUE) for the orders to function properly in game, otherwise it will skip over orders and behave unexpectedly.
     //_skipTriggers[1].Condition = 0;
     SkipT1AndOrT2 = false;                  //[JB] Set to AND
 }
示例#8
0
 /// <summary>Initializes a new FlightGroup</summary>
 /// <remarks>All <see cref="Orders"/> set to <b>100%</b> <see cref="BaseFlightGroup.BaseOrder.Throttle"/> (16 total, 4 per Region), <see cref="Goals"/> set to <b>NONE</b>, SP1 <b>Enabled</b>, most <see cref="Unknowns"/> <b>0/false</b>, <see cref="UnknownValues.Unknown1"/> to <b>2</b></remarks>
 public FlightGroup()
 {
     for (int i = 0; i < 6; i++) _arrDepTriggers[i] = new Mission.Trigger();
     for (int i = 0; i < 4; i++) _waypoints[i] = new Waypoint();
     for (int i = 0; i < 16; i++) _orders[i / 4, i % 4] = new Order();
     for (int i = 0; i < 8; i++) _goals[i] = new Goal();
     _optLoadout[0] = true;
     _optLoadout[9] = true;
     _optLoadout[13] = true;
     _waypoints[0].Enabled = true;
     Unknowns.Unknown1 = 2;
     _loadoutIndexer = new LoadoutIndexer(_optLoadout);
 }
示例#9
0
 /// <summary>Initializes a blank Goal</summary>
 /// <remarks>All <see cref="Triggers"/> set to <b>"never (FALSE)"</b>, <see cref="AndOr"/> values set to <b>true</b> (OR)</remarks>
 public Goal()
 {
     for (int i = 0; i < 12; i++)
     {
         _strings[i / 3, i % 3] = "";
     }
     for (int i = 0; i < 4; i++)
     {
         _triggers[i] = new Mission.Trigger(); _triggers[i].Condition = 10;
     }
     for (int i = 0; i < 3; i++)
     {
         _andOrs[i] = true;
     }
     _triggerStrings = new StringsIndexer(this);
 }
示例#10
0
 /// <summary>Initializes a new Order from an existing Order.</summary>
 /// <param name="other">Existing Order to clone. If <b>null</b>, Order will be blank.</param>
 /// <remarks><see cref="BaseFlightGroup.BaseOrder.Throttle"/> set to <b>100%</b>, AndOr values set to <b>"Or"</b> if <paramref name="other"/> is <b>null</b>.</remarks>
 public Order(Order other) : this()
 {
     if (other != null)
     {
         Array.Copy(other._items, _items, _items.Length);
         _customText = other.CustomText;
         for (int i = 0; i < _waypoints.Length; i++)
         {
             _waypoints[i] = new Waypoint(other._waypoints[i]);
         }
         for (int i = 0; i < _skipTriggers.Length; i++)
         {
             _skipTriggers[i] = new Mission.Trigger(other._skipTriggers[i]);
         }
     }
 }
示例#11
0
        /// <summary>Changes all Message indexes, to be used during a Message Swap (Move) or Delete operation.</summary>
        /// <remarks>Same concept as for Flight Groups.  Triggers may depend on Message indexes, and this function helps ensure indexes are not broken.</remarks>
        /// <param name="srcIndex">The Message index to match and replace (Move), or match and Delete.</param>
        /// <param name="dstIndex">The Message index to replace with.  Specify -1 to Delete, or zero or above to Move.</param>
        /// <returns>True if something was changed.</returns>
        public bool TransformMessageReferences(int srcIndex, int dstIndex)
        {
            bool change = false;

            for (int i = 0; i < ArrDepTriggers.Length; i++)
            {
                Mission.Trigger adt = ArrDepTriggers[i];
                change |= adt.TransformMessageRef(srcIndex, dstIndex);
            }

            foreach (FlightGroup.Order order in Orders)
            {
                foreach (Mission.Trigger trig in order.SkipTriggers)
                {
                    change |= trig.TransformMessageRef(srcIndex, dstIndex);
                }
            }

            return(change);
        }
示例#12
0
 void initialize()
 {
     for (int i = 0; i < 8; i++) _waypoints[i] = new Waypoint();
     _skipTriggers[0] = new Mission.Trigger();
     _skipTriggers[1] = new Mission.Trigger();
     _skipTriggers[0].Condition = 10;
     _skipTriggers[1].Condition = 10;
     SkipT1AndOrT2 = true;
 }
示例#13
0
        /// <summary>Changes all Flight Group indexes, to be used during a FG Swap (Move) or Delete operation.</summary>
        /// <remarks>FG references may exist in other mission properties, ensure those properties are adjusted too.</remarks>
        /// <param name="srcIndex">The FG index to match and replace (Move), or match and Delete.</param>
        /// <param name="dstIndex">The FG index to replace with.  Specify -1 to Delete, or zero or above to Move.</param>
        /// <returns>True if something was changed.</returns>
        public bool TransformFGReferences(int srcIndex, int dstIndex)
        {
            bool change = false;
            bool delete = false;
            byte dst    = (byte)dstIndex;

            if (dstIndex < 0)
            {
                dst    = 0;
                delete = true;
            }

            //If the FG matches, replace (and delete if necessary).  Else if our index is higher and we're supposed to delete, decrement index.
            if (ArrivalCraft1 == srcIndex)
            {
                change = true; ArrivalCraft1 = dst; if (delete)
                {
                    ArrivalMethod1 = false;
                }
            }
            else if (ArrivalCraft1 > srcIndex && delete == true)
            {
                change = true; ArrivalCraft1--;
            }
            if (ArrivalCraft2 == srcIndex)
            {
                change = true; ArrivalCraft2 = dst; if (delete)
                {
                    ArrivalMethod2 = false;
                }
            }
            else if (ArrivalCraft2 > srcIndex && delete == true)
            {
                change = true; ArrivalCraft2--;
            }
            if (DepartureCraft1 == srcIndex)
            {
                change = true; DepartureCraft1 = dst; if (delete)
                {
                    DepartureMethod1 = false;
                }
            }
            else if (DepartureCraft1 > srcIndex && delete == true)
            {
                change = true; DepartureCraft1--;
            }
            if (DepartureCraft2 == srcIndex)
            {
                change = true; DepartureCraft2 = dst; if (delete)
                {
                    DepartureMethod2 = false;
                }
            }
            else if (DepartureCraft2 > srcIndex && delete == true)
            {
                change = true; DepartureCraft2--;
            }
            for (int i = 0; i < ArrDepTriggers.Length; i++)
            {
                Mission.Trigger adt = ArrDepTriggers[i];
                change |= adt.TransformFGReferences(srcIndex, dstIndex, true);  //First 2 are arrival.  Set those to true.
            }

            //Skip triggers are part of the Order in XWA, don't need to handle them here.

            foreach (FlightGroup.Order order in Orders)
            {
                change |= order.TransformFGReferences(srcIndex, dstIndex);
            }
            return(change);
        }
示例#14
0
 /// <summary>Creates a new Message object</summary>
 /// <remarks>Sent to Team 1 by default</remarks>
 public Message()
 {
     for (int i = 0; i < 6; i++) _triggers[i] = new Mission.Trigger();
     _sentTo[0] = true;
 }