Examples of SpeakerNPC


Examples of games.stendhal.server.entity.npc.SpeakerNPC

  /**
   * Tests for quest.
   */
  @Test
  public void testQuest() {
    final SpeakerNPC npc = getNPC("Starkad");
    final Engine en = npc.getEngine();

    //test the basic messages
    assertTrue(en.step(player, "hi"));
    assertEquals("Greetings! How may I help you?", getReply(npc));

View Full Code Here

Examples of games.stendhal.server.entity.npc.SpeakerNPC

  public void testHiandBye() throws Exception {
    SingletonRepository.getRPWorld();
    final BarMaidNPC barmaidConfigurator = new BarMaidNPC();
    final StendhalRPZone zone = new StendhalRPZone("testzone");
    barmaidConfigurator.configureZone(zone, null);
    final SpeakerNPC barMaid = (SpeakerNPC) zone.getNPCList().get(0);
    assertThat(barMaid.getName(), is("Siandra"));
    final Engine engine = barMaid.getEngine();
    engine.setCurrentState(ConversationStates.IDLE);

    Sentence sentence = new SentenceImplementation(new Expression("hi", ExpressionType.VERB));
    engine.step(PlayerTestHelper.createPlayer("bob"), sentence);
    assertThat(engine.getCurrentState(), is(ConversationStates.ATTENDING));
View Full Code Here

Examples of games.stendhal.server.entity.npc.SpeakerNPC

  public void testJobOfferQuest() throws Exception {
    SingletonRepository.getRPWorld();
    final BarMaidNPC barmaidConfigurator = new BarMaidNPC();
    final StendhalRPZone zone = new StendhalRPZone("testzone");
    barmaidConfigurator.configureZone(zone, null);
    final SpeakerNPC barMaid = (SpeakerNPC) zone.getNPCList().get(0);
    assertThat(barMaid.getName(), is("Siandra"));
    final Engine engine = barMaid.getEngine();
    engine.setCurrentState(ConversationStates.ATTENDING);

    Sentence sentence = new SentenceImplementation(new Expression("job", ExpressionType.VERB));
    engine.step(PlayerTestHelper.createPlayer("bob"), sentence);
    assertThat(engine.getCurrentState(), is(ConversationStates.ATTENDING));
View Full Code Here

Examples of games.stendhal.server.entity.npc.SpeakerNPC

    SingletonRepository.getRPWorld();

    final BarMaidNPC barmaidConfigurator = new BarMaidNPC();
    final StendhalRPZone zone = new StendhalRPZone("testzone");
    barmaidConfigurator.configureZone(zone, null);
    final SpeakerNPC barMaid = (SpeakerNPC) zone.getNPCList().get(0);
    assertThat(barMaid.getName(), is("Siandra"));
    final Engine engine = barMaid.getEngine();
    engine.setCurrentState(ConversationStates.ATTENDING);

    Sentence sentence = new SentenceImplementation(new Expression("offer", ExpressionType.VERB));
    engine.step(PlayerTestHelper.createPlayer("bob"), sentence);
    assertThat(engine.getCurrentState(), is(ConversationStates.ATTENDING));
View Full Code Here

Examples of games.stendhal.server.entity.npc.SpeakerNPC

    player.setPosition(tableBounds.x+1, tableBounds.y-1);
  }

  @Test
  public void testQuest() {
    SpeakerNPC npc = SingletonRepository.getNPCList().get("Ricardo");
    en = npc.getEngine();

    en.step(player, "hi");
    assertEquals("Welcome to the #gambling table, where dreams can come true.", getReply(npc));
    en.step(player, "gambling");
    assertEquals("The rules are simple: just tell me if you want to #play, pay the stake, and throw the dice on the table. The higher the sum of the upper faces is, the nicer will be your prize. Take a look at the blackboards on the wall!", getReply(npc));
View Full Code Here

Examples of games.stendhal.server.entity.npc.SpeakerNPC

  @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");
    en.setCurrentState(ConversationStates.ATTENDING);
    en.step(player, "bail");
    assertEquals("Coward, you haven't even #started!", getReply(th));
    th.put("text", "");
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.SpeakerNPC

  @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");
    en.setCurrentState(ConversationStates.ATTENDING);
    player.setQuest("deathmatch", "done");
    en.step(player, "bail");
    assertEquals("Coward, we haven't even #started!", getReply(th));
    th.put("text", "");

  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.SpeakerNPC

  @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");
    en.setCurrentState(ConversationStates.ATTENDING);
    player.setQuest("deathmatch", "start");
    en.step(player, "bail");
    assertEquals("Coward! You're not as experienced as you used to be.", getReply(th));
    th.put("text", "");
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.SpeakerNPC

  @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");
    en.setCurrentState(ConversationStates.ATTENDING);
    final Item helmet = SingletonRepository.getEntityManager().getItem("trophy helmet");
    player.equipToInventoryOnly(helmet);
    assertTrue(player.isEquipped("trophy helmet"));
View Full Code Here

Examples of games.stendhal.server.entity.npc.SpeakerNPC

   
    for (String zone : CITY_ZONES) {
      setupZone(zone);
    }
   
    SpeakerNPC taxman = new SpeakerNPC("Mr Taxman");
    SingletonRepository.getNPCList().add(taxman);

    new HouseBuying().addToWorld();
  }
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.