b81b780afc
* map/avatar bash return if they can smash
The skill/resistance are only used for this, so just simplify it.
* Use damage/hp for bashed objects
Add functions for bash data to generate damage/hp values, and use those
instead of directly querying str_{min,max}. This allows expanding how
furniture responds to damage in the future.
The bool arguments could be improved, but work well enough.
Sound shouldn't care about the supported/blocked strength, so just
ignore that, it won't be that different.
* Character/map bash respond to all damage types
Pass in a map of damage types and the amount, instead of just a strength
number.
Add a member to damage types that allows specifying how they convert
into bash damage. Right now, this is zero for all types but bash.
There are rough edges right now where this interacts with pathfinding
and monster bashing: those have a strength integer that they just
convert to {bash: strength}
For simplicity, keep a map::bash overload that takes integer strength,
and just converts it bash damage for the real bash function.
Special mention to the {{{}}} constructor, which is
pair{} -> initializer_list{pair{}} -> map{initializer_list{pair{}}}
* Monsters & pathfinding do bash by damage type
Instead of only bash damage.
This enables NPCs to properly pathfind based on their bash damage.
Enable specifying bash skill as more than just an amount of bash damage
for monsters. Not that anyone uses this in repo anyways. Update the
docs, including adding documentation for this feature.
* Allow specifying damage profile for bashing
Not everything will respond the same to attempting to break it in
different ways. Add infrastructure to allow specifying different
"profiles" for damage on bash data. Because there will be a fairly
limited set of these, and many objects will have the same, make a new
type for it, and just refer to it by id.
* Make bashing terrain/furniture deterministic
Because damage is stored, there's no reason to add a bunch of randomness
to this. Just directly apply damage, and update tests.
The "hp" for bash data can be updated to achieve the desired effect,
instead of rng.
* Add fireaxe test for bashing chances
Now that bashing can do multiple damage types, add a test case that uses
a weapon with a large non-bash damage component.
Because only bash is counted now, this doesn't look much different from
discarding the cut damage.
* Add bashing profile for wooden doors
As is seen in the famous documentary _The Shining_, fire axes are
relatively effective at breaking through doors. Add a bash profile that
favors cut damage, and apply it to wooden doors.
Adjust the tests to account for this.
13 lines
212 B
JSON
13 lines
212 B
JSON
[
|
|
{
|
|
"type": "bash_damage_profile",
|
|
"id": "default",
|
|
"profile": { "bash": 1.0 }
|
|
},
|
|
{
|
|
"type": "bash_damage_profile",
|
|
"id": "wooden_door",
|
|
"profile": { "bash": 0.95, "cut": 1.2 }
|
|
}
|
|
]
|