Beispiel #1
0
  @Override
  public boolean tick(Tickable ticking, int tickID) {
    super.tick(ticking, tickID);

    if (anyWetWeather(lastWeather)) {
      if (ticking instanceof Room) {
        final Room R = (Room) ticking;
        final Area A = R.getArea();
        if ((!anyWetWeather(A.getClimateObj().weatherType(R)))
            && (!dryWeather(A.getClimateObj().weatherType(R)))
            && (CMLib.dice().rollPercentage() < pct()))
          makePuddle(R, lastWeather, A.getClimateObj().weatherType(R));
      } else if (ticking instanceof Area) {
        final Area A = (Area) ticking;
        if ((!anyWetWeather(A.getClimateObj().weatherType(null)))
            && (!dryWeather(A.getClimateObj().weatherType(null)))) {
          for (final Enumeration<Room> e = A.getProperMap(); e.hasMoreElements(); ) {
            final Room R = e.nextElement();
            if (((R.domainType() & Room.INDOORS) == 0)
                && (R.domainType() != Room.DOMAIN_OUTDOORS_AIR)
                && (!CMLib.flags().isWateryRoom(R))
                && (CMLib.dice().rollPercentage() < pct()))
              makePuddle(R, lastWeather, A.getClimateObj().weatherType(null));
          }
        }
      }
    }

    if (ticking instanceof Room)
      lastWeather = ((Room) ticking).getArea().getClimateObj().weatherType((Room) ticking);
    else if (ticking instanceof Area)
      lastWeather = ((Area) ticking).getClimateObj().weatherType(null);
    return true;
  }