Files
ehughsbaird b81b780afc terrain/furniture/field bashing can respond to more than bash damage (#81838)
* 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.
2025-09-27 23:39:42 -05:00

1.0 KiB

Smashing

Smashing is a feature that allows dealing damage to furniture, terrain, and fields on the map.

The "hp" for these objects is determined by subtracting the appropriate str_max value from the str_min value.

When one of these is smashed, the damage types of the characters weapon are applied to the damage profile of the bashed object to determine damage points. For terrain and furniture, this damage is stored, and once enough damage has been done, it will be destroyed. For fields, it is a (damage/hp) chance.

Damage Profile

A damage profile defines multipliers for converting each damage type into damage dealt in a smash action.

{
  "id": "my_profile",
  "type": "bash_damage_profile",
  "profile": { "bash": 1.0, "cut": 0.5, "stab": 2.0 }
}

Damage points are determined by multiplying the damage of each type of the weapon against the multiplier defined in profile, subtracting the str_min, then summing.

For damage types not specified, the multiplier is determined by the bash conversion factor specified by the damage type.