ref: 8acc8d6e30392a30a8353923219db71527f3a9bb
parent: aa51dbc61245d5b4949c1872b3d3e915a981ded3
parent: 59c4d824e65409f6de211d6e0fd354ca4ef6c61e
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Sun May 6 18:45:07 EDT 2018
Merge branch 'master' of https://github.com/pret/pokecrystal
--- a/constants/script_constants.asm
+++ b/constants/script_constants.asm
@@ -22,7 +22,7 @@
const HAVE_AMOUNT ; 1
const HAVE_LESS ; 2
-; checkpokeitem return values
+; checkpokemail return values
const_def
const POKEMAIL_WRONG_MAIL ; 0
const POKEMAIL_CORRECT ; 1
--- a/constants/sprite_constants.asm
+++ b/constants/sprite_constants.asm
@@ -1,5 +1,5 @@
; sprite ids
-; OverworldSprites indexes (see data/sprites.asm)
+; OverworldSprites indexes (see data/sprites/sprites.asm)
const_def
const SPRITE_NONE ; 00
const SPRITE_CHRIS ; 01
--- a/data/moves/animations.asm
+++ b/data/moves/animations.asm
@@ -303,7 +303,7 @@
anim_ret
; c92c1
-BattleAnim_ThrowPokeBall
+BattleAnim_ThrowPokeBall:
anim_if_param_equal NO_ITEM, .TheTrainerBlockedTheBall
anim_if_param_equal MASTER_BALL, .MasterBall
anim_if_param_equal ULTRA_BALL, .UltraBall
--- a/data/wild/flee_mons.asm
+++ b/data/wild/flee_mons.asm
@@ -31,6 +31,5 @@
AlwaysFleeMons: ; 3c5b1
db RAIKOU
db ENTEI
-; db SUICUNE
db -1
; 3c5b4
--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -1122,7 +1122,7 @@
```asm
.Cry: ; 40340
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call PlayMonCry
ret
```
--- a/docs/event_commands.md
+++ b/docs/event_commands.md
@@ -99,9 +99,9 @@
## `$2E`: <code>giveegg <i>mon_id</i>, <i>level</i></code>
-## `$2F`: <code>givepokeitem <i>pointer</i></code>
+## `$2F`: <code>givepokemail <i>pointer</i></code>
-## `$30`: <code>checkpokeitem <i>pointer</i></code>
+## `$30`: <code>checkpokemail <i>pointer</i></code>
## `$31`: <code>checkevent <i>event_flag</i></code>
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -6451,7 +6451,7 @@
.InitRoamHP:
; HP only uses the lo byte in the RoamMon struct since
-; Raikou/Entei/Suicune will have < 256 hp at level 40
+; Raikou and Entei will have < 256 hp at level 40
ld a, [wEnemyMonHP + 1]
ld [hl], a
jr .Moves
--- a/engine/events/std_scripts.asm
+++ b/engine/events/std_scripts.asm
@@ -240,7 +240,7 @@
PokecenterSignScript:
farjumptext PokecenterSignText
-MartSignScript
+MartSignScript:
farjumptext MartSignText
DayToTextScript:
@@ -331,23 +331,23 @@
verbosegiveitem BERRY
iffalse BugContestResults_NoRoomForBerry
-BugContestResults_DidNotWin
+BugContestResults_DidNotWin:
farwritetext ContestResults_DidNotWinText
buttonsound
jump BugContestResults_FinishUp
; 0xbc2b1
-BugContestResults_ReturnAfterWinnersPrize ; 0xbc2b1
+BugContestResults_ReturnAfterWinnersPrize: ; 0xbc2b1
farwritetext ContestResults_JoinUsNextTimeText
buttonsound
-BugContestResults_FinishUp
+BugContestResults_FinishUp:
checkevent EVENT_LEFT_MONS_WITH_CONTEST_OFFICER
iffalse BugContestResults_DidNotLeaveMons
farwritetext ContestResults_ReturnPartyText
waitbutton
special ContestReturnMons
-BugContestResults_DidNotLeaveMons
+BugContestResults_DidNotLeaveMons:
special CheckPartyFullAfterContest
ifequal BUGCONTEST_CAUGHT_MON, BugContestResults_CleanUp
ifequal BUGCONTEST_NO_CATCH, BugContestResults_CleanUp
@@ -354,7 +354,7 @@
; BUGCONTEST_BOXED_MON
farwritetext ContestResults_PartyFullText
waitbutton
-BugContestResults_CleanUp
+BugContestResults_CleanUp:
closetext
setscene SCENE_ROUTE36NATIONALPARKGATE_NOTHING
setmapscene ROUTE_35_NATIONAL_PARK_GATE, SCENE_ROUTE35NATIONALPARKGATE_NOTHING
@@ -383,7 +383,7 @@
end
; 0xbc31e
-BugContestResults_FirstPlace ; 0xbc31e
+BugContestResults_FirstPlace: ; 0xbc31e
setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1
itemtotext SUN_STONE, MEM_BUFFER_1
farwritetext ContestResults_PlayerWonAPrizeText
@@ -393,7 +393,7 @@
jump BugContestResults_ReturnAfterWinnersPrize
; 0xbc332
-BugContestResults_SecondPlace ; 0xbc332
+BugContestResults_SecondPlace: ; 0xbc332
itemtotext EVERSTONE, MEM_BUFFER_1
farwritetext ContestResults_PlayerWonAPrizeText
waitbutton
@@ -402,7 +402,7 @@
jump BugContestResults_ReturnAfterWinnersPrize
; 0xbc343
-BugContestResults_ThirdPlace ; 0xbc343
+BugContestResults_ThirdPlace: ; 0xbc343
itemtotext GOLD_BERRY, MEM_BUFFER_1
farwritetext ContestResults_PlayerWonAPrizeText
waitbutton
@@ -411,7 +411,7 @@
jump BugContestResults_ReturnAfterWinnersPrize
; 0xbc354
-BugContestResults_NoRoomForSunStone ; 0xbc354
+BugContestResults_NoRoomForSunStone: ; 0xbc354
farwritetext BugContestPrizeNoRoomText
buttonsound
setevent EVENT_CONTEST_OFFICER_HAS_SUN_STONE
@@ -418,7 +418,7 @@
jump BugContestResults_ReturnAfterWinnersPrize
; 0xbc35f
-BugContestResults_NoRoomForEverstone ; 0xbc35f
+BugContestResults_NoRoomForEverstone: ; 0xbc35f
farwritetext BugContestPrizeNoRoomText
buttonsound
setevent EVENT_CONTEST_OFFICER_HAS_EVERSTONE
@@ -425,7 +425,7 @@
jump BugContestResults_ReturnAfterWinnersPrize
; 0xbc36a
-BugContestResults_NoRoomForGoldBerry ; 0xbc36a
+BugContestResults_NoRoomForGoldBerry: ; 0xbc36a
farwritetext BugContestPrizeNoRoomText
buttonsound
setevent EVENT_CONTEST_OFFICER_HAS_GOLD_BERRY
@@ -432,7 +432,7 @@
jump BugContestResults_ReturnAfterWinnersPrize
; 0xbc375
-BugContestResults_NoRoomForBerry ; 0xbc375
+BugContestResults_NoRoomForBerry: ; 0xbc375
farwritetext BugContestPrizeNoRoomText
buttonsound
setevent EVENT_CONTEST_OFFICER_HAS_BERRY
@@ -439,7 +439,7 @@
jump BugContestResults_DidNotWin
; 0xbc380
-BugContestResults_CopyContestantsToResults ; 0xbc380
+BugContestResults_CopyContestantsToResults: ; 0xbc380
checkevent EVENT_BUG_CATCHING_CONTESTANT_1A
iftrue .skip1
clearevent EVENT_BUG_CATCHING_CONTESTANT_1B
--- a/engine/overworld/map_objects.asm
+++ b/engine/overworld/map_objects.asm
@@ -163,12 +163,12 @@
add hl, bc
bit INVISIBLE, [hl]
jr nz, SetFacingStanding
-asm_4448
+asm_4448:
ld de, ObjectActionPairPointers + 2 ; use second column
jr _HandleObjectAction
; 444d
-_HandleObjectAction
+_HandleObjectAction:
; call [4 * wObjectStructs[ObjInd, OBJECT_ACTION] + de]
ld hl, OBJECT_ACTION
add hl, bc
--- a/engine/overworld/scripting.asm
+++ b/engine/overworld/scripting.asm
@@ -112,8 +112,8 @@
dw Script_checkpoke ; 2c
dw Script_givepoke ; 2d
dw Script_giveegg ; 2e
- dw Script_givepokeitem ; 2f
- dw Script_checkpokeitem ; 30
+ dw Script_givepokemail ; 2f
+ dw Script_checkpokemail ; 30
dw Script_checkevent ; 31
dw Script_clearevent ; 32
dw Script_setevent ; 33
@@ -2019,7 +2019,7 @@
ld de, wStringBuffer2
jp ConvertMemToText
-Script_givepokeitem:
+Script_givepokemail:
; script command 0x2f
; parameters: pointer
@@ -2037,10 +2037,10 @@
ld a, [wScriptBank]
call FarCopyBytes
pop bc
- farcall GivePokeItem
+ farcall GivePokeMail
ret
-Script_checkpokeitem:
+Script_checkpokemail:
; script command 0x30
; parameters: pointer
@@ -2050,7 +2050,7 @@
ld d, a
ld a, [wScriptBank]
ld b, a
- farcall CheckPokeItem
+ farcall CheckPokeMail
ret
Script_giveitem:
--- a/engine/overworld/wildmons.asm
+++ b/engine/overworld/wildmons.asm
@@ -417,7 +417,7 @@
ld bc, WATER_WILDDATA_LENGTH
jr _NormalWildmonOK
-_JohtoWildmonCheck
+_JohtoWildmonCheck:
call IsInJohto
and a
ret z
@@ -425,7 +425,7 @@
ld l, e
ret
-_SwarmWildmonCheck
+_SwarmWildmonCheck:
call CopyCurrMapDE
push hl
ld hl, wSwarmFlags
@@ -460,11 +460,11 @@
scf
ret
-_NoSwarmWildmon
+_NoSwarmWildmon:
and a
ret
-_NormalWildmonOK
+_NormalWildmonOK:
call CopyCurrMapDE
jr LookUpWildmonsForMapDE
; 2a27f
--- a/engine/phone/phone.asm
+++ b/engine/phone/phone.asm
@@ -604,7 +604,7 @@
HangUp_Wait20Frames: ; 90355
jr Phone_Wait20Frames
-Phone_Wait20Frames
+Phone_Wait20Frames:
ld c, 20
call DelayFrames
farcall PhoneRing_CopyTilemapAtOnce
--- a/engine/pokemon/breeding.asm
+++ b/engine/pokemon/breeding.asm
@@ -24,7 +24,7 @@
ld [wTempMonDVs], a
ld a, [wBreedMon2DVs + 1]
ld [wTempMonDVs + 1], a
- ld a, $3
+ ld a, TEMPMON
ld [wMonType], a
predef GetGender
pop bc
--- a/engine/pokemon/evolve.asm
+++ b/engine/pokemon/evolve.asm
@@ -18,7 +18,7 @@
push hl
-EvolveAfterBattle_MasterLoop
+EvolveAfterBattle_MasterLoop:
ld hl, wCurPartyMon
inc [hl]
--- a/engine/pokemon/mail.asm
+++ b/engine/pokemon/mail.asm
@@ -124,7 +124,7 @@
jp CloseSRAM
; 44654
-CheckPokeItem:: ; 44654
+CheckPokeMail:: ; 44654
push bc
push de
farcall SelectMonFromParty
@@ -194,7 +194,7 @@
; 446cc
-GivePokeItem:: ; 446cc
+GivePokeMail:: ; 446cc
ld a, [wPartyCount]
dec a
push af
--- a/macros/legacy.asm
+++ b/macros/legacy.asm
@@ -51,6 +51,8 @@
resetfuncs EQUS "endall"
storetext EQUS "battletowertext"
displaylocation EQUS "landmarktotext"
+givepokeitem EQUS "givepokemail"
+checkpokeitem EQUS "checkpokemail"
; macros/scripts/maps.asm
--- a/macros/scripts/events.asm
+++ b/macros/scripts/events.asm
@@ -1,4 +1,4 @@
-; ScriptCommandTable indexes (see engine/scripting.asm)
+; ScriptCommandTable indexes (see engine/overworld/scripting.asm)
enum_start
enum scall_command ; $00
@@ -315,15 +315,15 @@
db \2 ; level
ENDM
- enum givepokeitem_command ; $2f
-givepokeitem: MACRO
- db givepokeitem_command
+ enum givepokemail_command ; $2f
+givepokemail: MACRO
+ db givepokemail_command
dw \1 ; pointer
ENDM
- enum checkpokeitem_command ; $30
-checkpokeitem: MACRO
- db checkpokeitem_command
+ enum checkpokemail_command ; $30
+checkpokemail: MACRO
+ db checkpokemail_command
dw \1 ; pointer
ENDM
--- a/macros/scripts/movement.asm
+++ b/macros/scripts/movement.asm
@@ -1,4 +1,4 @@
-; MovementPointers indexes (see engine/movement.asm)
+; MovementPointers indexes (see engine/overworld/movement.asm)
enum_start
; Directional movements
--- a/maps/OaksLab.asm
+++ b/maps/OaksLab.asm
@@ -223,7 +223,7 @@
line "manner."
done
-OaksLabTrashcanText
+OaksLabTrashcanText:
text "There's nothing in"
line "here…"
done
--- a/maps/Route31.asm
+++ b/maps/Route31.asm
@@ -195,7 +195,7 @@
.TryGiveKenya:
writetext Text_Route31SleepyManGotMail
buttonsound
- checkpokeitem ReceivedSpearowMailText
+ checkpokemail ReceivedSpearowMailText
ifequal POKEMAIL_WRONG_MAIL, .WrongMail
ifequal POKEMAIL_REFUSED, .Refused
ifequal POKEMAIL_NO_MAIL, .NoMail
--- a/maps/Route35GoldenrodGate.asm
+++ b/maps/Route35GoldenrodGate.asm
@@ -29,7 +29,7 @@
playsound SFX_KEY_ITEM
waitsfx
givepoke SPEAROW, 10, NO_ITEM, TRUE, GiftSpearowName, GiftSpearowOTName
- givepokeitem GiftSpearowMail
+ givepokemail GiftSpearowMail
setevent EVENT_GOT_KENYA
.alreadyhavekenya
writetext UnknownText_0x69ed6
--- a/mobile/mobile_40.asm
+++ b/mobile/mobile_40.asm
@@ -2320,7 +2320,7 @@
and a
call Function100eca
-asm_100eb8
+asm_100eb8:
ld hl, wcd68
inc [hl]
ld a, [hl]
@@ -2332,7 +2332,7 @@
Function100ec4: ; 100ec4
ret
-Function100ec5
+Function100ec5:
ld hl, wcd67
inc [hl]
ret
--- a/mobile/mobile_42.asm
+++ b/mobile/mobile_42.asm
@@ -1293,7 +1293,7 @@
call MobileTradeAnim_MonDisplay_UpdateBGMap
ret
-MobileTradeAnim_DisplayEggData
+MobileTradeAnim_DisplayEggData:
call WaitTop
call MobileTradeAnim_ClearTilemap
ld a, HIGH(vBGMap1)