Advertisement
Zanoab

TWEWY_Resources

Aug 17th, 2011
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.73 KB | None | 0 0
  1. !!! Random Number Generator (RNG)
  2.  
  3. !! Mechanics
  4. ! RNG Calculation
  5. You can calculate the next RNG state with the following lua script.
  6. %%SRC_EMBED lua
  7. function getNextRNG(lowRNG, upRNG)
  8. local temp = upRNG + ((2^0x2 * upRNG) % 2^0x10)
  9. lowRNG = lowRNG * 2 + math.floor(temp / 2^0x10) + upRNG + math.floor((lowRNG * 2 + math.floor(temp / 2^0x10)) / 2^0x10)
  10. return lowRNG % 0x10000, temp % 0x10000 -- return RNG L, RNG U
  11. end
  12. %%END_EMBED
  13.  
  14. ! RNG Addresses
  15. ||Address||Type||Description||
  16. |0x2063760|16-bit|RNG Lower 2 bytes|
  17. |0x2063762|16-bit|RNG Upper 2 bytes|
  18.  
  19. ! Passed Value
  20. A 16-bit value is passed to the function in register 0. The function then returns a value between 0 (inclusive) and the passed value (exclusive).
  21. %%SRC_EMBED lua
  22. r0 = (r0 * lowRNG) >> 0x10 // lowRNG is after the calculation for the next state
  23. %%END_EMBED
  24.  
  25. !! Battle Uses
  26. ! Item Drop Test
  27. Return address (r14): 0x020BB710%%%Passed Value: 0x2710 (10,000)
  28.  
  29. The item's drop rate is multiplied by the drop rate multiplier and stored in register 8 during the RNG execution. If the returned value is less than the value in register 8, the test is passed and the item is dropped. Else, the drop test is considered failed and continues to the next item in the table.
  30.  
  31. !!! Overworld Movement
  32.  
  33. !! Important Addresses
  34. ||Address||Type||Description||
  35. |0x207415C|32-bit|Current X Coordinate|
  36. |0x2074160|32-bit|Current Y Coordinate|
  37. !!! Battle Mechanics
  38.  
  39. !! Light Puck (Puck)
  40. ! Travel Time
  41. The Puck begins moving to the next partner two frames after the character holding the Puck (either character if the Puck is not in play) damages an enemy with a combo finisher. The value is set, when the Puck begins moving, to the base value of 89 and is reduced by 1 every frame until 0.
  42. Upon turning 0 from traveling, the value becomes 1 the next frame and the pass is considered complete. The value becomes 0 afterwards. Attempting to change this value directly to 0 will cause the game to reset the value to the base value.
  43.  
  44. This value is signed. All negative values are treated like 1 and will turn to 0 on the next frame to complete the pass normally.
  45.  
  46. ! Hold Time
  47. The Puck can only be held for a limited amount of time before disappearing from play. The value is reset, when passing the Puck, to the base value of 930 and reduced by 30 for every pass. This includes the pass the puck is created so maximum base value without clothes is 900. The value is reduced by 1 every frame until 0.
  48.  
  49. This value is signed. All negative values are treated like 1 and will turn to 0 on the next frame for the Puck to disappear from play normally.
  50.  
  51. This value is used the frame before a combo finisher by the character holding the Puck deals damage to determine the increase/decrease of the Puck's Damage Multiplier.
  52. ||Value/Max Value||Multiplier Change||
  53. |98%|+50 (+x0.5)|
  54. |92%|+20 (+x0.2)|
  55. |70%|+10 (+x0.1)|
  56. |0%|-100 (-x1.0)|
  57.  
  58. ! Damage Multiplier
  59. The Puck multiplies the damage dealt by a combo finisher if the character is currently holding it. The value is reset, when the Puck is created by the first pass, to the base value of 200. The value is then increased or decreased, when passing the Puck, based on the Puck Hold Time value. The value is a percentage so the value must be divided by 100 to get the true multiplier.
  60.  
  61. The minimum value is 200 (x2) and maximum is 500 (x5). Any values beyond this range will be set to the minimum (if under) or the maximum (if over). This value is signed and all negative values will be set to 200.
  62.  
  63. The Damage Multiplier applied to damage is after the increase or decrease. This must be noted because the Damage Multiplier in RAM is updated after the affected damage is dealt.
  64.  
  65. ! Useful Puck Addresses
  66. All Puck addresses are stored in the Battle GUI Linked List except the following:
  67. ||Address||Type||Description||
  68. |0x23918CD|8-bit|Current Puck Pass Count|
  69.  
  70. !! Hit Points
  71. A single address contains the current amount of Hit Points despite the two characters seeming to have their own Hit Point bars. The game only uses the current Hit Points. The damage received by the characters is only for graphical purposes and specific clothing abilities.
  72. ! HP Related Addresses
  73. ||Address||Type||Description||
  74. |0x23918B0|16-bit|Current HP|
  75. |0x23918B2|16-bit|Maximum HP|
  76. |0x23918B4|16-bit|Damage Received on Top Screen|
  77. |0x23918B6|16-bit|Damage Received on Bottom Screen|
  78.  
  79. !! Item Drop
  80. ! Drop Rate Multiplier (for Battles)
  81. The Drop Rate Multiplier can be temporarily multiplied by the amount of chained battles. This value is moved to a new address after the chain is finalized for use in battle.
  82.  
  83. ! Item Drop Table
  84. Each enemy has an item drop table containing one item and drop rate for each difficulty. Starting at the item for the current difficulty, a drop test is executed. If the test is successful, the item is dropped. If the test is unsuccessful, the game moves down a difficulty and tries again. If the game reaches the end of the enemy's drop table without dropping an item, no item is dropped.
  85.  
  86. ! Useful Item Drop Related Addresses
  87. ||Address||Type||Description||
  88. |0x2071D24|16-bit|Drop Rate Multiplier|
  89. |0x2391872|16-bit|Drop Rate Multiplier for Battle(s)|
  90.  
  91. !! Battle Field Object/GUI Linked Lists
  92. ! Linked Lists
  93. All GUI elements and Field Objects are stored within Linked Lists during battles.
  94. %%%Known heads and tails of these linked lists are listed below:
  95. ||Head Address||Tail Address||Description||
  96. |0x235406C|0x235408C|Field Objects, Bottom Screen|
  97. |0x235C0F8|0x235C118|Field Objects, Top Screen|
  98. |0x2364184|0x23641A4|GUI Elements|
  99.  
  100. ! Basic Struct
  101. This is used by all following structs, which are extended from this struct.
  102. %%%0x08 maybe be used to point to where the assets for the object are located.
  103. ||Offset||Type||Description||
  104. |0x00|32-bit|Unknown Purpose%%%0x51342403 if Valid Object|
  105. |0x04|32-bit|Pointer to Data Name|
  106. |0x08|32-bit|Size of Object|
  107. |0x0C|32-bit|End of List if 0xFFFFFFFF%%%Additional Objects if 0x0|
  108. |0x10|32-bit|Pointer to Head if Tail|
  109. |0x14|32-bit|Pointer to Tail if Head|
  110. |0x18|32-bit|Pointer to Next Object|
  111. |0x1C|32-bit|Pointer to Previous Object|
  112.  
  113. ! Puck Data Struct
  114. Found in the GUI Linked List.
  115.  
  116. This is available when a partner is present. This struct contains a preallocated linked list which is consistent enough for the following addresses to be static.
  117. %%%The value of 0x08 is usually 0x7E0.
  118. ||Address||Type||Description||
  119. |0x032|16-bit|Unknown|
  120. |0x034|16-bit|Unknown|
  121. |0x0E4|32-bit|Random 1a|
  122. |0x0E8|32-bit|Random 1b|
  123. |0x7BC|32-bit|Travel Time|
  124. |0x7CC|32-bit|Puck Decay|
  125. |0x7D0|16-bit|Damage Multiplier|
  126. |0x7D4|16-bit|Hold Time|
  127. Random 1: Set at beginning of battle. Unknown purpose
  128.  
  129. ! Rebootable Pin Struct
  130. Found in the GUI Linked List.
  131.  
  132. This is used by most pins that are able to reboot.
  133. %%%The value of 0x08 is usually 0x2C0. Occasionally, a newly created GUI Object would share this value during battle.
  134. ||Offset||Type||Description||
  135. |0x3E|16-bit|Attack Power|
  136. |0x64|16-bit|Uses Left|
  137. |0x66|16-bit|Maximum Uses%%%Not set until after a boot|
  138. |0x68|16-bit|Boot Time Left%%%0x0 if never booted yet%%%0xFFFF after a complete boot|
  139.  
  140. ! Enemy Struct
  141. Found in the Field Object Linked List.
  142.  
  143. This is used by all enemies.
  144. ||Offset||Type||Description||
  145. |0x7A|16-bit|Invulnerability Left|
  146. |0x8C|16-bit|Current Hp|
  147. |0x8E|16-bit|Maximum Hp|
  148. |0x98|32-bit|Pointer to Mirrored Enemy|
  149. |0x1C2|16-bit|Unknown|
  150.  
  151. ! Prize Struct
  152. Found in the Field Object Linked List.
  153.  
  154. This is used by Item Drops that float to a character and is collected.
  155. ||Offset||Type||Description||
  156. |0x8C|16-bit|Prize Collect Time%%%Collect Prize on 0|
  157.  
  158. !! Static enemy data
  159.  
  160. ! Starting address
  161. You can find the starting address of an enemy's data at 0x20E0E24 + (0x2670 * Enemy Id). The enemy id is their noise report number minus one.
  162.  
  163. ! Data Map
  164. ||Offset||Type||Description||
  165. |0x2C|16-bit|Item Id for the "Easy Drop"|
  166. |0x2E|16-bit|Item Id for the "Normal Drop"|
  167. |0x30|16-bit|Item Id for the "Hard Drop"|
  168. |0x32|16-bit|Item Id for the "Ultimate Drop"|
  169. |0x34|16-bit|Drop rate for the "Easy Drop"|
  170. |0x36|16-bit|Drop rate for the "Normal Drop"|
  171. |0x38|16-bit|Drop rate for the "Hard Drop"|
  172. |0x3A|16-bit|Drop rate for the "Ultimate Drop"|
  173.  
  174. !!! Other Useful Addresses
  175. ||Address||Type||Description||
  176. |0x2066A44|32-bit|Total Session Time (In frames)|
  177. |0x2071D29.0|2-bit|Difficulty%%%0 = Easy%%%1 = Normal%%%0 = Hard%%%3 = Ultimate|
  178. |0x2071D29.2|2-bit|Auto Partner%%%0 = Manual%%%0 = Slow%%%0 = Mid%%%3 = Fast|
  179. |0x2071D29.4|2-bit|Current Pin Deck%%%0 = Deck 1%%%1 = Deck 2%%%2 = Deck 3%%%3 = Deck 4|
  180. |0x2071D29.6|1-bit|Quick Buy Items|
  181. |0x2071D29.7|1-bit|Quick Sell Pins|
  182. |0x2073AA4|32-bit|Gameplay Time (In frames)|
  183. |0x2074E7C|8-bit|Current Level (Max)|
  184. |0x2074E80|16-bit|Xp until Next Level|
  185. |0x2074E98|32-bit|Battle Time (In frames)|
  186. |0x23A22D4|8-bit|Current Level (Reduced)|
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement