[WOTC] Nonlethal Combat

If you liked this item, please rate it up on Steam Workshop page.

Author: FearTheBunnies

Last revision: 25 Oct, 2022 at 02:57 UTC (2)

File size: 275.46 KB

On Steam Workshop

Description:
About This Mod

Ever wondered why you can’t just smack an enemy upside the head with the butt of your weapon and knock them out? Well… now you can, with TWO new abilities: Stunning Strike and Stay Down.

  • Stunning Strike is a melee attack that attempts to stun an enemy unit. The stun duration by default is 4 actions, which equates to 2 turns, but Stunned units may naturally recover early! Costs 1 AP but is turn ending.
  • Stay Down is a special melee attack that is activated when standing next to a Stunned unit that allows you to knock that unit Unconscious. Costs 1 AP and is NOT turn ending.

How It Works

There are a few restrictions to who you can target with Nonlethal Combat abilities.

  1. The unit must be at critical health (default 3 HP remaining).
  2. The unit must be organic (no knocking out MECs).
  3. The unit must not be undead (no knocking out Lost).
  4. The unit cannot be a Chosen.
  5. The unit cannot be a Ruler.
  6. The unit cannot be a large unit (no knocking out Berserkers or Gatekeepers).

Once all restrictions are met, then you can attempt to knock them out.

This was designed to help with capturing MOCX units and I figured, why not allow it to attack everything else?

Things to Note
  • Stun duration is counted in ACTIONS not TURNS. So 4 actions is normally equivalent to 2 turns.
  • Unconscious units do NOT count as kills for Experience and leveling.
  • Already configured for the undead units added in [WOTC] World War L, A Better ADVENT: War of the Chosen, ADVENT Warlock – WOTC
  • When using [WotC] The MOCX Initiative, ending a map will NOT auto-capture the unconscious units. They must be extracted before they can be converted.
  • Can be installed mid-campaign, but NOT mid-tactical.
  • Plays nicely with Interrogation And Recruitment and Extract Corpses WOTC
  • [WOTC] Execution is a way to deal with unconscious units keeping maps from being completable. This is no longer a requirement because knocking something unconscious is now a direct choice of the player as opposed to the only way to use this mod.
  • Unconscious units can be damaged with AoE attacks such as grenades.

Configurations

Configuration options that can be found in XComGameData_WeaponData.

  • MAX_HEALTH_SUBDUE: This is the threshold of how much remaining health (or less) the unit has to be targetable by Stunning Strike. By default it is set to 3, meaning this attack is equivalent to a 3 damage melee attack that can ONLY target units it can "kill" (knock unconscious).
  • bEXCLUDE_FULL_HEALTH: Flag controlling whether or not you can knock out healthy units. By default it is set to true representing that healthy units do not have a glass jaw.
  • bEXCLUDE_FRIENDLY: Flag controlling whether or not you can knock out friendly units. There is some strategic uses behind being able to knock out friendlies, and if you want to allow that, you now can. By default it is set to true representing that XCOM has a no-friendly-fire policy.
  • bEXCLUDE_ROBOTIC: Flag controlling whether or not you can knock out robotic units. By default it is set to true representing that robots are walking hunks of metal and don’t care about being smacked.
  • bEXCLUDE_LARGE_UNITS: Flag controlling whether or not you can knock out large units. By default it is set to true representing that big bulky monsters cannot be Stunning Striked.
  • SUBDUE_DURATION: The number of actions for the Stun effect to last. By default it is set to 8 which equates to 4 turns.
  • bSUBDUE_ENDS_TURN: Flag that will toggle whether Stunning Strike should end the turn or not when you use it. By default it is set to true. Strongly recommended that you only set to false when also using bFORCE_ENEMY_WITHIN_TILE_RANGE.
  • bFORCE_ENEMY_WITHIN_TILE_RANGE: Flag to restrict how close an enemy unit can be to attack it with Stunning Strike. By default is set to false. Flip to true to require enemy units to be closer to the user before you can stun them.
  • FORCED_SUBDUE_TILE_RANGE: The radius which bFORCE_ENEMY_WITHIN_TILE_RANGE uses to define the radius in which enemies can be struck. By default it is set to 7.5 which is essentially 1 blue move for a 12 movement unit.
  • bSTAY_DOWN_ADJACENT_ONLY: This config option will allow for Stay Down to be toggled from adjacent knock-out to a moving melee knockout. By default it is set to true which means it will ONLY be usable when standing next to the enemy. If set to FALSE, it uses the same rules as Stunning Strike for AP costs and range.
  • bPATCH_DARK_EVAC: This config option is only relevant when using [WotC] The MOCX Initiative. By default it is set to true which will allow Stay Down to cleanse the Dark Evac state from MOCX units.
  • Targetting lists: There are three targetting lists, SUBDUE_TARGET_INCLUSION, STAY_DOWN_TARGET_INCLUSION, and TARGET_EXCLUSION. By default, the INCLUSION lists have no values and both Stunning Strike and Stay Down use the EXCLUSION list. If a unit type is added to an INCLUSION list, then that ability will ONLY be usable against units in the INCLUSION list for that ability. This will allow for the skill to be scoped to a specific enemy set, such as MOCX.

Configuration options that can be found in XComGame.

  • bAPPLY_SUBDUE_GLOBALLY: Defaults to true. Flipping this to false will keep Stunning Strike from being given to soldiers.
  • bAPPLY_STAY_DOWN_GLOBALLY: Defaults to true. Flipping this to false will keep Stay Down from being given to soldiers.

Known Issues
  • When using the Right Click UI shortcut: The current algorithm greedily chooses the first melee skill it finds and uses it, which could either be Rend or Stunning Strike. I have opened an issue with the Community Highlander team and when it is fixed I will make that version of the highlander a required mod.
  • A lot of Long War of the Chosen mods require No Unconscious AI which will make Stay Down just extend the Stun duration instead of applying Unconscious

Compatibility

Adds new abilities to all classes through scripting. Should be compatible with pretty much anything out there.

Thanks
  • Shout out to Reality Machina whose MOCX Initiative got me creating this guy, as well as using the code for the Execute MOCX as a guide to do this!
  • Daevinski, Skarsatai 2.0 and Crazy_eyed1 for the feedback around completing maps with Unconscious units.
  • MrCloista for the request to add all the new flexibility options!
Download
Required DLC:

These DLC should be installed in order to use this item.


XCOM 2: War of the Chosen
Revisions:

Old revisions of this mod are available below. Click the link to download.