pokecrystal/data/odd_eggs.asm

496 lines
7.8 KiB
NASM
Raw Normal View History

2013-08-30 03:26:01 +00:00
GiveOddEgg: ; 1fb4b6
2014-07-18 12:28:30 +00:00
; Figure out which egg to give.
; Compare a random word to
; probabilities out of 0xffff.
call Random
2013-08-30 03:26:01 +00:00
ld hl, .Probabilities
ld c, 0
ld b, c
2014-07-18 12:28:30 +00:00
.loop
2013-08-30 03:26:01 +00:00
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
2014-07-18 12:28:30 +00:00
; Break on $ffff.
2013-08-30 03:26:01 +00:00
ld a, d
2014-07-18 12:28:30 +00:00
cp $ffff / $100
jr nz, .not_done
2013-08-30 03:26:01 +00:00
ld a, e
2014-07-18 12:28:30 +00:00
cp $ffff % $100
2013-08-30 03:26:01 +00:00
jr z, .done
2014-07-18 12:28:30 +00:00
.not_done
; Break when [hRandom] <= de.
ld a, [hRandom + 1]
2013-08-30 03:26:01 +00:00
cp d
jr c, .done
2014-07-18 12:28:30 +00:00
jr z, .ok
jr .next
.ok
ld a, [hRandom + 0]
2013-08-30 03:26:01 +00:00
cp e
jr c, .done
jr z, .done
2014-07-18 12:28:30 +00:00
.next
2013-08-30 03:26:01 +00:00
inc bc
2014-07-18 12:28:30 +00:00
jr .loop
2013-08-30 03:26:01 +00:00
.done
ld hl, OddEggs
ld a, OddEgg2 - OddEgg1
call AddNTimes
2014-07-18 12:28:30 +00:00
2015-11-01 23:13:31 +00:00
ld de, OddEggSpecies
ld bc, PARTYMON_STRUCT_LENGTH + 2 * PKMN_NAME_LENGTH
2013-08-30 03:26:01 +00:00
call CopyBytes
2014-07-18 12:28:30 +00:00
2013-08-30 03:26:01 +00:00
ld a, EGG_TICKET
ld [CurItem], a
2015-11-01 23:13:31 +00:00
ld a, 1
ld [wItemQuantityChangeBuffer], a
ld a, -1
2015-12-18 03:31:16 +00:00
ld [CurItemQuantity], a
2013-08-30 03:26:01 +00:00
ld hl, NumItems
call TossItem
2014-07-18 12:28:30 +00:00
2015-11-01 23:13:31 +00:00
; load species in wcd2a
2013-08-30 03:26:01 +00:00
ld a, EGG
2015-12-26 04:34:33 +00:00
ld [wMobileMonSpeciesBuffer], a
; load pointer to (wMobileMonSpeciesBuffer - 1) in wMobileMonSpeciesPointerBuffer
ld a, (wMobileMonSpeciesBuffer - 1) % $100
ld [wMobileMonSpeciesPointerBuffer], a
ld a, (wMobileMonSpeciesBuffer - 1) / $100
ld [wMobileMonSpeciesPointerBuffer + 1], a
; load pointer to OddEggSpecies in wMobileMonStructurePointerBuffer
2015-11-01 23:13:31 +00:00
ld a, OddEggSpecies % $100
2015-12-26 04:34:33 +00:00
ld [wMobileMonStructurePointerBuffer], a
2015-11-01 23:13:31 +00:00
ld a, OddEggSpecies / $100
2015-12-26 04:34:33 +00:00
ld [wMobileMonStructurePointerBuffer + 1], a
2013-08-30 03:26:01 +00:00
2015-12-26 04:34:33 +00:00
; load Odd Egg Name in wTempOddEggNickname
2013-08-30 03:26:01 +00:00
ld hl, .Odd
2015-12-26 04:34:33 +00:00
ld de, wTempOddEggNickname
2014-07-18 12:28:30 +00:00
ld bc, PKMN_NAME_LENGTH
2013-08-30 03:26:01 +00:00
call CopyBytes
2015-12-26 04:34:33 +00:00
; load pointer to wTempOddEggNickname in wMobileMonOTNamePointerBuffer
ld a, wTempOddEggNickname % $100
ld [wMobileMonOTNamePointerBuffer], a
ld a, wTempOddEggNickname / $100
ld [wMobileMonOTNamePointerBuffer + 1], a
; load pointer to wOddEggName in wMobileMonNicknamePointerBuffer
2015-11-01 23:13:31 +00:00
ld a, wOddEggName % $100
2015-12-26 04:34:33 +00:00
ld [wMobileMonNicknamePointerBuffer], a
2015-11-01 23:13:31 +00:00
ld a, wOddEggName / $100
2015-12-26 04:34:33 +00:00
ld [wMobileMonNicknamePointerBuffer + 1], a
callba AddMobileMonToParty
2013-08-30 03:26:01 +00:00
ret
; 1fb546
.Odd:
2013-08-30 03:26:01 +00:00
db "ODD@@@@@@@@@"
.Probabilities:
2014-07-18 12:28:30 +00:00
prob: MACRO
prob_total = prob_total + (\1)
dw prob_total * $ffff / 100
ENDM
prob_total = 0
2015-12-26 04:34:33 +00:00
; Pichu
2014-07-18 12:28:30 +00:00
prob 8
prob 1
2015-12-26 04:34:33 +00:00
; Cleffa
2014-07-18 12:28:30 +00:00
prob 16
prob 3
2015-12-26 04:34:33 +00:00
; Igglybuff
2014-07-18 12:28:30 +00:00
prob 16
prob 3
2015-12-26 04:34:33 +00:00
; Smoochum
2014-07-18 12:28:30 +00:00
prob 14
prob 2
2015-12-26 04:34:33 +00:00
; Magby
2014-07-18 12:28:30 +00:00
prob 10
prob 2
2015-12-26 04:34:33 +00:00
; Elekid
2014-07-18 12:28:30 +00:00
prob 12
prob 2
2015-12-26 04:34:33 +00:00
; Tyrogue
2014-07-18 12:28:30 +00:00
prob 10
prob 1
2013-08-30 03:26:01 +00:00
; 1fb56e
OddEggs: ; 1fb56e
OddEgg1:
2013-08-21 20:02:18 +00:00
db PICHU
db NO_ITEM
2015-11-02 19:37:02 +00:00
db THUNDERSHOCK, CHARM, DIZZY_PUNCH, 0
2013-08-21 20:02:18 +00:00
dw 02048 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $0, $0 ; DVs
db 30, 20, 10, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 17 ; Max HP
bigdw 9 ; Atk
bigdw 6 ; Def
bigdw 11 ; Spd
bigdw 8 ; SAtk
bigdw 8 ; SDef
db "EGG@@@@@@@@"
OddEgg2:
2013-08-21 20:02:18 +00:00
db PICHU
db NO_ITEM
2015-11-02 19:37:02 +00:00
db THUNDERSHOCK, CHARM, DIZZY_PUNCH, 0
2013-08-21 20:02:18 +00:00
dw 00256 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $2a, $aa ; DVs
db 30, 20, 10, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 17 ; Max HP
bigdw 9 ; Atk
bigdw 7 ; Def
bigdw 12 ; Spd
bigdw 9 ; SAtk
bigdw 9 ; SDef
db "EGG@@@@@@@@"
db CLEFFA
db NO_ITEM
2015-11-02 19:37:02 +00:00
db POUND, CHARM, DIZZY_PUNCH, 0
2013-08-21 20:02:18 +00:00
dw 04096 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $0, $0 ; DVs
db 35, 20, 10, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 20 ; Max HP
bigdw 7 ; Atk
bigdw 7 ; Def
bigdw 6 ; Spd
bigdw 9 ; SAtk
bigdw 10 ; SDef
db "EGG@@@@@@@@"
db CLEFFA
db NO_ITEM
2015-11-02 19:37:02 +00:00
db POUND, CHARM, DIZZY_PUNCH, 0
2013-08-21 20:02:18 +00:00
dw 00768 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $2a, $aa ; DVs
db 35, 20, 10, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 20 ; Max HP
bigdw 7 ; Atk
bigdw 8 ; Def
bigdw 7 ; Spd
bigdw 10 ; SAtk
bigdw 11 ; SDef
db "EGG@@@@@@@@"
db IGGLYBUFF
db NO_ITEM
2015-11-02 19:37:02 +00:00
db SING, CHARM, DIZZY_PUNCH, 0
2013-08-21 20:02:18 +00:00
dw 04096 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $0, $0 ; DVs
db 15, 20, 10, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 24 ; Max HP
bigdw 8 ; Atk
bigdw 6 ; Def
bigdw 6 ; Spd
bigdw 9 ; SAtk
bigdw 7 ; SDef
db "EGG@@@@@@@@"
db IGGLYBUFF
db NO_ITEM
2015-11-02 19:37:02 +00:00
db SING, CHARM, DIZZY_PUNCH, 0
2013-08-21 20:02:18 +00:00
dw 00768 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $2a, $aa ; DVs
db 15, 20, 10, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 24 ; Max HP
bigdw 8 ; Atk
bigdw 7 ; Def
bigdw 7 ; Spd
bigdw 10 ; SAtk
bigdw 8 ; SDef
db "EGG@@@@@@@@"
db SMOOCHUM
db NO_ITEM
2015-11-02 19:37:02 +00:00
db POUND, LICK, DIZZY_PUNCH, 0
2013-08-21 20:02:18 +00:00
dw 03584 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $0, $0 ; DVs
db 35, 30, 10, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 19 ; Max HP
bigdw 8 ; Atk
bigdw 6 ; Def
bigdw 11 ; Spd
bigdw 13 ; SAtk
bigdw 11 ; SDef
db "EGG@@@@@@@@"
db SMOOCHUM
db NO_ITEM
2015-11-02 19:37:02 +00:00
db POUND, LICK, DIZZY_PUNCH, 0
2013-08-21 20:02:18 +00:00
dw 00512 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $2a, $aa ; DVs
db 35, 30, 10, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 19 ; Max HP
bigdw 8 ; Atk
bigdw 7 ; Def
bigdw 12 ; Spd
bigdw 14 ; SAtk
bigdw 12 ; SDef
db "EGG@@@@@@@@"
db MAGBY
db NO_ITEM
2015-11-02 19:37:02 +00:00
db EMBER, DIZZY_PUNCH, 0, 0
2013-08-21 20:02:18 +00:00
dw 02560 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $0, $0 ; DVs
db 25, 10, 0, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 19 ; Max HP
bigdw 12 ; Atk
bigdw 8 ; Def
bigdw 13 ; Spd
bigdw 12 ; SAtk
bigdw 10 ; SDef
db "EGG@@@@@@@@"
db MAGBY
db NO_ITEM
2015-11-02 19:37:02 +00:00
db EMBER, DIZZY_PUNCH, 0, 0
2013-08-21 20:02:18 +00:00
dw 00512 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $2a, $aa ; DVs
db 25, 10, 0, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 19 ; Max HP
bigdw 12 ; Atk
bigdw 9 ; Def
bigdw 14 ; Spd
bigdw 13 ; SAtk
bigdw 11 ; SDef
db "EGG@@@@@@@@"
db ELEKID
db NO_ITEM
2015-11-02 19:37:02 +00:00
db QUICK_ATTACK, LEER, DIZZY_PUNCH, 0
2013-08-21 20:02:18 +00:00
dw 03072 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $0, $0 ; DVs
db 30, 30, 10, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 19 ; Max HP
bigdw 11 ; Atk
bigdw 8 ; Def
bigdw 14 ; Spd
bigdw 11 ; SAtk
bigdw 10 ; SDef
db "EGG@@@@@@@@"
db ELEKID
db NO_ITEM
2015-11-02 19:37:02 +00:00
db QUICK_ATTACK, LEER, DIZZY_PUNCH, 0
2013-08-21 20:02:18 +00:00
dw 00512 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $2a, $aa ; DVs
db 30, 30, 10, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 19 ; Max HP
bigdw 11 ; Atk
bigdw 9 ; Def
bigdw 15 ; Spd
bigdw 12 ; SAtk
bigdw 11 ; SDef
db "EGG@@@@@@@@"
db TYROGUE
db NO_ITEM
2015-11-02 19:37:02 +00:00
db TACKLE, DIZZY_PUNCH, 0, 0
2013-08-21 20:02:18 +00:00
dw 02560 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $0, $0 ; DVs
db 35, 10, 0, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 18 ; Max HP
bigdw 8 ; Atk
bigdw 8 ; Def
bigdw 8 ; Spd
bigdw 8 ; SAtk
bigdw 8 ; SDef
db "EGG@@@@@@@@"
db TYROGUE
db NO_ITEM
2015-11-02 19:37:02 +00:00
db TACKLE, DIZZY_PUNCH, 0, 0
2013-08-21 20:02:18 +00:00
dw 00256 ; OT ID
dt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
bigdw 0
bigdw 0
bigdw 0
db $2a, $aa ; DVs
db 35, 10, 0, 0 ; PP
db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
bigdw 0 ; HP
bigdw 18 ; Max HP
bigdw 8 ; Atk
bigdw 9 ; Def
bigdw 9 ; Spd
bigdw 9 ; SAtk
bigdw 9 ; SDef
db "EGG@@@@@@@@"