Version 0.29 is done.
Internal Changes- New item type, "TYPE_AMMO"
- New item attribute, "ammo_type"
- Class information is now loaded from a file for character creation.
Visual Changes- Made items brown on the map, to differentiate them from enemies.
- Fixed items sometimes not being drawn.
- Item purchase screen updated to allow the purchase of multiples.
Gameplay Changes- Ranged weapons are in, they can be used as melee weapons, or fire projectiles. Press 'f' to fire.
- Ammo will stack when picked up, purchased or fired.
- Enemies will not block a shot, so you can shoot past one enemy to hit another.
- Fixed doors being placed on the right and bottom outer walls.
- Look function now lets you pick a square to look at.
Editor Changes- Item editor and item.raw format updated for ammo_type
- Icons added for editors
Download is in the first post as usual. The biggest changes this time are the ranged weapons and the movement of class information to an external file. Ranged weapons will work just like melee weapons should you try to use them as such, but they have penalties instead of bonuses to strength and dexterity. To use it to fire a projectile, press 'f', then choose a square to shoot at (if it doesn't let you pick a square, you probably don't have ammo). The ammo items I've added have substantial bonuses to strength and/or dexterity, to make up for the weapon's penalties. If you want to make a ranged weapon in the editor, make a normal weapon and give it an ammo type. It can then be used to fire whatever type of projectile you chose. At the moment, only weapons can launch projectiles. I may change this later, especially if I grow too fond of the hidden, wrist-mounted pistol in Assassin's Creed 2
All class information is now stored in external files, and loaded when you want to create a character. The format is really simple, so I'll leave it for you to figure out. One thing of note, you can only have ten classes (0-9), any classes past that will be ignored.
Also, I made a mistake in my previous post when I described how to set up an icon. At least in CodeBlocks, the icon has to be in the same place as the source files. You could probably specify a directory for it, but I have not tried.
[EDIT]: Next version primary goal: Magic. Here's what I've got so far, spells will be loaded from a file with a format similar to DF's raws to allow me to store more information in a single tag. Of course, for this to work I'm going to have to write my own parser for them, so it may be a while before I have anything interesting to show. I have some idea of what I want the files to look like:
[NAME:Heal]
[DURATION:-1]
[TARGET:SELF]
[HEAL:5]
[NAME:Magic Missile]
[DURATION:-1]
[TARGET:RANGED]
[HURT:5]
[NAME:Weaken]
[DURATION:25]
[TARGET:RANGED]
[STR:-1]
Basically, a spell will consist of a name, a target (self and target to begin with, probably area effects later), and any number of effects. I'm considering the possibility of allowing multiple targets, so you could have, say:
[NAME:Drain]
[DURATION:-1]
[TARGET:SELF]
[HEAL:5]
[TARGET:RANGED]
[HURT:5]
Which would heal you and hurt the target. The format is far from perfect, and I may combine the duration tag into the effect tags, so each effect could have a different length.
As far as the actual code goes, I'll write a class that stores the name and target, as well as a vector of the effects, for a spell. Then have a vector of all spells in the _game structure. Items for the spells (scrolls, wands, whatever I decide to use) will be generated automatically. The effects may end up needing a structure of their own, depending on how complicated they get.
Duration would be the time an effect lasts, not the amount of time it takes to happen. -1 would signify a permanent effect, while a positive number would be an amount of time (probably in turns) until the effect reverses itself. (I.E. The "weaken" spell above would, after the 25 turns, reverse itself, giving the enemy back his missing strength point)