The GameSecret class#
Related module: pyzora.game_secret
- class pyzora.game_secret.GameSecret(*args, **kwargs)#
Bases:
BaseSecretA secret used to start a linked game.
CAUTION : Non-Hero linked secrets are generated by one game and target the opposite one, but Hero’s Secrets (non-linked) are generated by the same game they are intended for.
- property target_game#
The game the secret is meant for.
If you attempt inputting a secret meant for Ages in Seasons, for example, the input will fail.
- Type:
- property is_hero_quest#
A Hero’s Secret allows the player to start the game anew and get a special ring.
- Type:
bool
- property is_linked_game#
If a game is linked, some additional events will happen in the target game.
- Type:
bool
- property link_name#
Link’s name. Takes at most 5 characters to fit in the secret.
If you set this with a value containing spaces, they will be converted into null characters for compatibility with the secrets.
- Type:
str
- property child_name#
Game secrets also store Bipin and Blossom’s child’s name.
If you set this with a value containing spaces, they will be converted into null characters for compatibility with the secrets.
- Type:
str
- property animal#
The companion Link has obtained. During linked games, this should be set. In linked games, the companion stored in the secret will recognise Link and give him his flute again.
CAUTION: do NOT try to generate linked secrets with ObtainedCompanion.NONE as the animal friend! While Ages does have a check to prevent you from getting stuck due to the lack of an animal friend and gives you Moosh if you input a secret with no animal friend, Seasons doesn’t, and you will get stuck.
- Type:
ObtainedCompanion
- property behaviour#
Bipin and Blossom’s child’s behaviour is carried over through secrets.
Note that the value stored here is NOT indicative of the child’s behaviour on its own.
- Type:
int
- property was_given_free_ring#
This should be set if the player has already received the Friendship Ring from Vasu.
- Type:
bool
- classmethod load(secret: bytes | bytearray | str, region: GameRegion) GameSecret#
Load a game secret from bytes or a string.
- Parameters:
secret (str or bytearray) – The secret string/byte array to decode (if secret is an instance of str, then it will be parsed prior to loading).
region (GameRegion) – The region to use when loading the secret.
- Raises:
SecretError – if the given data is not 20 bytes long (only if used with bytes or bytearray, since strings will be parsed and reduced to 20 bytes).
NotAGameCodeError – if the given data is not for a game secret.
ChecksumError – if the given data’s checksum doesn’t match the expected one.
- Returns:
A secret based on the data contained in secret.
- Return type: