Okay, is somewhat OT, but there have been times in Earth history, where being illgitimate didn't necessarily mean you were out of the running to inherit a throne, particularly if there was a lack of legitimate heirs left.
Henry Tudor, had ancestry of dubious legitimacy. On his mother's side, he was descended from John, Duke of Lancaster and his mistress, Katherine Swynford. The offspring of this relationship were legitmized by Richard II, but with the proviso that there were barred from succession to the throne. And on his father's side? Well, Henry's grandmother had been Catherine of Valois, a French princess who had been married to Henry V, and mother of Henry VI. After her husband's death, Catherine had become involved with a Welsh squire, Owain Tudor. They had at least two children, Edmund and Jasper. Whether or not, Owain and Catherine ever married is not clear. But, their half brother, Henry VI. recognised them, conferring upon them lands and titles. And in Edmund's case, a wife, 12 year old Margaret Beaufort, a descendant of John Duke of Lancaster and Katherine Swynford. The result of this marriage was Henry.
Now, a couple of generations before, one of John of Lancaster's legitimate sons, Bolingbroke, had siezed power from Richard II. Richard died in prison, probably murdered, soon after, and left no heirs. There were people in England with a better claim to the throne than Bolingbroke. But, as he was a more competent king than Richard II, he was more or less accepted by the establishment. He became Henry IV, and his son, Henry V, the warrior king who led the English to victory against the French at Agincourt. He married Catherine of Valois, and they had a son, yet another Henry. Unfortunately, Henry V, died when his son was only nine months old, leaving him with some very big boots to fill.
Worse still, Henry VI, suffered from severe mental illness for much of his life. He would go into a catatonic, zombie-like state for months on end. The first and most severe bout occurred during his wife's pregnancy, and lasted for well over a year. He was surrounded by men who squabbled over how the kingdom should be run, and just who should run it. And when his wife, Margaret of Anjou insisted on having a hand in running the kingdom, things really went to hell.
It was at this point that people remembered that there were people in England who had a better claim to the throne than Henry, and the sorry mess known as the Wars of the Roses started. Long story short, Henry VI was dethroned by the Yorkist who became Edward IV; Margaret of Anjou and their son were forced into exile, and Henry spent several years in the Tower. A number of years later, Henry's supporters tried to take back the English throne. They lost out. Henry's son died in battle, Margaret of Anjou was captured by the Yorkists. Henry would die in the Tower, probably murdered. There ended the legimate line of Lancastrian kings.
But, young Henry Tudor was Henry VI's nephew, and could claim descent from John, Duke of Lancaster. He would grow up in exile, and supported by the Lancastrian faction attempt to twice take the throne. The first time, he failed. The second time, thanks to some powerful nobility changing sides at the last minute, he claimed the throne at Redmore Plain, otherwise known as Bosworth Field. He would become Henry VII, the father of Henry VIII, grandmother of Edward VI, Mary I and Elizabeth I.
Hope you can follow all this. The whole Wars of the Roses business is very complicated, and I have simplified it a lot. But that was how Henry Tudor, who had illgetimate ancestors ended up as king of England.
I should add that Henry VII and his son Henry VIII had no qualms about getting rid of any remaining Yorkist heirs. One was a nephew of Yorkist king Edward IV who was held in the Tower from the time he was 10, until the time of his execution when he was 24. Another was an illgitimate son of Richard III, who was executed.