Exemplo n.º 1
0
 public void setStat(String code, String val) {
   if (CMLib.coffeeMaker().getGenItemCodeNum(code) >= 0)
     CMLib.coffeeMaker().setGenItemStat(this, code, val);
   else
     switch (getCodeNum(code)) {
       case 0:
         setLidsNLocks(hasALid(), isOpen(), CMath.s_bool(val), false);
         break;
       case 1:
         setLidsNLocks(CMath.s_bool(val), isOpen(), hasALock(), false);
         break;
       case 2:
         setCapacity(CMath.s_parseIntExpression(val));
         break;
       case 3:
         setContainTypes(CMath.s_parseBitLongExpression(Container.CONTAIN_DESCS, val));
         break;
       case 4:
         {
           int x = CMath.s_parseListIntExpression(RawMaterial.CODES.NAMES(), val);
           x = ((x >= 0) && (x < RawMaterial.RESOURCE_MASK)) ? RawMaterial.CODES.GET(x) : x;
           setFuelType(x);
           break;
         }
       case 5:
         setPowerCapacity(CMath.s_parseLongExpression(val));
         break;
       default:
         CMProps.setStatCodeExtensionValue(getStatCodes(), xtraValues, code, val);
         break;
     }
 }
Exemplo n.º 2
0
 public void affectPhyStats(Physical affected, PhyStats affectableStats) {
   final MOB mob = (MOB) affected;
   final Room R = mob.location();
   if ((R != null)
       && ((R.domainType() == Room.DOMAIN_INDOORS_WATERSURFACE)
           || (R.domainType() == Room.DOMAIN_OUTDOORS_WATERSURFACE)
           || (R.domainType() == Room.DOMAIN_INDOORS_UNDERWATER)
           || (R.domainType() == Room.DOMAIN_OUTDOORS_UNDERWATER)
           || ((RawMaterial.CODES.GET(R.getAtmosphere()) & RawMaterial.MATERIAL_MASK)
               == RawMaterial.MATERIAL_LIQUID)))
     affectableStats.setDisposition(affectableStats.disposition() | PhyStats.IS_SWIMMING);
 }