kts
|
b3a3831cd2
|
Added EquipTile/EQUIP. This distinguishes equipable items such as weapons, armour, rings, etc., from non-equipables such as keys and the like.
|
2013-11-27 18:31:49 -08:00 |
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
|
375067aa8a
|
Added some equipment-related code, but it needs to be reworked entirely. Equipment should just be an instance of Inventory, not its own struct.
|
2013-11-25 00:59:08 -08:00 |
kts
|
d368c1efd0
|
Implemented the basic system for slots, stats, and damage wherein the type and amount of slots, stats, or die rolls are defined in their respective Tiles as a string. Although this has computational shortcomings due to parsing, it is the most flexible of all and forces no hard-coding on slot types or stat types. It can later be optimized, of course, as the size of each ItemTile, PlayerTile, and NpcTile has increased by at least 128 bytes. Note that some code is left-over from when the initial slot system was written using structs. Additionally, inventoryContext now handles up and down appropriately, and the inventory display has been improved. Along with the inventory display, an equipment surface is shown, although at the moment it lacks any equipment listing.
|
2013-11-23 03:28:38 -08:00 |
kts
|
6ad2ae9a5b
|
NULL wasn't declared on non-xcode environment, so string.h was included (over stddef.h, as sprintf was required). Inventory window, such as it is, is created according to the max_slots/slots_per_row properties of the Inventory, thus adjusting for larger inventories. The current item's name is now shown at the center-bottom of the window. Dropping items is also tidier, as the inventory->selected property is adjusted if it is equal to count (i.e., the selected cursor is pushed back when the last item is removed so selected always corresponds to an existing item).
|
2013-11-16 16:15:22 -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
|
4b7e0db3e0
|
Added rudimentary Inventory display, however we must have some way to keep track of the selected item in inventory offset. Perhaps through a global variable or, if it must be done, through a new Inventory struct that contains pertinent information. It should likely be the latter, so the same system can be expanded to chests and the like. Also added the ITEM type in general.
|
2013-11-16 02:15:03 -08:00 |
kts
|
d7ad2c3bd6
|
Added uiInit(), a function that creates ui_hotbar_surface, blits the appropriate ui.png sprites to it, then sets the opacity to 0.75. At the moment, ui.png must be in RGBA format due to my lack of knowledge on alpha blending, etc. - this shall be changed later for optimization. Added the SDL_SetOpacity(SDL_Surface *surface, double opacity) function that sets the alpha layer of the target surface to the desired amount. Along with this is the uiSetOpacity helper, which simply calls SDL_SetOpacity on ui_hotbar_surface. Also added uiSetScale which simply calls interfaceScaleSurface(SDL_Surface *surface, float x, float y) on ui_hotbar_surface. interfaceScaleSurface does a rough up/down-scale of the target surface - has not been thoroughly tested for bugs, so it has the potential to break.
|
2013-11-12 02:41:32 -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 |
kts
|
b567be76fd
|
Some minor tweaks made, majority of which I have forgotten already. DoorTile will soon be migrated to a generic TriggerTile type, in which it will exist as a DOOR subtype.
|
2013-10-23 18:58:17 -07:00 |
kts
|
c28a62d522
|
As per usual, added a bunch of stuff and remember almost none of them. Most importantly, a console interface has been added that can be summoned by pressing the tilde key. Much of the functionality, including the less-than-stellar associative array (that acts as a function pointer) was ripped from the noirchat project. The only important commands are 'quit' and, for SDL, 'set_video widthxheight 0|1', with 0 representing windowed and 1 representing fullscreen. Both the curses and SDL client now have camera offsets, allowing for the center of the screen to always be centered on the player. There are plans to have the camera offset be relative to the distance from the edges of the map (so if the player is 25% from the left-side of the map, the camera offset would be 25% off center). Really in need of code clean-up and reorganization.
|
2013-10-22 02:49:25 -07:00 |
kts
|
29cdd11ec8
|
Added basic NPC/monster functionality as well as a console system. Simply call ConsoleLog(&string) and it'll create a new ConsoleEntry, set the console_last_entry's next to it, set the new entry's prev to console_last_entry, and finally set console_last_entry to point to the new entry (functions very similarly to Tile Chains). This may later be changed to an array form so as to easily pull sections of the log from anywhere.
|
2013-10-19 22:56:46 -07:00 |
kts
|
4c204db4f3
|
Added support for doors. A DoorTile is a fairly basic tile - at the moment - sporting a state int to specify its current state via STATE_OPEN, STATE_CLOSED, STATE_BROKEN, or STATE_MISSING. Graphically/ascii-ly, the proper visual appearance is acquired by multiplying the door id by the total door states(4) and adding the current state value to the result. For example, for a door with the id of 0, you would have visual tile 0 for closed, 1 for open, 2 for broken, and 3 for missing. Beyond the doors, the curses tiles were moved from interface/curses.(c/h) to tiles/curses_tiles.(c/h) - they should, at some point, be generated in a similar manner to the tiles for the SDL client (using pack_tiles).
|
2013-10-17 15:11:29 -07:00 |
kts
|
33ab0f2af2
|
Renamed binary_to_c to pack_tiles and made it convert tiles/*.png to various char arrays in tiles/tiles.c and tiles/tiles.h. Added fully functional graphical tiles to the SDL client by using the tile's id and tid to point to the appropriate arrays in tiles.c/tiles.h. Also added proper displaying of multiple tiles on a tile chain, tile movement via gameMoveTile, tile line drawing via drawLine, along with other touch-ups
|
2013-10-15 18:54:23 -07:00 |
kts
|
e1a32045cf
|
Added a ton of stuff, SDL compile is broken, probably due to malloc issues. Must check over code in different environments.
|
2013-10-08 21:49:38 -07:00 |