about summary refs log tree commit diff
path: root/src/Xanthous/Entities/Creature.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-12-22 Add wielded, wieldable itemsGriffin Smith1-1/+2
Split the character's inventory up into wielded items (in one or both hands) and the backpack, and display wielded items when drawing the inventory panel. Currently there's no way to actually *wield* items though, so this is all unused/untested. Also, add the ability for items to be "wieldable", which gives specific descriptions for when attacking with them and also modified damage.
2019-11-30 Fix an injectivity issue with saving the gameGriffin Smith1-3/+3
Fix an injectivity issue with JSON-encoding the entity map that was causing the game saving to not properly round-trip. As part of this, there's a refactor to the internals of the entity map to use sets instead of vectors, which should also get us a nice perf boost.
2019-11-29 Use menus for combat and picking up itemsGriffin Smith1-1/+1
Refactor a bunch of stuff around to allow for polymorphically surfacing an EntityChar for all entities, and use this to write a generic `entityMenu` function, which generates a menu from the chars of a list of entities - and use that to fully implement (removing `undefined`) menus for both attacking and picking things up when there are multiple entities on the relevant tile.
2019-11-15 Recover character hitpoints over timeGriffin Smith1-2/+2
Wrap hitpoints in a newtype, and recover character hitpoints over time
2019-10-16 Add draw priorityGriffin Smith1-2/+2
Rather than blindly taking one entity from the list when we have multiple entities on the same tile, add a `drawPriority` method to the Draw typeclass which allows individual entities to request to be drawn on top - this avoids the "noodles floating over your head" bug we saw before.
2019-10-13 Implement speed and ticksGriffin Smith1-5/+64
Gormlaks now move 1/8th the speed of the character, which means we can run away from them - yay! Unfortunately this also introduces a bug where they'll eventually get stuck and not do anything, so I'll be tackling that next.
2019-09-28 Tweak gormlak movement slightlyGriffin Smith1-1/+1
- Don't let gormlaks run into things like walls or each other - Add a small element of randomness to gormlaks' motion - Increase gormlaks' vision by a large amount
2019-09-28 Implement the start of creature AIGriffin Smith1-5/+6
Add a Brain class, which determines for an entity the set of moves it makes every step of the game, and begin to implement that for gormlaks. The idea here is that every step of the game, a gormlak will move towards the furthest-away wall it can see.
2019-09-21 Implement combatGriffin Smith1-3/+11
Put a bunch of gormlaks randomly on the level, and implement combat via damaging those gormlaks by one point.
2019-09-20 Describe what you see when you walk over itemsGriffin Smith1-5/+7
Every step the character takes, describe the entities at that position excluding the character.
2019-09-20 Add doors and an open commandGriffin Smith1-0/+4
Add a Door entity and an Open command, which necessitated supporting the direction prompt. Currently nothing actually puts doors on the map, which puts a slight damper on actually testing this out.
2019-09-19 Add items and inventoryGriffin Smith1-10/+15
Add a new "Item" entity, which pulls from the previously-existent ItemType raw, and add a "PickUp" command which takes the (currently *only*) item off the ground and puts it into the inventory.
2019-09-15 Progressively reveal the map to the playerGriffin Smith1-1/+4
As the character walks around the map, progressively reveal the entities on the map to them, using an algorithm based on well known circle-rasterizing and line-rasterizing algorithms to calculate lines of sight that are potentially obscured by walls.
2019-09-02 Put a test gormlak on the screenGriffin Smith1-0/+32
Implement a concrete "Creature" entity, and place one on the screen at the game startup for testing. This revealed a bug with drawing when getting the maximum entity position, but that appears to be fixed now (yay)