Update Adding a new NPC authored by Noah MacMinn's avatar Noah MacMinn
......@@ -3,7 +3,8 @@
`PlayersForTest(int id, String playerName, String type, int row, int col, String password, String mapName, int pin, String changedOn, int doubloons, int experiencePoints,Crew crew, Major major, int section, int buffPool, boolean online, ArrayList<String> mapsVisited)`
2. In NPCForTest.java add the NPC <br>
`NPCsForTest(int playerID, String behaviorClass, String filePath)`
`NPCsForTest(int playerID, String behaviorClass)` **OR**
`NPCsForTest(int playerID, String behaviorClass, String filePath)` if the NPC has a walking path or dialog
3. Ensure the behavior exists or create the new behavior<br>
In an NPCs behavior class, there are several options that apply for some types of NPCs that will not apply for others. For example, Quizbot needs to send and receive messages between players, so Quizbot needs a getReportTypes() method that handles what types of reports it will respond to and receiveReport() method that handles what Quizbot will do when it receives a report (i.e. if a player answers their question and it’s correct, Quizbot should reply and give that player Doubloons). A more simple example of a behavior class would be the RandomFactsNPCBehavior class, in which only uses a simple constructor, a doTimedEvent() method that will tell the player a random fact every set number of seconds, and a getFacts() method that finds all facts that the NPC has. Currently the game is set up so all facts/responses for any NPC that has not been revamped with the new XML file update are stored in one enum file, RandomFactsForTest. Each fact is stored as Fact_NUM(factID, NPC ID, fact text, startTime, endTime), and is stored in the database so that when an NPC chooses a random response, it will pick one from this enum with the correct NPC ID.
......
......