public void Assimilate(TargetingOptions fallback, TargetType typeFlags, TargetingFlags optFlags, float range, Vector3D targetGolis, long targetEntityId, string[] blocksToTarget) { this.CanTarget = typeFlags | fallback.CanTarget; this.Flags = optFlags | fallback.Flags; this.TargetingRange = Math.Max(range, fallback.TargetingRange); this.TargetGolis = targetGolis.IsValid() ? targetGolis : fallback.TargetGolis; this.TargetEntityId = targetEntityId > 0L ? targetEntityId : fallback.TargetEntityId; this.blocksToTarget = blocksToTarget ?? fallback.blocksToTarget; }
public MagicRecordForm(MagicRecord magicRecord, NameTable nameTable) { this.magicRecord = magicRecord; InitializeComponent(); IDBox.Minimum = short.MinValue; IDBox.Maximum = short.MaxValue; IDBox.Value = magicRecord.ID; IDBox.Enabled = false; if (magicRecord.OwnerIDString != null) { Dictionary <short, string> ownerIDMap = nameTable.PLAYABLE_OWNER_ID_STRING_PAIRS; OwnerBox.DataSource = new BindingSource(ownerIDMap, null); OwnerBox.DisplayMember = "Value"; OwnerBox.ValueMember = "Key"; OwnerBox.SelectedItem = new KeyValuePair <short, string>(magicRecord.OwnerID, magicRecord.OwnerIDString); } else { OwnerBox.Enabled = false; } targetingFlags = new TargetingFlags(magicRecord.TargetingType); targetingFlags.LoadFlagsIntoUI(TargetingFlagsGroupBox, Provide1stLineBox); ActionIntentBox.DataSource = Enum.GetValues(typeof(ActionIntentType)); ActionIntentBox.SelectedItem = magicRecord.ActionIntent; ElementBox.DataSource = Enum.GetValues(typeof(ElementType)); ElementBox.SelectedItem = magicRecord.Element; CastTimeBox.Minimum = byte.MinValue; CastTimeBox.Maximum = byte.MaxValue; CastTimeBox.Value = magicRecord.CastTime; DelayBox.Minimum = byte.MinValue; DelayBox.Maximum = byte.MaxValue; DelayBox.Value = magicRecord.Delay; CostBox.Minimum = short.MinValue; CostBox.Maximum = short.MaxValue; CostBox.Value = magicRecord.Cost; LevelUnlockedBox.Minimum = byte.MinValue; LevelUnlockedBox.Maximum = byte.MaxValue; LevelUnlockedBox.Value = magicRecord.LevelUnlocked; MenuSortOrderBox.Minimum = short.MinValue; MenuSortOrderBox.Maximum = short.MaxValue; MenuSortOrderBox.Value = magicRecord.MenuSortOrder; UnbalanceBox.Minimum = byte.MinValue; UnbalanceBox.Maximum = byte.MaxValue; UnbalanceBox.Value = magicRecord.Unbalance; BreakDamageBox.Minimum = short.MinValue; BreakDamageBox.Maximum = short.MaxValue; BreakDamageBox.Value = (short)magicRecord.BreakDamage; BraveOrderTurnLengthBox.Minimum = short.MinValue; BraveOrderTurnLengthBox.Maximum = short.MaxValue; if (magicRecord.MagicboRecord != null) { BraveOrderTurnLengthBox.Value = magicRecord.MagicboRecord.BraveOrderTurnLength; } else { BraveOrderTurnLengthBox.Enabled = false; } SelectionTypeBox.DataSource = Enum.GetValues(typeof(TargetSelectionType)); SelectionTypeBox.SelectedItem = magicRecord.SelectionType; MaxRangeRadiusBox.Value = (decimal)magicRecord.MaxRangeRadius; SelectionRadiusBox.Minimum = byte.MinValue; SelectionRadiusBox.Maximum = byte.MaxValue; SelectionRadiusBox.Value = magicRecord.SelectionRadius; Description1stLineBox.Text = magicRecord.Description1stLine; Description2ndLineBox.Text = magicRecord.Description2ndLine; NameBox.Text = magicRecord.Name; AnimationNameBox.Text = magicRecord.AnimationName; }
public bool FlagSet(TargetingFlags flag) { return (Flags & flag) != 0; }
public bool FlagSet(TargetingFlags flag) { return((Flags & flag) != 0); }
public void Assimilate(TargetingOptions fallback, TargetType typeFlags, TargetingFlags optFlags, float range, Vector3D? targetGolis, long? targetEntityId, string[] blocksToTarget) { this.CanTarget = typeFlags | fallback.CanTarget; this.Flags = optFlags | fallback.Flags; this.TargetingRange = Math.Max(range, fallback.TargetingRange); this.TargetGolis = targetGolis ?? fallback.TargetGolis; this.TargetEntityId = targetEntityId ?? fallback.TargetEntityId; this.blocksToTarget = blocksToTarget ?? fallback.blocksToTarget; }