Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. Multiply:
  2.  
  3. /*r4 = base exp..*/
  4. /*r5 = foe’s level*/
  5. /*This multiplies the base exp. by the opponent’s level*/
  6. /*Then it multiplies the result by 20*/
  7. /*Then it divides the whole thing by 100*/
  8. /*This is the same as dividing it by 5*/
  9. /*r0 is the top number, r1 is the bottom number*/
  10.  
  11. mul r4, r5
  12. mov r0, r4 /*r1 is B x L*/
  13. mov r1, #0xFA /*r1 = 250*/
  14. bl Divide /*divides by 250* because dividing by a value over 255 breaks the script. we will divide again by 2 later to simulate division by 500*/
  15. mov r3, r0
  16.  
  17. LevelStuff:
  18.  
  19. /*r6 = your level*/
  20. /*r5 = opponent's level*/
  21. /*if r6 is 10+ higher than r5 no exp is earned*/
  22.  
  23. sub r1, r5, r6 /*(L-Lp)*/
  24. bl Decrypt
  25. ldr r0, =(-10) /*if player is 10 levels higher */
  26. cmp r1, r0
  27. ble NoExp. /*then no exp is earned*/
  28. mov r0, #0xA
  29. mul r1, r0 /* 10*(L - Lp) */
  30. mov r2, #0x64
  31. add r1, r1, r2 /* (100 + 10*(L - Lp)) */
  32. mul r1, r3 /* (B * L)/250 * (100 + 10*(L - Lp)) */
  33. mov r0, r1
  34. mov r1, #0x2
  35. bl Divide /*divides by 2 to simulate division by 500*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement