aliens

Author Topic: [DONE][Suggestion] soldier skills: check hands support for `battleType`  (Read 851 times)

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
I has a problem: if a unit uses the skill related to melee weapons, there is no way to check only items in hands. So "improved bashing superduper swing" can be not with the sword in hand, but with a knife in pbackpack. Only way is to define each item, available for this skill. But it can be a full list of all melee weapons.

So i propose to add "compatibleWeaponTypes" similar to "compatibleWeapons", to define "Melee" or whatever needed.

Thanks.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: [Suggestion]more types to define items for Skills
« Reply #1 on: October 23, 2024, 05:09:29 pm »
I has a problem: if a unit uses the skill related to melee weapons, there is no way to check only items in hands.

The documentation says there is an attribute just for that... does it not work?

`checkHandsOnly: true`

https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Soldier_Skillls

So i propose to add "compatibleWeaponTypes" similar to "compatibleWeapons", to define "Melee" or whatever needed.

Isn't this also already available? Or does it not work?

`battleType: 3`

https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Soldier_Skillls

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: [Suggestion]more types to define items for Skills
« Reply #2 on: October 23, 2024, 06:24:01 pm »
When "battleType" used, "checkHandsOnly"  does not apply.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: [Suggestion]more types to define items for Skills
« Reply #3 on: October 23, 2024, 06:29:32 pm »
ok, I will check

Offline Dadimus_Maximus

  • Sergeant
  • **
  • Posts: 21
    • View Profile
Re: [Suggestion]more types to define items for Skills
« Reply #4 on: October 24, 2024, 05:36:17 am »
ok, I will check
Happy 9000th post!  8)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: [Suggestion]more types to define items for Skills
« Reply #5 on: October 25, 2024, 05:44:48 pm »
When "battleType" used, "checkHandsOnly"  does not apply.

Yup, it's not checked.

There's even a note in the source code that it is not checked: https://github.com/MeridianOXC/OpenXcom/blob/oxce-plus/src/Battlescape/SkillMenuState.cpp#L309

@memmaker: is this intentional/desired or can I change it?

Offline memmaker

  • Captain
  • ***
  • Posts: 96
    • View Profile
Re: [Suggestion]more types to define items for Skills
« Reply #6 on: October 27, 2024, 07:16:04 am »
I only remember this vaguely, but I am pretty sure you'd want to be able to query more precisely. So I'd say you can just change it.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: [DONE][Suggestion] soldier skills: check hands support for `battleType`
« Reply #7 on: November 01, 2024, 12:15:30 pm »
When "battleType" used, "checkHandsOnly"  does not apply.

Added `checkHandsOnly2`, which applies for `battleType`.
Default false (for backwards-compatibility).

Example:

Code: [Select]
skills:
  - type: STR_SLASH
    costUse:
      time: 5
    targetMode: 10
#    compatibleWeapons: [STR_STUN_ROD]
    battleType: 3
    checkHandsOnly2: true   # default false

soldiers:
  - type: STR_SOLDIER
    skillIconSprite: 1
    skills:
      - STR_SLASH

PS: `battleType` can now also search within special weapons (not only inventory), same as `compatibleWeapons`... a small backwards-incompatibility, which hopefully doesn't bother anyone... if yes, shout

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: [DONE][Suggestion] soldier skills: check hands support for `battleType`
« Reply #8 on: November 01, 2024, 01:56:59 pm »
Thanks, that way is even better.