Example #1
0
 public static void ReturnItems(UnitResult unit, ContractHelper contract)
 {
     foreach (var item in unit.mech.Inventory.Where(i => i.DamageLevel != ComponentDamageLevel.Destroyed && !unit.mech.IsLocationDestroyed(i.MountedLocation)))
     {
         contract.AddComponentToFinalSalvage(item.Def);
     }
 }
Example #2
0
        public static void ReturnItemsAndParts(UnitResult unit, ContractHelper contract)
        {
            foreach (var item in unit.mech.Inventory.Where(i => i.DamageLevel != ComponentDamageLevel.Destroyed && !unit.mech.IsLocationDestroyed(i.MountedLocation)))
            {
                contract.AddComponentToFinalSalvage(item.Def);
            }
            int num_parts = Control.GetNumParts(unit.mech);

            contract.AddMechPartsToFinalSalvage(UnityGameInstance.BattleTechGame.Simulation.Constants, unit.mech, num_parts);
        }