about summary refs log tree commit diff
path: root/users/grfn/xanthous/src/Xanthous/Entities (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-11-25 r/3098 feat(gs/xanthous): Creatures use their weapons to attackGriffin Smith3-0/+19
If a creature has a weapon wielded, then they now use that weapon to attack the player *instead of* their natural attacks. This uses a new `creatureAttackMessage` field on the Item raw for the message to use. Change-Id: I73614f33dbf88dd4c68081f15710fa27b7b21ba2
2021-11-25 r/3097 feat(gs/xanthous): Allow generating creatures with itemsGriffin Smith6-75/+66
Add an `equippedItems` field to the CreatureType raw, which provides a chance for generating that creature with an item equipped, which goes into a new `inventory` field on the creature entity itself. Currently the creature doesn't actually *use* this equipped item, but it's a step. This commit also adds a broken-dagger equipped 90% of the time to the "husk" creature. Change-Id: I6416c0678ba7bc1b002c5ce6119f7dc97dd86437
2021-11-22 r/3081 refactor(gs/xanthous): Break out inventory into a common moduleGriffin Smith2-227/+248
Creatures are going to have an inventory too now in addition to characters, so all the data types and lenses and stuff that define inventory need to be broken out into a separate module so the Creature entity can use them. Change-Id: I83f1c70d316afaaf2e75901f9dc28f79fd2cd31f Reviewed-on: https://cl.tvl.fyi/c/depot/+/3901 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2021-11-13 r/3061 feat(gs/xanthous): Add a Husk creature, with limited generationGriffin Smith3-15/+99
Add a new "husk" creature raw, limited to only being generated on levels >= 1, including support for actually doing that limiting. These guys are gonna get daggers next! Change-Id: Ic4b58dc7ee36b50ced60fec6912cd1b46269d55c Reviewed-on: https://cl.tvl.fyi/c/depot/+/3868 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-11-13 r/3060 feat(gs/xanthous): Add a broken dagger rawGriffin Smith1-0/+21
The plan is to use this as a test bed for generating creatures wielding items, but for know it just shows up on the ground in places. Change-Id: I8b292606f425cd41bff9e52727f1094886777102 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3867 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-10-30 r/2994 feat(gs/xanthous): Allow throwing rocksGriffin Smith1-0/+10
Implement a first pass at a "fire" command, which allows throwing rocks, the max distance and the damage of which is based on the weight of the item and the strength of the player. Currently the actual numbers here likely need some tweaking, as the rocks are easily throwable at good distances but don't really deal any damage. Change-Id: Ic6ad0599444af44d8438b834237a1997b67f220f Reviewed-on: https://cl.tvl.fyi/c/depot/+/3764 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-06-23 r/2681 feat(xanthous): Describe *where* the item is in the inventoryGriffin Smith1-8/+69
When describing items in the inventory, both in detail and when producing menus from those items, describe not just the item itself but also *where* in the inventory the item is (either in the backpack, or wielded in either or both of the hands). This uses a new InventoryPosition datatype, and a method to get a list of items in the inventory associated with their inventory position. When *removing* items from the inventory (to wield, drop, or eat them), we want to make sure we remove from the right position, so this also introduces a `removeItemAtPosition` method to make that happen correctly. Finally, some of the tests for this stuff was getting really slow - I narrowed this down to runaway arbitrary generation for message Templates, so I've tweaked the Arbitrary instance for that type to generate smaller values. Change-Id: I24e9948adae24b0ca9bf13955602108ca9079dcc Reviewed-on: https://cl.tvl.fyi/c/depot/+/3228 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-06-23 r/2680 feat(xanthous): Add a command to describe an item in the inventoryGriffin Smith1-0/+13
Add a new DescribeInventory command, bound to I, to prompt for an item in the inventory (anywhere in the inventory, including wielded) and display a (new) panel describing it in detail. This description includes the description, the long description, and the item's physical properties (volume, density, and weight). Change-Id: Idc1a05ab16b4514728d42aa6b520f93bea807c07 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3227 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-06-23 r/2679 feat(xanthous) Generate random volume+density for itemsGriffin Smith4-14/+32
Generate random volumes and densities for items based on the ranges for those two quantities in the raw when building instances of items. Since this is the first time creating an item is impure, this also lifts entity generation into a (random) monadic context Change-Id: I2de4880e8144f7ff9e1304eb32806ed1d7affa18 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3226 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-06-23 r/2678 feat(xanthous): Track the volume and density of item typesGriffin Smith3-2/+25
Allow the itemType raw to have density and volume fields, both of which represent *intervals* of both density and volume (because both can hypothetically vary a bit). The idea here is that when we're making an *instance* of one of these items, we pick a random value in the range. Lots of stuff in this commit is datatype and typeclass instances to support things like intervals being fields on datatypes that get serialized to saved games - including a manual definition of Ord for Item since Ord isn't well-defined for intervals Change-Id: Ia088f2f75cdce9d00560297e5c269e3310b85bc3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3225 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-06-18 r/2676 feat(xanthous): Fistfighting builds knuckle callusesGriffin Smith1-14/+135
2000 ticks after the character damages their fists by hitting something, the character now develops calluses on their fists (scaled by *how* damaged they've become) that reduce the chance of them receiving additional damage from hitting things - up to a max of 5, which prevents *all* damage from fistfighting. This is all tracked in a new "Knuckles" struct in a new "Body" struct on the character datatype, which manages stepping itself forward as part of the Brain impl on the character. Change-Id: Ica269f16fb340fb25900d2c77fbad32f10c00be2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3222 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-06-18 r/2675 feat(xanthous): Add an auto-rest commandGriffin Smith1-0/+6
Add a command that automatically rests (essentially just stepping the game forwards) until the character's hitpoints are back to full. Currently due to the time it takes for the character to heal this takes a bit too long - my thought there is to make the per-step delay for autocommands different depending on the specific autocommand. Change-Id: I40378c29d3d9d19e9787af1f015bde65fd08868c Reviewed-on: https://cl.tvl.fyi/c/depot/+/3221 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-06-18 r/2674 feat(xanthous): Add configurable natural attacksGriffin Smith3-4/+35
Allow configuring the natural attacks (eg, part of their body rather than an item) of a creature. Each attack has a description and a damage associated with it. Change-Id: I69698a8ac4ee2da91e4c88e419593627519522a5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3220 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-06-18 r/2672 feat(xanthous): Add an ooze creature typeGriffin Smith2-2/+14
This required making sayVerb optional, as oozes don't say anything Change-Id: I2c7f425ca26d92beef1097eda49d84f00c84c482 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3218 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-06-14 r/2661 feat(xanthous): Gormlaks yell in gormlak when they see the characterGriffin Smith3-2/+14
Add a new "greetedCharacter" field to the creature hippocampus type, which tracks whether or not that creature has greeted the character yet. In the gormlak AI, when the gormlak sees the character and starts running towards them, if that field is set to False send a message that says that the gormlak yells a single randomly-generated gormlak word at the character, then set the field to true The gormlak yells "gukblom"! Change-Id: I17a388393693a322c2e09390884ed718911b2fc4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3207 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-06-14 r/2659 feat(xanthous): Store language on creaturesGriffin Smith2-1/+29
Add a new "language" field to the CreatureType raw type, which references the *name* of the language that creature speaks (this is so that different creatures can speak the same language without having to duplicate the language definition in the raws). At some point this should change to not hardcode the sets of languages and instead define them in data files like we do for creatures, but this is fine as a start. Change-Id: I6708570175e23472cb37e0061a329e54e8eac9c0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3205 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-06-14 r/2658 feat(xanthous): BangPattern all fields in RawsGriffin Smith1-10/+10
This is generally just good practice for foundational data-types like these Change-Id: I88c5b6b73dad6665cf25837b8d6a9e0ea66f2b0b Reviewed-on: https://cl.tvl.fyi/c/depot/+/3204 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2021-04-12 r/2485 refactor(users/glittershark): Rename to grfnGriffin Smith14-0/+1021
Rename my //users directory and all places that refer to glittershark to grfn, including nix references and documentation. This may require some extra attention inside of gerrit's database after it lands to allow me to actually push things. Change-Id: I4728b7ec2c60024392c1c1fa6e0d4a59b3e266fa Reviewed-on: https://cl.tvl.fyi/c/depot/+/2933 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: lukegb <lukegb@tvl.fyi> Reviewed-by: glittershark <grfn@gws.fyi>