Package games.stendhal.server.core.engine

Examples of games.stendhal.server.core.engine.StendhalRPZone.collides()


      if (action.has(CREATURE) && action.has(X) && action.has(Y)) {
        final StendhalRPZone zone = player.getZone();
        final int x = action.getInt(X);
        final int y = action.getInt(Y);
       
        if (!zone.collides(player, x, y)) {
          final EntityFactory factory = new EntityFactory(player) {
            @Override
            void found(final String type, final Entity entity) {
               final Entity entityToBePlaced;
              if (manager.isCreature(type)) { 
View Full Code Here


      final int x = rpEntity.getX() + dir.getdx();
      final int y = rpEntity.getY() + dir.getdy();

      final StendhalRPZone zone = player.getZone();
      if (!zone.collides(rpEntity, x, y)) {
        move(player, rpEntity, x, y);
        // Stop players running toward to make trapping harder. Don't
        // stop anyone just following a path (again to make annoying
        // others harder)
        if (dir.oppositeDirection() == rpEntity.getDirection()
View Full Code Here

          // done checking all of the border
          break;
        }
       
        boolean zCollides = zone.collides(zoneX, zoneY);
        boolean nCollides = neighbour.collides(neighbourX, neighbourY);
       
        if (zCollides != nCollides) {
          badness++;
          if (badness >= badnessThreshold) {
            problems.add(collidesMessage(zone.getName(), zoneX, zoneY, zCollides)
View Full Code Here

        // checking if EntityManager knows about this creature type.
        final Creature tempCreature = new Creature((Creature) manager.getEntity(RAT_TYPES.get(tc)));
        final Creature rat = new Creature(tempCreature.getNewInstance());

        // chosen place is occupied
        if (zone.collides(rat,x,y)) {
          // Could not place the creature here.
          // Treat it like it was never exists.
          logger.debug("RATS " + zone.getName() + " " + x + " " + y + " collided.");
          continue;
        } else if (zone.getName().startsWith("0")) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.