This version adds the /Quest datum and the on-screen quest tracker. There are procs to manage the quest-related input with an NPC, you just have to call this:
mob/npc/interact(mob/m)
m.quest_dialog(/Quest/MySampleQuest)
And the library will automatically check if the player has the quest, check their status on the quest, and take the appropriate action. If the player doesn't have the quest, the NPC will offer it to them. If the player has the quest but it isn't completed, it'll show a specified message (specified by your /Quest datum). If the quest is complete it'll complete the quest and show a specified message. If the player has already completed the quest it'll show a different specified message.
The actions that must be taken to complete a quest are totally up to you. Maybe the player has to kill a really tough enemy. Maybe they have to find a hidden tomb. Maybe they have to collect some items.
Overlay Generation
I added the icon-generation folder which has some code to generate overlays for the player icon that comes with the library. You can easily change what color or pattern is applied to armor and generate extra overlays.
Condition Saving
Any condition applied to the player is saved when they log out. If you're poisoned (taking 4 damage each second) and it has ticked once when you log out, it'll tick three more times when you log in again and begin to play that character. Cooldowns still aren't saved but you can use Conditions to create things that behave like cooldowns.
Music & Game Menu
I added the mob.music() proc and used it to play music in the sample game. I also added the game options menu under the game menu. This menu contains screen size, sound volume, and music volume options.
Here's the full list of changes:
- Fixed the alignment of item captions in the loot window when the item name wrapped to a second line. Also increased the width of the loot window by a tile to make it less likely that item names will wrap.
- Condition objects are now saved and loaded. Their durations are only being checked and diminished when the character owning them is active. If you give the player a condition that lasts for 10 minutes, it'll only expire after 10 minutes of playing time on that character.
- Updated the combat object in the sample game to not check for critical hits when the attacker is null.
- Added client options for screen size, sound volume, and music volume. These values are also stored in the client's savefile.
- Added the interface to set the client options in the "Game Options" menu.
- Made the escape key only open the game menu if it didn't perform any other action (ex: untargeting the mob you're currently targeting).
- Set the anchor property of the chat input control so the window resizes properly now.
- Added the icon-generation folder which contains code and icons used to generate overlays. This lets you easily generate new armor or helmet overlays with different colors or patterns.
- Added the mob.music proc which is used to play music to the player. The songs are automatically updated when the client's volume setting is changed.
- Added music to the sample game.
- Added the "slowed" condition to the sample game. The blue oozes attacks slow your movement speed by 50% for one second.
- Added the base_speed var to the sample game. This is a value that doesn't change so even if you modify the player's move_speed var, you always know what their base movement speed was.
- Shifted the condition icons up and over 8 pixels so they're in the center of their icon states now. The ConditionsBar HUD element was shifted down and left 8 pixels so the icons still appear in the same position on the screen.
- Fixed a bug with the Condition.stack_size var. Previously it'd allow one more condition than you had told it to allow.
- Replaced the mob.saved_loc var with the mob.saved_x/y/z vars. Saving a reference to your turf could cause unwanted things to be saved. Instead we use the saved coordinates to get a reference to your saved loc at runtime.
- Added the Quest datum and the mob procs to manage accepting quests, updating the progress on quests, abandoning them, and completing them.
- The Quest datum automatically has procs that are called when you kill an enemy, get an item, lose an item, or get killed. This makes it easy to capture these events to update the quest's status accordingly.
- Added the mob.quest_dialog() proc which takes a /Quest type and displays the appropriate prompts given the player's current progress on that quest. The second argument is the dialog type, which can be QUEST_START, QUEST_END, or QUEST_START | QUEST_END. This lets you make NPCs act as only the quest's starting point, only the end point, or both.
- Added two quests to the sample game. See demo\npcs,dm for more details.
- Added the on-screen quest tracker which shows the name of each quest and its status.
- Pressing the Q key will set focus to the quest tracker. The player can use the arrow keys to select a quest and press the delete key to abandon a quest (there is a confirmation prompt before it's abandoned).
- Made the mob.prompt() proc create a dialog with no buttons if you pass null as a button name. Omitting all button names makes it default to having just an "Ok" button, but calling prompt("text...", null) makes it not show any buttons.
- Added support for specifying a width and height for prompt windows. The first parameter to prompt() is still the message. Any parameter after the first that's a number is assumed to be the width or height of the window. For example, prompt("", "Ok", "Cancel", 4, 4) makes a 4x4 prompt. The default size is 6x4.
- Added the global Options object. This is like the Constants object except it contains values that aren't needed at compile-time. This makes it easier to change options in your project because you can simply do: Options/space_opens_inventory = 0 to change that option and it overrides the value specified in the library.
- Added the "space_opens_inventory" option to the Options object. This is used to determine if the space bar should open the inventory screen when there's nothing else for you to interact with (it's 1 by default).
- Changed the mob.wander() proc to check for some conditions that would cause infinite loops.
- Added shadows below mobs in the sample game.
- Removed the "Chat Menu" button from the interface. It'll be accessed through the game menu (the one that appears when you press escape) though it's still not implemented yet.
What I'll most likely work on next is a more complete game that's made using this library. That should show off what you can make with the library and help me realize where it can be improved.