#4 = terms etc #1 - RNG #2 - defs #3 - mechs #5 - rng methods #6 - rng list starting rules: Balamb: Open Galbadia: Same Trabia: Plus, Random Centra: Same, Plus, Random Dollet: Random, Elemental FH: Sudden Death, Elemental Lunar: Open, Same, Plus, Random, Sudden Death, Same Wall, Elemental Esthar: Same Wall, Elemental =============================================================================== #4. Definitions, Terms =============================================================================== #todo =============================================================================== #1. Random Number Generator =============================================================================== #todo =============================================================================== #2. Variables =============================================================================== This section covers all variables that come into play during rule manipulation. You don't have to understand this to manipulate the card game rules, so this is mainly for those who want to know what the game does behind the scenes. ------------------ #2.1 Carried Rules ------------------ The game has two variables for the rules Squall carries, which I'll call "carried rules (most recent)" and "carried rules (second most recent)". Their relationship becomes apparent when you read section #3, especially #3.1.4. Basically, if one of these two variables is not equal to the rules of the region you are in, you can mix rules. The game also saves the origin (region) of the rules Squall is carrying, but it's only used for the "You have rules from X, let's mix!" message box. ----------------------------- #2.2 Region Rules Spread From ----------------------------- This variable specifically refers to trade rules and can be changed by just challenging (depending on the "amount of trading", see below). If you repeatedly challenge players in one region, the "region rules spread from" will eventually (again, see below) become the region you are in. You can find out where rules are spreading from by talking to the Queen of Cards while she is in Balamb. ---------------------- #2.3 Amount of Trading ---------------------- Amount of trading changes when you challenge someone and directly influences the region rules spread from. (You don't even have to play a card game) - It will increase by one (capped at 10) if you challenge in the region rules spread from. - It will decrease by one (capped at 0) if you challenge in any other region. - If it's already 0 and you didn't challenge in the region rules spread from, the region you are in will become the region rules spread from, but the value still remains 0. The higher the amount of trading, the higher the probability that the trade rule of a random region will be changed. (see section #3.2.10) You can find out the approximate value by talking to the Queen of Cards, but only if she gives her lengthened speech (see next section): 0 to 2: "little trading" 3 to 5: "much trading" 6 to 10: "some trading" As DaBubba pointed out, the text for the values 6 to 10 is a mistranslation; it's supposed to be "a lot of trading". An example: Rules spread from region A, you are currently in region B. Amount of trading is 10. You challenge => Amount of trading = 9, Rules spread from A You challenge again => Amount of trading = 8, Rules spread from A (you challenge 7 more times) => Amount of trading = 1, Rules spread from A You challenge again => Amount of trading = 0, Rules spread from A You challenge again => Amount of trading = 0, Rules spread from B You challenge again => Amount of trading = 1, Rules spread from B (you challenge 8 more times) => Amount of trading = 9, Rules spread from B You challenge again => Amount of trading = 10, Rules spread from B I.e. It doent matter where rules spread from or what the amount of trading is, after challenging 21 times, rules will spread from your current region and the amount of trading will be 10. ---------------------- #2.4 Trade Rule Points ---------------------- After a card game (you can also just quit), trade rule points can (see section #3.2.10) increase by a random amount, from 0 to 7. If the resulting value is greater than 250, it's reset to 0. The higher the trade rule points are, the higher the probability that a random region's trade rule will be set to One. (see section #3.2.10) You can find out the approximate value by talking to the Queen of Cards: 0 to 127: No changes to her speech. 128 to 250: Will give a shortened speech and mention that the trade rules are moving towards One. =============================================================================== #3. Card Rule Mechanics =============================================================================== This section will cover everything that's happening right after you challenge someone as well as what happens right after the game, step by step. As with the last section, you don't have to understand this to manipulate the card game rules. ============== #3.1 Functions ============== First some commonly used functions I'll be referring to. ---------------- #3.1.1 getRandom ---------------- Creates a random integer in the range 0 to 255. ---------------------- #3.1.2 getRandomRegion ---------------------- regionID = [ getRandom / 32 ] If regionID == 0: return Balamb Else If regionID == 1: return Galbadia Else If regionID == 2: return Trabia Else If regionID == 3: return Centra Else If regionID == 4: return Dollet Else If regionID == 5: return FH Else If regionID == 6: return Lunar Else return Esthar -------------------- #3.1.3 getRandomRule -------------------- ruleID = [ getRandom / 32 ] If ruleID == 0: return Open Else If ruleID == 1: return Same Else If ruleID == 2: return Plus Else If ruleID == 3: return Random Else If ruleID == 4: return Sudden Death Else If ruleID == 5: return Open Else If ruleID == 6: return Same Wall Else return Elemental Note: The probability of Open being selected is twice as high as other rules'. -------------------- #3.1.4 pushRulesBack -------------------- carried rules (second most recent) = carried rules (most recent) carried rules (most recent) = region rules ============== #3.2 Mechanics ============== Onto the juicy bits. I've tried to include notes describing what's happening as the pseudo code sometimes isn't easy to read. ------------------------------- #3.2.1 Step 1: Push rules back? ------------------------------- If getRandom < 64: pushRulesBack Note: In other words, there is a 25% chance that this region will be set as the "most recent" one. If this is the second time rules are pushed back, you can't mix anymore in the current region. ----------------------------------- #3.2.2 Step 2: Will rules be mixed? ----------------------------------- selected_rules = None If carried rules (most recent) != region's rules: selected_rules = carried rules (most recent) Else selected_rules = carried rules (second most recent) Note: Will try to select one of the two sets of carried rules that aren't equal to the region's rules. If all three are equal, you won' be able to mix anyway. If selected_rules has at least one rule current region doesn't: If getRandom < 255: rules will be mixed after the game and you get a message box with the usual "you have rules this region doesn't, lets mix" speech. Note: Even if you *could* mix rules, there is a probability of 1/256 that you won't. ------------------------------------------------------------- #3.2.3 Step 3: Will this region adopt the Queen's trade rule? ------------------------------------------------------------- Note: This step only happens when the Queen of Cards is in the current region. If she isn't, skip this. If getRandom < 90: current region's trade rule = Queen's trade rule Note: There's a probability of 35.16% that the current region will adopt the Queen's rule. --------------------------------------- #3.2.4 Step 4: Update amount of trading --------------------------------------- If rules spread from current region: If amount if trading < 10: amount of trading = amount of trading + 1 Else: If amount of trading == 0: region rules spread from = current region Else if amount if trading > 0: amount of trading = amount of trading - 1 Note: This will update amount of trading as described in section #2.3. ---------------------------------------------------- #3.2.5 Step 5: Change the Queen of Card's trade rule ---------------------------------------------------- Note: This step only happens when you're challenging the Queen of Cards. If you don't (even if she's in the current region), skip this. rnd = getRandom Note: The Queen's trade rule will be upgraded if rnd is below 110 and degraded if it's between 110 and 219 (both inclusive), use the following chart to determine what the new trade rule is: |-----------------------||-------------rnd's value--------------| | Queen's original rule || 0 to 109 | 110 to 219 | 220 to 255 | |=======================||============|============|============| | One || Diff | Diff | One | | Diff || Direct | One | Diff | | Direct || All | Diff | Direct | | All || Direct | Direct | All | |-----------------------||------------|------------|------------| Note: As you can see, there's a 43% probability that her rule will be upgraded, 43% that it'll be degraded and 14% that nothing changes. Additionally, her rule will upgraded with a probability of 86% if it's One and degraded with the same chance if it's All. ---------------------------- #3.2.6 Step 6: The Card Game ---------------------------- In this step, you will be prompted to start the game. If you refuse, nothing else happens and if you agree, the card game starts. Note that you don't actually have to play (except if you're playing against the Queen of Cards and want to move her somewhere else) and can just select Quit for the following steps to happen. Another interesting fact is that everything up to now can be done without actually playing a single game (e.g. change the Queen's trade rule or have the current region adopt her rule, if she's there). --------------------------------- #3.2.7 Step 7: Update most recent --------------------------------- If carried rules (most recent) != region rules: pushRulesBack Note: Squall's carried rules (most recent) will be set to this region's, but you still can mix rules if the second most recent slot has foreign rules. However, if you start the card game and then trigger the check of step 1 when you challenge again, you won't be able to mix. ---------------------------------------------------- #3.2.8 Step 8: Abolish random rule if region has all ---------------------------------------------------- If region rules == all rules: If getRandom < 64: random_rule = getRandomRule remove random_rule from this region's rules pushRulesBack pushRulesBack Note: This will remove a random rule with a chance of 25% from the current region if it has all rules (like Lunar). Furthermore, you won't be able to mix anymore in this region and the "rule X was abolished" message box will be shown. --------------------------------------- #3.2.9 Step 9: The spread/abolish check --------------------------------------- Note: This step only happens if step 2 determined that rules will be mixed, otherwise skip this. Also, to improve readability, "carried rules (second most recent)" will be shortened to "rules (2nd)" rule1 = getRandomRule If rule1 is in rules (2nd) but not in region rules: add rule1 to region rules pushBackRules pushBackRules display "rule was spread" message box. Else: rule2 = getRandomRule If rule2 is in rules (2nd) but not in region rules: add rule2 to region rules pushBackRules pushBackRules display "rule was spread" message box. Else: rule3 = getRandomRule If rule3 is in rules (2nd) but not in region rules: add rule3 to region rules pushBackRules pushBackRules display "rule was spread" message box. Else If rule3 is in region rules: If getRandom < 128 remove rule3 from region rules pushBackRules pushBackRules display "rule was abolished" message box. Note: What this does is generate up to three three random rules and see if one of them is carried by Squall while not being in the current region's ruleset. If so, the first where this applies is spread into the region. However, if all three could not be spread, the game will abolish the third generated rule with a chance of 50% (provided it's in the current region's ruleset). Also, if you spread/abolish something, you can't mix anymore in this region. ---------------------------------------- #3.2.10 Step 10: Trade Rule Modification ---------------------------------------- If amount of trading > [ getRandom / 25 ]: random_region = getRandomRegion random_region's trade rule = trade rule of region rules spread from trade rule points = trade rule points + [ getRandom / 32 ] If trade rule points > 250: trade rule points = 0 If getRandom < trade rule points: random_region = getRandomRegion random_region's trade rule = One Note: There is a (amount of trading * 9.77%) chance that all of the following happen: - trade rule of the region rules spread from is spread to a random region. (can spread even to itself) - trade rule points increase by a random amount of 0 to 7, and if the resulting value is greater than 250, the points are reset to 0. - if a random integer is less than the trade rule points, a random region's trade rule is set to One. You don't get any messages regarding this, so it's hard to tell if anything happened. ---------------------------------------- #3.2.11 Step 11: Move the Queen of Cards ---------------------------------------- Note: This step only happens if you've actually played against the Queen of Cards and changed her quantity of Lv8 (or higher) cards, which usually means either losing one of those or winning, but not both at the same time (e.g. with Direct trade rule). The Queen will move somewhere else, giving you a hint when you talk to her again, and disappearing if you leave the screen (you also won't be able to challenge). The following chart shows where she goes, depending on her current location: rnd = [ getRandom / 32 ] QoC is ||------------------------------rnd's value----------------------------- in: || 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 =======||========|========|========|========|========|========|========|======= Balamb || Dollet | Galbadia -------||--------|--------|--------|--------|--------|--------|--------|------- Galbad || Balamb | Dollet | FH | Centra -------||--------|--------|--------|--------|--------|--------|--------|------- Trabia || Dollet | Lunar | Balamb -------||--------|--------|--------|--------|--------|--------|--------|------- Centra || Dollet | Galbadia | FH -------||--------|--------|--------|--------|--------|--------|--------|------- Dollet || Balamb | Galbadia -------||--------|--------|--------|--------|--------|--------|--------|------- FH || Esthar | Centra | Dollet -------||--------|--------|--------|--------|--------|--------|--------|------- Lunar || Balamb | Galbad | Trabia | Dollet | Centra | FH | Lunar | Esthar -------||--------|--------|--------|--------|--------|--------|--------|------- Esthar || Trabia | Lunar | Dollet | FH As for her actual locations: Balamb: Train station in Balamb Galbadia: Hotel in Deling City Trabia: Hotel in Shumi Village Centra: Hotel in Winhil Dollet: Second floor of pub FH: Close to the Regen drawpoint and savepoint Lunar: Lunar Gate Esthar: Presidential Palace in Esthar