Package games.stendhal.server.util

Examples of games.stendhal.server.util.Area


   * Tests for bailNoDM.
   */
  @Test
  public void testBailNoDM() {
    final StendhalRPZone zone = new StendhalRPZone("zone");
    final AdosDeathmatch adm = new AdosDeathmatch(zone, new Area(zone, 0, 0, 1, 1));
    adm.createNPC("th", 0, 0);
    final SpeakerNPC th = NPCList.get().get("th");
    assertNotNull(th);
    final Engine en = th.getEngine();
    final Player player = PlayerTestHelper.createPlayer("bob");
View Full Code Here


   * Tests for bailDoneDM.
   */
  @Test
  public void testBailDoneDM() {
    final StendhalRPZone zone = new StendhalRPZone("zone");
    final AdosDeathmatch adm = new AdosDeathmatch(zone, new Area(zone, 0, 0, 1, 1));
    adm.createNPC("th", 0, 0);
    final SpeakerNPC th = NPCList.get().get("th");
    assertNotNull(th);
    final Engine en = th.getEngine();
    final Player player = PlayerTestHelper.createPlayer("bob");
View Full Code Here

   * Tests for bailStartedDMNOhelmet.
   */
  @Test
  public void testBailStartedDMNOhelmet() {
    final StendhalRPZone zone = new StendhalRPZone("zone");
    final AdosDeathmatch adm = new AdosDeathmatch(zone, new Area(zone, 0, 0, 1, 1));
    adm.createNPC("th", 0, 0);
    final SpeakerNPC th = NPCList.get().get("th");
    assertNotNull(th);
    final Engine en = th.getEngine();
    final Player player = PlayerTestHelper.createPlayer("bob");
View Full Code Here

   * Tests for fire.
   */
  @Test
  public void testFire() {
    final StendhalRPZone zone = new StendhalRPZone("zone");
    final AdosDeathmatch adm = new AdosDeathmatch(zone, new Area(zone, 0, 0, 1, 1));
    adm.createNPC("th", 0, 0);
    final SpeakerNPC th = NPCList.get().get("th");
    assertNotNull(th);
    final Engine en = th.getEngine();
    final Player player = PlayerTestHelper.createPlayer("bob");
View Full Code Here

   * @param  attributes  Configuration attributes.
   */
  public void configureZone(final StendhalRPZone zone, final Map<String, String> attributes) {
    final Rectangle2D shape = new Rectangle2D.Double();
    shape.setRect(88, 77, 112 - 88 + 1, 94 - 77 + 1);
    final Area arena = new Area(zone, shape);
    final AdosDeathmatch deathmatch = new AdosDeathmatch(zone, arena);
    deathmatch.createHelmet(102, 75);
    deathmatch.createNPC("Thanatos", 98, 77);
  }
View Full Code Here

  public void execute(Player admin, List<String> args) {
    super.execute(admin, args);
    TurnNotifier.get().dontNotify(this);
    StendhalRPWorld world = SingletonRepository.getRPWorld();
    zone = world.getZone("int_semos_bank");
    pathArea = new Area(zone, 32, 7, 35, 7);
    tablePathArea = new Area(zone, 35, 2, 40, 8);
    TurnNotifier.get().notifyInSeconds(CHECK_INTERVAL, this);
  }
View Full Code Here

  private void buildSecretRoomArea(final StendhalRPZone zone, final Map<String, String> attributes) {
    Observer observer = new DrowObserver();
   
    // describe secret room tunnel here
    final Area a1 = new Area(zone, 33, 50, 10, 20);
    final Area a2 = new Area(zone, 23, 021, 49);
   
    for(CreatureRespawnPoint p:zone.getRespawnPointList()) {
      if(p!=null) {
        if(a1.contains(p) || a2.contains(p)) {
          if(creatures.indexOf(p.getPrototypeCreature().getName())!=-1) {
            // it is our creature, set up observer now
            p.addObserver(observer);         
          }
        }       
View Full Code Here

     */
    private Area getPen(StendhalRPZone zone) {
      if (pen == null) {
        Rectangle2D rect = new Rectangle2D.Double();
        rect.setRect(SHEEP_PEN_X, SHEEP_PEN_Y, SHEEP_PEN_WIDTH, SHEEP_PEN_HEIGHT);
        pen = new Area(zone, rect);
      }
     
      return pen;
    }
View Full Code Here

     * @param zone the zone to check
     * @return list of sheep in the pen
     */
    private List<Sheep> sheepInPen(StendhalRPZone zone) {
      List<Sheep> sheep = new LinkedList<Sheep>();
      Area pen = getPen(zone);
     
      for (RPEntity entity : zone.getPlayerAndFriends()) {
        if (entity instanceof Sheep) {
          if (pen.contains(entity)) {
            sheep.add((Sheep) entity);
          }
        }
      }
     
View Full Code Here

        null,
        ConversationStates.QUESTION_1, null,
        new ChatAction() {
            public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
                        final StendhalRPZone fadoHotel = npc.getZone();
                        final Area hotelReception = new Area(fadoHotel, new Rectangle(11, 46, 19, 10));

                        Player husband;
                        Player wife;
                        String partnerName;
                        husband = player;
                        partnerName = husband.getQuest(marriage.getSpouseQuestSlot());
                        wife = SingletonRepository.getRuleProcessor().getPlayer(partnerName);
                       
            if (!(player.hasQuest(marriage.getQuestSlot())) || !("just_married".equals(player.getQuest(marriage.getQuestSlot())))) {
              // person is not just married
              npc.say("Sorry, our honeymoon suites are only available for just married customers.");
              npc.setCurrentState(ConversationStates.ATTENDING);           
            } else if (wife == null) {
              //wife is not online
                            npc.say("Come back when " + partnerName + " is with you - you're meant to have your honeymoon together!");
                            npc.setCurrentState(ConversationStates.IDLE);
                        } else if (!(wife.hasQuest(marriage.getQuestSlot())
                                     && wife.getQuest(marriage.getSpouseQuestSlot()).equals(husband.getName()))) {
                          //wife is not married to this husband
                            npc.say("Oh dear, this is embarassing. You seem to be married, but " + partnerName + " is not married to you.");
                            npc.setCurrentState(ConversationStates.ATTENDING);
                        } else if (!hotelReception.contains(wife)) {
                          //  wife has not bothered to come to reception desk
                            npc.say("Could you get " + partnerName + " to come to the reception desk, please. Then please read our catalogue here and tell me the room number that you would like.");
                        else {
                          //wife and husband fulfill all conditions
              npc.say("How lovely! Please read our catalogue here and tell me the room number that you would like.");
View Full Code Here

TOP

Related Classes of games.stendhal.server.util.Area

Copyright © 2018 www.massapicom. 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.