Пример #1
0
        static Test_RemoveItem()
        {
            ThingDef thingDef = ThingDef.Named("MeleeWeapon_Knife");
            ThingStuffPairWithQuality pair1 = new ThingStuffPairWithQuality
            {
                thing   = thingDef,
                stuff   = ThingDefOf.Plasteel,
                quality = QualityCategory.Legendary
            };

            ThingStuffPairWithQuality pair2 = new ThingStuffPairWithQuality
            {
                thing   = thingDef,
                stuff   = ThingDefOf.Steel,
                quality = QualityCategory.Good
            };

            ThingStuffPairWithQuality pair3 = new ThingStuffPairWithQuality
            {
                thing   = thingDef,
                stuff   = ThingDefOf.Steel,
                quality = QualityCategory.Legendary
            };

            Thing finemeal = ThingMaker.MakeThing(ThingDefOf.MealFine);

            finemeal.stackCount = 11;

            things.Add(pair1.MakeThing());
            things.Add(pair2.MakeThing());
            things.Add(pair3.MakeThing());
            things.Add(finemeal);

            foreach (Thing thing in things)
            {
                loadoutInstance.Add(thing, false);
            }
        }
Пример #2
0
        static Test_UpdateForNewLoadout()
        {
            _pawn         = PawnGenerator.GeneratePawn(PawnKindDefOf.Colonist);
            _pawn.outfits = new Pawn_OutfitTracker(_pawn);
            _pawn.apparel.DestroyAll();
            _pawn.equipment.DestroyAllEquipment();
            _pawn.inventory.DestroyAll();

            ThingDef knifeDef = ThingDef.Named("MeleeWeapon_Knife");
            ThingDef shirtDef = ThingDef.Named("Apparel_BasicShirt");

            _knifePlasteelLegendary
                = new ThingStuffPairWithQuality(
                      knifeDef
                      , ThingDefOf.Plasteel
                      , QualityCategory.Legendary)
                  .MakeThing();

            _knifePlasteelGood
                = new ThingStuffPairWithQuality(
                      knifeDef
                      , ThingDefOf.Plasteel
                      , QualityCategory.Good)
                  .MakeThing();

            _knifeSteelGood
                = new ThingStuffPairWithQuality(
                      knifeDef
                      , ThingDefOf.Steel
                      , QualityCategory.Good)
                  .MakeThing();

            _shirtClothNormal
                = new ThingStuffPairWithQuality(
                      shirtDef
                      , ThingDefOf.Cloth
                      , QualityCategory.Normal)
                  .MakeThing();

            _finemeal            = ThingMaker.MakeThing(ThingDefOf.MealFine);
            _finemeal.stackCount = 11;

            _loadout0 = null;
            _loadout1 = new AILoadout(_pawn);
            LoadoutManager.AddLoadout(_loadout1);

            _loadout2 = new AILoadout(_pawn);
            LoadoutManager.AddLoadout(_loadout2);

            _loadout3 = new AILoadout(_pawn);
            LoadoutManager.AddLoadout(_loadout3);

            _loadout4 = new AILoadout(_pawn);
            LoadoutManager.AddLoadout(_loadout4);

            _loadout1.Add(_knifePlasteelLegendary);

            _loadout2.Add(_knifePlasteelLegendary);
            _loadout2.Add(_knifePlasteelGood);

            _loadout3.Add(_knifePlasteelLegendary);
            _loadout3.Add(_knifePlasteelGood);
            _loadout3.Add(_knifeSteelGood);

            _loadout4.Add(_knifePlasteelLegendary);
            _loadout4.Add(_knifePlasteelGood);
            _loadout4.Add(_knifeSteelGood);
            _loadout4.Add(_shirtClothNormal);
            _loadout4.Add(_finemeal);

            _loadouts = new List <AILoadout>()
            {
                _loadout0,
                _loadout1,
                _loadout2,
                _loadout3,
                _loadout4,
            };
        }