trade animation

This commit is contained in:
PikalaxALT 2015-11-23 00:21:21 -05:00
parent 8740fc6e87
commit 58020fb5f6
23 changed files with 4123 additions and 3888 deletions

View File

@ -2532,48 +2532,48 @@ WinTrainerBattle: ; 3cfa4
; 3d02b
Function3d02b: ; 3d02b
ld a, [wc73d]
ld a, [wAmuletCoin]
and a
call nz, Function3d099
call Function3d0b1
call nz, .DoubleReward
call .CheckMaxedOutMomMoney
push af
ld a, $0
jr nc, .asm_3d044
jr nc, .okay
ld a, [wMomSavingMoney]
and $7
cp $3
jr nz, .asm_3d044
jr nz, .okay
inc a
.asm_3d044
.okay
ld b, a
ld c, $4
.asm_3d047
.loop
ld a, b
and a
jr z, .asm_3d052
call Function3d081
jr z, .loop2
call .SendMoneyToMom
dec c
dec b
jr .asm_3d047
jr .loop
.asm_3d052
.loop2
ld a, c
and a
jr z, .asm_3d05c
call Function3d08d
jr z, .done
call .AddMoneyToWallet
dec c
jr .asm_3d052
jr .loop2
.asm_3d05c
call Function3d099
call Function3d099
.done
call .DoubleReward
call .DoubleReward
pop af
jr nc, .KeepItAll
ld a, [wMomSavingMoney]
and $7
jr z, .KeepItAll
ld hl, SentToMomTexts
ld hl, .SentToMomTexts
dec a
ld c, a
ld b, 0
@ -2590,26 +2590,26 @@ endr
jp StdBattleTextBox
; 3d081
Function3d081: ; 3d081
.SendMoneyToMom: ; 3d081
push bc
ld hl, wc688
ld hl, wBattleReward + 2
ld de, wMomsMoney + 2
call Function3d0be
call AddBattleMoneyToAccount
pop bc
ret
; 3d08d
Function3d08d: ; 3d08d
.AddMoneyToWallet: ; 3d08d
push bc
ld hl, wc688
ld hl, wBattleReward + 2
ld de, Money + 2
call Function3d0be
call AddBattleMoneyToAccount
pop bc
ret
; 3d099
Function3d099: ; 3d099
ld hl, wc688
.DoubleReward: ; 3d099
ld hl, wBattleReward + 2
sla [hl]
dec hl
rl [hl]
@ -2624,14 +2624,14 @@ endr
ret
; 3d0ab
SentToMomTexts: ; 3d0ab
.SentToMomTexts: ; 3d0ab
dw SentSomeToMomText
dw SentHalfToMomText
dw SentAllToMomText
; 3d0b1
Function3d0b1: ; 3d0b1
.CheckMaxedOutMomMoney: ; 3d0b1
ld hl, wMomsMoney + 2
ld a, [hld]
cp 999999 % $100
@ -2642,7 +2642,7 @@ Function3d0b1: ; 3d0b1
ret
; 3d0be
Function3d0be: ; 3d0be
AddBattleMoneyToAccount: ; 3d0be
ld c, $3
and a
push de
@ -2653,14 +2653,14 @@ Function3d0be: ; 3d0be
callba MobileFn_106008
pop bc
pop hl
.asm_3d0ce
.loop
ld a, [de]
adc [hl]
ld [de], a
dec de
dec hl
dec c
jr nz, .asm_3d0ce
jr nz, .loop
pop hl
ld a, [hld]
cp 999999 % $100
@ -2823,7 +2823,7 @@ PlayerMonFaintHappinessMod: ; 3d1aa
ld a, [CurBattleMon]
ld c, a
ld hl, wBattleParticipantsNotFainted
ld b, $0
ld b, RESET_FLAG
predef FlagPredef
ld hl, EnemySubStatus3
res SUBSTATUS_IN_LOOP, [hl]
@ -5602,7 +5602,7 @@ CheckAmuletCoin: ; 3e4a8
cp HELD_AMULET_COIN
ret nz
ld a, 1
ld [wc73d], a
ld [wAmuletCoin], a
ret
; 3e4bc
@ -6716,7 +6716,7 @@ endr
ld a, [TempEnemyMonSpecies]
dec a
ld c, a
ld b, 1 ; set
ld b, SET_FLAG
ld hl, PokedexSeen
predef FlagPredef
@ -7741,7 +7741,7 @@ endr
ld hl, EvolvableFlags
ld a, [CurPartyMon]
ld c, a
ld b, $1
ld b, SET_FLAG
predef FlagPredef
pop af
ld [CurPartyLevel], a
@ -8790,7 +8790,7 @@ CheckPayDay: ; 3f71d
inc hl
or [hl]
ret z
ld a, [wc73d]
ld a, [wAmuletCoin]
and a
jr z, .okay
ld hl, wPayDayMoney + 2
@ -8809,7 +8809,7 @@ endr
.okay
ld hl, wPayDayMoney + 2
ld de, Money + 2
call Function3d0be
call AddBattleMoneyToAccount
ld hl, BattleText_PlayerPickuedUpPayDayMoney
call StdBattleTextBox
ld a, [InBattleTowerBattle]

349
battle/used_move_text.asm Executable file
View File

@ -0,0 +1,349 @@
DisplayUsedMoveText: ; 105db0
; battle command 03
ld hl, UsedMoveText
call BattleTextBox
jp WaitBGMap
; 105db9
UsedMoveText: ; 105db9
; this is a stream of text and asm from 105db9 to 105ef6
text_jump _ActorNameText
start_asm
ld a, [hBattleTurn]
and a
jr nz, .start
ld a, [wPlayerMoveStruct + MOVE_ANIM]
call UpdateUsedMoves
.start
ld a, BATTLE_VARS_LAST_MOVE
call GetBattleVarAddr
ld d, h
ld e, l
ld a, BATTLE_VARS_LAST_COUNTER_MOVE
call GetBattleVarAddr
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
ld [wd265], a
push hl
callba CheckUserIsCharging
pop hl
jr nz, .grammar
; update last move
ld a, [wd265]
ld [hl], a
ld [de], a
.grammar
call GetMoveGrammar
; wd265 now contains MoveGrammar
; everything except 'instead' made redundant in localization
; check obedience
ld a, [AlreadyDisobeyed]
and a
ld hl, UsedMove2Text
ret nz
; check move grammar
ld a, [wd265]
cp $3
ld hl, UsedMove2Text
ret c
ld hl, UsedMove1Text
ret
; 105e04
UsedMove1Text: ; 105e04
text_jump _UsedMove1Text
start_asm
jr Function105e10
; 105e0b
UsedMove2Text: ; 105e0b
text_jump _UsedMove2Text
start_asm
; 105e10
Function105e10: ; 105e10
; check obedience
ld a, [AlreadyDisobeyed]
and a
jr z, GetMoveNameText
; print "instead,"
ld hl, UsedInsteadText
ret
; 105e1a
UsedInsteadText: ; 105e1a
text_jump _UsedInsteadText
start_asm
; 105e1f
GetMoveNameText: ; 105e1f
ld hl, MoveNameText
ret
; 105e23
MoveNameText: ; 105e23
text_jump _MoveNameText
start_asm
; 105e28
GetUsedMoveTextEnder: ; 105e28
; get start address
ld hl, .endusedmovetexts
; get move id
ld a, [wd265]
; 2-byte pointer
add a
; seek
push bc
ld b, $0
ld c, a
add hl, bc
pop bc
; get pointer to usedmovetext ender
ld a, [hli]
ld h, [hl]
ld l, a
ret
; 105e39
.endusedmovetexts ; 105e39
dw EndUsedMove1Text
dw EndUsedMove2Text
dw EndUsedMove3Text
dw EndUsedMove4Text
dw EndUsedMove5Text
; 105e43
EndUsedMove1Text: ; 105e43
text_jump _EndUsedMove1Text
db "@"
; 105e48
EndUsedMove2Text: ; 105e48
text_jump _EndUsedMove2Text
db "@"
; 105e4d
EndUsedMove3Text: ; 105e4d
text_jump _EndUsedMove3Text
db "@"
; 105e52
EndUsedMove4Text: ; 105e52
text_jump _EndUsedMove4Text
db "@"
; 105e57
EndUsedMove5Text: ; 105e57
text_jump _EndUsedMove5Text
db "@"
; 105e5c
GetMoveGrammar: ; 105e5c
; store move grammar type in wd265
push bc
; c = move id
ld a, [wd265]
ld c, a
ld b, $0
; read grammar table
ld hl, MoveGrammar
.loop
ld a, [hli]
; end of table?
cp $ff
jr z, .end
; match?
cp c
jr z, .end
; advance grammar type at $00
and a
jr nz, .loop
; next grammar type
inc b
jr .loop
.end
; wd265 now contains move grammar
ld a, b
ld [wd265], a
; we're done
pop bc
ret
; 105e7a
MoveGrammar: ; 105e7a
; made redundant in localization
; each move is given an identifier for what usedmovetext to use (0-4):
; 0
db SWORDS_DANCE
db GROWTH
db STRENGTH
db HARDEN
db MINIMIZE
db SMOKESCREEN
db WITHDRAW
db DEFENSE_CURL
db EGG_BOMB
db SMOG
db BONE_CLUB
db FLASH
db SPLASH
db ACID_ARMOR
db BONEMERANG
db REST
db SHARPEN
db SUBSTITUTE
db MIND_READER
db SNORE
db PROTECT
db SPIKES
db ENDURE
db ROLLOUT
db SWAGGER
db SLEEP_TALK
db HIDDEN_POWER
db PSYCH_UP
db EXTREMESPEED
db 0 ; end set
; 1
db RECOVER
db TELEPORT
db BIDE
db SELFDESTRUCT
db AMNESIA
db FLAIL
db 0 ; end set
; 2
db MEDITATE
db AGILITY
db MIMIC
db DOUBLE_TEAM
db BARRAGE
db TRANSFORM
db STRUGGLE
db SCARY_FACE
db 0 ; end set
; 3
db POUND
db SCRATCH
db VICEGRIP
db WING_ATTACK
db FLY
db BIND
db SLAM
db HORN_ATTACK
db WRAP
db THRASH
db TAIL_WHIP
db LEER
db BITE
db GROWL
db ROAR
db SING
db PECK
db ABSORB
db STRING_SHOT
db EARTHQUAKE
db FISSURE
db DIG
db TOXIC
db SCREECH
db METRONOME
db LICK
db CLAMP
db CONSTRICT
db POISON_GAS
db BUBBLE
db SLASH
db SPIDER_WEB
db NIGHTMARE
db CURSE
db FORESIGHT
db CHARM
db ATTRACT
db ROCK_SMASH
db 0 ; end set
; all other moves = 4
db $ff ; end
; 105ed0
UpdateUsedMoves: ; 105ed0
; append move a to PlayerUsedMoves unless it has already been used
push bc
; start of list
ld hl, PlayerUsedMoves
; get move id
ld b, a
; next count
ld c, NUM_MOVES
.loop
; get move from the list
ld a, [hli]
; not used yet?
and a
jr z, .add
; already used?
cp b
jr z, .quit
; next byte
dec c
jr nz, .loop
; if the list is full and the move hasn't already been used
; shift the list back one byte, deleting the first move used
; this can occur with struggle or a new learned move
ld hl, PlayerUsedMoves + 1
; 1 = 2
ld a, [hld]
ld [hli], a
; 2 = 3
inc hl
ld a, [hld]
ld [hli], a
; 3 = 4
inc hl
ld a, [hld]
ld [hl], a
; 4 = new move
ld a, b
ld [PlayerUsedMoves + 3], a
jr .quit
.add
; go back to the byte we just inced from
dec hl
; add the new move
ld [hl], b
.quit
; list updated
pop bc
ret
; 105ef6

View File

@ -2547,41 +2547,41 @@ String_e36f1: ; e36f1
; e36f9
Functione36f9: ; e36f9 (38:76f9)
ld hl, MenuDataHeader_0xe377b
ld hl, .MenuDataHeader
call LoadMenuDataHeader
call InterpretMenu2
call ExitMenu
ret c
ld a, [MenuSelection2]
cp $1
jr z, .asm_e3734
jr z, .Switch
cp $2
jr z, .asm_e3745
jr z, .Name
cp $3
jr z, .asm_e3717
jr z, .Print
and a
ret
.asm_e3717
.Print
call GetBoxCount
and a
jr z, .asm_e372f
jr z, .EmptyBox
ld e, l
ld d, h
ld a, [MenuSelection]
dec a
ld c, a
callba Function844bc
callba PrintPCBox
call Functione35e2
and a
ret
.asm_e372f
.EmptyBox
call Functione37be
and a
ret
.asm_e3734
.Switch
ld a, [MenuSelection]
dec a
ld e, a
@ -2591,8 +2591,8 @@ Functione36f9: ; e36f9 (38:76f9)
callba ChangeBoxSaveGame
ret
.asm_e3745
ld b, $4
.Name
ld b, $4 ; box
ld de, wd002
callba NamingScreen
call ClearTileMap
@ -2616,15 +2616,15 @@ Functione36f9: ; e36f9 (38:76f9)
hlcoord 11, 7 ; XXX
MenuDataHeader_0xe377b: ; 0xe377b
.MenuDataHeader: ; 0xe377b
db $40 ; flags
db 04, 11 ; start coords
db 13, 19 ; end coords
dw MenuData2_0xe3783
dw .MenuData2
db 1 ; default option
; 0xe3783
MenuData2_0xe3783: ; 0xe3783
.MenuData2: ; 0xe3783
db $80 ; flags
db 4 ; items
db "SWITCH@"

File diff suppressed because it is too large Load Diff

View File

@ -489,7 +489,7 @@ Function4484a: ; 0x4484a
ld a, BANK(sMailboxCount)
call GetSRAMBank
pop af
ld hl, sMailbox1MailType
ld hl, sMailbox1Type
ld bc, MAIL_STRUCT_LENGTH
call AddNTimes
ld a, [hl]

View File

@ -161,9 +161,9 @@ Function49da4: ; 49da4
cp $1
ld a, $1
ret nz
ld a, BANK(s0_abe5)
ld a, BANK(sNumDailyMysteryGiftPartnerIDs)
call GetSRAMBank
ld a, [s0_abe5]
ld a, [sNumDailyMysteryGiftPartnerIDs]
cp $ff
call CloseSRAM
jr nz, .done

1702
engine/mysterygift.asm Executable file

File diff suppressed because it is too large Load Diff

View File

@ -18,10 +18,14 @@ TRADE_WRONG EQU 2
TRADE_COMPLETE EQU 3
TRADE_AFTER EQU 4
TRADE_EITHER_GENDER EQU 0
TRADE_MALE_ONLY EQU 1
TRADE_FEMALE_ONLY EQU 2
NPCTrade:: ; fcba8
ld a, e
ld [wJumptableIndex], a
call Functionfcc59
call Trade_GetDialog
ld b, CHECK_FLAG
call TradeFlagAction
ld a, TRADE_AFTER
@ -57,8 +61,8 @@ NPCTrade:: ; fcba8
ld hl, ConnectLinkCableText
call PrintText
call Functionfcc63
call Functionfcc07
call DoNPCTrade
call .TradeAnimation
call GetTradeMonNames
ld hl, TradedForText
@ -73,13 +77,13 @@ NPCTrade:: ; fcba8
ret
; fcc07
Functionfcc07: ; fcc07
.TradeAnimation: ; fcc07
call DisableSpriteUpdates
ld a, [wJumptableIndex]
push af
ld a, [wcf64]
push af
predef Function28f24
predef TradeAnimation
pop af
ld [wcf64], a
pop af
@ -118,7 +122,7 @@ CheckTradeGender: ; fcc23
; fcc4a
TradeFlagAction: ; fcc4a
ld hl, wd960
ld hl, wTradeFlags
ld a, [wJumptableIndex]
ld c, a
predef FlagPredef
@ -127,7 +131,7 @@ TradeFlagAction: ; fcc4a
ret
; fcc59
Functionfcc59: ; fcc59
Trade_GetDialog: ; fcc59
ld e, TRADE_DIALOG
call GetTradeAttribute
ld a, [hl]
@ -135,74 +139,74 @@ Functionfcc59: ; fcc59
ret
; fcc63
Functionfcc63: ; fcc63
DoNPCTrade: ; fcc63
ld e, TRADE_GIVEMON
call GetTradeAttribute
ld a, [hl]
ld [wc6d0], a
ld [wPlayerTrademonSpecies], a
ld e, TRADE_GETMON
call GetTradeAttribute
ld a, [hl]
ld [wc702], a
ld [wOTTrademonSpecies], a
ld a, [wc6d0]
ld de, wc6d1
call Functionfcde8
call Functionfcdf4
ld a, [wPlayerTrademonSpecies]
ld de, wPlayerTrademonSpeciesName
call GetTradeMonName
call CopyTradeName
ld a, [wc702]
ld de, wc703
call Functionfcde8
call Functionfcdf4
ld a, [wOTTrademonSpecies]
ld de, wOTTrademonSpeciesName
call GetTradeMonName
call CopyTradeName
ld hl, PartyMonOT
ld bc, NAME_LENGTH
call Functionfcdd7
ld de, wc6f2
call Functionfcdf4
call Trade_GetAttributeOfCurrentPartymon
ld de, wPlayerTrademonOTName
call CopyTradeName
ld hl, PlayerName
ld de, wc6e7
call Functionfcdf4
ld de, wPlayerTrademonSenderName
call CopyTradeName
ld hl, PartyMon1ID
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdd7
ld de, wc6ff
call Functionfce0f
call Trade_GetAttributeOfCurrentPartymon
ld de, wPlayerTrademonID
call Trade_CopyTwoBytes
ld hl, PartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdd7
ld de, wc6fd
call Functionfce0f
call Trade_GetAttributeOfCurrentPartymon
ld de, wPlayerTrademonDVs
call Trade_CopyTwoBytes
ld hl, PartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdd7
call Trade_GetAttributeOfCurrentPartymon
ld b, h
ld c, l
callba GetCaughtGender
ld a, c
ld [wc701], a
ld [wPlayerTrademonCaughtData], a
ld e, TRADE_DIALOG
call GetTradeAttribute
ld a, [hl]
cp TRADE_COMPLETE
cp 3
ld a, 1
jr c, .asm_fcce6
jr c, .okay
ld a, 2
.asm_fcce6
ld [wEnemyCharging], a
.okay
ld [wOTTrademonCaughtData], a
ld hl, PartyMon1Level
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdd7
call Trade_GetAttributeOfCurrentPartymon
ld a, [hl]
ld [CurPartyLevel], a
ld a, [wc702]
ld a, [wOTTrademonSpecies]
ld [CurPartySpecies], a
xor a
ld [MonType], a
@ -214,66 +218,66 @@ Functionfcc63: ; fcc63
call GetTradeAttribute
ld a, [hl]
cp TRADE_COMPLETE
ld b, 0
ld b, RESET_FLAG
jr c, .asm_fcd1c
ld b, 1
ld b, SET_FLAG
.asm_fcd1c
callba SetGiftPartyMonCaughtData
ld e, TRADE_NICK
call GetTradeAttribute
ld de, wc70e
call Functionfcdf4
ld de, wOTTrademonNickname
call CopyTradeName
ld hl, PartyMonNicknames
ld bc, PKMN_NAME_LENGTH
call Functionfcdde
ld hl, wc70e
call Functionfcdf4
call Trade_GetAttributeOfLastPartymon
ld hl, wOTTrademonNickname
call CopyTradeName
ld e, TRADE_OT_NAME
call GetTradeAttribute
push hl
ld de, wc724
call Functionfcdf4
ld de, wOTTrademonOTName
call CopyTradeName
pop hl
ld de, wc719
call Functionfcdf4
ld de, wOTTrademonSenderName
call CopyTradeName
ld hl, PartyMonOT
ld bc, NAME_LENGTH
call Functionfcdde
ld hl, wc724
call Functionfcdf4
call Trade_GetAttributeOfLastPartymon
ld hl, wOTTrademonOTName
call CopyTradeName
ld e, TRADE_DVS
call GetTradeAttribute
ld de, wEnemyTrappingMove
call Functionfce0f
ld de, wOTTrademonDVs
call Trade_CopyTwoBytes
ld hl, PartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdde
ld hl, wEnemyTrappingMove
call Functionfce0f
call Trade_GetAttributeOfLastPartymon
ld hl, wOTTrademonDVs
call Trade_CopyTwoBytes
ld e, TRADE_OT_ID
call GetTradeAttribute
ld de, wPlayerCharging
call Functionfce15
ld de, wOTTrademonID + 1
call Trade_CopyTwoBytesReverseEndian
ld hl, PartyMon1ID
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdde
ld hl, wEnemyWrapCount
call Functionfce0f
call Trade_GetAttributeOfLastPartymon
ld hl, wOTTrademonID
call Trade_CopyTwoBytes
ld e, TRADE_ITEM
call GetTradeAttribute
push hl
ld hl, PartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call Functionfcdde
call Trade_GetAttributeOfLastPartymon
pop hl
ld a, [hl]
ld [de], a
@ -315,13 +319,13 @@ endr
ret
; 0xfcdd7
Functionfcdd7: ; fcdd7
Trade_GetAttributeOfCurrentPartymon: ; fcdd7
ld a, [CurPartyMon]
call AddNTimes
ret
; fcdde
Functionfcdde: ; fcdde
Trade_GetAttributeOfLastPartymon: ; fcdde
ld a, [PartyCount]
dec a
call AddNTimes
@ -330,7 +334,7 @@ Functionfcdde: ; fcdde
ret
; fcde8
Functionfcde8: ; fcde8
GetTradeMonName: ; fcde8
push de
ld [wd265], a
call GetBasePokemonName
@ -339,29 +343,31 @@ Functionfcde8: ; fcde8
ret
; fcdf4
Functionfcdf4: ; fcdf4
CopyTradeName: ; fcdf4
ld bc, NAME_LENGTH
call CopyBytes
ret
; fcdfb
Functionfcdfb: ; fcdfb
; unreferenced
ld bc, 4
call CopyBytes
ld a, $50
ld a, "@"
ld [de], a
ret
; fce05
Functionfce05: ; fce05
; unreferenced
ld bc, 3
call CopyBytes
ld a, $50
ld a, "@"
ld [de], a
ret
; fce0f
Functionfce0f: ; fce0f
Trade_CopyTwoBytes: ; fce0f
ld a, [hli]
ld [de], a
inc de
@ -370,7 +376,7 @@ Functionfce0f: ; fce0f
ret
; fce15
Functionfce15: ; fce15
Trade_CopyTwoBytesReverseEndian: ; fce15
ld a, [hli]
ld [de], a
dec de
@ -383,18 +389,18 @@ GetTradeMonNames: ; fce1b
ld e, TRADE_GETMON
call GetTradeAttribute
ld a, [hl]
call Functionfcde8
call GetTradeMonName
ld de, StringBuffer2
call Functionfcdf4
call CopyTradeName
ld e, TRADE_GIVEMON
call GetTradeAttribute
ld a, [hl]
call Functionfcde8
call GetTradeMonName
ld de, wd050
call Functionfcdf4
call CopyTradeName
ld hl, StringBuffer1
.loop
@ -423,13 +429,22 @@ GetTradeMonNames: ; fce1b
NPCTrades: ; fce58
db 0, ABRA, MACHOP, "MUSCLE@@@@@", $37, $66, GOLD_BERRY, $54, $92, "MIKE@@@@@@@", 0, 0
db 0, BELLSPROUT, ONIX, "ROCKY@@@@@@", $96, $66, BITTER_BERRY, $1e, $bf, "KYLE@@@@@@@", 0, 0
db 1, KRABBY, VOLTORB, "VOLTY@@@@@@", $98, $88, PRZCUREBERRY, $05, $72, "TIM@@@@@@@@", 0, 0
db 3, DRAGONAIR, DODRIO, "DORIS@@@@@@", $77, $66, SMOKE_BALL, $1b, $01, "EMY@@@@@@@@", 2, 0
db 2, HAUNTER, XATU, "PAUL@@@@@@@", $96, $86, MYSTERYBERRY, $00, $3d, "CHRIS@@@@@@", 0, 0
db 3, CHANSEY, AERODACTYL, "AEROY@@@@@@", $96, $66, GOLD_BERRY, $7b, $67, "KIM@@@@@@@@", 0, 0
db 0, DUGTRIO, MAGNETON, "MAGGIE@@@@@", $96, $66, METAL_COAT, $a2, $c3, "FOREST@@@@@", 0, 0
npctrade: MACRO
db \1, \2, \3, \4
dw \5
db \6
dw \7
db \8, \9, 0
ENDM
npctrade 0, ABRA, MACHOP, "MUSCLE@@@@@", $6637, GOLD_BERRY, $9254, "MIKE@@@@@@@", TRADE_EITHER_GENDER
npctrade 0, BELLSPROUT, ONIX, "ROCKY@@@@@@", $6696, BITTER_BERRY, $bf1e, "KYLE@@@@@@@", TRADE_EITHER_GENDER
npctrade 1, KRABBY, VOLTORB, "VOLTY@@@@@@", $8898, PRZCUREBERRY, $7205, "TIM@@@@@@@@", TRADE_EITHER_GENDER
npctrade 3, DRAGONAIR, DODRIO, "DORIS@@@@@@", $6677, SMOKE_BALL, $011b, "EMY@@@@@@@@", TRADE_FEMALE_ONLY
npctrade 2, HAUNTER, XATU, "PAUL@@@@@@@", $8696, MYSTERYBERRY, $3d00, "CHRIS@@@@@@", TRADE_EITHER_GENDER
npctrade 3, CHANSEY, AERODACTYL, "AEROY@@@@@@", $6696, GOLD_BERRY, $677b, "KIM@@@@@@@@", TRADE_EITHER_GENDER
npctrade 0, DUGTRIO, MAGNETON, "MAGGIE@@@@@", $6696, METAL_COAT, $c3a2, "FOREST@@@@@", TRADE_EITHER_GENDER
; fcf38

View File

@ -476,7 +476,7 @@ Function4034f: ; 4034f
push af
ld a, [wJumptableIndex]
push af
callba Function8442c
callba PrintDexEntry
pop af
ld [wJumptableIndex], a
pop af

View File

@ -59,8 +59,8 @@ PredefPointers:: ; 856b
add_predef LearnLevelMoves
add_predef FillMoves
add_predef EvolveAfterBattle
add_predef Function28f63
add_predef Function28f24
add_predef TradeAnimationPlayer2
add_predef TradeAnimation
add_predef CopyPkmnToTempMon
add_predef ListMoves ; $20
add_predef PlaceNonFaintStatus

View File

@ -653,7 +653,7 @@ Function84425: ; 84425
ret
; 8442c
Function8442c: ; 8442c
PrintDexEntry: ; 8442c
ld a, [wcf65]
push af
ld hl, VTiles1
@ -661,7 +661,7 @@ Function8442c: ; 8442c
lb bc, BANK(FontInversed), $80
call Request1bpp
xor a
ld [$ffac], a
ld [hPrinter], a
call Function8474c
ld a, [rIE]
push af
@ -720,7 +720,7 @@ Function8442c: ; 8442c
ret
; 844bc
Function844bc: ; 844bc (21:44bc)
PrintPCBox: ; 844bc (21:44bc)
ld a, [wcf65]
push af
ld a, $9
@ -728,13 +728,13 @@ Function844bc: ; 844bc (21:44bc)
ld a, e
ld [wd004], a
ld a, d
ld [StartFlypoint], a
ld [wd005], a
ld a, b
ld [EndFlypoint], a
ld [wd006], a
ld a, c
ld [MovementBuffer], a
ld [wd007], a
xor a
ld [$ffac], a
ld [hPrinter], a
ld [wd003], a
call Function8474c
ld a, [rIE]
@ -801,11 +801,11 @@ Function84559: ; 84559 (21:4559)
call Function843f0
ret
Function84560: ; 84560
PrintUnownStamp: ; 84560
ld a, [wcf65]
push af
xor a
ld [$ffac], a
ld [hPrinter], a
call Function8474c
ld a, [rIE]
push af
@ -861,7 +861,7 @@ Function84560: ; 84560
ret
; 845d4
Function845d4: ; 845d4
PrintMail: ; 845d4
call Function845db
call Function84425
ret
@ -871,7 +871,7 @@ Function845db: ; 845db
ld a, [wcf65]
push af
xor a
ld [$ffac], a
ld [hPrinter], a
call Function8474c
ld a, [rIE]
push af
@ -903,11 +903,11 @@ Function845db: ; 845db
ret
; 8461a
Function8461a: ; 8461a
PrintPartymon: ; 8461a
ld a, [wcf65]
push af
xor a
ld [$ffac], a
ld [hPrinter], a
call Function8474c
ld a, [rIE]
push af
@ -962,7 +962,7 @@ _PrintDiploma: ; 84688
push af
callba Function1dd709
xor a
ld [$ffac], a
ld [hPrinter], a
call Function8474c
ld a, [rIE]
push af
@ -1040,7 +1040,7 @@ Function846f6: ; 846f6
.asm_84722
ld a, $1
ld [$ffac], a
ld [hPrinter], a
scf
ret
; 84728
@ -1205,15 +1205,15 @@ Function84817: ; 84817 (21:4817)
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
ld a, " "
call ByteFill
call Function84a0e
call Printer_PlaceEmptyBoxSlotString
hlcoord 0, 0
ld bc, 9 * SCREEN_WIDTH
ld a, " "
call ByteFill
call Function849e9
call Function849d7
call Printer_PlaceSideBorders
call Printer_PlaceTopBorder
hlcoord 4, 3
ld de, String_84865
ld de, .String_PokemonList
call PlaceString
ld a, [wd007]
ld bc, BOX_NAME_LENGTH
@ -1231,7 +1231,7 @@ Function84817: ; 84817 (21:4817)
ret
; 84865 (21:4865)
String_84865:
.String_PokemonList:
db "#MON LIST@"
; 8486f
@ -1240,8 +1240,8 @@ Function8486f: ; 8486f (21:486f)
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
ld a, " "
call ByteFill
call Function84a0e
call Function849e9
call Printer_PlaceEmptyBoxSlotString
call Printer_PlaceSideBorders
ld a, [wd003]
and a
ret nz
@ -1257,8 +1257,8 @@ Function84893: ; 84893 (21:4893)
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
ld a, " "
call ByteFill
call Function84a0e
call Function849e9
call Printer_PlaceEmptyBoxSlotString
call Printer_PlaceSideBorders
ld a, [wd003]
and a
ret nz
@ -1274,12 +1274,12 @@ Function848b7: ; 848b7 (21:48b7)
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
ld a, " "
call ByteFill
call Function84a0e
call Printer_PlaceEmptyBoxSlotString
hlcoord 1, 15
lb bc, 2, 18
call ClearBox
call Function849e9
call Function849fc
call Printer_PlaceSideBorders
call Printer_PlaceBottomBorders
ld a, [wd003]
and a
ret nz
@ -1291,7 +1291,7 @@ Function848b7: ; 848b7 (21:48b7)
ret
Function848e7: ; 848e7 (21:48e7)
ld a, [EndFlypoint]
ld a, [wd006]
call GetSRAMBank
Function848ed: ; 848ed (21:48ed)
@ -1318,7 +1318,7 @@ Function848ed: ; 848ed (21:48ed)
push hl
call PlaceString
ld a, [CurPartySpecies]
cp $fd
cp EGG
pop hl
jr z, .ok2
ld bc, $b
@ -1326,7 +1326,7 @@ Function848ed: ; 848ed (21:48ed)
call Function8498a
ld bc, $9
add hl, bc
ld a, $f3
ld a, "/"
ld [hli], a
push hl
ld bc, $e
@ -1336,7 +1336,7 @@ Function848ed: ; 848ed (21:48ed)
push hl
ld a, [wd004]
ld l, a
ld a, [StartFlypoint]
ld a, [wd005]
ld h, a
ld bc, $372
add hl, bc
@ -1354,7 +1354,7 @@ Function848ed: ; 848ed (21:48ed)
push hl
ld a, [wd004]
ld l, a
ld a, [StartFlypoint]
ld a, [wd005]
ld h, a
ld bc, $35
add hl, bc
@ -1387,7 +1387,7 @@ Function8498a: ; 8498a (21:498a)
push hl
ld a, [wd004]
ld l, a
ld a, [StartFlypoint]
ld a, [wd005]
ld h, a
ld bc, $2b
add hl, bc
@ -1421,7 +1421,7 @@ Function849c6: ; 849c6 (21:49c6)
ld d, $0
ld a, [wd004]
ld l, a
ld a, [StartFlypoint]
ld a, [wd005]
ld h, a
add hl, de
ld e, l
@ -1429,62 +1429,62 @@ Function849c6: ; 849c6 (21:49c6)
pop hl
ret
Function849d7: ; 849d7 (21:49d7)
Printer_PlaceTopBorder: ; 849d7 (21:49d7)
hlcoord 0, 0
ld a, "┌"
ld [hli], a
ld a, "─"
ld c, SCREEN_WIDTH - 2
.asm_849e1
.loop
ld [hli], a
dec c
jr nz, .asm_849e1
jr nz, .loop
ld a, "┐"
ld [hl], a
ret
Function849e9: ; 849e9 (21:49e9)
Printer_PlaceSideBorders: ; 849e9 (21:49e9)
hlcoord 0, 0
ld de, SCREEN_WIDTH - 1
ld c, SCREEN_HEIGHT
.asm_849f1
.loop
ld a, "│"
ld [hl], a
add hl, de
ld a, "│"
ld [hli], a
dec c
jr nz, .asm_849f1
jr nz, .loop
ret
Function849fc: ; 849fc (21:49fc)
Printer_PlaceBottomBorders: ; 849fc (21:49fc)
hlcoord 0, 17
ld a, "└"
ld [hli], a
ld a, "─"
ld c, SCREEN_WIDTH - 2
.asm_84a06
.loop
ld [hli], a
dec c
jr nz, .asm_84a06
jr nz, .loop
ld a, "┘"
ld [hl], a
ret
Function84a0e: ; 84a0e (21:4a0e)
Printer_PlaceEmptyBoxSlotString: ; 84a0e (21:4a0e)
hlcoord 2, 0
ld c, $6
.asm_84a13
.loop
push bc
push hl
ld de, String84a25
call PlaceString
pop hl
ld bc, $3c
ld bc, 3 * SCREEN_WIDTH
add hl, bc
pop bc
dec c
jr nz, .asm_84a13
jr nz, .loop
ret
; 84a25 (21:4a25)

1542
engine/trade/animation.asm Executable file

File diff suppressed because it is too large Load Diff

View File

@ -81,7 +81,7 @@ UnownPrinter: ; 16be4
.pressed_a
ld a, [wJumptableIndex]
push af
callba Function84560
callba PrintUnownStamp
call RestartMapMusic
pop af
ld [wJumptableIndex], a
@ -248,9 +248,9 @@ PhotoStudio: ; 16dc7
ld hl, .Text_HoldStill
call PrintText
call DisableSpriteUpdates
callba Function8461a
callba PrintPartymon
call Function2b74
ld a, [$ffac]
ld a, [hPrinter]
and a
jr nz, .cancel
ld hl, .Text_Presto

View File

@ -41,14 +41,12 @@ ReadAnyMail: ; b9237
call SetPalettes
xor a
ld [hJoyPressed], a
call Functionb929a
call .loop
call ClearBGPalettes
call DisableLCD
call LoadStandardFont
jp EnableLCD
; b929a
Functionb929a: ; b929a
.loop
call GetJoypad
ld a, [hJoyPressed]
@ -61,7 +59,7 @@ Functionb929a: ; b929a
.pressed_start
ld a, [wJumptableIndex]
push af
callab Function845d4
callab PrintMail ; printer
pop af
ld [wJumptableIndex], a
jr .loop

View File

@ -32,6 +32,7 @@ hJoyDown EQU $ffa8
hJoyLast EQU $ffa9
hInMenu EQU $ffaa
hPrinter EQU $ffac
hFillBox EQU $ffad
hMapObjectIndexBuffer EQU $ffaf

View File

@ -14,7 +14,7 @@ INCLUDE "macros/predef.asm"
INCLUDE "macros/rst.asm"
INCLUDE "macros/mobile.asm"
INCLUDE "macros/trainer.asm"
INCLUDE "macros/trade_anim.asm"
RGB: MACRO

175
macros/trade_anim.asm Executable file
View File

@ -0,0 +1,175 @@
enum_start
enum tradeanim_next_command
tradeanim_next: macro
db tradeanim_next_command
endm
enum tradeanim_01_command
tradeanim_01: macro
db tradeanim_01_command
endm
enum tradeanim_02_command
tradeanim_02: macro
db tradeanim_02_command
endm
enum tradeanim_03_command
tradeanim_03: macro
db tradeanim_03_command
endm
enum tradeanim_04_command
tradeanim_04: macro
db tradeanim_04_command
endm
enum tradeanim_05_command
tradeanim_05: macro
db tradeanim_05_command
endm
enum tradeanim_06_command
tradeanim_06: macro
db tradeanim_06_command
endm
__enum__ set $e
enum tradeanim_0e_command
tradeanim_0e: macro
db tradeanim_0e_command
endm
__enum__ set $16
enum tradeanim_16_command
tradeanim_16: macro
db tradeanim_16_command
endm
enum tradeanim_17_command
tradeanim_17: macro
db tradeanim_17_command
endm
enum tradeanim_18_command
tradeanim_18: macro
db tradeanim_18_command
endm
enum tradeanim_19_command
tradeanim_19: macro
db tradeanim_19_command
endm
enum tradeanim_1a_command
tradeanim_1a: macro
db tradeanim_1a_command
endm
enum tradeanim_1b_command
tradeanim_1b: macro
db tradeanim_1b_command
endm
enum tradeanim_1c_command
tradeanim_1c: macro
db tradeanim_1c_command
endm
enum tradeanim_1d_command
tradeanim_1d: macro
db tradeanim_1d_command
endm
enum tradeanim_1e_command
tradeanim_1e: macro
db tradeanim_1e_command
endm
enum tradeanim_1f_command
tradeanim_1f: macro
db tradeanim_1f_command
endm
enum tradeanim_20_command
tradeanim_20: macro
db tradeanim_20_command
endm
enum tradeanim_21_command
tradeanim_21: macro
db tradeanim_21_command
endm
enum tradeanim_22_command
tradeanim_22: macro
db tradeanim_22_command
endm
enum tradeanim_23_command
tradeanim_23: macro
db tradeanim_23_command
endm
enum tradeanim_24_command
tradeanim_24: macro
db tradeanim_24_command
endm
enum tradeanim_25_command
tradeanim_25: macro
db tradeanim_25_command
endm
enum tradeanim_26_command
tradeanim_26: macro
db tradeanim_26_command
endm
enum tradeanim_27_command
tradeanim_27: macro
db tradeanim_27_command
endm
enum tradeanim_28_command
tradeanim_28: macro
db tradeanim_28_command
endm
enum tradeanim_29_command
tradeanim_29: macro
db tradeanim_29_command
endm
enum tradeanim_2a_command
tradeanim_2a: macro
db tradeanim_2a_command
endm
enum tradeanim_end_command
tradeanim_end: macro
db tradeanim_end_command
endm
enum tradeanim_2c_command
tradeanim_2c: macro
db tradeanim_2c_command
endm
enum tradeanim_2d_command
tradeanim_2d: macro
db tradeanim_2d_command
endm
enum tradeanim_2e_command
tradeanim_2e: macro
db tradeanim_2e_command
endm
enum tradeanim_2f_command
tradeanim_2f: macro
db tradeanim_2f_command
endm

2163
main.asm

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@ GBCOnlyScreen: ; 4ea82
call ClearTileMap
ld hl, GBCOnlyGFX
ld de, $d000
ld de, wd000
ld a, [rSVBK]
push af
ld a, 0
@ -19,7 +19,7 @@ GBCOnlyScreen: ; 4ea82
pop af
ld [rSVBK], a
ld de, $d000
ld de, wd000
ld hl, VTiles2
lb bc, BANK(GBCOnlyGFX), $54
call Get2bpp

View File

@ -59,17 +59,17 @@ sMailbox10Backup:: mailmsg sMailbox10Backup
sMysteryGiftItem:: ds 1
sMysteryGiftUnlocked:: ds 1
sBackupMysteryGiftItem:: ds 1
s0_abe5:: ds 1
s0_abe6:: ds 10
sNumDailyMysteryGiftPartnerIDs:: ds 1
sDailyMysteryGiftPartnerIDs:: ds 5 * 2 ; maximum 5 per day, 2 bytes per ID
sMysteryGiftDecorationsReceived:: flag_array NUM_NON_TROPHY_DECOS
ds 4
sMysteryGiftTimer:: ds 1
sMysteryGiftTimerStartDay:: ds 1
ds 1
sMysteryGiftTrainerHouseFlag:: ds 1
s0_abfe:: ds 12
sMysteryGiftTrainer:: ds (1 + 1 + NUM_MOVES) * PARTY_LENGTH + 1
ds 1
sMysteryGiftPartnerName:: ds NAME_LENGTH
s0_ac09:: ds 1
sMysteryGiftTrainer:: ds (1 + 1 + NUM_MOVES) * PARTY_LENGTH + 2
sBackupMysteryGiftItemEnd::
ds $30

View File

@ -194,7 +194,7 @@ BattleText_EnemyPkmnFainted: ; 0x809a8
GotMoneyForWinningText:
text "<PLAYER> got ¥@"
deciram wc686, 3, 6
deciram wBattleReward, 3, 6
text ""
line "for winning!"
prompt
@ -213,7 +213,7 @@ TiedAgainstText: ; 0x809eb
SentSomeToMomText:
text "<PLAYER> got ¥@"
deciram wc686, 3, 6
deciram wBattleReward, 3, 6
text ""
line "for winning!"
cont "Sent some to MOM!"

View File

@ -279,7 +279,7 @@ UnknownText_0x1c04c6: ; 1c04c6
; 1c04e9
UnknownText_0x1c04e9: ; 1c04e9
text_from_ram wc903
text_from_ram wMysteryGiftPartnerName
text " sent"
line "@"
text_from_ram StringBuffer1
@ -288,7 +288,7 @@ UnknownText_0x1c04e9: ; 1c04e9
; 1c04fa
UnknownText_0x1c04fa: ; 1c04fa
text_from_ram wc903
text_from_ram wMysteryGiftPartnerName
text " sent"
line "@"
text_from_ram StringBuffer1

View File

@ -152,9 +152,11 @@ mailmsg: MACRO
\1AuthorNationality:: ds 2
\1AuthorID:: ds 2
\1Species:: ds 1
\1MailType:: ds 1
\1Type:: ds 1
\1End::
endm
INCLUDE "vram.asm"
SECTION "Stack", WRAM0
@ -542,7 +544,8 @@ wc64e:: ds 1
ds 1
wEnemyTrainerItem1:: ds 1
wEnemyTrainerItem2:: ds 1
wc652:: ds 4
wEnemyTrainerBaseReward:: ds 1
wEnemyTrainerAIFlags:: ds 3
wc656::
OTName:: ds NAME_LENGTH ; c656
@ -688,8 +691,7 @@ PlayerDamageTaken:: ; c682
EnemyDamageTaken:: ; c684
ds 2
wc686:: ds 2
wc688:: ds 1
wBattleReward:: ds 3
wKickCounter::
wPresentPower:: ds 1
wc68a::
@ -719,6 +721,24 @@ PlayerSpdLevel:: ; c6ce
ds 1
PlayerSAtkLevel:: ; c6cf
ds 1
trademon: MACRO
\1Species:: ds 1 ; wc6d0 | wc702
\1SpeciesName:: ds PKMN_NAME_LENGTH ; wc6d1 | wc703
\1Nickname:: ds PKMN_NAME_LENGTH ; wc6dc | wc70e
\1SenderName:: ds NAME_LENGTH ; wc6e7 | wc719
\1OTName:: ds NAME_LENGTH ; wc6f2 | wc724
\1DVs:: ds 2 ; wc6fd | wc72f
\1ID:: ds 2 ; wc6ff | wc731
\1CaughtData:: ds 1 ; wc701 | wc733
\1End::
ENDM
wPlayerTrademon:: trademon wPlayerTrademon
wOTTrademon:: trademon wOTTrademon
ds wPlayerTrademon - @
wc6d0::
wPokedexDataStart::
PlayerSDefLevel:: ; c6d0
@ -920,12 +940,19 @@ wc729:: ds 2
wPlayerRageCounter:: ds 1
wEnemyRageCounter:: ds 1
wc72d:: ds 1 ; if 0 then PrintButItFailed
wc72e::
wPlayerTrappingMove:: ds 1
wc72f::
wEnemyTrappingMove:: ds 1
wc730::
wPlayerWrapCount:: ds 1
wc731::
wEnemyWrapCount:: ds 1
wc732::
wPlayerCharging:: ds 1
wEnemyCharging:: ds 1
wEnemyCharging::
wc733:: ds 1
wTradeAnimPointer::
wc734::
BattleEnded:: ; c734
ds 1
@ -935,7 +962,7 @@ wc735:: ds 1
wc736:: ds 3
wWildMonPP::
wc739:: ds 4
wc73d:: ds 1
wAmuletCoin:: ds 1
wc73e:: ds 1
wPlayerJustGotFrozen:: ds 1
wEnemyJustGotFrozen:: ds 1
@ -1006,6 +1033,8 @@ wc820:: ds 1
wc821:: ds 15
wc830:: ds 16
wc840:: ds 16
wMysteryGiftTrainerData:: ds (1 + 1 + NUM_MOVES) * PARTY_LENGTH + 2
ds wMysteryGiftTrainerData - @
wc850:: ds 16
wc860:: ds 16
wc870:: ds 16
@ -1018,9 +1047,9 @@ wc8d0:: ds 16
wc8e0:: ds 16
wc8f0:: ds 16
wc900:: ds 1
wc901:: ds 1
wc902:: ds 1
wc903:: ds 12
wMysteryGiftPartnerID:: ds 2
wMysteryGiftPartnerName:: ds NAME_LENGTH
wc90e:: ds 1
wc90f:: ds 1
wc910:: ds 1
wc911:: ds 1
@ -2432,7 +2461,7 @@ PlayerState:: ; d95d
ds 1
wHallOfFameCount:: ds 2
wd960:: ds 2
wTradeFlags:: ds 2
MooMooBerries:: ; d962
ds 1 ; how many berries fed to MooMoo
UndergroundSwitchPositions:: ; d963