public static void Prefix(ref TroopRoster rightMemberRoster) { if (Settings.Instance.Enabled && Settings.Instance.ApplyInventoryPatch && rightMemberRoster.Contains(Hero.MainHero.CharacterObject)) { //TroopRoster newRoster = new TroopRoster(); TroopRoster newRoster = TroopRoster.CreateDummyTroopRoster(); newRoster.Add(rightMemberRoster); PatchInventoryDefaults.DefaultCharacterEquipments.Clear(); foreach (Hero hero in Clan.PlayerClan.Heroes) { if (hero.IsAlive && !hero.IsChild && hero != Hero.MainHero && !newRoster.Contains(hero.CharacterObject)) { newRoster.AddToCounts(hero.CharacterObject, 1); PatchInventoryDefaults.SetDefault(hero.CharacterObject); } } foreach (Hero hero in Clan.PlayerClan.Companions) { if (hero.IsAlive && hero.IsPlayerCompanion && !newRoster.Contains(hero.CharacterObject)) { newRoster.AddToCounts(hero.CharacterObject, 1); PatchInventoryDefaults.SetDefault(hero.CharacterObject); } } rightMemberRoster = newRoster; } }
private void DealPatyTroop(TroopRoster battleTroopRoster) { TroopRoster troopRosters = MobileParty.MainParty.MemberRoster; ICollection <TroopRosterElement> needMoveTroop = troopRosters.RemoveIf(obj => !battleTroopRoster.Contains(obj.Character)); foreach (TroopRosterElement element in needMoveTroop) { if (element.Character.IsHero) { this._tempMobile.MemberRoster.AddToCounts(element.Character, 1); } else { this._tempMobile.MemberRoster.AddToCounts(element.Character, element.Number); } } }