Use more constants in scripts

This commit is contained in:
Remy Oukaour
2018-01-12 01:40:20 -05:00
parent b23085f526
commit d83aefb30a
120 changed files with 828 additions and 732 deletions

View File

@@ -146,7 +146,7 @@ AzaleaGymStatue:
iftrue .Beaten
jumpstd gymstatue1
.Beaten:
trainertotext BUGSY, BUGSY1, $1
trainertotext BUGSY, BUGSY1, MEM_BUFFER_1
jumpstd gymstatue2
BugsyText_INeverLose:

View File

@@ -125,7 +125,7 @@ Script_GivePlayerHisPrize: ; 0x9e47a
writebyte BATTLETOWERACTION_GIVEREWARD
special BattleTowerAction
if_equal POTION, Script_YourPackIsStuffedFull
itemtotext $0, $1
itemtotext USE_SCRIPT_VAR, MEM_BUFFER_1
giveitem ITEM_FROM_MEM, 5
writetext Text_PlayerGotFive
writebyte BATTLETOWERACTION_1D

View File

@@ -29,7 +29,7 @@ Script_BattleRoomLoop: ; 0x9f425
waitsfx
applymovement BATTLETOWERBATTLEROOM_YOUNGSTER, MovementData_BattleTowerBattleRoomOpponentWalksIn
opentext
battletowertext 1
battletowertext $1
buttonsound
closetext
special BattleTowerBattle ; calls predef startbattle

View File

@@ -70,7 +70,7 @@ BlackthornGymClairScript:
buttonsound
giveitem TM_DRAGONBREATH
iffalse .BagFull
itemtotext TM_DRAGONBREATH, $0
itemtotext TM_DRAGONBREATH, MEM_BUFFER_0
writetext BlackthornGymText_ReceivedTM24
playsound SFX_ITEM
waitsfx
@@ -146,7 +146,7 @@ BlackthornGymStatue:
iftrue .Beaten
jumpstd gymstatue1
.Beaten:
trainertotext CLAIR, CLAIR1, $1
trainertotext CLAIR, CLAIR1, MEM_BUFFER_1
jumpstd gymstatue2
ClairIntroText:

View File

@@ -27,8 +27,8 @@ DaisyScript:
writetext DaisyWhichMonText
waitbutton
special Special_DaisyMassage
if_equal 0, .Refused
if_equal 1, .CantGroomEgg
if_equal $0, .Refused
if_equal $1, .CantGroomEgg
setflag ENGINE_TEA_IN_BLUES_HOUSE
writetext DaisyAlrightText
waitbutton

View File

@@ -92,7 +92,7 @@ ReleaseTheBeasts:
setevent EVENT_BURNED_TOWER_MORTY
setevent EVENT_BURNED_TOWER_1F_EUSINE
appear BURNEDTOWERB1F_EUSINE
refreshscreen $0
refreshscreen
changeblock 6, 14, $1b
reloadmappart
closetext
@@ -106,7 +106,7 @@ BurnedTowerB1FEusine:
waitbutton
closetext
checkcode VAR_FACING
if_equal $1, .Movement
if_equal UP, .Movement
applymovement BURNEDTOWERB1F_EUSINE, BurnedTowerB1FEusineMovement1
jump UnknownScript_0x18622a

View File

@@ -96,7 +96,7 @@ CeladonCafeTrashcan:
giveitem LEFTOVERS
iffalse .PackFull
opentext
itemtotext LEFTOVERS, $0
itemtotext LEFTOVERS, MEM_BUFFER_0
writetext FoundLeftoversText
playsound SFX_ITEM
waitsfx
@@ -107,7 +107,7 @@ CeladonCafeTrashcan:
.PackFull:
opentext
itemtotext LEFTOVERS, $0
itemtotext LEFTOVERS, MEM_BUFFER_0
writetext FoundLeftoversText
buttonsound
writetext NoRoomForLeftoversText

View File

@@ -11,7 +11,7 @@ CeladonDeptStore6F_MapScriptHeader:
dbw MAPCALLBACK_TILES, .Callback
.Callback:
changeblock 12, 0, $3
changeblock 12, 0, $03
return
CeladonDeptStore6FSuperNerdScript:
@@ -28,37 +28,37 @@ CeladonDeptStore6FVendingMachine:
loadmenudata .MenuData
verticalmenu
closewindow
if_equal $1, .FreshWater
if_equal $2, .SodaPop
if_equal $3, .Lemonade
if_equal 1, .FreshWater
if_equal 2, .SodaPop
if_equal 3, .Lemonade
closetext
end
.FreshWater:
checkmoney $0, 200
if_equal $2, .NotEnoughMoney
checkmoney YOUR_MONEY, 200
if_equal HAVE_LESS, .NotEnoughMoney
giveitem FRESH_WATER
iffalse .NotEnoughSpace
takemoney $0, 200
itemtotext FRESH_WATER, $0
takemoney YOUR_MONEY, 200
itemtotext FRESH_WATER, MEM_BUFFER_0
jump .VendItem
.SodaPop:
checkmoney $0, 300
if_equal $2, .NotEnoughMoney
checkmoney YOUR_MONEY, 300
if_equal HAVE_LESS, .NotEnoughMoney
giveitem SODA_POP
iffalse .NotEnoughSpace
takemoney $0, 300
itemtotext SODA_POP, $0
takemoney YOUR_MONEY, 300
itemtotext SODA_POP, MEM_BUFFER_0
jump .VendItem
.Lemonade:
checkmoney $0, 350
if_equal $2, .NotEnoughMoney
checkmoney YOUR_MONEY, 350
if_equal HAVE_LESS, .NotEnoughMoney
giveitem LEMONADE
iffalse .NotEnoughSpace
takemoney $0, 350
itemtotext LEMONADE, $0
takemoney YOUR_MONEY, 350
itemtotext LEMONADE, MEM_BUFFER_0
jump .VendItem
.VendItem:

View File

@@ -59,8 +59,8 @@ CeladonGameCornerFisherScript:
checkitem COIN_CASE
iffalse .NoCoinCase
checkcoins MAX_COINS - 1
if_equal $0, .FullCoinCase
stringtotext .coinname, $1
if_equal HAVE_MORE, .FullCoinCase
stringtotext .coinname, MEM_BUFFER_1
scall .GiveCoins
givecoins 18
setevent EVENT_GOT_COINS_FROM_GAMBLER_AT_CELADON
@@ -111,23 +111,23 @@ CeladonGameCornerPoster2Script:
jumptext CeladonGameCornerPoster2Text
CeladonGameCornerLuckySlotMachineScript:
random $6
if_equal $0, CeladonGameCornerSlotMachineScript
refreshscreen $0
writebyte $0
random 6
if_equal 0, CeladonGameCornerSlotMachineScript
refreshscreen
writebyte FALSE
special Special_SlotMachine
closetext
end
CeladonGameCornerSlotMachineScript:
refreshscreen $0
writebyte $1
refreshscreen
writebyte TRUE
special Special_SlotMachine
closetext
end
CeladonGameCornerCardFlipScript:
refreshscreen $0
refreshscreen
special Special_CardFlip
closetext
end

View File

@@ -28,15 +28,15 @@ CeladonPrizeRoom_tmcounterloop:
loadmenudata CeladonPrizeRoom_TMMenuDataHeader
verticalmenu
closewindow
if_equal $1, .doubleteam
if_equal $2, .psychic
if_equal $3, .hyperbeam
if_equal 1, .doubleteam
if_equal 2, .psychic
if_equal 3, .hyperbeam
jump CeladonPrizeRoom_cancel
.doubleteam
checkcoins 1500
if_equal $2, CeladonPrizeRoom_notenoughcoins
itemtotext TM_DOUBLE_TEAM, $0
if_equal HAVE_LESS, CeladonPrizeRoom_notenoughcoins
itemtotext TM_DOUBLE_TEAM, MEM_BUFFER_0
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_cancel
giveitem TM_DOUBLE_TEAM
@@ -46,8 +46,8 @@ CeladonPrizeRoom_tmcounterloop:
.psychic
checkcoins 3500
if_equal $2, CeladonPrizeRoom_notenoughcoins
itemtotext TM_PSYCHIC_M, $0
if_equal HAVE_LESS, CeladonPrizeRoom_notenoughcoins
itemtotext TM_PSYCHIC_M, MEM_BUFFER_0
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_cancel
giveitem TM_PSYCHIC_M
@@ -57,8 +57,8 @@ CeladonPrizeRoom_tmcounterloop:
.hyperbeam
checkcoins 7500
if_equal $2, CeladonPrizeRoom_notenoughcoins
itemtotext TM_HYPER_BEAM, $0
if_equal HAVE_LESS, CeladonPrizeRoom_notenoughcoins
itemtotext TM_HYPER_BEAM, MEM_BUFFER_0
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_cancel
giveitem TM_HYPER_BEAM
@@ -132,17 +132,17 @@ GoldenrodGameCornerPokemonVendor:
loadmenudata .MenuDataHeader
verticalmenu
closewindow
if_equal $1, .pikachu
if_equal $2, .porygon
if_equal $3, .larvitar
if_equal 1, .pikachu
if_equal 2, .porygon
if_equal 3, .larvitar
jump CeladonPrizeRoom_cancel
.pikachu
checkcoins 2222
if_equal $2, CeladonPrizeRoom_notenoughcoins
if_equal HAVE_LESS, CeladonPrizeRoom_notenoughcoins
checkcode VAR_PARTYCOUNT
if_equal $6, CeladonPrizeRoom_notenoughroom
pokenamemem PIKACHU, $0
if_equal PARTY_LENGTH, CeladonPrizeRoom_notenoughroom
pokenamemem PIKACHU, MEM_BUFFER_0
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_cancel
waitsfx
@@ -157,10 +157,10 @@ GoldenrodGameCornerPokemonVendor:
.porygon
checkcoins 5555
if_equal $2, CeladonPrizeRoom_notenoughcoins
if_equal HAVE_LESS, CeladonPrizeRoom_notenoughcoins
checkcode VAR_PARTYCOUNT
if_equal $6, CeladonPrizeRoom_notenoughroom
pokenamemem PORYGON, $0
if_equal PARTY_LENGTH, CeladonPrizeRoom_notenoughroom
pokenamemem PORYGON, MEM_BUFFER_0
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_cancel
waitsfx
@@ -175,10 +175,10 @@ GoldenrodGameCornerPokemonVendor:
.larvitar
checkcoins 8888
if_equal $2, CeladonPrizeRoom_notenoughcoins
if_equal HAVE_LESS, CeladonPrizeRoom_notenoughcoins
checkcode VAR_PARTYCOUNT
if_equal $6, CeladonPrizeRoom_notenoughroom
pokenamemem LARVITAR, $0
if_equal PARTY_LENGTH, CeladonPrizeRoom_notenoughroom
pokenamemem LARVITAR, MEM_BUFFER_0
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_cancel
waitsfx

View File

@@ -109,7 +109,7 @@ CeladonGymStatue:
iftrue .Beaten
jumpstd gymstatue1
.Beaten:
trainertotext ERIKA, ERIKA1, $1
trainertotext ERIKA, ERIKA1, MEM_BUFFER_1
jumpstd gymstatue2
UnknownText_0x72b28:

View File

@@ -16,7 +16,7 @@ CooltrainerMScript_0x71670:
opentext
writetext UnknownText_0x716ce
checkcode VAR_DEXCAUGHT
if_greater_than 248, UnknownScript_0x7167e
if_greater_than NUM_POKEMON - 2 - 1, UnknownScript_0x7167e ; ignore Mew and Celebi
waitbutton
closetext
end

View File

@@ -45,7 +45,7 @@ CeladonEusine:
waitbutton
closetext
checkcode VAR_FACING
if_equal $1, .Location1
if_equal UP, .Location1
applymovement CELADONPOKECENTER1F_EUSINE, .Movement1
jump .Continue

View File

@@ -161,7 +161,7 @@ CeruleanGymStatue:
iftrue .Beaten
jumpstd gymstatue1
.Beaten:
trainertotext MISTY, MISTY1, $1
trainertotext MISTY, MISTY1, MEM_BUFFER_1
jumpstd gymstatue2
MovementData_0x1884e3:

View File

@@ -69,7 +69,7 @@ CherrygroveCityGuideGent:
opentext
writetext GuideGentGiftText
buttonsound
stringtotext .mapcardname, $1
stringtotext .mapcardname, MEM_BUFFER_1
scall .JumpstdReceiveItem
setflag ENGINE_MAP_CARD
writetext GotMapCardText

View File

@@ -138,7 +138,7 @@ CianwoodGymStatue:
iftrue .Beaten
jumpstd gymstatue1
.Beaten:
trainertotext CHUCK, CHUCK1, $1
trainertotext CHUCK, CHUCK1, MEM_BUFFER_1
jumpstd gymstatue2
CianwoodGymMovement_ChuckChucksBoulder:

View File

@@ -33,9 +33,9 @@ DragonShrine_MapScriptHeader:
loadmenudata MenuDataHeader_0x18d215
verticalmenu
closewindow
if_equal $1, .RightAnswer
if_equal $2, .WrongAnswer
if_equal $3, .RightAnswer
if_equal 1, .RightAnswer
if_equal 2, .WrongAnswer
if_equal 3, .RightAnswer
end
.Question2:
@@ -45,9 +45,9 @@ DragonShrine_MapScriptHeader:
loadmenudata MenuDataHeader_0x18d234
verticalmenu
closewindow
if_equal $1, .RightAnswer
if_equal $2, .RightAnswer
if_equal $3, .WrongAnswer
if_equal 1, .RightAnswer
if_equal 2, .RightAnswer
if_equal 3, .WrongAnswer
.Question3:
setevent EVENT_DRAGON_SHRINE_QUESTION_3
writetext UnknownText_0x18d3f3
@@ -55,9 +55,9 @@ DragonShrine_MapScriptHeader:
loadmenudata MenuDataHeader_0x18d258
verticalmenu
closewindow
if_equal $1, .WrongAnswer
if_equal $2, .RightAnswer
if_equal $3, .RightAnswer
if_equal 1, .WrongAnswer
if_equal 2, .RightAnswer
if_equal 3, .RightAnswer
.Question4:
setevent EVENT_DRAGON_SHRINE_QUESTION_4
writetext UnknownText_0x18d420
@@ -65,9 +65,9 @@ DragonShrine_MapScriptHeader:
loadmenudata MenuDataHeader_0x18d283
verticalmenu
closewindow
if_equal $1, .RightAnswer
if_equal $2, .WrongAnswer
if_equal $3, .RightAnswer
if_equal 1, .RightAnswer
if_equal 2, .WrongAnswer
if_equal 3, .RightAnswer
.Question5:
setevent EVENT_DRAGON_SHRINE_QUESTION_5
writetext UnknownText_0x18d44a
@@ -75,9 +75,9 @@ DragonShrine_MapScriptHeader:
loadmenudata MenuDataHeader_0x18d2a5
verticalmenu
closewindow
if_equal $1, .WrongAnswer
if_equal $2, .RightAnswer
if_equal $3, .WrongAnswer
if_equal 1, .WrongAnswer
if_equal 2, .RightAnswer
if_equal 3, .WrongAnswer
.RightAnswer:
checkevent EVENT_DRAGON_SHRINE_QUESTION_5
iftrue .PassedTheTest

View File

@@ -57,7 +57,7 @@ DragonsDenB1F_ClairScene:
buttonsound
giveitem TM_DRAGONBREATH
iffalse .BagFull
itemtotext TM_DRAGONBREATH, $0
itemtotext TM_DRAGONBREATH, MEM_BUFFER_0
writetext NotifyReceiveDragonbreath
playsound SFX_ITEM
waitsfx
@@ -135,7 +135,7 @@ PokeBallScript_0x18c95a:
iffalse .BagFull
disappear DRAGONSDENB1F_POKE_BALL1
opentext
itemtotext DRAGON_FANG, $0
itemtotext DRAGON_FANG, MEM_BUFFER_0
writetext Text_FoundDragonFang
playsound SFX_ITEM
waitsfx
@@ -145,7 +145,7 @@ PokeBallScript_0x18c95a:
.BagFull:
opentext
itemtotext DRAGON_FANG, $0
itemtotext DRAGON_FANG, MEM_BUFFER_0
writetext Text_FoundDragonFang
buttonsound
writetext Text_NoRoomForDragonFang

View File

@@ -69,11 +69,11 @@ AcademyBlackboard:
loadmenudata .BlackboardMenuData
_2dmenu
closewindow
if_equal $1, .Poison
if_equal $2, .Paralysis
if_equal $3, .Sleep
if_equal $4, .Burn
if_equal $5, .Freeze
if_equal 1, .Poison
if_equal 2, .Paralysis
if_equal 3, .Sleep
if_equal 4, .Burn
if_equal 5, .Freeze
closetext
end

View File

@@ -162,7 +162,7 @@ EcruteakGymStatue:
iftrue .Beaten
jumpstd gymstatue1
.Beaten:
trainertotext MORTY, MORTY1, $1
trainertotext MORTY, MORTY1, MEM_BUFFER_1
jumpstd gymstatue2
MovementData_0x99e5d:

Some files were not shown because too many files have changed in this diff Show More