Piercing projectiles
More refactoring on the ability system (it's taking a while). Among other changes, I'm fleshing out a more robust version of a data structure that contains information on which tiles are valid for selection when we're trying to activate a skill. E.g. a melee attack has neighbour tiles, a ranged attack has more tiles to select. Now this is all nice and simple, but the corner cases come to bite:
- Sometimes we want to target a wall, or a liquid.
- Sometimes we can target the floor or an entity occupying the floor.
- Sometimes only particular entities can be targetted, and no floor.
- Sometimes occlusion matters, sometimes it doesn't. Same with field of vision (currently, or having seen a tile before).
- Another requirement is if we can reach the tile by land, air or water. Now this is used of course for projectiles.
Part of the tile selection process is the visual representation of which tiles can be selected, which are highlighted. If a projectile attack would be blocked by creatures, normally there's no purpose in highlighting (and thus making available) tiles that are behind the creature, but if the projectile attack is piercing, we should. Also Some more complexity arises if the projectiles are homing or not.
Another smaller thing that I implemented was behaviour of objects when they're being attacked. For now, I just created a few categories handled via an enumeration, and they amount to "do nothing", "self-destruct" and "trigger effect". A fountain would set "do nothing", as nothing happens when we swing at it. A web would call "self-destruct" so it would break. A jug would set "trigger effect" so that it will break and its contents will fall to the floor. Nice and simple, before I overthink damage/hitpoints for objects.