Open zenseii opened 1 month ago
Step 1 in this issue is to verify the artifact transfer logic of the original game. Note that in the original game it was not possible to reorder artifacts in the bag (see https://github.com/ihhub/fheroes2/issues/1643).
I think that if this gets implemented, only the higher difficulties should use this tactic.
Preliminary checks
Describe the problem requiring a solution
Currently if an AI hero has met up with another hero and exchanged artifacts, it will have its artifacts ordered from best to worst, and this means that when they lose a battle the winner will get the best artifacts first. It should be the opposite.
Describe the possible solution
Add logic for the AI to sort its artifacts from worst to best, both after it has met and exchanged artifacts and other situations when it gets artifacts. The latter could be the first turn because its possible that a hero starts with artifacts, in which case they should be sorted by the AI.
Additional info
I have not checked if this logic of transferring artifacts to the winner in fheroes2 is the same as in the original game. If the original game transfers artifacts over to the winner according to different rules, like according to artifactID, then we should discuss if we want to reimplement that.