Ejemplo n.º 1
0
 // Token: 0x0600004B RID: 75 RVA: 0x00005114 File Offset: 0x00003314
 public static bool IsViolation(Pawn p, ThingDef t)
 {
     if (!t.IsDrug)
     {
         return(true);
     }
     if ((p?.Faction) != null && p.Faction == Faction.OfPlayer)
     {
         return(PawnUtility.IsTeetotaler(p) && t.IsNonMedicalDrug);
     }
     return(t.IsNonMedicalDrug);
 }
Ejemplo n.º 2
0
 // Token: 0x06000041 RID: 65 RVA: 0x00004B60 File Offset: 0x00002D60
 private static bool IsViolation(Pawn p, RecipeDef r, out string reason)
 {
     reason = "";
     if ((p?.Faction) != null && p.Faction == Faction.OfPlayer)
     {
         if (PawnUtility.IsTeetotaler(p) && r.ingredients[0].filter.AllowedThingDefs.First <ThingDef>().IsNonMedicalDrug)
         {
             reason = Translator.Translate("MSPainless.ViolationTeetotaler");
             return(true);
         }
         return(false);
     }
     else
     {
         if (r.ingredients[0].filter.AllowedThingDefs.First <ThingDef>().IsNonMedicalDrug)
         {
             reason = Translator.Translate("MSPainless.ViolationNonPlayer");
             return(true);
         }
         return(false);
     }
 }