Ejemplo n.º 1
0
 public override void CompTick()
 {
     base.CompTick();
     if (this.parent.Faction == Faction.OfPlayer)
     {
         if (this.AbilityData.AllPowers.Count == 0)
         {
             Pawn p = parent as Pawn;
             foreach (Apparel Ap in p.apparel.WornApparel)
             {
                 CompAbilityItem comp = Ap.TryGetComp <AbilityUser.CompAbilityItem>();
                 if (comp != null)
                 {
                     foreach (AbilityDef Pa in comp.Props.Abilities)
                     {
                         this.AddApparelAbility(Pa);
                     }
                 }
             }
             foreach (var Eq in p.equipment.AllEquipmentListForReading)
             {
                 CompAbilityItem comp = Eq.TryGetComp <AbilityUser.CompAbilityItem>();
                 if (comp != null)
                 {
                     foreach (AbilityDef Pa in comp.Props.Abilities)
                     {
                         this.AddWeaponAbility(Pa);
                     }
                 }
             }
         }
     }
 }