Fix escort service ability when target is of size three #2614
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes issue issue
My wallet address 0xb82c1a2192090acf236f691113b2a823a15eb03b.
The proposed changes are the following:
In the object related to scavenger's escort service change the condition from require function to disable the escort service is based on the hexes usable calculated in the query function. This will be one to one correspondence between the button availability to be used and the hexes available to use for escort .
the distance is changed, now bing equally to the remaining moves so that when it computes the adjiacent haxes from the new x at least the hex behind Scavenger will be taken into consideration.
Let's take an example:
Scavenger size is 2 and target size is 3, the remaining moves are 5 and the target is in front. Until now the distance was Math.floor(crea.remainingMove / trg.size), which would be 2. Then the adjiacent hexes from the x of the target are the two hexes backwards from x which results in not having the possibility to move the target backwards.
With the new change the distance is the remaining moves which is 5. The adjiacent hexes from the x of the target will be 5 hexes backwards which will be the hex behind the Scavenger.