for (final String itemName : CLOAKS.subList(1, CLOAKS.size())) {
en.stepTest(player, itemName);
assertEquals("Oh, I'm disappointed. You don't really have "
+ Grammar.a_noun(itemName) + " with you.", getReply(npc));
final Item cloak = new Item(itemName, "", "", null);
player.getSlot("bag").add(cloak);
en.stepTest(player, itemName);
assertEquals("Wow, thank you! What else did you bring?", getReply(npc));
en.stepTest(player, itemName);
assertEquals("You're terribly forgetful, you already brought that one to me.", getReply(npc));
}
// check the message again now that it has changed
en.stepTest(player, "cloaks");
assertEquals(stillWantedMessage(player), getReply(npc));
// Give the last one too. Try lying first again just to be sure
final String lastCloak = CLOAKS.get(0);
en.stepTest(player, lastCloak);
assertEquals("Oh, I'm disappointed. You don't really have "
+ Grammar.a_noun(lastCloak) + " with you.", getReply(npc));
final Item cloak = new Item(lastCloak, "", "", null);
player.getSlot("bag").add(cloak);
en.stepTest(player, lastCloak);
assertEquals("Answer to last brought cloak", "Oh, yay! You're so kind, I bet you'll have great Karma now! Here, take these killer boots. I think they're gorgeous but they don't fit me!", getReply(npc));
// check the rewards
assertEquals(karma + 5.0 + 100.0, player.getKarma(), 0.01);
assertEquals(100000, player.getXP());
assertEquals("done;rewarded", player.getQuest(QUEST_NAME));
assertEquals(true, player.isEquipped("killer boots"));
final Item boots = player.getFirstEquipped("killer boots");
assertEquals("player", boots.getBoundTo());
}