Author Topic: [Suggestion] Can't use Medi-Kit on a mind-controlled unit  (Read 2288 times)

Offline Delian

  • Commander
  • *****
  • Posts: 527
    • View Profile
[Suggestion] Can't use Medi-Kit on a mind-controlled unit
« on: August 29, 2024, 12:32:49 pm »
In some cases (item medikitTargetMatrix = 31), when the player tries to use a medi-kit on a mind-controlled enemy unit, they're unable to do so, despite this unit technically being "friendly". What could be the problem?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9115
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #1 on: August 29, 2024, 12:40:40 pm »
The unit is still technically "enemy".
It's only seemingly "friendly".

Offline Delian

  • Commander
  • *****
  • Posts: 527
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #2 on: August 29, 2024, 01:06:14 pm »
Ah, thanks for the quick answer.

Hmm. The player's units perceive the mind-controlled unit as their own. They can't fire at it, and they won't reaction fire when it moves around. So for any purpose of selecting targets, unit's current faction is normally used instead of the original faction. Am I wrong to think that this behavior should also apply to medi-kits?

ActionMenuState.cpp -> ActionMenuState::handleAction()
Code: [Select]
if ((weapon->getAllowTargetFriendGround() && bu->getOriginalFaction() == FACTION_PLAYER) ||
(weapon->getAllowTargetNeutralGround() && bu->getOriginalFaction() == FACTION_NEUTRAL) ||
(weapon->getAllowTargetHostileGround() && bu->getOriginalFaction() == FACTION_HOSTILE))
...
if ((weapon->getAllowTargetFriendStanding() && tile->getUnit()->getOriginalFaction() == FACTION_PLAYER) ||
(weapon->getAllowTargetNeutralStanding() && tile->getUnit()->getOriginalFaction() == FACTION_NEUTRAL) ||
(weapon->getAllowTargetHostileStanding() && tile->getUnit()->getOriginalFaction() == FACTION_HOSTILE))
« Last Edit: August 29, 2024, 01:12:54 pm by Delian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9115
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #3 on: August 29, 2024, 01:15:20 pm »
I could compare "current faction" instead of "original faction".

Consequences of that would be:

1. you will not be able to heal a mind-controlled xcom soldier... which (in my personal opinion) is much worse than not being able to heal a mind-controlled alien

2. healing fatal wounds gives experience... which is balanced by soldier being wounded/out of service. Aliens however cannot be "out of service", so the balance would be broken... which is why modders asked me explicitly to implement the feature as it is today.

Original discussion is lost, but feel free to ask e.g. Dioxine.

Am I wrong to think that this behavior should also apply to medi-kits?

There's a lot of places in OXC and OXCE, where current faction is considered and also a lot of places where original faction is considered.

You're not wrong, but you're also not correct.
« Last Edit: August 29, 2024, 01:18:13 pm by Meridian »

Offline Delian

  • Commander
  • *****
  • Posts: 527
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #4 on: August 29, 2024, 02:28:43 pm »
1. That sound logical. A mind-controlled xcom soldier would not allow anyone with a needle to touch them, same way as normal enemies don't (in case of matrix=31). The counter to enemy mind control has always been to mind-control the soldier back.

2. In XPZ, the exp provision wouldn't be affected by this change because most medi-kits that can heal fatal wounds have matrix=63 (e.g. Bandages), so they can already be used on enemies and give exp either way. There's a few exceptions, however, if the player wanted to train soldier exp, then they can always bring extra medi-kits with matrix=63.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9115
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #5 on: August 29, 2024, 02:38:31 pm »
Fair enough.

As I said, it's intentionally implemented this way.

For a change, I'd need a request from (multiple) modder(s).
(and even then also an idea how to keep it backwards-compatible)

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3360
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #6 on: August 29, 2024, 02:47:40 pm »
On other hand how use "human" medkit on organism that have near noting in common with humans?
Most drugs can no effect on alien biology or even be poisonous.
I think this should be separate configs (like bigger bit flags) as current version have logical usage that is not possible in new version.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9115
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #7 on: August 29, 2024, 02:52:15 pm »
In the original game, the medi-kit can already be used on aliens and mind-controlled aliens.

Sorry, but in the original, the aliens don't even bleed.

Offline Delian

  • Commander
  • *****
  • Posts: 527
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #8 on: August 29, 2024, 03:04:14 pm »
For a change, I'd need a request from (multiple) modder(s).
(and even then also an idea how to keep it backwards-compatible)

I would consider the current behavior to be a bug, but we can also go with a suggestion I suppose. In that case, the topic can be moved to the suggestions subforum.

For backwards compatibility, uhh... mediKitUseOriginalFaction... something.

On other hand how use "human" medkit on organism that have near noting in common with humans?

In the original game, the medi-kit can already be used on aliens and mind-controlled aliens. What you're asking for is an ability to customize what sort of races a medi-kit could be used on. But that's far outside the scope of this topic.

Sorry, but in the original, the aliens don't even bleed.

Well, with Aliens Bleeding option on. Hmm. I wonder if you can use painkiller/stim on them...

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9115
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #9 on: August 29, 2024, 03:22:29 pm »
In that case, the topic can be moved to the suggestions subforum.

Moved.

Well, with Aliens Bleeding option on.

Original doesn't have this option (or any option for that matter).
Not that it makes any difference for this discussion anyway.