Latest OXCE nightly has a feature that
allows melee weapons to destroy terrain.
Can be enabled using the following ruleset:
constants:
extendedTerrainMelee: 4 # 0 = turned off; 1 to 11 turned on (higher number means that it only applies to taller objects/walls)
Compass directions
W /\ N
/ \
\ /
S \/ E
How it works:
- if there is no unit to attack, game tries to find a wall or an object to attack (
floors cannot be attacked)
- only N/W/S/E attack directions are supported; diagonal NW/SW/NE/SE directions are not supported
-
only 1x1 units can perform such attack, 2x2 units are not supported 2x2 units are also supported since OXCE v6.8.3- only the player can use it,
AI is not capable of using it- the game first tries to find a wall, if not found then tries to find an object:
1. North direction: first North wall on the same tile, then object on next tile
2. East direction: first West wall of next tile, then object on next tile
3. South direction: first North wall of the next tile, then object on the next tile
4. West direction: first West wall on the same tile, then object on the next tile
- walls that don't block movement (e.g. rubble walls) are ignored... with the exception of doors and UFO doors
- objects and walls that are not tall enough are ignored... minimum height is defined using `
extendedTerrainMelee` global constant
- terrain melee never misses; and doesn't support scripting of melee accuracy
- if the attacker is on elevated terrain of height 16 voxels or more (e.g. upper part of stairs), the attack is performed as if the attacker was one tile higher
- damage to terrain is calculated using standard terrain damage formulas, see: `
TileDamageMethod`, `
ToTile` and `
RandomTile` attributes in the ruleset reference:
https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Item_Damage_Types- (if you didn't know already) terrain damage is all or nothing, terrain doesn't have any HP that could be decreased by multiple attacks
EDIT:
- for melee weapons, if primary damage type has
ToTile = 0.0, terrain melee is not attempted (e.g. stun rod)
- for other weapons (e.g. rifle gunbutt), if secondary (melee) damage type has
ToTile == 0.0, terrain melee is not attempted
`
extendedTerrainMelee` refers to 12 LOFTemps of map tile parts, see attached picture.
(btw. each LOFTemp is 2 voxels high, for a total of 24 voxels in one tile)
Constructive feedback welcome.
Tests welcome:
https://lxnt.wtf/oxem/builds//Extended/Extended-6.6.3-f7a8833c6-2020-10-11-win64.7z