Add more constants for some maximum values

This commit is contained in:
Remy Oukaour
2017-12-24 19:49:57 -05:00
parent 7d4486e6a3
commit 148fd299f9
8 changed files with 33 additions and 27 deletions

View File

@@ -7009,14 +7009,14 @@ ApplyStatLevelMultiplier: ; 3ecb7
; Cap at 999. ; Cap at 999.
ld a, [hQuotient + 2] ld a, [hQuotient + 2]
sub 999 % $100 sub MAX_STAT_VALUE % $100
ld a, [hQuotient + 1] ld a, [hQuotient + 1]
sbc 999 / $100 sbc MAX_STAT_VALUE / $100
jp c, .okay3 jp c, .okay3
ld a, 999 / $100 ld a, MAX_STAT_VALUE / $100
ld [hQuotient + 1], a ld [hQuotient + 1], a
ld a, 999 % $100 ld a, MAX_STAT_VALUE % $100
ld [hQuotient + 2], a ld [hQuotient + 2], a
.okay3 .okay3
@@ -7132,13 +7132,13 @@ BoostStat: ; 3ed7c
; Cap at 999. ; Cap at 999.
ld a, [hld] ld a, [hld]
sub 999 % $100 sub MAX_STAT_VALUE % $100
ld a, [hl] ld a, [hl]
sbc 999 / $100 sbc MAX_STAT_VALUE / $100
ret c ret c
ld a, 999 / $100 ld a, MAX_STAT_VALUE / $100
ld [hli], a ld [hli], a
ld a, 999 % $100 ld a, MAX_STAT_VALUE % $100
ld [hld], a ld [hld], a
ret ret
; 3ed9f ; 3ed9f
@@ -9135,10 +9135,10 @@ AddLastMobileBattleToLinkRecord: ; 3fa42
dec hl dec hl
ld a, [hl] ld a, [hl]
inc hl inc hl
cp 9999 / $100 cp MAX_LINK_RECORD / $100
ret c ret c
ld a, [hl] ld a, [hl]
cp 9999 % $100 cp MAX_LINK_RECORD % $100
ret ret
; 3fac8 ; 3fac8

View File

@@ -5651,10 +5651,10 @@ CheckIfStatCanBeRaised: ; 361ef
.no_carry .no_carry
pop bc pop bc
ld a, [hld] ld a, [hld]
sub 999 % $100 sub MAX_STAT_VALUE % $100
jr nz, .not_already_max jr nz, .not_already_max
ld a, [hl] ld a, [hl]
sbc 999 / $100 sbc MAX_STAT_VALUE / $100
jp z, .stats_already_max jp z, .stats_already_max
.not_already_max .not_already_max
ld a, [hBattleTurn] ld a, [hBattleTurn]
@@ -6417,14 +6417,14 @@ CalcStats: ; 3661d
.check_maxed_out .check_maxed_out
ld a, [hQuotient + 2] ld a, [hQuotient + 2]
cp 999 % $100 cp MAX_STAT_VALUE % $100
ld a, b ld a, b
sbc 999 / $100 sbc MAX_STAT_VALUE / $100
jr c, .not_maxed_out jr c, .not_maxed_out
ld a, 999 % $100 ld a, MAX_STAT_VALUE % $100
ld [hQuotient + 2], a ld [hQuotient + 2], a
ld a, 999 / $100 ld a, MAX_STAT_VALUE / $100
ld [hQuotient + 1], a ld [hQuotient + 1], a
.not_maxed_out .not_maxed_out

View File

@@ -54,6 +54,8 @@ NUM_STATS EQU const_value
STAT_MIN_NORMAL EQU 5 STAT_MIN_NORMAL EQU 5
STAT_MIN_HP EQU 10 STAT_MIN_HP EQU 10
MAX_STAT_VALUE EQU 999
; shiny dvs ; shiny dvs
ATKDEFDV_SHINY EQU $EA ATKDEFDV_SHINY EQU $EA
SPDSPCDV_SHINY EQU $AA SPDSPCDV_SHINY EQU $AA

View File

@@ -89,6 +89,8 @@ HOF_MON_LENGTH = 1 + 2 + 2 + 1 + (PKMN_NAME_LENGTH +- 1) ; species, id, dvs, lev
HOF_LENGTH = 1 + HOF_MON_LENGTH * PARTY_LENGTH + 1 ; win count, party, terminator HOF_LENGTH = 1 + HOF_MON_LENGTH * PARTY_LENGTH + 1 ; win count, party, terminator
NUM_HOF_TEAMS = 30 NUM_HOF_TEAMS = 30
MAX_LINK_RECORD EQU 9999
; significant money values ; significant money values
START_MONEY EQU 3000 START_MONEY EQU 3000

View File

@@ -2147,8 +2147,8 @@ GetHealingItemAmount: ; f395 (3:7395)
dbw HYPER_POTION, 200 dbw HYPER_POTION, 200
dbw SUPER_POTION, 50 dbw SUPER_POTION, 50
dbw POTION, 20 dbw POTION, 20
dbw MAX_POTION, 999 dbw MAX_POTION, MAX_STAT_VALUE
dbw FULL_RESTORE, 999 dbw FULL_RESTORE, MAX_STAT_VALUE
dbw MOOMOO_MILK, 100 dbw MOOMOO_MILK, 100
dbw BERRY, 10 dbw BERRY, 10
dbw GOLD_BERRY, 30 dbw GOLD_BERRY, 30

View File

@@ -1579,9 +1579,9 @@ CalcPkmnStatC: ; e17b
jr c, .stat_value_okay jr c, .stat_value_okay
.max_stat .max_stat
ld a, 999 / $100 ld a, MAX_STAT_VALUE / $100
ld [hMultiplicand + 1], a ld [hMultiplicand + 1], a
ld a, 999 % $100 ld a, MAX_STAT_VALUE % $100
ld [hMultiplicand + 2], a ld [hMultiplicand + 2], a
.stat_value_okay .stat_value_okay

View File

@@ -58,7 +58,7 @@ CeladonGameCornerFisherScript:
buttonsound buttonsound
checkitem COIN_CASE checkitem COIN_CASE
iffalse .NoCoinCase iffalse .NoCoinCase
checkcoins 9998 checkcoins MAX_COINS - 1
if_equal $0, .FullCoinCase if_equal $0, .FullCoinCase
stringtotext .coinname, $1 stringtotext .coinname, $1
scall .GiveCoins scall .GiveCoins

View File

@@ -1,3 +1,5 @@
ROUTE43GATE_TOLL EQU 1000
const_value set 2 const_value set 2
const ROUTE43GATE_OFFICER const ROUTE43GATE_OFFICER
const ROUTE43GATE_ROCKET1 const ROUTE43GATE_ROCKET1
@@ -48,17 +50,17 @@ RocketScript_Southbound:
opentext opentext
writetext RocketText_TollFee writetext RocketText_TollFee
buttonsound buttonsound
checkmoney $0, 999 checkmoney $0, ROUTE43GATE_TOLL - 1
if_equal $0, RocketScript_TollSouth if_equal $0, RocketScript_TollSouth
jump RocketScript_YoureBrokeSouth jump RocketScript_YoureBrokeSouth
RocketScript_TollSouth: RocketScript_TollSouth:
takemoney $0, 1000 takemoney $0, ROUTE43GATE_TOLL
writetext RocketText_ThankYou writetext RocketText_ThankYou
jump RocketScript_ShakeDownSouth jump RocketScript_ShakeDownSouth
RocketScript_YoureBrokeSouth: RocketScript_YoureBrokeSouth:
takemoney $0, 1000 takemoney $0, ROUTE43GATE_TOLL
writetext RocketText_AllYouGot writetext RocketText_AllYouGot
jump RocketScript_ShakeDownSouth jump RocketScript_ShakeDownSouth
@@ -80,17 +82,17 @@ RocketScript_Northbound:
opentext opentext
writetext RocketText_TollFee writetext RocketText_TollFee
buttonsound buttonsound
checkmoney $0, 999 checkmoney $0, ROUTE43GATE_TOLL - 1
if_equal $0, RocketScript_TollNorth if_equal $0, RocketScript_TollNorth
jump RocketScript_YoureBrokeNorth jump RocketScript_YoureBrokeNorth
RocketScript_TollNorth: RocketScript_TollNorth:
takemoney $0, 1000 takemoney $0, ROUTE43GATE_TOLL
writetext RocketText_ThankYou writetext RocketText_ThankYou
jump RocketScript_ShakeDownNorth jump RocketScript_ShakeDownNorth
RocketScript_YoureBrokeNorth: RocketScript_YoureBrokeNorth:
takemoney $0, 1000 takemoney $0, ROUTE43GATE_TOLL
writetext RocketText_AllYouGot writetext RocketText_AllYouGot
jump RocketScript_ShakeDownNorth jump RocketScript_ShakeDownNorth