init_battle_variables.asm 836 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. InitBattleVariables:
  2. ld a, [hTilesetType]
  3. ld [wSavedTilesetType], a
  4. xor a
  5. ld [wActionResultOrTookBattleTurn], a
  6. ld [wBattleResult], a
  7. ld hl, wPartyAndBillsPCSavedMenuItem
  8. ld [hli], a
  9. ld [hli], a
  10. ld [hli], a
  11. ld [hl], a
  12. ld [wListScrollOffset], a
  13. ld [wCriticalHitOrOHKO], a
  14. ld [wBattleMonSpecies], a
  15. ld [wPartyGainExpFlags], a
  16. ld [wPlayerMonNumber], a
  17. ld [wEscapedFromBattle], a
  18. ld [wMapPalOffset], a
  19. ld hl, wPlayerHPBarColor
  20. ld [hli], a ; wPlayerHPBarColor
  21. ld [hl], a ; wEnemyHPBarColor
  22. ld hl, wCanEvolveFlags
  23. ld b, $3c
  24. .loop
  25. ld [hli], a
  26. dec b
  27. jr nz, .loop
  28. inc a ; POUND
  29. ld [wTestBattlePlayerSelectedMove], a
  30. ld a, [wCurMap]
  31. cp SAFARI_ZONE_EAST
  32. jr c, .notSafariBattle
  33. cp SAFARI_ZONE_REST_HOUSE_1
  34. jr nc, .notSafariBattle
  35. ld a, BATTLE_TYPE_SAFARI
  36. ld [wBattleType], a
  37. .notSafariBattle
  38. jpab PlayBattleMusic