-
Notifications
You must be signed in to change notification settings - Fork 127
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 Draftmancer pick breakdown #2606
Fix Draftmancer pick breakdown #2606
Conversation
the first. Add the count of picks of the previous packs to the current index from the draftmancer log, instead of InitialState which is for CubeCobra drafts.
@@ -142,7 +146,7 @@ const DraftmancerBreakdown: React.FC<BreakdownProps> = ({ draft, seatNumber, pic | |||
</Flexbox> | |||
</Col> | |||
<Col xs={6} sm={8} lg={9} xl={10}> | |||
<Text semibold lg>{`Pack ${(pack || 0) + 1}: Pick ${pick}`}</Text> | |||
<Text semibold lg>{`Pack ${pack || 0}: Pick ${pick}`}</Text> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DraftMancer drafts, unlike CubeCobra drafts, have to break the picks into packs ourselves and the code starts that at 1. CubeCobra packs are arrays starting from zero.
if (draft.InitialState !== undefined) { | ||
picks += draft.InitialState[0][i].cards.length; | ||
} | ||
picks += picksList[i].length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sum the picks of the packs before this one. That plus the index within this pack is the overall card index
} | ||
} | ||
|
||
if (i === parseInt(pickNumber)) { | ||
cardsInPack = log[i].booster; | ||
pick = log[i].pick; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log[i].pick
is the card index of the overall set of cards, as best I can see
Problems
Testing
I tested a Draftmancer draft locally in two ways:
Before
As you click through the picks once you get to pack 2 you see the same cards as in pack 1 and the same pick #. Also you can see the pack/pick numbers are all over the place.
![old-draftmancer-draft-picks-recycles-first-pack](https://private-user-images.githubusercontent.com/10130745/412171268-494ce94c-4e4b-44a7-aa0c-d54197697310.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5NzQ2MzUsIm5iZiI6MTczOTk3NDMzNSwicGF0aCI6Ii8xMDEzMDc0NS80MTIxNzEyNjgtNDk0Y2U5NGMtNGU0Yi00NGE3LWFhMGMtZDU0MTk3Njk3MzEwLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDE0MTIxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIxY2Q4OTc3YjFiOTFiMjNiNWNkMzk3YTUwODMxNjQ5YjA5ZjRmZmJkOGQ1YzBhYTM5MGExMGIyMjNiMTVkOTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7vASy_HZql0Lg9V-W7Yt8yoAieWRE1q6tdXtj30OtFU)
After
Now each pack shows the correct cards
![new-draftmancer-draft-picks-through-packs](https://private-user-images.githubusercontent.com/10130745/412171369-e96ddca6-6c7a-472d-a227-60aa605439dc.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5NzQ2MzUsIm5iZiI6MTczOTk3NDMzNSwicGF0aCI6Ii8xMDEzMDc0NS80MTIxNzEzNjktZTk2ZGRjYTYtNmM3YS00NzJkLWEyMjctNjBhYTYwNTQzOWRjLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDE0MTIxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI0MTNhYzU4NGVhODFiYTJjMDg0NjUyNGU2ODI0ZDBhMjNkM2YxYzRlMGZiMjBiMGRiZDVlM2E0MWQxOGQzYzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.q-_1wVTzdD7obUOJqIP8AAt9COTMKZlvEke1mQC1FV8)
And the pick/pack number are accurate
![new-draftmancer-draft-picks-wacky-draft-correct-pack_pick-numbers](https://private-user-images.githubusercontent.com/10130745/412171744-713df08b-de37-4217-94e6-41340ed3fde5.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5NzQ2MzUsIm5iZiI6MTczOTk3NDMzNSwicGF0aCI6Ii8xMDEzMDc0NS80MTIxNzE3NDQtNzEzZGYwOGItZGUzNy00MjE3LTk0ZTYtNDEzNDBlZDNmZGU1LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDE0MTIxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE3ZWIyNWU0MjM4NDY2MzdlMWM4ZDA3MzI2YzA4MTE5NmM0MmZlYWMyN2ViM2ZkZTM4YWQ2ZDNhMmU3NjI4MDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Whvnwha5P-e60wiqYlu5nESTAamMcP1Uy1XqC98337Q)