Beispiel #1
0
        public void unequipWeapon()
        {
            changeTick();
            defaultPawn.equipment.DestroyAllEquipment();

            MilSquadFC.UpdateEquipmentTotalCostOfSquadsContaining(this);
        }
Beispiel #2
0
        public void wearEquipment(Apparel Equipment, bool wear)
        {
            changeTick();
Reset:
            foreach (ApparelLayerDef layer in Equipment.def.apparel.layers)
            {
                foreach (BodyPartGroupDef part in Equipment.def.apparel.bodyPartGroups)
                {
                    foreach (Apparel apparel in defaultPawn.apparel.WornApparel)
                    {
                        if ((apparel.def.apparel.layers.Contains(layer) &&
                             apparel.def.apparel.bodyPartGroups.Contains(part)) ||
                            (Equipment.def.apparel.layers.Contains(ApparelLayerDefOf.Overhead) &&
                             apparel.def.apparel.layers.Contains(ApparelLayerDefOf.Overhead)))
                        {
                            defaultPawn.apparel.Remove(apparel);
                            goto Reset;
                        }
                    }
                }
            }

            if (wear == false)
            {
                //NOTHING
            }
            else
            {
                defaultPawn.apparel.Wear(Equipment);
            }

            MilSquadFC.UpdateEquipmentTotalCostOfSquadsContaining(this);
        }
Beispiel #3
0
        public void equipWeapon(ThingWithComps weapon)
        {
            changeTick();
            if (isCivilian == false)
            {
                unequipWeapon();
                defaultPawn.equipment.AddEquipment(weapon);
            }
            else
            {
                Messages.Message("You cannot put a weapon on a civilian!", MessageTypeDefOf.RejectInput);
            }

            MilSquadFC.UpdateEquipmentTotalCostOfSquadsContaining(this);
        }