Package games.stendhal.server.entity.creature

Examples of games.stendhal.server.entity.creature.Cat


    pq.onAction(player, action);
    assertThat(player.events().get(0).get("text"), equalTo("No player or pet named \"pet\" is currently logged in."));
 
   
    final Pet testPet = new Cat();
   
    final Sheep testSheep = new Sheep();

    player = PlayerTestHelper.createPlayer("player");
   
View Full Code Here


        found(type, entity);
      } else if ("cat".equals(type)) {
        if (player.hasPet()) {
          error("You already own a pet!");
        } else {
          final Cat cat = new Cat(player);
          found(type, cat);
        }
      } else if ("baby dragon".equals(type)) {
        if (player.hasPet()) {
          error("You already own a pet!");
View Full Code Here

        slot.remove(object.getID());

        player.removeSlot("#pets");

        if (object.get("type").equals("cat")) {
          return new Cat(object, player);
        } else if (object.get("type").equals("baby_dragon")) {
          return new BabyDragon(object, player);
        }
      }
    }
View Full Code Here

    assertEquals(0.2, (new SpeakerNPC("bob")).getBaseSpeed(), 0.001);
    assertEquals(0.0, (new Creature()).getBaseSpeed(), 0.001);
    assertEquals(1.0, (PlayerTestHelper.createPlayer("player")).getBaseSpeed(),
        0.001);
    assertEquals(0.9, (new Cat()).getBaseSpeed(), 0.001);
    assertEquals(0.25, (new Sheep()).getBaseSpeed(), 0.001);

  }
View Full Code Here

                seller.say("You don't seem to have enough money.");
                return false;
              }
              seller.say("Here you go, a cute little kitten! Your kitten will eat any piece of chicken or fish you place on the ground. Enjoy her!");

              final Cat cat = new Cat(player);
             
              Entity sellerEntity = seller.getEntity();
              cat.setPosition(sellerEntity.getX(), sellerEntity.getY() + 1);

              player.setPet(cat);
              player.notifyWorldAboutChanges();

              return true;
            }
          }
        }

        final Map<String, Integer> items = new HashMap<String, Integer>();
        items.put("cat", BUYING_PRICE);

        addGreeting();
        addJob("I sell cats. Well, really they are just little kittens when I sell them to you but if you #care for them well they grow into cats.");
        addHelp("I sell cats. To buy one, just tell me you want to #buy #cat. If you're new to this business, I can tell you how to #travel with her and take #care of her. If you find any wild cat, incidentally, you can make them your #own.");
        addGoodbye();
        new SellerAdder().addSeller(this, new CatSellerBehaviour(items));
        addReply("care",
            "Cats love chicken and fish. Just place a piece on the ground and your cat will run over to eat it. You can right-click on her and choose 'Look' at any time, to check up on her weight; she will gain one unit of weight for every piece of chicken she eats.");
        addReply("travel",
            "You'll need your cat to be close by in order for her to follow you when you change zones; you can say #cat to call her if she's not paying attention. If you decide to abandon her instead, you can right-click on yourself and select 'Leave Pet'; but frankly I think that sort of behaviour is disgraceful.");
        addReply("sell",
            "Sell??? What kind of a monster are you? Why would you ever sell your beautiful cat?");
        addReply("own",
            "If you find any wild or abandoned cat, you can right-click on them and select 'Own' to tame them. It will start following you immediately. Cats go a bit crazy without an owner!");
      }
    };

    npc.setEntityClass("woman_009_npc");
    npc.setPosition(6, 8);
    npc.initHP(100);
    npc.setDescription("Felina is walking around while taking care of her kittens. They are purring out of all corners.");
    zone.add(npc);
   
    // Also put a cat in her bedroom (people can't Own it as it is behind a fence)
    final Cat hercat = new Cat();
                hercat.setPosition(19, 3);
                zone.add(hercat);

  }
View Full Code Here

                seller.say("You don't seem to have enough money.");
                return false;
              }
              seller.say("Here you go, a cute little kitten! Your kitten will eat any piece of chicken or fish you place on the ground. Enjoy her!");

              final Cat cat = new Cat(player);
             
              Entity sellerEntity = seller.getEntity();
              cat.setPosition(sellerEntity.getX(), sellerEntity.getY() + 1);

              player.setPet(cat);
              player.notifyWorldAboutChanges();

              return true;
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.creature.Cat

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.