Through ScrCmd_takecoins

This commit is contained in:
scnorton
2019-01-06 16:14:59 -05:00
parent fdd7b1033c
commit abac6f3ec8
9 changed files with 311 additions and 594 deletions
+18 -18
View File
@@ -478,8 +478,8 @@ _0805B25C:
_0805B264: .4byte gUnknown_835B4B0
thumb_func_end sub_805B210
thumb_func_start sub_805B268
sub_805B268: @ 805B268
thumb_func_start FieldSetDoorOpened
FieldSetDoorOpened: @ 805B268
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
@@ -504,10 +504,10 @@ _0805B292:
bx r0
.align 2, 0
_0805B298: .4byte gUnknown_835B5D8
thumb_func_end sub_805B268
thumb_func_end FieldSetDoorOpened
thumb_func_start sub_805B29C
sub_805B29C: @ 805B29C
thumb_func_start FieldSetDoorClosed
FieldSetDoorClosed: @ 805B29C
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
@@ -532,10 +532,10 @@ _0805B2C6:
bx r0
.align 2, 0
_0805B2CC: .4byte gUnknown_835B5D8
thumb_func_end sub_805B29C
thumb_func_end FieldSetDoorClosed
thumb_func_start sub_805B2D0
sub_805B2D0: @ 805B2D0
thumb_func_start FieldAnimateDoorClose
FieldAnimateDoorClose: @ 805B2D0
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
@@ -566,10 +566,10 @@ _0805B308:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_805B2D0
thumb_func_end FieldAnimateDoorClose
thumb_func_start sub_805B310
sub_805B310: @ 805B310
thumb_func_start FieldAnimateDoorOpen
FieldAnimateDoorOpen: @ 805B310
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
@@ -600,10 +600,10 @@ _0805B348:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_805B310
thumb_func_end FieldAnimateDoorOpen
thumb_func_start sub_805B350
sub_805B350: @ 805B350
thumb_func_start FieldIsDoorAnimationRunning
FieldIsDoorAnimationRunning: @ 805B350
push {lr}
ldr r0, _0805B360 @ =sub_805B028
bl FuncIsActiveTask
@@ -613,10 +613,10 @@ sub_805B350: @ 805B350
bx r1
.align 2, 0
_0805B360: .4byte sub_805B028
thumb_func_end sub_805B350
thumb_func_end FieldIsDoorAnimationRunning
thumb_func_start sub_805B364
sub_805B364: @ 805B364
thumb_func_start GetDoorSoundEffect
GetDoorSoundEffect: @ 805B364
push {lr}
adds r3, r0, 0
adds r2, r1, 0
@@ -635,7 +635,7 @@ _0805B380:
_0805B382:
pop {r1}
bx r1
thumb_func_end sub_805B364
thumb_func_end GetDoorSoundEffect
thumb_func_start sub_805B388
sub_805B388: @ 805B388
+10 -10
View File
@@ -661,7 +661,7 @@ _0807E028:
ldrsh r0, [r6, r2]
movs r2, 0
ldrsh r1, [r7, r2]
bl sub_805B268
bl FieldSetDoorOpened
movs r0, 0x1
strh r0, [r4, 0x8]
b _0807E206
@@ -691,7 +691,7 @@ _0807E074:
ldrsh r0, [r6, r1]
movs r2, 0
ldrsh r1, [r7, r2]
bl sub_805B364
bl GetDoorSoundEffect
lsls r0, 16
lsrs r0, 16
bl PlaySE
@@ -699,12 +699,12 @@ _0807E074:
ldrsh r0, [r6, r1]
movs r2, 0
ldrsh r1, [r7, r2]
bl sub_805B310
bl FieldAnimateDoorOpen
movs r0, 0x7
strh r0, [r4, 0x8]
b _0807E206
_0807E0A2:
bl sub_805B350
bl FieldIsDoorAnimationRunning
lsls r0, 24
cmp r0, 0
beq _0807E0AE
@@ -750,7 +750,7 @@ _0807E0FC:
ldrsh r0, [r4, r1]
movs r2, 0x22
ldrsh r1, [r4, r2]
bl sub_805B2D0
bl FieldAnimateDoorClose
movs r0, 0x9
strh r0, [r4, 0x8]
b _0807E206
@@ -762,7 +762,7 @@ _0807E10E:
lsls r0, 24
cmp r0, 0
beq _0807E206
bl sub_805B350
bl FieldIsDoorAnimationRunning
lsls r0, 24
cmp r0, 0
bne _0807E206
@@ -822,7 +822,7 @@ _0807E198:
ldrsh r0, [r6, r1]
movs r2, 0
ldrsh r1, [r7, r2]
bl sub_805B2D0
bl FieldAnimateDoorClose
lsls r0, 24
asrs r0, 24
strh r0, [r4, 0xA]
@@ -1690,7 +1690,7 @@ _0807E85C:
movs r2, 0
ldrsh r1, [r6, r2]
subs r1, 0x1
bl sub_805B364
bl GetDoorSoundEffect
lsls r0, 16
lsrs r0, 16
bl PlaySE
@@ -1699,7 +1699,7 @@ _0807E85C:
movs r2, 0
ldrsh r1, [r6, r2]
subs r1, 0x1
bl sub_805B310
bl FieldAnimateDoorOpen
lsls r0, 24
asrs r0, 24
strh r0, [r5, 0xA]
@@ -1760,7 +1760,7 @@ _0807E8F4:
movs r2, 0
ldrsh r1, [r6, r2]
subs r1, 0x1
bl sub_805B2D0
bl FieldAnimateDoorClose
lsls r0, 24
asrs r0, 24
strh r0, [r5, 0xA]
+3 -3
View File
@@ -1185,8 +1185,8 @@ sub_80554BC: @ 80554BC
_080554C8: .4byte gUnknown_2031DBC
thumb_func_end sub_80554BC
thumb_func_start sub_80554CC
sub_80554CC: @ 80554CC
thumb_func_start SetLastHealLocationWarp
SetLastHealLocationWarp: @ 80554CC
push {r4,r5,lr}
sub sp, 0x8
lsls r0, 24
@@ -1218,7 +1218,7 @@ _08055500:
bx r0
.align 2, 0
_08055508: .4byte gSaveBlock1Ptr
thumb_func_end sub_80554CC
thumb_func_end SetLastHealLocationWarp
thumb_func_start sub_805550C
sub_805550C: @ 805550C
-552
View File
@@ -5,558 +5,6 @@
.text
thumb_func_start ScrCmd_pokemartdecoration
ScrCmd_pokemartdecoration: @ 806C3C0
push {lr}
bl ScriptReadWord
bl sub_809C1A0
bl ScriptContext1_Stop
movs r0, 0x1
pop {r1}
bx r1
thumb_func_end ScrCmd_pokemartdecoration
thumb_func_start ScrCmd_pokemartdecoration2
ScrCmd_pokemartdecoration2: @ 806C3D4
push {lr}
bl ScriptReadWord
bl sub_809C1BC
bl ScriptContext1_Stop
movs r0, 0x1
pop {r1}
bx r1
thumb_func_end ScrCmd_pokemartdecoration2
thumb_func_start ScrCmd_playslotmachine
ScrCmd_playslotmachine: @ 806C3E8
push {lr}
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
lsls r0, 24
lsrs r0, 24
ldr r1, _0806C40C @ =c2_exit_to_overworld_1_continue_scripts_restart_music
bl sub_813F804
bl ScriptContext1_Stop
movs r0, 0x1
pop {r1}
bx r1
.align 2, 0
_0806C40C: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music
thumb_func_end ScrCmd_playslotmachine
thumb_func_start ScrCmd_setberrytree
ScrCmd_setberrytree: @ 806C410
movs r0, 0
bx lr
thumb_func_end ScrCmd_setberrytree
thumb_func_start ScrCmd_getpricereduction
ScrCmd_getpricereduction: @ 806C414
movs r0, 0
bx lr
thumb_func_end ScrCmd_getpricereduction
thumb_func_start ScrCmd_choosecontestmon
ScrCmd_choosecontestmon: @ 806C418
push {lr}
bl ScriptContext1_Stop
movs r0, 0x1
pop {r1}
bx r1
thumb_func_end ScrCmd_choosecontestmon
thumb_func_start ScrCmd_startcontest
ScrCmd_startcontest: @ 806C424
movs r0, 0
bx lr
thumb_func_end ScrCmd_startcontest
thumb_func_start ScrCmd_showcontestresults
ScrCmd_showcontestresults: @ 806C428
movs r0, 0
bx lr
thumb_func_end ScrCmd_showcontestresults
thumb_func_start ScrCmd_contestlinktransfer
ScrCmd_contestlinktransfer: @ 806C42C
movs r0, 0
bx lr
thumb_func_end ScrCmd_contestlinktransfer
thumb_func_start ScrCmd_dofieldeffect
ScrCmd_dofieldeffect: @ 806C430
push {lr}
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
lsls r0, 16
lsrs r0, 16
ldr r1, _0806C454 @ =gUnknown_20370B6
strh r0, [r1]
lsls r0, 24
lsrs r0, 24
bl FieldEffectStart
movs r0, 0
pop {r1}
bx r1
.align 2, 0
_0806C454: .4byte gUnknown_20370B6
thumb_func_end ScrCmd_dofieldeffect
thumb_func_start ScrCmd_setfieldeffectarg
ScrCmd_setfieldeffectarg: @ 806C458
push {r4,lr}
ldr r1, [r0, 0x8]
ldrb r4, [r1]
adds r1, 0x1
str r1, [r0, 0x8]
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
ldr r1, _0806C484 @ =gFieldEffectArguments
lsls r4, 2
adds r4, r1
lsls r0, 16
asrs r0, 16
str r0, [r4]
movs r0, 0
pop {r4}
pop {r1}
bx r1
.align 2, 0
_0806C484: .4byte gFieldEffectArguments
thumb_func_end ScrCmd_setfieldeffectarg
thumb_func_start WaitForFieldEffectFinish
WaitForFieldEffectFinish: @ 806C488
push {lr}
ldr r0, _0806C49C @ =gUnknown_20370B6
ldrb r0, [r0]
bl FieldEffectActiveListContains
lsls r0, 24
cmp r0, 0
beq _0806C4A0
movs r0, 0
b _0806C4A2
.align 2, 0
_0806C49C: .4byte gUnknown_20370B6
_0806C4A0:
movs r0, 0x1
_0806C4A2:
pop {r1}
bx r1
thumb_func_end WaitForFieldEffectFinish
thumb_func_start ScrCmd_waitfieldeffect
ScrCmd_waitfieldeffect: @ 806C4A8
push {r4,lr}
adds r4, r0, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
ldr r1, _0806C4CC @ =gUnknown_20370B6
strh r0, [r1]
ldr r1, _0806C4D0 @ =WaitForFieldEffectFinish
adds r0, r4, 0
bl SetupNativeScript
movs r0, 0x1
pop {r4}
pop {r1}
bx r1
.align 2, 0
_0806C4CC: .4byte gUnknown_20370B6
_0806C4D0: .4byte WaitForFieldEffectFinish
thumb_func_end ScrCmd_waitfieldeffect
thumb_func_start ScrCmd_setrespawn
ScrCmd_setrespawn: @ 806C4D4
push {lr}
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
lsls r0, 24
lsrs r0, 24
bl sub_80554CC
movs r0, 0
pop {r1}
bx r1
thumb_func_end ScrCmd_setrespawn
thumb_func_start ScrCmd_checkplayergender
ScrCmd_checkplayergender: @ 806C4F0
ldr r1, _0806C500 @ =gSpecialVar_Result
ldr r0, _0806C504 @ =gSaveBlock2Ptr
ldr r0, [r0]
ldrb r0, [r0, 0x8]
strh r0, [r1]
movs r0, 0
bx lr
.align 2, 0
_0806C500: .4byte gSpecialVar_Result
_0806C504: .4byte gSaveBlock2Ptr
thumb_func_end ScrCmd_checkplayergender
thumb_func_start ScrCmd_playmoncry
ScrCmd_playmoncry: @ 806C508
push {r4,r5,lr}
adds r5, r0, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
adds r4, r0, 0
lsls r4, 16
lsrs r4, 16
adds r0, r5, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
bl PlayCry7
movs r0, 0
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end ScrCmd_playmoncry
thumb_func_start ScrCmd_waitmoncry
ScrCmd_waitmoncry: @ 806C540
push {lr}
ldr r1, _0806C550 @ =IsCryFinished
bl SetupNativeScript
movs r0, 0x1
pop {r1}
bx r1
.align 2, 0
_0806C550: .4byte IsCryFinished
thumb_func_end ScrCmd_waitmoncry
thumb_func_start ScrCmd_setmetatile
ScrCmd_setmetatile: @ 806C554
push {r4-r7,lr}
adds r4, r0, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
lsls r0, 16
lsrs r6, r0, 16
adds r0, r4, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
lsls r0, 16
lsrs r5, r0, 16
adds r0, r4, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
lsls r0, 16
lsrs r7, r0, 16
adds r0, r4, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
lsls r0, 16
adds r1, r6, 0x7
lsls r1, 16
lsrs r6, r1, 16
adds r1, r5, 0x7
lsls r1, 16
lsrs r5, r1, 16
cmp r0, 0
bne _0806C5B8
adds r0, r6, 0
adds r1, r5, 0
adds r2, r7, 0
bl MapGridSetMetatileIdAt
b _0806C5CA
_0806C5B8:
movs r1, 0xC0
lsls r1, 4
adds r0, r1, 0
adds r2, r7, 0
orrs r2, r0
adds r0, r6, 0
adds r1, r5, 0
bl MapGridSetMetatileIdAt
_0806C5CA:
movs r0, 0
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end ScrCmd_setmetatile
thumb_func_start ScrCmd_opendoor
ScrCmd_opendoor: @ 806C5D4
push {r4,r5,lr}
adds r4, r0, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
adds r5, r0, 0
lsls r5, 16
lsrs r5, 16
adds r0, r4, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
adds r4, r0, 0
lsls r4, 16
adds r5, 0x7
lsls r5, 16
lsrs r5, 16
movs r0, 0xE0
lsls r0, 11
adds r4, r0
lsrs r4, 16
adds r0, r5, 0
adds r1, r4, 0
bl sub_805B364
lsls r0, 16
lsrs r0, 16
bl PlaySE
adds r0, r5, 0
adds r1, r4, 0
bl sub_805B310
movs r0, 0
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end ScrCmd_opendoor
thumb_func_start ScrCmd_closedoor
ScrCmd_closedoor: @ 806C62C
push {r4,r5,lr}
adds r5, r0, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
adds r4, r0, 0
lsls r4, 16
lsrs r4, 16
adds r0, r5, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
adds r1, r0, 0
lsls r1, 16
adds r4, 0x7
lsls r4, 16
lsrs r4, 16
movs r0, 0xE0
lsls r0, 11
adds r1, r0
lsrs r1, 16
adds r0, r4, 0
bl sub_805B2D0
movs r0, 0
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end ScrCmd_closedoor
thumb_func_start sub_806C670
sub_806C670: @ 806C670
push {lr}
bl sub_805B350
lsls r0, 24
cmp r0, 0
beq _0806C680
movs r0, 0
b _0806C682
_0806C680:
movs r0, 0x1
_0806C682:
pop {r1}
bx r1
thumb_func_end sub_806C670
thumb_func_start ScrCmd_waitdoranim
ScrCmd_waitdoranim: @ 806C688
push {lr}
ldr r1, _0806C698 @ =sub_806C670
bl SetupNativeScript
movs r0, 0x1
pop {r1}
bx r1
.align 2, 0
_0806C698: .4byte sub_806C670
thumb_func_end ScrCmd_waitdoranim
thumb_func_start ScrCmd_setdooropen
ScrCmd_setdooropen: @ 806C69C
push {r4,r5,lr}
adds r5, r0, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
adds r4, r0, 0
lsls r4, 16
lsrs r4, 16
adds r0, r5, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
adds r1, r0, 0
lsls r1, 16
adds r4, 0x7
lsls r4, 16
lsrs r4, 16
movs r0, 0xE0
lsls r0, 11
adds r1, r0
lsrs r1, 16
adds r0, r4, 0
bl sub_805B268
movs r0, 0
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end ScrCmd_setdooropen
thumb_func_start ScrCmd_setdoorclosed
ScrCmd_setdoorclosed: @ 806C6E0
push {r4,r5,lr}
adds r5, r0, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
adds r4, r0, 0
lsls r4, 16
lsrs r4, 16
adds r0, r5, 0
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
adds r1, r0, 0
lsls r1, 16
adds r4, 0x7
lsls r4, 16
lsrs r4, 16
movs r0, 0xE0
lsls r0, 11
adds r1, r0
lsrs r1, 16
adds r0, r4, 0
bl sub_805B29C
movs r0, 0
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end ScrCmd_setdoorclosed
thumb_func_start ScrCmd_addelevmenuitem
ScrCmd_addelevmenuitem: @ 806C724
movs r0, 0
bx lr
thumb_func_end ScrCmd_addelevmenuitem
thumb_func_start ScrCmd_showelevmenu
ScrCmd_showelevmenu: @ 806C728
movs r0, 0
bx lr
thumb_func_end ScrCmd_showelevmenu
thumb_func_start ScrCmd_checkcoins
ScrCmd_checkcoins: @ 806C72C
push {r4,lr}
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl GetVarPointer
adds r4, r0, 0
bl GetCoins
strh r0, [r4]
movs r0, 0
pop {r4}
pop {r1}
bx r1
thumb_func_end ScrCmd_checkcoins
thumb_func_start ScrCmd_givecoins
ScrCmd_givecoins: @ 806C74C
push {lr}
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
lsls r0, 16
lsrs r0, 16
bl GiveCoins
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
bne _0806C774
ldr r1, _0806C770 @ =gSpecialVar_Result
movs r0, 0
b _0806C778
.align 2, 0
_0806C770: .4byte gSpecialVar_Result
_0806C774:
ldr r1, _0806C780 @ =gSpecialVar_Result
movs r0, 0x1
_0806C778:
strh r0, [r1]
movs r0, 0
pop {r1}
bx r1
.align 2, 0
_0806C780: .4byte gSpecialVar_Result
thumb_func_end ScrCmd_givecoins
thumb_func_start ScrCmd_takecoins
ScrCmd_takecoins: @ 806C784
push {lr}
bl ScriptReadHalfword
lsls r0, 16
lsrs r0, 16
bl VarGet
lsls r0, 16
lsrs r0, 16
bl TakeCoins
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
bne _0806C7AC
ldr r1, _0806C7A8 @ =gSpecialVar_Result
movs r0, 0
b _0806C7B0
.align 2, 0
_0806C7A8: .4byte gSpecialVar_Result
_0806C7AC:
ldr r1, _0806C7B8 @ =gSpecialVar_Result
movs r0, 0x1
_0806C7B0:
strh r0, [r1]
movs r0, 0
pop {r1}
bx r1
.align 2, 0
_0806C7B8: .4byte gSpecialVar_Result
thumb_func_end ScrCmd_takecoins
thumb_func_start ScrCmd_cmdCA
ScrCmd_cmdCA: @ 806C7BC
push {lr}
+6 -6
View File
@@ -2853,8 +2853,8 @@ _0809C198: .4byte gUnknown_203996C
_0809C19C: .4byte gMapHeader
thumb_func_end CreatePokemartMenu
thumb_func_start sub_809C1A0
sub_809C1A0: @ 809C1A0
thumb_func_start CreateDecorationShop1Menu
CreateDecorationShop1Menu: @ 809C1A0
push {lr}
bl sub_809ABD8
movs r0, 0x2
@@ -2865,10 +2865,10 @@ sub_809C1A0: @ 809C1A0
bx r0
.align 2, 0
_0809C1B8: .4byte EnableBothScriptContexts
thumb_func_end sub_809C1A0
thumb_func_end CreateDecorationShop1Menu
thumb_func_start sub_809C1BC
sub_809C1BC: @ 809C1BC
thumb_func_start CreateDecorationShop2Menu
CreateDecorationShop2Menu: @ 809C1BC
push {lr}
bl sub_809ABD8
movs r0, 0x3
@@ -2879,7 +2879,7 @@ sub_809C1BC: @ 809C1BC
bx r0
.align 2, 0
_0809C1D4: .4byte EnableBothScriptContexts
thumb_func_end sub_809C1BC
thumb_func_end CreateDecorationShop2Menu
thumb_func_start sub_809C1D8
sub_809C1D8: @ 809C1D8
+3 -3
View File
@@ -5,8 +5,8 @@
.text
thumb_func_start sub_813F804
sub_813F804: @ 813F804
thumb_func_start PlaySlotMachine
PlaySlotMachine: @ 813F804
push {r4-r6,lr}
adds r6, r1, 0
lsls r0, 16
@@ -39,7 +39,7 @@ _0813F840:
bx r0
.align 2, 0
_0813F848: .4byte sub_813F898
thumb_func_end sub_813F804
thumb_func_end PlaySlotMachine
thumb_func_start sub_813F84C
sub_813F84C: @ 813F84C
+1 -1
View File
@@ -175,7 +175,7 @@ gScriptCmdTable:: @ 815F9B4
.4byte ScrCmd_turnvobject
.4byte ScrCmd_opendoor
.4byte ScrCmd_closedoor
.4byte ScrCmd_waitdoranim
.4byte ScrCmd_waitdooranim
.4byte ScrCmd_setdooropen
.4byte ScrCmd_setdoorclosed
.4byte ScrCmd_addelevmenuitem
+1
View File
@@ -95,5 +95,6 @@ extern u8 gUnknown_2031DD8;
extern u8 gUnknown_2036E28;
extern bool8 (* gUnknown_3005024)(void);
void SetLastHealLocationWarp(u8 healLocaionId);
#endif //GUARD_ROM4_H
+269 -1
View File
@@ -36,6 +36,10 @@
#include "battle_setup.h"
#include "shop.h"
#include "script_pokemon_80F8.h"
#include "slot_machine.h"
#include "field_effect.h"
#include "fieldmap.h"
#include "field_door.h"
extern u16 (*const gSpecials[])(void);
extern u16 (*const gSpecialsEnd[])(void);
@@ -48,7 +52,7 @@ EWRAM_DATA u16 sPauseCounter = 0;
EWRAM_DATA u16 sMovingNpcId = 0;
EWRAM_DATA u16 sMovingNpcMapBank = 0;
EWRAM_DATA u16 sMovingNpcMapId = 0;
EWRAM_DATA u16 gUnknown_20370B6 = 0;
EWRAM_DATA u16 sFieldEffectScriptId = 0;
extern u8 gSelectedEventObject;
@@ -1960,3 +1964,267 @@ SCRCMD_DEF(pokemart)
ScriptContext1_Stop();
return TRUE;
}
SCRCMD_DEF(pokemartdecoration)
{
const void *ptr = (void *)ScriptReadWord(ctx);
CreateDecorationShop1Menu(ptr);
ScriptContext1_Stop();
return TRUE;
}
SCRCMD_DEF(pokemartdecoration2)
{
const void *ptr = (void *)ScriptReadWord(ctx);
CreateDecorationShop2Menu(ptr);
ScriptContext1_Stop();
return TRUE;
}
SCRCMD_DEF(playslotmachine)
{
u8 slotMachineIndex = VarGet(ScriptReadHalfword(ctx));
PlaySlotMachine(slotMachineIndex, c2_exit_to_overworld_1_continue_scripts_restart_music);
ScriptContext1_Stop();
return TRUE;
}
SCRCMD_DEF(setberrytree)
{
// u8 treeId = ScriptReadByte(ctx);
// u8 berry = ScriptReadByte(ctx);
// u8 growthStage = ScriptReadByte(ctx);
//
// if (berry == 0)
// PlantBerryTree(treeId, 0, growthStage, FALSE);
// else
// PlantBerryTree(treeId, berry, growthStage, FALSE);
return FALSE;
}
SCRCMD_DEF(getpricereduction)
{
// u16 value = VarGet(ScriptReadHalfword(ctx));
//
// gSpecialVar_Result = GetPriceReduction(value);
return FALSE;
}
SCRCMD_DEF(choosecontestmon)
{
// sub_81B9404();
ScriptContext1_Stop();
return TRUE;
}
SCRCMD_DEF(startcontest)
{
// sub_80F840C();
// ScriptContext1_Stop();
// return TRUE;
return FALSE;
}
SCRCMD_DEF(showcontestresults)
{
// sub_80F8484();
// ScriptContext1_Stop();
// return TRUE;
return FALSE;
}
SCRCMD_DEF(contestlinktransfer)
{
// sub_80F84C4(gSpecialVar_ContestCategory);
// ScriptContext1_Stop();
// return TRUE;
return FALSE;
}
SCRCMD_DEF(dofieldeffect)
{
u16 effectId = VarGet(ScriptReadHalfword(ctx));
sFieldEffectScriptId = effectId;
FieldEffectStart(sFieldEffectScriptId);
return FALSE;
}
SCRCMD_DEF(setfieldeffectarg)
{
u8 argNum = ScriptReadByte(ctx);
gFieldEffectArguments[argNum] = (s16)VarGet(ScriptReadHalfword(ctx));
return FALSE;
}
static bool8 WaitForFieldEffectFinish(void)
{
if (!FieldEffectActiveListContains(sFieldEffectScriptId))
return TRUE;
else
return FALSE;
}
SCRCMD_DEF(waitfieldeffect)
{
sFieldEffectScriptId = VarGet(ScriptReadHalfword(ctx));
SetupNativeScript(ctx, WaitForFieldEffectFinish);
return TRUE;
}
SCRCMD_DEF(setrespawn)
{
u16 healLocationId = VarGet(ScriptReadHalfword(ctx));
SetLastHealLocationWarp(healLocationId);
return FALSE;
}
SCRCMD_DEF(checkplayergender)
{
gSpecialVar_Result = gSaveBlock2Ptr->playerGender;
return FALSE;
}
SCRCMD_DEF(playmoncry)
{
u16 species = VarGet(ScriptReadHalfword(ctx));
u16 mode = VarGet(ScriptReadHalfword(ctx));
PlayCry7(species, mode);
return FALSE;
}
SCRCMD_DEF(waitmoncry)
{
SetupNativeScript(ctx, IsCryFinished);
return TRUE;
}
SCRCMD_DEF(setmetatile)
{
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
u16 tileId = VarGet(ScriptReadHalfword(ctx));
u16 v8 = VarGet(ScriptReadHalfword(ctx));
x += 7;
y += 7;
if (!v8)
MapGridSetMetatileIdAt(x, y, tileId);
else
MapGridSetMetatileIdAt(x, y, tileId | 0xC00);
return FALSE;
}
SCRCMD_DEF(opendoor)
{
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
x += 7;
y += 7;
PlaySE(GetDoorSoundEffect(x, y));
FieldAnimateDoorOpen(x, y);
return FALSE;
}
SCRCMD_DEF(closedoor)
{
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
x += 7;
y += 7;
FieldAnimateDoorClose(x, y);
return FALSE;
}
static bool8 IsDoorAnimationStopped(void)
{
if (!FieldIsDoorAnimationRunning())
return TRUE;
else
return FALSE;
}
SCRCMD_DEF(waitdooranim)
{
SetupNativeScript(ctx, IsDoorAnimationStopped);
return TRUE;
}
SCRCMD_DEF(setdooropen)
{
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
x += 7;
y += 7;
FieldSetDoorOpened(x, y);
return FALSE;
}
SCRCMD_DEF(setdoorclosed)
{
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
x += 7;
y += 7;
FieldSetDoorClosed(x, y);
return FALSE;
}
SCRCMD_DEF(addelevmenuitem)
{
// u8 v3 = ScriptReadByte(ctx);
// u16 v5 = VarGet(ScriptReadHalfword(ctx));
// u16 v7 = VarGet(ScriptReadHalfword(ctx));
// u16 v9 = VarGet(ScriptReadHalfword(ctx));
//ScriptAddElevatorMenuItem(v3, v5, v7, v9);
return FALSE;
}
SCRCMD_DEF(showelevmenu)
{
/*ScriptShowElevatorMenu();
ScriptContext1_Stop();
return TRUE;*/
return FALSE;
}
SCRCMD_DEF(checkcoins)
{
u16 *ptr = GetVarPointer(ScriptReadHalfword(ctx));
*ptr = GetCoins();
return FALSE;
}
SCRCMD_DEF(givecoins)
{
u16 coins = VarGet(ScriptReadHalfword(ctx));
if (GiveCoins(coins) == TRUE)
gSpecialVar_Result = 0;
else
gSpecialVar_Result = 1;
return FALSE;
}
SCRCMD_DEF(takecoins)
{
u16 coins = VarGet(ScriptReadHalfword(ctx));
if (TakeCoins(coins) == TRUE)
gSpecialVar_Result = 0;
else
gSpecialVar_Result = 1;
return FALSE;
}