Ejemplo n.º 1
0
 static bool Prefix(ref JobDriver_Wear __instance)
 {
     if (__instance.pawn.IsHacked())
     {
         Apparel        apparel     = Traverse.Create(__instance).Property("Apparel").GetValue <Apparel>();
         List <Apparel> wornApparel = __instance.pawn.apparel.WornApparel;
         foreach (Apparel wornApp in wornApparel)
         {
             if (BothBelts(apparel.def, wornApp.def))
             {
                 Log.Message("drop belt!");
                 bool    forbid = __instance.pawn.Faction != null && __instance.pawn.Faction.HostileTo(Faction.OfPlayer);
                 Apparel apparel2;
                 if (!__instance.pawn.apparel.TryDrop(wornApp, out apparel2, __instance.pawn.PositionHeld, forbid))
                 {
                     Log.Error(__instance.pawn + " could not drop " + wornApp.ToStringSafe <Apparel>(), false);
                     __instance.EndJobWith(JobCondition.Errored);
                     return(false);
                 }
                 break;
             }
         }
     }
     return(true);
 }
Ejemplo n.º 2
0
 public static void Postfix(JobDriver_Wear __instance)
 {
     if (QuickFast.Settings.FlatRate)
     {
         __instance.duration = QuickFast.Settings.EquipModTicks;
     }
     else
     {
         __instance.duration = (int)(__instance.duration * QuickFast.Settings.EquipModPC);
     }
 }