public bool Save() { Reach.CampaignSave saveData = _saveManager.SaveData; Reach.BipedObject selectedBiped = ((ComboBoxItem)cBBipeds.SelectedItem).Tag as Reach.BipedObject; if (selectedBiped != null) { saveData.Player.ChangeBiped(selectedBiped, (bool)cBWeapTransfer.IsChecked); } Reach.BipedObject playerBiped = saveData.Player.Biped; playerBiped.MakeInvincible((bool)checkInvincible.IsChecked); playerBiped.NoFallDamage = (bool)checkNoFallDamage.IsChecked; if (playerBiped.Vehicle != null) { playerBiped.Vehicle.MakeInvincible((bool)checkInvincible.IsChecked); playerBiped.Vehicle.NoFallDamage = (bool)checkNoFallDamage.IsChecked; } playerBiped.PhysicsEnabled = !(bool)checkNoPhysics.IsChecked; playerBiped.X = Convert.ToSingle(txtPlayerXCord.Text); playerBiped.Y = Convert.ToSingle(txtPlayerYCord.Text); playerBiped.Z = Convert.ToSingle(txtPlayerZCord.Text); return(true); }
public static void AllWeaponsMaxAmmo(Reach.CampaignSave saveData) { foreach (Reach.GameObject obj in saveData.Objects) { Reach.WeaponObject weapon = obj as Reach.WeaponObject; if (weapon != null) { weapon.Ammo = 32767; weapon.ClipAmmo = 32767; } } }
public static HashSet <Reach.BipedObject> FindSwappableBipeds(Reach.CampaignSave saveData) { Reach.BipedObject currentBiped = saveData.Player.Biped; HashSet <Reach.BipedObject> availableBipeds = new HashSet <Reach.BipedObject>(); foreach (Reach.GameObject obj in saveData.Objects) { if (obj != null && !obj.Deleted && obj.TagGroup == Reach.TagGroup.Bipd && obj.Zone == currentBiped.Zone && obj.IsActive) { availableBipeds.Add((Reach.BipedObject)obj); } } return(availableBipeds); }
public void Load() { loading = true; Reach.CampaignSave saveData = _saveManager.SaveData; Reach.BipedObject playerBiped = saveData.Player.Biped; checkInvincible.IsChecked = playerBiped.Health.IsInfinite; checkNoPhysics.IsEnabled = (playerBiped.Vehicle == null); checkNoPhysics.IsChecked = !playerBiped.PhysicsEnabled; checkNoFallDamage.IsChecked = playerBiped.NoFallDamage; txtPlayerXCord.Text = playerBiped.X.ToString(); txtPlayerYCord.Text = playerBiped.Y.ToString(); txtPlayerZCord.Text = playerBiped.Z.ToString(); originalBipdItem = -1; cBWeapTransfer.IsEnabled = false; cBBipeds.Items.Clear(); HashSet <Reach.BipedObject> availableBipeds = Util.EditorSupport.FindSwappableBipeds(saveData); availableBipeds.Add(playerBiped); SortedDictionary <string, Reach.BipedObject> sortedBipeds = new SortedDictionary <string, Reach.BipedObject>(); foreach (Reach.BipedObject obj in availableBipeds) { sortedBipeds[_taglistManager.Identify(obj)] = obj; } foreach (KeyValuePair <string, Reach.BipedObject> obj in sortedBipeds) { ComboBoxItem item = new ComboBoxItem(); item.Content = obj.Key; item.Tag = obj.Value; cBBipeds.Items.Add(item); if (obj.Value == playerBiped) { originalBipdItem = cBBipeds.Items.Count - 1; cBBipeds.SelectedIndex = originalBipdItem; } } cBBipeds.IsEnabled = true; loading = false; }
public static string GetMissionName(Reach.CampaignSave saveData) { switch (saveData.Map) { case @"levels\solo\m05\m05": return("Noble Actual"); case @"levels\solo\m10\m10": return("Winter Contingency"); case @"levels\solo\m20\m20": return("ONI: Sword Base"); case @"levels\solo\m30\m30": return("Nightfall"); case @"levels\solo\m35\m35": return("Tip of the Spear"); case @"levels\solo\m45\m45": return("Long Night of Solace"); case @"levels\solo\m50\m50": return("Exodus"); case @"levels\solo\m52\m52": return("New Alexandria"); case @"levels\solo\m60\m60": return("The Package"); case @"levels\solo\m70\m70": return("The Pillar of Autumn"); case @"levels\solo\m70_a\m70_a": return("Credits"); case @"levels\solo\m70_bonus\m70_bonus": return("Lone Wolf"); default: return(saveData.Map.Substring(saveData.Map.LastIndexOf('\\') + 1).ToLower()); } }
/// <summary> /// Returns a UIElement/Util.IAmmoDisplay that can be used to accurately display the weapon's ammo. /// </summary> /// <param name="saveData">The save data to read from</param> /// <param name="weapon">The weapon object to display</param> /// <param name="name">The name of the weapon</param> /// <returns>A UIElement/Util.IAmmoDisplay corresponding to the weapon</returns> public static UIElement GetAmmoDisplay(Reach.CampaignSave saveData, Reach.WeaponObject weapon, string name) { name = name.ToLower(); UIElement display; if (name.Contains("plasma") || name.Contains("energy") || name.Contains("laser") || name.Contains("focus")) { display = new plasmaAmmoDisplay(weapon); } else if (name.Contains("target") || name.Contains("locator")) { display = new targetLocatorDisplay(saveData); } else { display = new regularAmmoDisplay(weapon); } return(display); }
public void Load() { Reach.CampaignSave saveData = _saveManager.SaveData; lblGamertag.Content = saveData.Gamertag; lblServiceTag.Content = saveData.ServiceTag; lblMapName.Text = Util.EditorSupport.GetMissionName(saveData) + " - " + saveData.Map; lblDifficulty.Content = saveData.Difficulty.ToString(); // Try to load the mission image try { string mapName = saveData.Map; mapName = mapName.Substring(mapName.LastIndexOf('\\') + 1); var source = new Uri(@"/Liberty;component/Images/reachMaps/" + mapName + ".jpg", UriKind.Relative); imgMapImage.Source = new BitmapImage(source); int diff = (int)saveData.Difficulty + 1; source = new Uri(@"/Liberty;component/Images/Difficulty/Blam_Default/" + diff.ToString() + ".png", UriKind.Relative); imgDifficulty.Source = new BitmapImage(source); } catch { } }
public listcordWindow(Reach.CampaignSave _reach, Reach.TagGroup group, Reach.TagListManager _reachTaglist) { this.InitializeComponent(); lblTitle.Text = "COPY COORDINATES"; lblSubInfo.Text = "Select an object to copy coordinates from"; GID = 4; foreach (Reach.GameObject obj in _reach.Objects) { if (obj != null && obj.TagGroup == group) { ListBoxItem lbi = new ListBoxItem(); string posData = " -- [X: {0} - Y: {1} - Z: {2}]"; lbi.Content = _reachTaglist.Identify(obj) + string.Format(posData, obj.X.ToString(), obj.Y.ToString(), obj.Z.ToString()); lbi.Tag = obj; listObjects.Items.Add(lbi); } } }
private void BuildWeaponLists() { _freeWeapons.Clear(); _weaponIndices.Clear(); foreach (ComboBox box in _weaponBoxes) { box.Items.Clear(); ComboBoxItem emptyItem = new ComboBoxItem(); emptyItem.Content = "(nothing)"; box.Items.Add(emptyItem); } // Sort the weapons by name into a set Reach.CampaignSave saveData = _saveManager.SaveData; Reach.BipedObject playerBiped = saveData.Player.Biped; SortedSet <WeaponItem> weapons = new SortedSet <WeaponItem>(); foreach (Reach.GameObject obj in saveData.Objects) { // Only process non-null weapons that aren't deleted, aren't carried by a vehicle, or that are carried by the player if (obj != null && obj.TagGroup == Reach.TagGroup.Weap && !obj.Deleted && (obj.Carrier == null || obj.Carrier.TagGroup != Reach.TagGroup.Vehi || obj.Carrier == playerBiped)) { string name = _tagList.Identify(obj); if (name.StartsWith("Spartan") || name == "Knife" || name == "Knife Sheath") { continue; } weapons.Add(new WeaponItem() { Name = name, Object = (Reach.WeaponObject)obj }); } } // Now add them to the combo boxes foreach (WeaponItem weapon in weapons) { // Grab the free indices set for the combo box SortedSet <int> freeIndices; if (!_freeWeapons.TryGetValue(weapon.Object.MapID, out freeIndices)) { freeIndices = new SortedSet <int>(); _freeWeapons[weapon.Object.MapID] = freeIndices; } // Mark the weapon as unused int index = _weaponBoxes[0].Items.Count; freeIndices.Add(index); weapon.Index = index; _weaponIndices[weapon.Object] = index; // Add it to each combo box foreach (ComboBox box in _weaponBoxes) { ComboBoxItem item = new ComboBoxItem(); item.Content = weapon.Name; item.Tag = weapon; if (freeIndices.Count > 1) { item.Visibility = Visibility.Collapsed; } box.Items.Add(item); } } }