kts
|
ef59c0a365
|
Equipping and unequipping items now fully implemented. Uses the player's slots and used_slots properties along with the target item's required slots property. used_slots+required_slots are checked against slots and if less than, used_slots is changed accordingly. Unequipping removes required_slots from used_slots. equipmentContext added for equipping/unequipping as well. interface/sdl.c changed so that the focused UI (being either inventory or equipment) is at a higher opacity than the unfocused UI.
|
2013-11-26 16:02:04 -08:00 |
kts
|
d50282effa
|
We now have a mostly working inventory system. Items can be picked up via ` and dropped using ` within the inventory. Currently using a new playerPickup() function, but it should be abstracted to a tilePickup(struct Tile *tile) function so that npcs, etc., can share in the fun.
|
2013-11-16 04:41:06 -08:00 |
kts
|
81c3ea6fdc
|
Moved a portion of the user messages (e.g., 'You open the %s.') to various #define MESSAGE_* in message.h. Also fixed the bug I never looked into where entries in consoleLog would read past the string into neighboring memory - this was due to using strlen(string) for the byte-length in memcpy, as strlen does not count the terminating character '\0'. Fixed by adding +1 to the return value of strlen
|
2013-11-14 16:21:53 -08:00 |
kts
|
5edcc76a86
|
interfacePrint is no longer directly called in non-interface contexts, but rather is handled by a messaging system. When one tile wishes to tell another tile a message, whether that be for descriptive purposes such as opening a door or otherwise, messageTile(Tile *sender, Tile *recipient, const char *message) is called. Within that, if the recipient->tid is PLAYER, then it calls interfacePrint. This will later be modified to check if the recipient->data->controller matches the actual user's controller (thus tying messages to particular users only). Also added was the basic struct for controller, but it is thus far unused in actual game code. The Controller will be used once a basic network/game structure is in order.
|
2013-11-03 22:53:13 -08:00 |