コード例 #1
0
 public boolean mayICraft(final Item I) {
   if (I == null) return false;
   if (!super.mayBeCrafted(I)) return false;
   if ((I.material() & RawMaterial.MATERIAL_MASK) != RawMaterial.MATERIAL_LEATHER) return false;
   if (CMLib.flags().isDeadlyOrMaliciousEffect(I)) return false;
   if (I.basePhyStats().level() < 31) return (isANativeItem(I.Name()));
   if (I instanceof Armor) {
     final long noWearLocations =
         Wearable.WORN_LEFT_FINGER | Wearable.WORN_RIGHT_FINGER | Wearable.WORN_EARS;
     if ((I.rawProperLocationBitmap() & noWearLocations) > 0) return (isANativeItem(I.Name()));
     return true;
   }
   if (I instanceof Rideable) {
     Rideable R = (Rideable) I;
     int rideType = R.rideBasis();
     switch (rideType) {
       case Rideable.RIDEABLE_SLEEP:
       case Rideable.RIDEABLE_SIT:
       case Rideable.RIDEABLE_TABLE:
         return true;
       default:
         return false;
     }
   }
   if (I instanceof Shield) return true;
   if (I instanceof Weapon) {
     Weapon W = (Weapon) I;
     if ((W.requiresAmmunition()) || (W.weaponClassification() == Weapon.CLASS_FLAILED))
       return true;
     return (isANativeItem(I.Name()));
   }
   if (I instanceof Container) return true;
   if ((I instanceof Drink) && (!(I instanceof Potion))) return true;
   if (I instanceof FalseLimb) return true;
   if (I.rawProperLocationBitmap() == Wearable.WORN_HELD) return true;
   return (isANativeItem(I.Name()));
 }