Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the logic of transferring artifacts after a battle #9594

Merged
merged 5 commits into from
Feb 26, 2025

Conversation

oleg-derevenetz
Copy link
Collaborator

@oleg-derevenetz oleg-derevenetz commented Feb 24, 2025

fix #9592

If I understood correctly, this is exactly how it should work. Here is a video of the artifact transfer process (the source has been modified a bit to allow the artifact transfer on retreat or surrender):

fheroes2.engine.version_.1.1.6.2025-02-24.23-28-59.mp4

@oleg-derevenetz oleg-derevenetz added bug Something doesn't work logic Things related to game logic labels Feb 24, 2025
@oleg-derevenetz oleg-derevenetz added this to the 1.1.7 milestone Feb 24, 2025
@zenseii
Copy link
Collaborator

zenseii commented Feb 24, 2025

@oleg-derevenetz . The logic looka correct apart from the transfer of ultimate artifacts. From what I understand, the UA will never leave the defeated hero, right @LeHerosInconnu ?

Meanwhile, I'm aware that in the original game the winning hero gets an empty inventory slot per UA on the defeated hero but this seems strange to me, which means that items are skipped. I'll ask for people's opinion on it in the issue thread.

@oleg-derevenetz
Copy link
Collaborator Author

From what I understand, the UA will never leave the defeated hero

According to my understanding, they either disappear or remain with the defeated hero. The winner never gets them. It works the same way here.

I'm aware that in the original game the winning hero gets an empty inventory slot per UA on the defeated hero but this seems strange to me, which means that items are skipped.

Well, in this PR, empty slots for UA also remain in the winner's bag, just at the end, not in the middle. I don't think it's essential.

@zenseii
Copy link
Collaborator

zenseii commented Feb 25, 2025

According to my understanding, they either disappear or remain with the defeated hero. The winner never gets them. It works the same way here.

I've tested this now and can confirm that in the case when a UA is attempted to be transferred when there's space in the winning hero's inventory, it will disappear from the losing hero's inventory too.

@oleg-derevenetz oleg-derevenetz marked this pull request as ready for review February 25, 2025 09:39
@LeHerosInconnu
Copy link

Hello @zenseii and @oleg-derevenetz,

Here is a video of the artifact transfer process (the source has been modified a bit to allow the artifact transfer on retreat or surrender):

It's only for demonstration purposes, right? :)

@oleg-derevenetz . The logic looka correct apart from the transfer of ultimate artifacts. From what I understand, the UA will never leave the defeated hero, right @LeHerosInconnu ?

If the victorious hero has a free slot in his inventory, he tries to grab the ultimate artifact, but it disappears as soon as he tries.
The defeated hero retains an ultimate artifact only if the winning hero doesn't try to grab it, i.e. when his inventory no longer has a free slot to capture, or try to capture, the next artifact in the defeated hero's inventory.

Meanwhile, I'm aware that in the original game the winning hero gets an empty inventory slot per UA on the defeated hero but this seems strange to me, which means that items are skipped. I'll ask for people's opinion on it in the issue thread.

Yes, it's weird and doesn't really make sense.

@ihhub ihhub merged commit 42db4cb into ihhub:master Feb 26, 2025
22 checks passed
@ihhub
Copy link
Owner

ihhub commented Feb 26, 2025

@oleg-derevenetz , a bunch of thanks for the fix!

@oleg-derevenetz oleg-derevenetz deleted the artifact-capture-fix branch February 26, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work logic Things related to game logic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Excess artifacts on a defeated hero should remain on that hero
4 participants