diff --git a/constants/battle_tower_constants.asm b/constants/battle_tower_constants.asm index 9bf7bd7aa..9945a08ad 100644 --- a/constants/battle_tower_constants.asm +++ b/constants/battle_tower_constants.asm @@ -7,7 +7,7 @@ BATTLETOWER_NUM_UNIQUE_TRAINERS EQU 70 BATTLETOWER_TRAINERDATALENGTH EQU $24 BATTLE_TOWER_STRUCT_LENGTH EQUS "(NAME_LENGTH + BATTLETOWER_PARTY_LENGTH * NICKNAMED_MON_STRUCT_LENGTH + BATTLETOWER_TRAINERDATALENGTH)" -; BattleTowerAction writebyte arguments (see engine/events/battle_tower/battle_tower.asm) +; BattleTowerAction setval arguments (see engine/events/battle_tower/battle_tower.asm) const_def const BATTLETOWERACTION_CHECK_EXPLANATION_READ const BATTLETOWERACTION_SET_EXPLANATION_READ diff --git a/constants/script_constants.asm b/constants/script_constants.asm index 91a519b8d..99275efe3 100644 --- a/constants/script_constants.asm +++ b/constants/script_constants.asm @@ -2,12 +2,12 @@ PLAYER EQU 0 LAST_TALKED EQU -2 -; memory constants +; string buffer constants const_def - const MEM_BUFFER_0 ; use wStringBuffer3 - const MEM_BUFFER_1 ; use wStringBuffer4 - const MEM_BUFFER_2 ; use wStringBuffer5 -NUM_MEM_BUFFERS EQU const_value + const STRING_BUFFER_3 ; use wStringBuffer3 + const STRING_BUFFER_4 ; use wStringBuffer4 + const STRING_BUFFER_5 ; use wStringBuffer5 +NUM_STRING_BUFFERS EQU const_value ; checkmoney/takemoney accounts const_def @@ -34,7 +34,13 @@ NUM_MEM_BUFFERS EQU const_value const PHONE_CONTACTS_FULL ; 1 const PHONE_CONTACT_REFUSED ; 2 -; writecode/checkcode arguments +; trainertext arguments + const_def + const TRAINERTEXT_SEEN + const TRAINERTEXT_WIN + const TRAINERTEXT_LOSS + +; readvar/writevar/loadvar arguments ; _GetVarAction.VarActionTable indexes (see engine/overworld/variables.asm) const_def const VAR_STRINGBUFFER2 ; 00 @@ -223,7 +229,7 @@ NUM_FRUIT_TREES EQU const_value + -1 const SWARM_DUNSPARCE ; 0 const SWARM_YANMA ; 1 -; ActivateFishingSwarm writebyte arguments +; ActivateFishingSwarm setval arguments const_def const FISHSWARM_NONE ; 0 const FISHSWARM_QWILFISH ; 1 @@ -256,14 +262,14 @@ NUM_FRUIT_TREES EQU const_value + -1 const BUGCONTEST_BOXED_MON ; 1 const BUGCONTEST_NO_CATCH ; 2 -; HealMachineAnim writebyte arguments +; HealMachineAnim setval arguments ; HealMachineAnim.Pointers indexes (see engine/events/heal_machine_anim.asm) const_def const HEALMACHINE_POKECENTER ; 0 const HEALMACHINE_ELMS_LAB ; 1 const HEALMACHINE_HALL_OF_FAME ; 2 -; UnownPuzzle writebyte arguments +; UnownPuzzle setval arguments ; LoadUnownPuzzlePiecesGFX.LZPointers indexes (see engine/games/unown_puzzle.asm) const_def const UNOWNPUZZLE_KABUTO ; 0 @@ -272,7 +278,7 @@ NUM_FRUIT_TREES EQU const_value + -1 const UNOWNPUZZLE_HO_OH ; 3 NUM_UNOWN_PUZZLES EQU const_value -; DisplayUnownWords writebyte arguments +; DisplayUnownWords setval arguments ; UnownWalls and MenuHeaders_UnownWalls indexes (see data/events/unown_walls.asm) const_def const UNOWNWORDS_ESCAPE ; 0 @@ -280,7 +286,7 @@ NUM_UNOWN_PUZZLES EQU const_value const UNOWNWORDS_WATER ; 2 const UNOWNWORDS_HO_OH ; 3 -; MoveTutor writebyte arguments +; MoveTutor setval arguments const_def 1 const MOVETUTOR_FLAMETHROWER ; 1 const MOVETUTOR_THUNDERBOLT ; 2 diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 5f6a3b3f7..9d62d6461 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -1388,8 +1388,8 @@ First, edit `UsedSurfScript` in [engine/events/overworld.asm](/engine/events/ove callasm .empty_fn ; empty function - copybytetovar wBuffer2 - writevarcode VAR_MOVEMENT + readmem wBuffer2 + writevar VAR_MOVEMENT special ReplaceKrisSprite special PlayMapMusic diff --git a/docs/event_commands.md b/docs/event_commands.md index 49130c792..cd18a1e2d 100644 --- a/docs/event_commands.md +++ b/docs/event_commands.md @@ -7,340 +7,555 @@ Until this document is filled out, the [G/S Scripting Compendium](https://hax.ii ## `$00`: scall script + ## `$01`: farscall script + ## `$02`: ptcall script + ## `$03`: jump script + ## `$04`: farjump script + ## `$05`: ptjump script + ## `$06`: ifequal byte, script + ## `$07`: ifnotequal byte, script + ## `$08`: iffalse script + ## `$09`: iftrue script + ## `$0A`: ifgreater byte, script + ## `$0B`: ifless byte, script + ## `$0C`: jumpstd std_script + ## `$0D`: callstd std_script + ## `$0E`: callasm asm + ## `$0F`: special special_pointer + ## `$10`: ptcallasm asm + ## `$11`: checkmapscene map + ## `$12`: setmapscene map, scene_id + ## `$13`: `checkscene` + ## `$14`: setscene scene_id -## `$15`: writebyte value -## `$16`: addvar value +## `$15`: setval value + +[wScriptVar] = value + + +## `$16`: addval value + +[wScriptVar] += value + ## `$17`: random value + ## `$18`: `checkver` -## `$19`: copybytetovar address -## `$1A`: copyvartobyte address +## `$19`: readmem address -## `$1B`: loadvar address, value +[wScriptVar] = [address] -## `$1C`: checkcode variable -## `$1D`: writevarcode variable +## `$1A`: writemem address + +[address] = [wScriptVar] + + +## `$1B`: loadmem address, value + +[address] = value + + +## `$1C`: readvar variable + +[wScriptVar] = GetVarAction(variable) + + +## `$1D`: writevar variable + +GetVarAction(variable) = [wScriptVar] + + +## `$1E`: loadvar variable, value + +GetVarAction(variable) = value -## `$1E`: writecode variable, value ## `$1F`: giveitem item_id[, quantity=1] + ## `$20`: takeitem item_id[, quantity=1] + ## `$21`: checkitem item_id + ## `$22`: givemoney account, value + ## `$23`: takemoney account, value + ## `$24`: checkmoney account, value + ## `$25`: givecoins value + ## `$26`: takecoins value + ## `$27`: checkcoins value + ## `$28`: addcellnum contact_id + ## `$29`: delcellnum contact_id + ## `$2A`: checkcellnum contact_id + ## `$2B`: checktime time + ## `$2C`: checkpoke mon_id + ## `$2D`: givepoke mon_id, level[, item=0[, trainer=0, ot_name, nickname]] + ## `$2E`: giveegg mon_id, level + ## `$2F`: givepokemail pointer + ## `$30`: checkpokemail pointer + ## `$31`: checkevent event_flag + ## `$32`: clearevent event_flag + ## `$33`: setevent event_flag + ## `$34`: checkflag engine_flag + ## `$35`: clearflag engine_flag + ## `$36`: setflag engine_flag + ## `$37`: `wildon` + ## `$38`: `wildoff` + ## `$39`: xycompare pointer + ## `$3A`: warpmod warp_id, map + ## `$3B`: blackoutmod map + ## `$3C`: warp map, x, y -## `$3D`: readmoney account, memory -## `$3E`: readcoins memory +## `$3D`: getmoney string_buffer, account -## `$3F`: vartomem memory +GetStringBuffer(string_buffer) = PrintNum(GetMoneyAccount(account)) -## `$40`: pokenamemem mon_id, memory -## `$41`: itemtotext item_id, memory +## `$3E`: getcoins string_buffer -## `$42`: mapnametotext memory +GetStringBuffer(string_buffer) = PrintNum([wCoins]) -## `$43`: trainertotext trainer_id, trainer_group, memory -## `$44`: stringtotext text_pointer, memory +## `$3F`: getnum string_buffer + +GetStringBuffer(string_buffer) = PrintNum([wScriptVar]) + + +## `$40`: getmonname string_buffer, mon_id + +GetStringBuffer(string_buffer) = GetPokemonName(mon_id) + +If mon_id = `USE_SCRIPT_VAR`, then it uses `[wScriptVar]` instead. + + +## `$41`: getitemname string_buffer, item_id + +GetStringBuffer(string_buffer) = GetItemName(item_id) + +If item_id = `USE_SCRIPT_VAR`, then it uses `[wScriptVar]` instead. + + +## `$42`: getcurlandmarkname string_buffer + +GetStringBuffer(string_buffer) = GetLandmarkName(GetWorldMapLocation()) + + +## `$43`: gettrainername string_buffer, trainer_group, trainer_id + +GetStringBuffer(string_buffer) = GetTrainerName(trainer_group, trainer_id) + + +## `$44`: getstring string_buffer, text_pointer + +GetStringBuffer(string_buffer) = CopyName1([wScriptBank], text_pointer) + ## `$45`: `itemnotify` + ## `$46`: `pocketisfull` + ## `$47`: `opentext` + ## `$48`: refreshscreen [dummy=0] + ## `$49`: `closetext` + ## `$4A`: loadbytec2cf byte + ## `$4B`: farwritetext text_pointer + ## `$4C`: writetext text_pointer + ## `$4D`: repeattext byte1, byte2 + ## `$4E`: `yesorno` + ## `$4F`: loadmenu menu_header + ## `$50`: `closewindow` + ## `$51`: jumptextfaceplayer text_pointer + ## `$52`: farjumptext text_pointer + ## `$53`: jumptext text_pointer + ## `$54`: `waitbutton` + ## `$55`: `buttonsound` + ## `$56`: pokepic mon_id + ## `$57`: `closepokepic` + ## `$58`: `_2dmenu` + ## `$59`: `verticalmenu` + ## `$5A`: `loadpikachudata` + ## `$5B`: `randomwildmon` -## `$5C`: `loadmemtrainer` + +## `$5C`: `loadtemptrainer` + +`[wOtherTrainer] = [wTempTrainer]` + ## `$5D`: loadwildmon mon_id, level + ## `$5E`: loadtrainer trainer_group, trainer_id + ## `$5F`: `startbattle` + ## `$60`: `reloadmapafterbattle` + ## `$61`: catchtutorial byte -## `$62`: trainertext which_text + +## `$62`: trainertext text_id + ## `$63`: trainerflagaction action + ## `$64`: winlosstext win_text_pointer, loss_text_pointer + ## `$65`: `scripttalkafter` + ## `$66`: `endifjustbattled` + ## `$67`: `checkjustbattled` + ## `$68`: setlasttalked object_id + ## `$69`: applymovement object_id, data_pointer -## `$6A`: applymovement2 data_pointer + +## `$6A`: applymovementlasttalked data_pointer + ## `$6B`: `faceplayer` + ## `$6C`: faceobject object1, object2 + ## `$6D`: variablesprite variable_sprite_id, sprite_id + ## `$6E`: disappear object_id + ## `$6F`: appear object_id + ## `$70`: follow object2, object1 + ## `$71`: `stopfollow` + ## `$72`: moveobject object_id, x, y + ## `$73`: writeobjectxy object_id + ## `$74`: loademote emote_id + ## `$75`: showemote emote_id, object_id, length + ## `$76`: turnobject object_id, facing + ## `$77`: follownotexact object2, object1 + ## `$78`: earthquake param -## `$79`: changemap bank, blockdata_pointer + +## `$79`: changemapblocks blockdata_pointer + +ChangeMap(blockdata_pointer) + ## `$7A`: changeblock x, y, block + ## `$7B`: `reloadmap` + ## `$7C`: `reloadmappart` + ## `$7D`: writecmdqueue queue_pointer + ## `$7E`: delcmdqueue byte + ## `$7F`: playmusic music_id + ## `$80`: `encountermusic` + ## `$81`: musicfadeout music_id, length + ## `$82`: `playmapmusic` + ## `$83`: `dontrestartmapmusic` + ## `$84`: cry mon_id + ## `$85`: playsound sfx_id + ## `$86`: `waitsfx` + ## `$87`: `warpsound` + ## `$88`: `specialsound` + ## `$89`: autoinput input_pointer + ## `$8A`: newloadmap which_method + ## `$8B`: pause length + ## `$8C`: deactivatefacing length + ## `$8D`: priorityjump script + ## `$8E`: `warpcheck` + ## `$8F`: ptpriorityjump script + ## `$90`: `return` + ## `$91`: `end` + ## `$92`: reloadandreturn which_method + ## `$93`: `endall` + ## `$94`: pokemart dialog_id, mart_id + ## `$95`: elevator floor_list + ## `$96`: trade trade_id + ## `$97`: askforphonenumber contact_id + ## `$98`: phonecall call_id + ## `$99`: `hangup` + ## `$9A`: describedecoration byte + ## `$9B`: fruittree tree_id + ## `$9C`: specialphonecall call_id + ## `$9D`: `checkphonecall` + ## `$9E`: verbosegiveitem item_id[, quantity=1] -## `$9F`: verbosegiveitem2 item_id, variable + +## `$9F`: verbosegiveitemvar item_id, variable + ## `$A0`: swarm swarm_id, map + ## `$A1`: `halloffame` + ## `$A2`: `credits` + ## `$A3`: warpfacing facing, map, x, y -## `$A4`: battletowertext memory -## `$A5`: landmarktotext landmark_id, memory +## `$A4`: battletowertext bttext_id -## `$A6`: trainerclassname trainer_group, memory -## `$A7`: name type, id, memory +## `$A5`: getlandmarkname string_buffer, landmark_id + +GetStringBuffer(string_buffer) = GetLandmarkName(landmark_id) + + +## `$A6`: gettrainerclassname string_buffer, trainer_group + +GetStringBuffer(string_buffer) = GetName(TRAINER_NAME, trainer_group) + + +## `$A7`: getname string_buffer, type, id + +GetStringBuffer(string_buffer) = GetName(type, id) + ## `$A8`: wait duration + ## `$A9`: `checksave` diff --git a/docs/move_effect_commands.md b/docs/move_effect_commands.md index acb9eca8e..e8f239ef0 100644 --- a/docs/move_effect_commands.md +++ b/docs/move_effect_commands.md @@ -5,354 +5,530 @@ Defined in [macros/scripts/battle_commands.asm](/macros/scripts/battle_commands. ## `$01`: `checkturn` + ## `$02`: `checkobedience` + ## `$03`: `usedmovetext` + ## `$04`: `doturn` + ## `$05`: `critical` + ## `$06`: `damagestats` + ## `$07`: `stab` + ## `$08`: `damagevariation` + ## `$09`: `checkhit` + ## `$0A`: `lowersub` + ## `$0B`: `hittargetnosub` + ## `$0C`: `raisesub` + ## `$0D`: `failuretext` + ## `$0E`: `applydamage` + ## `$0F`: `criticaltext` + ## `$10`: `supereffectivetext` + ## `$11`: `checkfaint` + ## `$12`: `buildopponentrage` + ## `$13`: `poisontarget` + ## `$14`: `sleeptarget` + ## `$15`: `draintarget` + ## `$16`: `eatdream` + ## `$17`: `burntarget` + ## `$18`: `freezetarget` + ## `$19`: `paralyzetarget` + ## `$1A`: `selfdestruct` + ## `$1B`: `mirrormove` + ## `$1C`: `statup` + ## `$1D`: `statdown` + ## `$1E`: `payday` + ## `$1F`: `conversion` + ## `$20`: `resetstats` + ## `$21`: `storeenergy` + ## `$22`: `unleashenergy` + ## `$23`: `forceswitch` + ## `$24`: `endloop` + ## `$25`: `flinchtarget` + ## `$26`: `ohko` + ## `$27`: `recoil` + ## `$28`: `mist` + ## `$29`: `focusenergy` + ## `$2A`: `confuse` + ## `$2B`: `confusetarget` + ## `$2C`: `heal` + ## `$2D`: `transform` + ## `$2E`: `screen` + ## `$2F`: `poison` + ## `$30`: `paralyze` + ## `$31`: `substitute` + ## `$32`: `rechargenextturn` + ## `$33`: `mimic` + ## `$34`: `metronome` + ## `$35`: `leechseed` + ## `$36`: `splash` + ## `$37`: `disable` + ## `$38`: `cleartext` + ## `$39`: `charge` + ## `$3A`: `checkcharge` + ## `$3B`: `traptarget` + ## `$3C`: `effect0x3c` + ## `$3D`: `rampage` + ## `$3E`: `checkrampage` + ## `$3F`: `constantdamage` + ## `$40`: `counter` + ## `$41`: `encore` + ## `$42`: `painsplit` + ## `$43`: `snore` + ## `$44`: `conversion2` + ## `$45`: `lockon` + ## `$46`: `sketch` + ## `$47`: `defrostopponent` + ## `$48`: `sleeptalk` + ## `$49`: `destinybond` + ## `$4A`: `spite` + ## `$4B`: `falseswipe` + ## `$4C`: `healbell` + ## `$4D`: `kingsrock` + ## `$4E`: `triplekick` + ## `$4F`: `kickcounter` + ## `$50`: `thief` + ## `$51`: `arenatrap` + ## `$52`: `nightmare` + ## `$53`: `defrost` + ## `$54`: `curse` + ## `$55`: `protect` + ## `$56`: `spikes` + ## `$57`: `foresight` + ## `$58`: `perishsong` + ## `$59`: `startsandstorm` + ## `$5A`: `endure` + ## `$5B`: `checkcurl` + ## `$5C`: `rolloutpower` + ## `$5D`: `effect0x5d` + ## `$5E`: `furycutter` + ## `$5F`: `attract` + ## `$60`: `happinesspower` + ## `$61`: `present` + ## `$62`: `damagecalc` + ## `$63`: `frustrationpower` + ## `$64`: `safeguard` + ## `$65`: `checksafeguard` + ## `$66`: `getmagnitude` + ## `$67`: `batonpass` + ## `$68`: `pursuit` + ## `$69`: `clearhazards` + ## `$6A`: `healmorn` + ## `$6B`: `healday` + ## `$6C`: `healnite` + ## `$6D`: `hiddenpower` + ## `$6E`: `startrain` + ## `$6F`: `startsun` + ## `$70`: `attackup` + ## `$71`: `defenseup` + ## `$72`: `speedup` + ## `$73`: `specialattackup` + ## `$74`: `specialdefenseup` + ## `$75`: `accuracyup` + ## `$76`: `evasionup` + ## `$77`: `attackup2` + ## `$78`: `defenseup2` + ## `$79`: `speedup2` + ## `$7A`: `specialattackup2` + ## `$7B`: `specialdefenseup2` + ## `$7C`: `accuracyup2` + ## `$7D`: `evasionup2` + ## `$7E`: `attackdown` + ## `$7F`: `defensedown` + ## `$80`: `speeddown` + ## `$81`: `specialattackdown` + ## `$82`: `specialdefensedown` + ## `$83`: `accuracydown` + ## `$84`: `evasiondown` + ## `$85`: `attackdown2` + ## `$86`: `defensedown2` + ## `$87`: `speeddown2` + ## `$88`: `specialattackdown2` + ## `$89`: `specialdefensedown2` + ## `$8A`: `accuracydown2` + ## `$8B`: `evasiondown2` + ## `$8C`: `statupmessage` + ## `$8D`: `statdownmessage` + ## `$8E`: `statupfailtext` + ## `$8F`: `statdownfailtext` + ## `$90`: `effectchance` + ## `$91`: `statdownanim` + ## `$92`: `statupanim` + ## `$93`: `switchturn` + ## `$94`: `fakeout` + ## `$95`: `bellydrum` + ## `$96`: `psychup` + ## `$97`: `rage` + ## `$98`: `doubleflyingdamage` + ## `$99`: `doubleundergrounddamage` + ## `$9A`: `mirrorcoat` + ## `$9B`: `checkfuturesight` + ## `$9C`: `futuresight` + ## `$9D`: `doubleminimizedamage` + ## `$9E`: `skipsuncharge` + ## `$9F`: `thunderaccuracy` + ## `$A0`: `teleport` + ## `$A1`: `beatup` + ## `$A2`: `ragedamage` + ## `$A3`: `resettypematchup` + ## `$A4`: `allstatsup` + ## `$A5`: `bidefailtext` + ## `$A6`: `raisesubnoanim` + ## `$A7`: `lowersubnoanim` + ## `$A8`: `beatupfailtext` + ## `$A9`: `clearmissdamage` + ## `$AA`: `movedelay` + ## `$AB`: `hittarget` + ## `$AC`: `tristatuschance` + ## `$AD`: `supereffectivelooptext` + ## `$AE`: `startloop` + ## `$AF`: `curl` + ## `$FE`: `endturn` + ## `$FF`: `endmove` diff --git a/docs/movement_commands.md b/docs/movement_commands.md index 794dd8a98..8dd278136 100644 --- a/docs/movement_commands.md +++ b/docs/movement_commands.md @@ -5,80 +5,119 @@ Defined in [macros/scripts/movement.asm](/macros/scripts/movement.asm) and [engi ## `$00`−`$03`: turn_head direction + ## `$04`−`$07`: turn_step direction + ## `$08`−`$0B`: slow_step direction + ## `$0C`−`$0F`: step direction + ## `$10`−`$13`: big_step direction + ## `$14`−`$17`: slow_slide_step direction + ## `$18`−`$1B`: slide_step direction + ## `$1C`−`$1F`: fast_slide_step direction + ## `$20`−`$23`: turn_away direction + ## `$24`−`$27`: turn_in direction + ## `$28`−`$2B`: turn_waterfall direction + ## `$2C`−`$2F`: slow_jump_step direction + ## `$30`−`$33`: jump_step direction + ## `$34`−`$37`: fast_jump_step direction + ## `$38`: `remove_sliding` + ## `$39`: `set_sliding` + ## `$3A`: `remove_fixed_facing` + ## `$3B`: `fix_facing` + ## `$3C`: `show_object` + ## `$3D`: `hide_object` + ## `$3E`−`$46`: step_sleep length + ## `$47`: `step_end` + ## `$48`: step_48 param + ## `$49`: `remove_object` + ## `$4A`: `step_loop` + ## `$4B`: `step_4b` + ## `$4C`: `teleport_from` + ## `$4D`: `teleport_to` + ## `$4E`: `skyfall` + ## `$4F`: step_dig length + ## `$50`: `step_bump` + ## `$51`: `fish_got_bite` + ## `$52`: `fish_cast_rod` + ## `$53`: `hide_emote` + ## `$54`: `show_emote` + ## `$55`: step_shake displacement + ## `$56`: `tree_shake` + ## `$57`: rock_smash length + ## `$58`: return_dig length + ## `$59`: `skyfall_top` diff --git a/engine/events/bug_contest/contest.asm b/engine/events/bug_contest/contest.asm index 7a5d0885a..cf8c284ae 100644 --- a/engine/events/bug_contest/contest.asm +++ b/engine/events/bug_contest/contest.asm @@ -7,11 +7,11 @@ GiveParkBalls: ret BugCatchingContestBattleScript:: - writecode VAR_BATTLETYPE, BATTLETYPE_CONTEST + loadvar VAR_BATTLETYPE, BATTLETYPE_CONTEST randomwildmon startbattle reloadmapafterbattle - copybytetovar wParkBallsRemaining + readmem wParkBallsRemaining iffalse BugCatchingContestOutOfBallsScript end diff --git a/engine/events/forced_movement.asm b/engine/events/forced_movement.asm index 69f27bfe2..fcd2793f2 100644 --- a/engine/events/forced_movement.asm +++ b/engine/events/forced_movement.asm @@ -1,5 +1,5 @@ Script_ForcedMovement:: - checkcode VAR_FACING + readvar VAR_FACING ifequal DOWN, .down ifequal UP, .up ifequal LEFT, .left diff --git a/engine/events/fruit_trees.asm b/engine/events/fruit_trees.asm index 92e66c07e..af9c594bd 100644 --- a/engine/events/fruit_trees.asm +++ b/engine/events/fruit_trees.asm @@ -1,8 +1,8 @@ FruitTreeScript:: callasm GetCurTreeFruit opentext - copybytetovar wCurFruit - itemtotext USE_SCRIPT_VAR, MEM_BUFFER_0 + readmem wCurFruit + getitemname STRING_BUFFER_3, USE_SCRIPT_VAR writetext FruitBearingTreeText buttonsound callasm TryResetFruitTrees @@ -14,7 +14,7 @@ FruitTreeScript:: .fruit writetext HeyItsFruitText - copybytetovar wCurFruit + readmem wCurFruit giveitem ITEM_FROM_MEM iffalse .packisfull buttonsound diff --git a/engine/events/misc_scripts_2.asm b/engine/events/misc_scripts_2.asm index 61d9d11f1..514bb2790 100644 --- a/engine/events/misc_scripts_2.asm +++ b/engine/events/misc_scripts_2.asm @@ -12,8 +12,8 @@ RepelWoreOffScript:: HiddenItemScript:: opentext - copybytetovar wEngineBuffer3 - itemtotext USE_SCRIPT_VAR, MEM_BUFFER_0 + readmem wEngineBuffer3 + getitemname STRING_BUFFER_3, USE_SCRIPT_VAR writetext .found_text giveitem ITEM_FROM_MEM iffalse .bag_full diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index 7dc43c15a..f7d1f972e 100644 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -414,8 +414,8 @@ UsedSurfScript: callasm .empty_fn ; empty function - copybytetovar wBuffer2 - writevarcode VAR_MOVEMENT + readmem wBuffer2 + writevar VAR_MOVEMENT special ReplaceKrisSprite special PlayMapMusic @@ -624,7 +624,7 @@ FlyFunction: farscall Script_AbortBugContest special WarpToSpawnPoint callasm DelayLoadingNewSprites - writecode VAR_MOVEMENT, PLAYER_NORMAL + loadvar VAR_MOVEMENT, PLAYER_NORMAL newloadmap MAPSETUP_FLY callasm FlyToAnim special WaitSFX @@ -871,7 +871,7 @@ dig_incave applymovement PLAYER, .DigOut farscall Script_AbortBugContest special WarpToSpawnPoint - writecode VAR_MOVEMENT, PLAYER_NORMAL + loadvar VAR_MOVEMENT, PLAYER_NORMAL newloadmap MAPSETUP_DOOR playsound SFX_WARP_FROM applymovement PLAYER, .DigReturn @@ -958,7 +958,7 @@ TeleportFunction: applymovement PLAYER, .TeleportFrom farscall Script_AbortBugContest special WarpToSpawnPoint - writecode VAR_MOVEMENT, PLAYER_NORMAL + loadvar VAR_MOVEMENT, PLAYER_NORMAL newloadmap MAPSETUP_TELEPORT playsound SFX_WARP_FROM applymovement PLAYER, .TeleportTo @@ -1025,7 +1025,7 @@ Script_StrengthFromMenu: Script_UsedStrength: callasm SetStrengthFlag writetext .UsedStrength - copybytetovar wBuffer6 + readmem wBuffer6 cry 0 pause 3 writetext .StrengthAllowedItToMoveBoulders @@ -1390,11 +1390,11 @@ RockSmashScript: special WaitSFX playsound SFX_STRENGTH earthquake 84 - applymovement2 MovementData_0xcf55 + applymovementlasttalked MovementData_0xcf55 disappear -2 callasm RockMonEncounter - copybytetovar wTempWildMonSpecies + readmem wTempWildMonSpecies iffalse .done randomwildmon startbattle @@ -1609,7 +1609,7 @@ Fishing_CheckFacingUp: Script_FishCastRod: reloadmappart - loadvar hBGMapMode, $0 + loadmem hBGMapMode, $0 special UpdateTimePals loademote EMOTE_ROD callasm LoadFishingGFX @@ -1735,7 +1735,7 @@ BikeFunction: Script_GetOnBike: reloadmappart special UpdateTimePals - writecode VAR_MOVEMENT, PLAYER_BIKE + loadvar VAR_MOVEMENT, PLAYER_BIKE writetext GotOnTheBikeText waitbutton closetext @@ -1743,7 +1743,7 @@ Script_GetOnBike: end Script_GetOnBike_Register: - writecode VAR_MOVEMENT, PLAYER_BIKE + loadvar VAR_MOVEMENT, PLAYER_BIKE closetext special ReplaceKrisSprite end @@ -1755,7 +1755,7 @@ Script_GetOnBike_Register: Script_GetOffBike: reloadmappart special UpdateTimePals - writecode VAR_MOVEMENT, PLAYER_NORMAL + loadvar VAR_MOVEMENT, PLAYER_NORMAL writetext GotOffTheBikeText waitbutton @@ -1766,7 +1766,7 @@ FinishGettingOffBike: end Script_GetOffBike_Register: - writecode VAR_MOVEMENT, PLAYER_NORMAL + loadvar VAR_MOVEMENT, PLAYER_NORMAL jump FinishGettingOffBike Script_CantGetOffBike: diff --git a/engine/events/std_scripts.asm b/engine/events/std_scripts.asm index 28272405c..f6860d654 100644 --- a/engine/events/std_scripts.asm +++ b/engine/events/std_scripts.asm @@ -113,7 +113,7 @@ PokecenterNurseScript: pause 10 special HealParty playmusic MUSIC_NONE - writebyte HEALMACHINE_POKECENTER + setval HEALMACHINE_POKECENTER special HealMachineAnim pause 30 special RestartMapMusic @@ -203,7 +203,7 @@ HomepageScript: Radio1Script: opentext - writebyte MAPRADIO_POKEMON_CHANNEL + setval MAPRADIO_POKEMON_CHANNEL special MapRadio closetext end @@ -211,7 +211,7 @@ Radio1Script: Radio2Script: ; Lucky Channel opentext - writebyte MAPRADIO_LUCKY_CHANNEL + setval MAPRADIO_LUCKY_CHANNEL special MapRadio closetext end @@ -244,32 +244,32 @@ MartSignScript: farjumptext MartSignText DayToTextScript: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal MONDAY, .Monday ifequal TUESDAY, .Tuesday ifequal WEDNESDAY, .Wednesday ifequal THURSDAY, .Thursday ifequal FRIDAY, .Friday ifequal SATURDAY, .Saturday - stringtotext .SundayText, MEM_BUFFER_0 + getstring STRING_BUFFER_3, .SundayText end .Monday: - stringtotext .MondayText, MEM_BUFFER_0 + getstring STRING_BUFFER_3, .MondayText end .Tuesday: - stringtotext .TuesdayText, MEM_BUFFER_0 + getstring STRING_BUFFER_3, .TuesdayText end .Wednesday: - stringtotext .WednesdayText, MEM_BUFFER_0 + getstring STRING_BUFFER_3, .WednesdayText end .Thursday: - stringtotext .ThursdayText, MEM_BUFFER_0 + getstring STRING_BUFFER_3, .ThursdayText end .Friday: - stringtotext .FridayText, MEM_BUFFER_0 + getstring STRING_BUFFER_3, .FridayText end .Saturday: - stringtotext .SaturdayText, MEM_BUFFER_0 + getstring STRING_BUFFER_3, .SaturdayText end .SundayText: db "SUNDAY@" @@ -321,7 +321,7 @@ BugContestResultsScript: farwritetext ContestResults_ReadyToJudgeText waitbutton special BugContestJudging - vartomem MEM_BUFFER_0 + getnum STRING_BUFFER_3 ifequal 1, BugContestResults_FirstPlace ifequal 2, BugContestResults_SecondPlace ifequal 3, BugContestResults_ThirdPlace @@ -383,7 +383,7 @@ BugContestResults_CleanUp: BugContestResults_FirstPlace: setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 - itemtotext SUN_STONE, MEM_BUFFER_1 + getitemname STRING_BUFFER_4, SUN_STONE farwritetext ContestResults_PlayerWonAPrizeText waitbutton verbosegiveitem SUN_STONE @@ -391,7 +391,7 @@ BugContestResults_FirstPlace: jump BugContestResults_ReturnAfterWinnersPrize BugContestResults_SecondPlace: - itemtotext EVERSTONE, MEM_BUFFER_1 + getitemname STRING_BUFFER_4, EVERSTONE farwritetext ContestResults_PlayerWonAPrizeText waitbutton verbosegiveitem EVERSTONE @@ -399,7 +399,7 @@ BugContestResults_SecondPlace: jump BugContestResults_ReturnAfterWinnersPrize BugContestResults_ThirdPlace: - itemtotext GOLD_BERRY, MEM_BUFFER_1 + getitemname STRING_BUFFER_4, GOLD_BERRY farwritetext ContestResults_PlayerWonAPrizeText waitbutton verbosegiveitem GOLD_BERRY @@ -614,7 +614,7 @@ InitializeEventsScript: AskNumber1MScript: special RandomPhoneMon - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -699,7 +699,7 @@ AskNumber1MScript: AskNumber2MScript: special RandomPhoneMon - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -790,7 +790,7 @@ RegisteredNumberMScript: end NumberAcceptedMScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -914,7 +914,7 @@ NumberAcceptedMScript: end NumberDeclinedMScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -1038,7 +1038,7 @@ NumberDeclinedMScript: end PhoneFullMScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -1162,7 +1162,7 @@ PhoneFullMScript: end RematchMScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -1268,7 +1268,7 @@ RematchMScript: end GiftMScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_BIRDKEEPER_JOSE, .Jose ifequal PHONE_BUG_CATCHER_WADE, .Wade ifequal PHONE_SCHOOLBOY_ALAN, .Alan @@ -1307,7 +1307,7 @@ GiftMScript: end PackFullMScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_BIRDKEEPER_JOSE, .Jose ifequal PHONE_YOUNGSTER_JOEY, .Joey @@ -1378,7 +1378,7 @@ PackFullMScript: RematchGiftMScript: opentext - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_YOUNGSTER_JOEY, .Joey ifequal PHONE_BIRDKEEPER_VANCE, .Vance @@ -1402,7 +1402,7 @@ RematchGiftMScript: end AskNumber1FScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -1438,7 +1438,7 @@ AskNumber1FScript: end AskNumber2FScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -1481,7 +1481,7 @@ RegisteredNumberFScript: end NumberAcceptedFScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -1533,7 +1533,7 @@ NumberAcceptedFScript: end NumberDeclinedFScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -1585,7 +1585,7 @@ NumberDeclinedFScript: end PhoneFullFScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -1637,7 +1637,7 @@ PhoneFullFScript: end RematchFScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena ifequal PHONE_PICNICKER_LIZ, .Liz @@ -1683,7 +1683,7 @@ RematchFScript: end GiftFScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_PICNICKER_GINA, .Gina ifequal PHONE_LASS_DANA, .Dana @@ -1707,7 +1707,7 @@ GiftFScript: end PackFullFScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_PICNICKER_GINA, .Gina ifequal PHONE_LASS_DANA, .Dana @@ -1741,7 +1741,7 @@ PackFullFScript: end RematchGiftFScript: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_PICNICKER_ERIN, .Erin .Erin: @@ -1751,7 +1751,7 @@ RematchGiftFScript: end GymStatue1Script: - mapnametotext MEM_BUFFER_0 + getcurlandmarkname STRING_BUFFER_3 opentext farwritetext GymStatue_CityGymText waitbutton @@ -1759,7 +1759,7 @@ GymStatue1Script: end GymStatue2Script: - mapnametotext MEM_BUFFER_0 + getcurlandmarkname STRING_BUFFER_3 opentext farwritetext GymStatue_CityGymText buttonsound diff --git a/engine/events/trainer_scripts.asm b/engine/events/trainer_scripts.asm index 6f0bb2d29..5097f51b0 100644 --- a/engine/events/trainer_scripts.asm +++ b/engine/events/trainer_scripts.asm @@ -2,30 +2,30 @@ TalkToTrainerScript:: faceplayer trainerflagaction CHECK_FLAG iftrue AlreadyBeatenTrainerScript - loadmemtrainer + loadtemptrainer encountermusic jump StartBattleWithMapTrainerScript SeenByTrainerScript:: - loadmemtrainer + loadtemptrainer encountermusic showemote EMOTE_SHOCK, LAST_TALKED, 30 callasm TrainerWalkToPlayer - applymovement2 wMovementBuffer + applymovementlasttalked wMovementBuffer writeobjectxy LAST_TALKED faceobject PLAYER, LAST_TALKED jump StartBattleWithMapTrainerScript StartBattleWithMapTrainerScript: opentext - trainertext $0 + trainertext TRAINERTEXT_SEEN waitbutton closetext - loadmemtrainer + loadtemptrainer startbattle reloadmapafterbattle trainerflagaction SET_FLAG - loadvar wRunningTrainerBattleScript, -1 + loadmem wRunningTrainerBattleScript, -1 AlreadyBeatenTrainerScript: scripttalkafter diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index fe2c51560..6cbfab329 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -849,7 +849,7 @@ SelectMenuScript: StartMenuCallback: SelectMenuCallback: - copybytetovar hMenuReturn + readmem hMenuReturn ifequal HMENURETURN_SCRIPT, .Script ifequal HMENURETURN_ASM, .Asm end diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index e998da7c3..1919a0ff1 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -84,16 +84,16 @@ ScriptCommandTable: dw Script_setmapscene ; 12 dw Script_checkscene ; 13 dw Script_setscene ; 14 - dw Script_writebyte ; 15 - dw Script_addvar ; 16 + dw Script_setval ; 15 + dw Script_addval ; 16 dw Script_random ; 17 dw Script_checkver ; 18 - dw Script_copybytetovar ; 19 - dw Script_copyvartobyte ; 1a - dw Script_loadvar ; 1b - dw Script_checkcode ; 1c - dw Script_writevarcode ; 1d - dw Script_writecode ; 1e + dw Script_readmem ; 19 + dw Script_writemem ; 1a + dw Script_loadmem ; 1b + dw Script_readvar ; 1c + dw Script_writevar ; 1d + dw Script_loadvar ; 1e dw Script_giveitem ; 1f dw Script_takeitem ; 20 dw Script_checkitem ; 21 @@ -124,14 +124,14 @@ ScriptCommandTable: dw Script_warpmod ; 3a dw Script_blackoutmod ; 3b dw Script_warp ; 3c - dw Script_readmoney ; 3d - dw Script_readcoins ; 3e - dw Script_vartomem ; 3f - dw Script_pokenamemem ; 40 - dw Script_itemtotext ; 41 - dw Script_mapnametotext ; 42 - dw Script_trainertotext ; 43 - dw Script_stringtotext ; 44 + dw Script_getmoney ; 3d + dw Script_getcoins ; 3e + dw Script_getnum ; 3f + dw Script_getmonname ; 40 + dw Script_getitemname ; 41 + dw Script_getcurlandmarkname ; 42 + dw Script_gettrainername ; 43 + dw Script_getstring ; 44 dw Script_itemnotify ; 45 dw Script_pocketisfull ; 46 dw Script_opentext ; 47 @@ -157,7 +157,7 @@ endc dw Script_verticalmenu ; 59 dw Script_loadpikachudata ; 5a dw Script_randomwildmon ; 5b - dw Script_loadmemtrainer ; 5c + dw Script_loadtemptrainer ; 5c dw Script_loadwildmon ; 5d dw Script_loadtrainer ; 5e dw Script_startbattle ; 5f @@ -171,7 +171,7 @@ endc dw Script_checkjustbattled ; 67 dw Script_setlasttalked ; 68 dw Script_applymovement ; 69 - dw Script_applymovement2 ; 6a + dw Script_applymovementlasttalked ; 6a dw Script_faceplayer ; 6b dw Script_faceobject ; 6c dw Script_variablesprite ; 6d @@ -186,7 +186,7 @@ endc dw Script_turnobject ; 76 dw Script_follownotexact ; 77 dw Script_earthquake ; 78 - dw Script_changemap ; 79 + dw Script_changemapblocks ; 79 dw Script_changeblock ; 7a dw Script_reloadmap ; 7b dw Script_reloadmappart ; 7c @@ -224,15 +224,15 @@ endc dw Script_specialphonecall ; 9c dw Script_checkphonecall ; 9d dw Script_verbosegiveitem ; 9e - dw Script_verbosegiveitem2 ; 9f + dw Script_verbosegiveitemvar ; 9f dw Script_swarm ; a0 dw Script_halloffame ; a1 dw Script_credits ; a2 dw Script_warpfacing ; a3 dw Script_battletowertext ; a4 - dw Script_landmarktotext ; a5 - dw Script_trainerclassname ; a6 - dw Script_name ; a7 + dw Script_getlandmarkname ; a5 + dw Script_gettrainerclassname ; a6 + dw Script_getname ; a7 dw Script_wait ; a8 dw Script_checksave ; a9 @@ -496,7 +496,7 @@ Script__2dmenu: Script_battletowertext: ; script command 0xa4 -; parameters: pointer, memory +; parameters: bttext_id call SetUpTextBox call GetScriptByte @@ -511,7 +511,7 @@ Script_verbosegiveitem: call Script_giveitem call CurItemName ld de, wStringBuffer1 - ld a, MEM_BUFFER_1 + ld a, STRING_BUFFER_4 call CopyConvertedText ld b, BANK(GiveItemScript) ld de, GiveItemScript @@ -539,7 +539,7 @@ ReceivedItemText: text_far UnknownText_0x1c4719 text_end -Script_verbosegiveitem2: +Script_verbosegiveitemvar: ; script command 0x9f ; parameters: item, var @@ -562,7 +562,7 @@ Script_verbosegiveitem2: ld [wScriptVar], a call CurItemName ld de, wStringBuffer1 - ld a, MEM_BUFFER_1 + ld a, STRING_BUFFER_4 call CopyConvertedText ld b, BANK(GiveItemScript) ld de, GiveItemScript @@ -754,12 +754,12 @@ Script_swarm: Script_trainertext: ; script command 0x62 -; parameters: which_text +; parameters: text_id call GetScriptByte ld c, a ld b, 0 - ld hl, wWalkingX + ld hl, wSeenTextPointer add hl, bc add hl, bc ld a, [hli] @@ -972,7 +972,7 @@ SetFlagsForMovement_2: farcall _SetFlagsForMovement_2 ret -Script_applymovement2: +Script_applymovementlasttalked: ; script command 0x6a ; parameters: data ; apply movement to last talked @@ -1250,9 +1250,9 @@ Script_showemote: ShowEmoteScript: loademote EMOTE_FROM_MEM - applymovement2 .Show + applymovementlasttalked .Show pause 0 - applymovement2 .Hide + applymovementlasttalked .Hide end .Show: @@ -1307,7 +1307,7 @@ Script_randomwildmon: ld [wBattleScriptFlags], a ret -Script_loadmemtrainer: +Script_loadtemptrainer: ; script command 0x5c ld a, (1 << 7) | 1 @@ -1702,7 +1702,7 @@ DoScene: .no_scene ret -Script_copybytetovar: +Script_readmem: ; script command 0x19 ; parameters: address @@ -1714,7 +1714,7 @@ Script_copybytetovar: ld [wScriptVar], a ret -Script_copyvartobyte: +Script_writemem: ; script command 0x1a ; parameters: address @@ -1726,7 +1726,7 @@ Script_copyvartobyte: ld [hl], a ret -Script_loadvar: +Script_loadmem: ; script command 0x1b ; parameters: address, value @@ -1738,7 +1738,7 @@ Script_loadvar: ld [hl], a ret -Script_writebyte: +Script_setval: ; script command 0x15 ; parameters: value @@ -1746,7 +1746,7 @@ Script_writebyte: ld [wScriptVar], a ret -Script_addvar: +Script_addval: ; script command 0x16 ; parameters: value @@ -1809,7 +1809,7 @@ Script_random: add c ret -Script_checkcode: +Script_readvar: ; script command 0x1c ; parameters: variable_id @@ -1819,7 +1819,7 @@ Script_checkcode: ld [wScriptVar], a ret -Script_writevarcode: +Script_writevar: ; script command 0x1d ; parameters: variable_id @@ -1829,7 +1829,7 @@ Script_writevarcode: ld [de], a ret -Script_writecode: +Script_loadvar: ; script command 0x1e ; parameters: variable_id, value @@ -1854,9 +1854,9 @@ Script_checkver: .gs_version: db GS_VERSION -Script_pokenamemem: +Script_getmonname: ; script command 0x40 -; parameters: pokemon (0 aka USE_SCRIPT_VAR to use wScriptVar), memory +; parameters: string_buffer, mon_id (0 aka USE_SCRIPT_VAR to use wScriptVar) call GetScriptByte and a @@ -1867,9 +1867,9 @@ Script_pokenamemem: call GetPokemonName ld de, wStringBuffer1 -ConvertMemToText: +GetStringBuffer: call GetScriptByte - cp NUM_MEM_BUFFERS + cp NUM_STRING_BUFFERS jr c, .ok xor a .ok @@ -1881,9 +1881,9 @@ CopyConvertedText: call CopyName2 ret -Script_itemtotext: +Script_getitemname: ; script command 0x41 -; parameters: item (0 aka USE_SCRIPT_VAR to use wScriptVar), memory +; parameters: string_buffer, item_id (0 aka USE_SCRIPT_VAR to use wScriptVar) call GetScriptByte and a ; USE_SCRIPT_VAR @@ -1893,11 +1893,11 @@ Script_itemtotext: ld [wNamedObjectIndexBuffer], a call GetItemName ld de, wStringBuffer1 - jr ConvertMemToText + jr GetStringBuffer -Script_mapnametotext: +Script_getcurlandmarkname: ; script command 0x42 -; parameters: memory +; parameters: string_buffer ld a, [wMapGroup] ld b, a @@ -1909,29 +1909,29 @@ ConvertLandmarkToText: ld e, a farcall GetLandmarkName ld de, wStringBuffer1 - jp ConvertMemToText + jp GetStringBuffer -Script_landmarktotext: +Script_getlandmarkname: ; script command 0xa5 -; parameters: id, memory +; parameters: string_buffer, landmark_id call GetScriptByte jr ConvertLandmarkToText -Script_trainertotext: +Script_gettrainername: ; script command 0x43 -; parameters: trainer_id, trainer_group, memory +; parameters: string_buffer, trainer_group, trainer_id call GetScriptByte ld c, a call GetScriptByte ld b, a farcall GetTrainerName - jr ConvertMemToText + jr GetStringBuffer -Script_name: +Script_getname: ; script command 0xa7 -; parameters: type, id, memory +; parameters: string_buffer, type, id call GetScriptByte ld [wNamedObjectTypeBuffer], a @@ -1941,19 +1941,19 @@ ContinueToGetName: ld [wCurSpecies], a call GetName ld de, wStringBuffer1 - jp ConvertMemToText + jp GetStringBuffer -Script_trainerclassname: +Script_gettrainerclassname: ; script command 0xa6 -; parameters: id, memory +; parameters: string_buffer, trainer_group ld a, TRAINER_NAME ld [wNamedObjectTypeBuffer], a jr ContinueToGetName -Script_readmoney: +Script_getmoney: ; script command 0x3d -; parameters: account, memory +; parameters: string_buffer, account call ResetStringBuffer1 call GetMoneyAccount @@ -1961,11 +1961,11 @@ Script_readmoney: lb bc, PRINTNUM_RIGHTALIGN | 3, 6 call PrintNum ld de, wStringBuffer1 - jp ConvertMemToText + jp GetStringBuffer -Script_readcoins: +Script_getcoins: ; script command 0x3e -; parameters: memory +; parameters: string_buffer call ResetStringBuffer1 ld hl, wStringBuffer1 @@ -1973,11 +1973,11 @@ Script_readcoins: lb bc, PRINTNUM_RIGHTALIGN | 2, 6 call PrintNum ld de, wStringBuffer1 - jp ConvertMemToText + jp GetStringBuffer -Script_vartomem: +Script_getnum: ; script command 0x3f -; parameters: memory +; parameters: string_buffer call ResetStringBuffer1 ld de, wScriptVar @@ -1985,7 +1985,7 @@ Script_vartomem: lb bc, PRINTNUM_RIGHTALIGN | 1, 3 call PrintNum ld de, wStringBuffer1 - jp ConvertMemToText + jp GetStringBuffer ResetStringBuffer1: ld hl, wStringBuffer1 @@ -1994,9 +1994,9 @@ ResetStringBuffer1: call ByteFill ret -Script_stringtotext: +Script_getstring: ; script command 0x44 -; parameters: text_pointer, memory +; parameters: string_buffer, text_pointer call GetScriptByte ld e, a @@ -2006,7 +2006,7 @@ Script_stringtotext: ld hl, CopyName1 rst FarCall ld de, wStringBuffer2 - jp ConvertMemToText + jp GetStringBuffer Script_givepokemail: ; script command 0x2f @@ -2551,7 +2551,7 @@ Script_delcmdqueue: ld [wScriptVar], a ret -Script_changemap: +Script_changemapblocks: ; script command 0x79 ; parameters: map_data_pointer diff --git a/engine/phone/scripts/alan.asm b/engine/phone/scripts/alan.asm index e5f7680f7..a8e40532f 100644 --- a/engine/phone/scripts/alan.asm +++ b/engine/phone/scripts/alan.asm @@ -1,5 +1,5 @@ AlanPhoneCalleeScript: - trainertotext SCHOOLBOY, ALAN1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, SCHOOLBOY, ALAN1 checkflag ENGINE_ALAN iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male @@ -7,7 +7,7 @@ AlanPhoneCalleeScript: iftrue .NotWednesday checkflag ENGINE_ALAN_HAS_FIRE_STONE iftrue .FireStone - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal WEDNESDAY, .NotWednesday checktime DAY iftrue AlanWednesdayDay @@ -16,15 +16,15 @@ AlanPhoneCalleeScript: farjump UnknownScript_0xa0970 .WantsBattle: - landmarktotext ROUTE_36, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_36 farjump UnknownScript_0xa0a73 .FireStone: - landmarktotext ROUTE_36, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_36 farjump UnknownScript_0xa0ac5 AlanPhoneCallerScript: - trainertotext SCHOOLBOY, ALAN1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, SCHOOLBOY, ALAN1 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_ALAN iftrue .Generic @@ -50,11 +50,11 @@ AlanWednesdayDay: setflag ENGINE_ALAN_WEDNESDAY_AFTERNOON AlanWantsBattle: - landmarktotext ROUTE_36, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_36 setflag ENGINE_ALAN farjump PhoneScript_WantsToBattle_Male AlanHasFireStone: setflag ENGINE_ALAN_HAS_FIRE_STONE - landmarktotext ROUTE_36, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_36 farjump PhoneScript_FoundItem_Male diff --git a/engine/phone/scripts/anthony.asm b/engine/phone/scripts/anthony.asm index 3dc298f8f..df9297f83 100644 --- a/engine/phone/scripts/anthony.asm +++ b/engine/phone/scripts/anthony.asm @@ -1,11 +1,11 @@ AnthonyPhoneCalleeScript: - trainertotext HIKER, ANTHONY2, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, HIKER, ANTHONY2 checkflag ENGINE_ANTHONY iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_ANTHONY_FRIDAY_NIGHT iftrue .NotFriday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal FRIDAY, .NotFriday checktime NITE iftrue AnthonyFridayNight @@ -16,15 +16,15 @@ AnthonyPhoneCalleeScript: farjump UnknownScript_0xa0950 .WantsBattle: - landmarktotext ROUTE_33, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_33 farjump UnknownScript_0xa0a5f .AlreadySwarming: - landmarktotext ROUTE_33, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_33 farjump UnknownScript_0xa0afa AnthonyPhoneCallerScript: - trainertotext HIKER, ANTHONY2, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, HIKER, ANTHONY2 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_FLYPOINT_GOLDENROD iffalse .TriesSwarm @@ -44,7 +44,7 @@ AnthonyFridayNight: setflag ENGINE_ANTHONY_FRIDAY_NIGHT AnthonyWantsBattle: - landmarktotext ROUTE_33, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_33 setflag ENGINE_ANTHONY farjump PhoneScript_WantsToBattle_Male @@ -52,9 +52,9 @@ AnthonyTriesDunsparceSwarm: checkflag ENGINE_DUNSPARCE_SWARM iftrue .Generic setflag ENGINE_DUNSPARCE_SWARM - pokenamemem DUNSPARCE, MEM_BUFFER_1 + getmonname STRING_BUFFER_4, DUNSPARCE swarm SWARM_DUNSPARCE, DARK_CAVE_VIOLET_ENTRANCE - landmarktotext DARK_CAVE, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, DARK_CAVE farjump UnknownScript_0xa05de .Generic: diff --git a/engine/phone/scripts/arnie.asm b/engine/phone/scripts/arnie.asm index 908e7ff6d..7fdcad9d3 100644 --- a/engine/phone/scripts/arnie.asm +++ b/engine/phone/scripts/arnie.asm @@ -1,11 +1,11 @@ ArniePhoneCalleeScript: - trainertotext BUG_CATCHER, ARNIE1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BUG_CATCHER, ARNIE1 checkflag ENGINE_ARNIE iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_ARNIE_TUESDAY_MORNING iftrue .NotTuesday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal TUESDAY, .NotTuesday checktime MORN iftrue ArnieTuesdayMorning @@ -16,15 +16,15 @@ ArniePhoneCalleeScript: farjump UnknownScript_0xa0968 .WantsBattle: - landmarktotext ROUTE_35, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_35 farjump UnknownScript_0xa0a6e .AlreadySwarming: - landmarktotext ROUTE_35, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_35 farjump UnknownScript_0xa0aff ArniePhoneCallerScript: - trainertotext BUG_CATCHER, ARNIE1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BUG_CATCHER, ARNIE1 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_ARNIE iftrue .Swarm @@ -44,7 +44,7 @@ ArnieTuesdayMorning: setflag ENGINE_ARNIE_TUESDAY_MORNING ArnieWantsBattle: - landmarktotext ROUTE_35, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_35 setflag ENGINE_ARNIE farjump PhoneScript_WantsToBattle_Male @@ -52,9 +52,9 @@ ArnieYanmaSwarm: ; start swarm checkflag ENGINE_YANMA_SWARM iftrue ArnieYanmaAlreadySwarming setflag ENGINE_YANMA_SWARM - pokenamemem YANMA, MEM_BUFFER_1 + getmonname STRING_BUFFER_4, YANMA swarm SWARM_YANMA, ROUTE_35 - landmarktotext ROUTE_35, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_35 farjump UnknownScript_0xa05ce ArnieFoundRare: diff --git a/engine/phone/scripts/beth.asm b/engine/phone/scripts/beth.asm index 4aae343a7..4c69e58e9 100644 --- a/engine/phone/scripts/beth.asm +++ b/engine/phone/scripts/beth.asm @@ -1,11 +1,11 @@ BethPhoneCalleeScript: - trainertotext COOLTRAINERF, BETH1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, COOLTRAINERF, BETH1 checkflag ENGINE_BETH iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Female checkflag ENGINE_BETH_FRIDAY_AFTERNOON iftrue .NotFriday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal FRIDAY, .NotFriday checktime DAY iftrue BethFridayAfternoon @@ -14,11 +14,11 @@ BethPhoneCalleeScript: farjump UnknownScript_0xa0918 .WantsBattle: - landmarktotext ROUTE_26, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_26 farjump BethBattleReminderScript BethPhoneCallerScript: - trainertotext COOLTRAINERF, BETH1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, COOLTRAINERF, BETH1 farscall PhoneScript_GreetPhone_Female checkflag ENGINE_BETH iftrue .Generic @@ -34,6 +34,6 @@ BethFridayAfternoon: setflag ENGINE_BETH_FRIDAY_AFTERNOON BethWantsBattle: - landmarktotext ROUTE_26, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_26 setflag ENGINE_BETH farjump PhoneScript_WantsToBattle_Female diff --git a/engine/phone/scripts/beverly.asm b/engine/phone/scripts/beverly.asm index abc86cb9d..d930738f4 100644 --- a/engine/phone/scripts/beverly.asm +++ b/engine/phone/scripts/beverly.asm @@ -1,16 +1,16 @@ BeverlyPhoneCalleeScript: - trainertotext POKEFANF, BEVERLY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, POKEFANF, BEVERLY1 farscall PhoneScript_AnswerPhone_Female checkflag ENGINE_BEVERLY_HAS_NUGGET iftrue .HasNugget farjump UnknownScript_0xa0900 .HasNugget: - landmarktotext NATIONAL_PARK, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, NATIONAL_PARK farjump UnknownScript_0xa0aa5 BeverlyPhoneCallerScript: - trainertotext POKEFANF, BEVERLY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, POKEFANF, BEVERLY1 farscall PhoneScript_GreetPhone_Female checkflag ENGINE_BEVERLY_HAS_NUGGET iftrue .HasNugget @@ -22,5 +22,5 @@ BeverlyPhoneCallerScript: .FoundNugget: setflag ENGINE_BEVERLY_HAS_NUGGET - landmarktotext NATIONAL_PARK, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, NATIONAL_PARK farjump PhoneScript_FoundItem_Female diff --git a/engine/phone/scripts/bill.asm b/engine/phone/scripts/bill.asm index 733224f22..5683e4b27 100644 --- a/engine/phone/scripts/bill.asm +++ b/engine/phone/scripts/bill.asm @@ -20,8 +20,8 @@ BillPhoneCalleeScript: .main farwritetext BillPhoneGenericText buttonsound - checkcode VAR_BOXSPACE - vartomem MEM_BUFFER_0 + readvar VAR_BOXSPACE + getnum STRING_BUFFER_3 ifequal 0, .full ifless PARTY_LENGTH, .nearlyfull farwritetext BillPhoneNotFullText diff --git a/engine/phone/scripts/brent.asm b/engine/phone/scripts/brent.asm index ef18f06b9..63217a7b0 100644 --- a/engine/phone/scripts/brent.asm +++ b/engine/phone/scripts/brent.asm @@ -1,11 +1,11 @@ BrentPhoneCalleeScript: - trainertotext POKEMANIAC, BRENT1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, POKEMANIAC, BRENT1 checkflag ENGINE_BRENT iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_BRENT_MONDAY_MORNING iftrue .NotMonday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal MONDAY, .NotMonday checktime MORN iftrue BrentMondayMorning @@ -14,11 +14,11 @@ BrentPhoneCalleeScript: farjump UnknownScript_0xa0998 .WantsBattle: - landmarktotext ROUTE_43, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_43 farjump UnknownScript_0xa0a87 BrentPhoneCallerScript: - trainertotext POKEMANIAC, BRENT1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, POKEMANIAC, BRENT1 farscall PhoneScript_GreetPhone_Male farscall PhoneScript_Random2 ifequal 0, BrentBillTrivia @@ -36,7 +36,7 @@ BrentMondayMorning: setflag ENGINE_BRENT_MONDAY_MORNING BrentWantsBattle: - landmarktotext ROUTE_43, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_43 setflag ENGINE_BRENT farjump PhoneScript_WantsToBattle_Male diff --git a/engine/phone/scripts/buena.asm b/engine/phone/scripts/buena.asm index 3e08fcd40..1a8868b6e 100644 --- a/engine/phone/scripts/buena.asm +++ b/engine/phone/scripts/buena.asm @@ -1,7 +1,7 @@ BuenaPhoneCalleeScript: checkflag ENGINE_ROCKETS_IN_RADIO_TOWER iftrue BuenaPhoneScript_Rocket - checkcode VAR_HOUR + readvar VAR_HOUR ifgreater 17, BuenaPhoneScript_AfterMidnight1 scall BuenaPhoneScript_CheckTimeOfDay1 jump BuenaPhoneScript_Random1 @@ -36,7 +36,7 @@ BuenaPhoneScript_AfterMidnight1: end BuenaPhoneScript_CheckTimeOfDay2: - checkcode VAR_HOUR + readvar VAR_HOUR ifgreater 17, BuenaPhoneScript_AfterMidnight2 checktime MORN iftrue .morn diff --git a/engine/phone/scripts/chad.asm b/engine/phone/scripts/chad.asm index e89563a09..d3465699c 100644 --- a/engine/phone/scripts/chad.asm +++ b/engine/phone/scripts/chad.asm @@ -1,11 +1,11 @@ ChadPhoneCalleeScript: - trainertotext SCHOOLBOY, CHAD1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, SCHOOLBOY, CHAD1 checkflag ENGINE_CHAD iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_CHAD_FRIDAY_MORNING iftrue .NotFriday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal FRIDAY, .NotFriday checktime MORN iftrue ChadFridayMorning @@ -14,11 +14,11 @@ ChadPhoneCalleeScript: farjump UnknownScript_0xa0980 .WantsBattle: - landmarktotext ROUTE_38, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_38 farjump UnknownScript_0xa0a7d ChadPhoneCallerScript: - trainertotext SCHOOLBOY, CHAD1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, SCHOOLBOY, CHAD1 farscall PhoneScript_GreetPhone_Male farscall PhoneScript_Random2 ifequal 0, ChadOakGossip @@ -38,7 +38,7 @@ ChadFridayMorning: setflag ENGINE_CHAD_FRIDAY_MORNING ChadWantsBattle: - landmarktotext ROUTE_38, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_38 setflag ENGINE_CHAD farjump PhoneScript_WantsToBattle_Male diff --git a/engine/phone/scripts/dana.asm b/engine/phone/scripts/dana.asm index b072820a6..41d5d87ac 100644 --- a/engine/phone/scripts/dana.asm +++ b/engine/phone/scripts/dana.asm @@ -1,5 +1,5 @@ DanaPhoneCalleeScript: - trainertotext LASS, DANA1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, LASS, DANA1 checkflag ENGINE_DANA iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Female @@ -7,7 +7,7 @@ DanaPhoneCalleeScript: iftrue .NotThursday checkflag ENGINE_DANA_HAS_THUNDERSTONE iftrue .HasThunderstone - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal THURSDAY, .NotThursday checktime NITE iftrue DanaThursdayNight @@ -16,15 +16,15 @@ DanaPhoneCalleeScript: farjump UnknownScript_0xa0978 .WantsBattle: - landmarktotext ROUTE_38, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_38 farjump UnknownScript_0xa0a78 .HasThunderstone: - landmarktotext ROUTE_38, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_38 farjump UnknownScript_0xa0acd DanaPhoneCallerScript: - trainertotext LASS, DANA1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, LASS, DANA1 farscall PhoneScript_GreetPhone_Female checkflag ENGINE_DANA iftrue .Generic @@ -52,7 +52,7 @@ DanaThursdayNight: setflag ENGINE_DANA_THURSDAY_NIGHT DanaWantsBattle: - landmarktotext ROUTE_38, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_38 setflag ENGINE_DANA farjump PhoneScript_WantsToBattle_Female @@ -61,5 +61,5 @@ DanaFoundRare: DanaHasThunderstone: setflag ENGINE_DANA_HAS_THUNDERSTONE - landmarktotext ROUTE_38, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_38 farjump PhoneScript_FoundItem_Female diff --git a/engine/phone/scripts/derek.asm b/engine/phone/scripts/derek.asm index 95ff8bb76..4f3f5d94e 100644 --- a/engine/phone/scripts/derek.asm +++ b/engine/phone/scripts/derek.asm @@ -1,5 +1,5 @@ DerekPhoneCalleeScript: - trainertotext POKEFANM, DEREK1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, POKEFANM, DEREK1 farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_DEREK_HAS_NUGGET iftrue .Nugget @@ -7,7 +7,7 @@ DerekPhoneCalleeScript: ifequal 0, .NoContest checkflag ENGINE_DAILY_BUG_CONTEST iftrue .NoContest - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal TUESDAY, .ContestToday ifequal THURSDAY, .ContestToday ifequal SATURDAY, .ContestToday @@ -19,17 +19,17 @@ DerekPhoneCalleeScript: farjump PhoneScript_BugCatchingContest .Nugget: - landmarktotext ROUTE_39, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_39 farjump UnknownScript_0xa0ad5 DerekPhoneCallerScript: - trainertotext POKEFANM, DEREK1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, POKEFANM, DEREK1 farscall PhoneScript_GreetPhone_Male farscall PhoneScript_Random2 ifequal 0, .NoContest checkflag ENGINE_DAILY_BUG_CONTEST iftrue .NoContest - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal TUESDAY, .ContestToday ifequal THURSDAY, .ContestToday ifequal SATURDAY, .ContestToday @@ -44,5 +44,5 @@ DerekPhoneCallerScript: .Nugget: setflag ENGINE_DEREK_HAS_NUGGET - landmarktotext ROUTE_39, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_39 farjump PhoneScript_FoundItem_Male diff --git a/engine/phone/scripts/elm.asm b/engine/phone/scripts/elm.asm index 2890a14b9..d1b54905d 100644 --- a/engine/phone/scripts/elm.asm +++ b/engine/phone/scripts/elm.asm @@ -1,5 +1,5 @@ ElmPhoneCalleeScript: - checkcode VAR_SPECIALPHONECALL + readvar VAR_SPECIALPHONECALL ifequal SPECIALCALL_POKERUS, .pokerus checkevent EVENT_SHOWED_TOGEPI_TO_ELM iftrue .discovery @@ -62,7 +62,7 @@ ElmPhoneCalleeScript: end ElmPhoneCallerScript: - checkcode VAR_SPECIALPHONECALL + readvar VAR_SPECIALPHONECALL ifequal SPECIALCALL_ROBBED, .disaster ifequal SPECIALCALL_ASSISTANT, .assistant ifequal SPECIALCALL_WEIRDBROADCAST, .rocket diff --git a/engine/phone/scripts/erin.asm b/engine/phone/scripts/erin.asm index 1bf6f2154..10cd903d9 100644 --- a/engine/phone/scripts/erin.asm +++ b/engine/phone/scripts/erin.asm @@ -1,11 +1,11 @@ ErinPhoneCalleeScript: - trainertotext PICNICKER, ERIN1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, PICNICKER, ERIN1 checkflag ENGINE_ERIN iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Female checkflag ENGINE_ERIN_SATURDAY_NIGHT iftrue .NotSaturday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal SATURDAY, .NotSaturday checktime NITE iftrue ErinSaturdayNight @@ -14,11 +14,11 @@ ErinPhoneCalleeScript: farjump ErinWorkingHardScript .WantsBattle: - landmarktotext ROUTE_46, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_46 farjump ErinComeBattleScript ErinPhoneCallerScript: - trainertotext PICNICKER, ERIN1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, PICNICKER, ERIN1 farscall PhoneScript_GreetPhone_Female checkflag ENGINE_ERIN iftrue .GenericCall @@ -35,6 +35,6 @@ ErinSaturdayNight: setflag ENGINE_ERIN_SATURDAY_NIGHT ErinWantsBattle: - landmarktotext ROUTE_46, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_46 setflag ENGINE_ERIN farjump PhoneScript_WantsToBattle_Female diff --git a/engine/phone/scripts/gaven.asm b/engine/phone/scripts/gaven.asm index bf4804e4e..4445d86c4 100644 --- a/engine/phone/scripts/gaven.asm +++ b/engine/phone/scripts/gaven.asm @@ -1,11 +1,11 @@ GavenPhoneCalleeScript: - trainertotext COOLTRAINERM, GAVEN3, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, COOLTRAINERM, GAVEN3 checkflag ENGINE_GAVEN iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_GAVEN_THURSDAY_MORNING iftrue .NotThursday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal THURSDAY, .NotThursday checktime MORN iftrue GavenThursdayMorning @@ -14,11 +14,11 @@ GavenPhoneCalleeScript: farjump UnknownScript_0xa0910 .WantsBattle: - landmarktotext ROUTE_26, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_26 farjump UnknownScript_0xa0a37 GavenPhoneCallerScript: - trainertotext COOLTRAINERM, GAVEN3, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, COOLTRAINERM, GAVEN3 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_GAVEN iftrue .WaitingForBattle @@ -36,7 +36,7 @@ GavenThursdayMorning: setflag ENGINE_GAVEN_THURSDAY_MORNING GavenWantsRematch: - landmarktotext ROUTE_26, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_26 setflag ENGINE_GAVEN farjump PhoneScript_WantsToBattle_Male diff --git a/engine/phone/scripts/generic_callee.asm b/engine/phone/scripts/generic_callee.asm index 407480d36..d282aeb92 100644 --- a/engine/phone/scripts/generic_callee.asm +++ b/engine/phone/scripts/generic_callee.asm @@ -23,7 +23,7 @@ PhoneScript_AnswerPhone_Male: iftrue PhoneScript_AnswerPhone_Male_Day checktime NITE iftrue PhoneScript_AnswerPhone_Male_Nite - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -146,7 +146,7 @@ PhoneScript_AnswerPhone_Male: end PhoneScript_AnswerPhone_Male_Day: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -269,7 +269,7 @@ PhoneScript_AnswerPhone_Male_Day: end PhoneScript_AnswerPhone_Male_Nite: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -396,7 +396,7 @@ PhoneScript_AnswerPhone_Female: iftrue PhoneScript_AnswerPhone_Female_Day checktime NITE iftrue PhoneScript_AnswerPhone_Female_Nite - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -447,7 +447,7 @@ PhoneScript_AnswerPhone_Female: end PhoneScript_AnswerPhone_Female_Day: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -498,7 +498,7 @@ PhoneScript_AnswerPhone_Female_Day: end PhoneScript_AnswerPhone_Female_Nite: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -553,7 +553,7 @@ PhoneScript_GreetPhone_Male: iftrue PhoneScript_GreetPhone_Male_Day checktime NITE iftrue PhoneScript_GreetPhone_Male_Nite - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -676,7 +676,7 @@ PhoneScript_GreetPhone_Male: end PhoneScript_GreetPhone_Male_Day: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -799,7 +799,7 @@ PhoneScript_GreetPhone_Male_Day: end PhoneScript_GreetPhone_Male_Nite: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -926,7 +926,7 @@ PhoneScript_GreetPhone_Female: iftrue PhoneScript_GreetPhone_Female_Day checktime NITE iftrue PhoneScript_GreetPhone_Female_Nite - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -977,7 +977,7 @@ PhoneScript_GreetPhone_Female: end PhoneScript_GreetPhone_Female_Day: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -1028,7 +1028,7 @@ PhoneScript_GreetPhone_Female_Day: end PhoneScript_GreetPhone_Female_Nite: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -1079,7 +1079,7 @@ PhoneScript_GreetPhone_Female_Nite: end PhoneScript_Generic_Male: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven ifequal PHONE_BIRDKEEPER_JOSE, .Jose @@ -1189,7 +1189,7 @@ PhoneScript_Generic_Male: end PhoneScript_Generic_Female: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena diff --git a/engine/phone/scripts/generic_caller.asm b/engine/phone/scripts/generic_caller.asm index a929ba1d8..a450a5407 100644 --- a/engine/phone/scripts/generic_caller.asm +++ b/engine/phone/scripts/generic_caller.asm @@ -55,7 +55,7 @@ Phone_GotAwayCall_Female: farjump PhoneScript_HangupText_Female Phone_WhosBragging_Male: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven ifequal PHONE_BIRDKEEPER_JOSE, .Jose @@ -160,7 +160,7 @@ Phone_WhosBragging_Male: end Phone_WhosBragging_Female: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -211,7 +211,7 @@ Phone_WhosBragging_Female: end Phone_WhoDefeatedMon_Male: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven ifequal PHONE_BIRDKEEPER_JOSE, .Jose @@ -316,7 +316,7 @@ Phone_WhoDefeatedMon_Male: end Phone_WhoDefeatedMon_Female: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -367,7 +367,7 @@ Phone_WhoDefeatedMon_Female: end Phone_WhoLostAMon_Male: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven ifequal PHONE_BIRDKEEPER_JOSE, .Jose @@ -472,7 +472,7 @@ Phone_WhoLostAMon_Male: end Phone_WhoLostAMon_Female: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -531,7 +531,7 @@ PhoneScript_WantsToBattle_Female: farjump PhoneScript_HangupText_Female PhoneScript_RematchText_Male: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -636,7 +636,7 @@ PhoneScript_RematchText_Male: end PhoneScript_RematchText_Female: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena ifequal PHONE_PICNICKER_LIZ, .Liz @@ -689,7 +689,7 @@ TiffanyItsAwful: end PhoneScript_HangupText_Male: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_SCHOOLBOY_JACK, .Jack ifequal PHONE_SAILOR_HUEY, .Huey ifequal PHONE_COOLTRAINERM_GAVEN, .Gaven @@ -792,7 +792,7 @@ PhoneScript_HangupText_Male: end PhoneScript_HangupText_Female: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_COOLTRAINERF_BETH, .Beth ifequal PHONE_COOLTRAINERF_REENA, .Reena @@ -855,7 +855,7 @@ PhoneScriptRareWildMon: end PhoneScript_BugCatchingContest: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_BUG_CATCHER_WADE, .Wade ifequal PHONE_POKEFANM_DEREK, .Derek @@ -895,7 +895,7 @@ UnknownScript_0xa05de: jump PhoneScript_HangupText_Male PhoneScript_FoundItem_Male: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_BIRDKEEPER_JOSE, .Jose ifequal PHONE_BUG_CATCHER_WADE, .Wade ifequal PHONE_SCHOOLBOY_ALAN, .Alan @@ -928,7 +928,7 @@ PhoneScript_FoundItem_Male: end PhoneScript_FoundItem_Female: - checkcode VAR_CALLERID + readvar VAR_CALLERID ifequal PHONE_POKEFAN_BEVERLY, .Beverly ifequal PHONE_PICNICKER_GINA, .Gina ifequal PHONE_LASS_DANA, .Dana diff --git a/engine/phone/scripts/gina.asm b/engine/phone/scripts/gina.asm index 79514a46e..c0d1016e9 100644 --- a/engine/phone/scripts/gina.asm +++ b/engine/phone/scripts/gina.asm @@ -1,5 +1,5 @@ GinaPhoneCalleeScript: - trainertotext PICNICKER, GINA1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, PICNICKER, GINA1 checkflag ENGINE_GINA iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Female @@ -7,7 +7,7 @@ GinaPhoneCalleeScript: iftrue .NotSunday checkflag ENGINE_GINA_HAS_LEAF_STONE iftrue .HasLeafStone - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal SUNDAY, .NotSunday checktime DAY iftrue GinaSundayDay @@ -21,15 +21,15 @@ GinaPhoneCalleeScript: farjump UnknownScript_0xa05c6 .WantsBattle: - landmarktotext ROUTE_34, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_34 farjump UnknownScript_0xa0a69 .HasLeafStone: - landmarktotext ROUTE_34, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_34 farjump UnknownScript_0xa0abd GinaPhoneCallerScript: - trainertotext PICNICKER, GINA1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, PICNICKER, GINA1 farscall PhoneScript_GreetPhone_Female checkflag ENGINE_ROCKETS_IN_RADIO_TOWER iftrue GinaRockets @@ -59,7 +59,7 @@ GinaSundayDay: setflag ENGINE_GINA_SUNDAY_AFTERNOON GinaWantsBattle: - landmarktotext ROUTE_34, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_34 setflag ENGINE_GINA farjump PhoneScript_WantsToBattle_Female @@ -68,5 +68,5 @@ GinaRockets: GinaHasLeafStone: setflag ENGINE_GINA_HAS_LEAF_STONE - landmarktotext ROUTE_34, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_34 farjump PhoneScript_FoundItem_Female diff --git a/engine/phone/scripts/hangups.asm b/engine/phone/scripts/hangups.asm index 3dca4a0bb..713f8eac9 100644 --- a/engine/phone/scripts/hangups.asm +++ b/engine/phone/scripts/hangups.asm @@ -150,7 +150,7 @@ UnknownScript_0xa09e6: jump PhoneScript_HangupText_Male KenjiAnswerPhoneScript: - checkcode VAR_KENJI_BREAK + readvar VAR_KENJI_BREAK ifequal 2, .Training ifequal 1, .OnBreak farwritetext UnknownText_0x66e17 diff --git a/engine/phone/scripts/huey.asm b/engine/phone/scripts/huey.asm index e0398a62a..49b09b62c 100644 --- a/engine/phone/scripts/huey.asm +++ b/engine/phone/scripts/huey.asm @@ -1,11 +1,11 @@ HueyPhoneCalleeScript: - trainertotext SAILOR, HUEY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, SAILOR, HUEY1 checkflag ENGINE_HUEY iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_HUEY_WEDNESDAY_NIGHT iftrue .NotWednesday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal WEDNESDAY, .NotWednesday checktime NITE iftrue HueyWednesdayNight @@ -15,11 +15,11 @@ HueyPhoneCalleeScript: farjump UnknownScript_0xa0908 .WantsBattle: - landmarktotext LIGHTHOUSE, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, LIGHTHOUSE farjump HueyWantsBattleScript HueyPhoneCallerScript: - trainertotext SAILOR, HUEY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, SAILOR, HUEY1 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_HUEY iftrue .Flavor @@ -36,6 +36,6 @@ HueyWednesdayNight: setflag ENGINE_HUEY_WEDNESDAY_NIGHT HueyWantsBattle: - landmarktotext LIGHTHOUSE, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, LIGHTHOUSE setflag ENGINE_HUEY farjump PhoneScript_WantsToBattle_Male diff --git a/engine/phone/scripts/irwin.asm b/engine/phone/scripts/irwin.asm index 11e7198f0..b65986c82 100644 --- a/engine/phone/scripts/irwin.asm +++ b/engine/phone/scripts/irwin.asm @@ -1,5 +1,5 @@ IrwinPhoneCalleeScript: - trainertotext JUGGLER, IRWIN1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, JUGGLER, IRWIN1 farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_ROCKETS_IN_RADIO_TOWER iftrue .Rockets @@ -9,7 +9,7 @@ IrwinPhoneCalleeScript: farjump IrwinRocketRumor IrwinPhoneCallerScript: - trainertotext JUGGLER, IRWIN1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, JUGGLER, IRWIN1 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_ROCKETS_IN_RADIO_TOWER iftrue .Rockets diff --git a/engine/phone/scripts/jack.asm b/engine/phone/scripts/jack.asm index a02c3c36a..61a30f96e 100644 --- a/engine/phone/scripts/jack.asm +++ b/engine/phone/scripts/jack.asm @@ -1,11 +1,11 @@ JackPhoneCalleeScript: - trainertotext SCHOOLBOY, JACK1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, SCHOOLBOY, JACK1 checkflag ENGINE_JACK iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_JACK_MONDAY_MORNING iftrue .NotMonday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal MONDAY, .NotMonday checktime MORN iftrue JackMondayMorning @@ -14,11 +14,11 @@ JackPhoneCalleeScript: farjump JackPhoneTips .WantsBattle: - landmarktotext NATIONAL_PARK, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, NATIONAL_PARK farjump JackWantsBattleScript JackPhoneCallerScript: - trainertotext SCHOOLBOY, JACK1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, SCHOOLBOY, JACK1 farscall PhoneScript_GreetPhone_Male farscall PhoneScript_Random2 ifequal 0, JackBattleTrivia @@ -38,7 +38,7 @@ JackMondayMorning: setflag ENGINE_JACK_MONDAY_MORNING JackWantsToBattle: - landmarktotext NATIONAL_PARK, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, NATIONAL_PARK setflag ENGINE_JACK farjump PhoneScript_WantsToBattle_Male diff --git a/engine/phone/scripts/joey.asm b/engine/phone/scripts/joey.asm index 0d2c6267a..f5abce673 100644 --- a/engine/phone/scripts/joey.asm +++ b/engine/phone/scripts/joey.asm @@ -1,11 +1,11 @@ JoeyPhoneCalleeScript: - trainertotext YOUNGSTER, JOEY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, YOUNGSTER, JOEY1 checkflag ENGINE_JOEY iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_JOEY_MONDAY_AFTERNOON iftrue .NotMonday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal MONDAY, .NotMonday checktime DAY iftrue JoeyMondayAfternoon @@ -15,11 +15,11 @@ JoeyPhoneCalleeScript: farjump UnknownScript_0xa0930 .WantsBattle: - landmarktotext ROUTE_30, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_30 farjump UnknownScript_0xa0a4b JoeyPhoneCallerScript: - trainertotext YOUNGSTER, JOEY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, YOUNGSTER, JOEY1 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_JOEY iftrue .Generic @@ -36,6 +36,6 @@ JoeyMondayAfternoon: setflag ENGINE_JOEY_MONDAY_AFTERNOON JoeyWantsBattle: - landmarktotext ROUTE_30, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_30 setflag ENGINE_JOEY farjump PhoneScript_WantsToBattle_Male diff --git a/engine/phone/scripts/jose.asm b/engine/phone/scripts/jose.asm index 38bd0a99f..f1d8c9fa4 100644 --- a/engine/phone/scripts/jose.asm +++ b/engine/phone/scripts/jose.asm @@ -1,5 +1,5 @@ JosePhoneCalleeScript: - trainertotext BIRD_KEEPER, JOSE2, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BIRD_KEEPER, JOSE2 checkflag ENGINE_JOSE iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male @@ -7,7 +7,7 @@ JosePhoneCalleeScript: iftrue .NotSaturday checkflag ENGINE_JOSE_HAS_STAR_PIECE iftrue .HasItem - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal SATURDAY, .NotSaturday checktime NITE iftrue JoseSaturdayNight @@ -16,15 +16,15 @@ JosePhoneCalleeScript: farjump UnknownScript_0xa0920 .WantsBattle: - landmarktotext ROUTE_27, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_27 farjump UnknownScript_0xa0a41 .HasItem: - landmarktotext ROUTE_27, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_27 farjump UnknownScript_0xa0a41 JosePhoneCallerScript: - trainertotext BIRD_KEEPER, JOSE2, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BIRD_KEEPER, JOSE2 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_JOSE iftrue .Generic @@ -46,7 +46,7 @@ JoseSaturdayNight: setflag ENGINE_JOSE_SATURDAY_NIGHT JoseWantsBattle: - landmarktotext ROUTE_27, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_27 setflag ENGINE_JOSE farjump PhoneScript_WantsToBattle_Male @@ -55,5 +55,5 @@ JoseFoundRare: JoseHasStarPiece: setflag ENGINE_JOSE_HAS_STAR_PIECE - landmarktotext ROUTE_27, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_27 farjump PhoneScript_FoundItem_Male diff --git a/engine/phone/scripts/kenji.asm b/engine/phone/scripts/kenji.asm index 3888afbfd..4b7f3bf85 100644 --- a/engine/phone/scripts/kenji.asm +++ b/engine/phone/scripts/kenji.asm @@ -1,9 +1,9 @@ KenjiPhoneCalleeScript: - trainertotext BLACKBELT_T, KENJI3, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BLACKBELT_T, KENJI3 farscall PhoneScript_AnswerPhone_Male farjump KenjiAnswerPhoneScript KenjiPhoneCallerScript: - trainertotext BLACKBELT_T, KENJI3, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BLACKBELT_T, KENJI3 farscall PhoneScript_GreetPhone_Male farjump KenjiCallingPhoneScript diff --git a/engine/phone/scripts/liz.asm b/engine/phone/scripts/liz.asm index 31df3d4e9..61efabd75 100644 --- a/engine/phone/scripts/liz.asm +++ b/engine/phone/scripts/liz.asm @@ -1,11 +1,11 @@ LizPhoneCalleeScript: - trainertotext PICNICKER, LIZ1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, PICNICKER, LIZ1 checkflag ENGINE_LIZ iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Female checkflag ENGINE_LIZ_THURSDAY_AFTERNOON iftrue .NotThursday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal THURSDAY, .NotThursday checktime DAY iftrue LizThursdayAfternoon @@ -15,11 +15,11 @@ LizPhoneCalleeScript: farjump UnknownScript_0xa0948 .WantsBattle: - landmarktotext ROUTE_32, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_32 farjump UnknownScript_0xa0a5a LizPhoneCallerScript: - trainertotext PICNICKER, LIZ1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, PICNICKER, LIZ1 farscall PhoneScript_Random4 ifequal 0, LizWrongNumber farscall PhoneScript_GreetPhone_Female @@ -43,7 +43,7 @@ LizThursdayAfternoon: setflag ENGINE_LIZ_THURSDAY_AFTERNOON LizWantsBattle: - landmarktotext ROUTE_32, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_32 setflag ENGINE_LIZ farjump PhoneScript_WantsToBattle_Female @@ -63,39 +63,39 @@ LizGossip: ifequal 8, .PokefanM .CoolTrainerM: - trainerclassname COOLTRAINERM, NICK + gettrainerclassname STRING_BUFFER_4, COOLTRAINERM jump LizGossipScript .Beauty: - trainerclassname BEAUTY, VICTORIA + gettrainerclassname STRING_BUFFER_4, BEAUTY jump LizGossipScript .Grunt: - trainerclassname GRUNTM, GRUNTM_1 + gettrainerclassname STRING_BUFFER_4, GRUNTM jump LizGossipScript .Teacher: - trainerclassname TEACHER, COLETTE + gettrainerclassname STRING_BUFFER_4, TEACHER jump LizGossipScript .SwimmerF: - trainerclassname SWIMMERF, ELAINE + gettrainerclassname STRING_BUFFER_4, SWIMMERF jump LizGossipScript .KimonoGirl: - trainerclassname KIMONO_GIRL, NAOKO1 + gettrainerclassname STRING_BUFFER_4, KIMONO_GIRL jump LizGossipScript .Skier: - trainerclassname SKIER, ROXANNE + gettrainerclassname STRING_BUFFER_4, SKIER jump LizGossipScript .Medium: - trainerclassname MEDIUM, MARTHA + gettrainerclassname STRING_BUFFER_4, MEDIUM jump LizGossipScript .PokefanM: - trainerclassname POKEFANM, WILLIAM + gettrainerclassname STRING_BUFFER_4, POKEFANM jump LizGossipScript LizGossipScript: diff --git a/engine/phone/scripts/mom.asm b/engine/phone/scripts/mom.asm index 9b8e1fcf3..22887f3e9 100644 --- a/engine/phone/scripts/mom.asm +++ b/engine/phone/scripts/mom.asm @@ -14,8 +14,8 @@ MomPhoneCalleeScript: iftrue MomPhoneHangUpScript farwritetext MomPhoneGreetingText buttonsound - mapnametotext MEM_BUFFER_0 - checkcode VAR_ROOFPALETTE + getcurlandmarkname STRING_BUFFER_3 + readvar VAR_ROOFPALETTE ifequal 1, MomPhonePalette1 ifequal 2, MomPhonePalette2 jump MomPhoneOther @@ -26,7 +26,7 @@ MomPhoneLandmark: jump MomSavingMoney MomPhonePalette1: - checkcode VAR_MAPGROUP + readvar VAR_MAPGROUP ifequal GROUP_NEW_BARK_TOWN, .newbark ifequal GROUP_CHERRYGROVE_CITY, .cherrygrove ifequal GROUP_VIOLET_CITY, .violet @@ -47,13 +47,13 @@ MomPhonePalette1: jump MomSavingMoney .violet - landmarktotext SPROUT_TOWER, MEM_BUFFER_1 + getlandmarkname STRING_BUFFER_4, SPROUT_TOWER jump MomPhoneLandmark .azalea - landmarktotext SLOWPOKE_WELL, MEM_BUFFER_1 + getlandmarkname STRING_BUFFER_4, SLOWPOKE_WELL jump MomPhoneLandmark .goldenrod - landmarktotext RADIO_TOWER, MEM_BUFFER_1 + getlandmarkname STRING_BUFFER_4, RADIO_TOWER jump MomPhoneLandmark MomPhonePalette2: @@ -79,7 +79,7 @@ MomSavingMoney: jump .NoMoney .SavingHasMoney: - readmoney MOMS_MONEY, MEM_BUFFER_0 + getmoney STRING_BUFFER_3, MOMS_MONEY farwritetext MomCheckBalanceText yesorno iftrue MomPhoneSaveMoneyScript @@ -98,7 +98,7 @@ MomSavingMoney: jump MomPhoneWontSaveMoneyScript .HasMoney: - readmoney MOMS_MONEY, MEM_BUFFER_0 + getmoney STRING_BUFFER_3, MOMS_MONEY farwritetext MomYouveSavedText yesorno iftrue MomPhoneSaveMoneyScript diff --git a/engine/phone/scripts/parry.asm b/engine/phone/scripts/parry.asm index 0ab95ad9f..55733b9b2 100644 --- a/engine/phone/scripts/parry.asm +++ b/engine/phone/scripts/parry.asm @@ -1,11 +1,11 @@ ParryPhoneCalleeScript: - trainertotext HIKER, PARRY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, HIKER, PARRY1 checkflag ENGINE_PARRY iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_PARRY_FRIDAY_AFTERNOON iftrue .WantsRematch - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal FRIDAY, .WantsRematch checktime DAY iftrue ParryFridayDay @@ -14,11 +14,11 @@ ParryPhoneCalleeScript: farjump ParryBattleWithMe .WantsBattle: - landmarktotext ROUTE_45, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_45 farjump ParryHaventYouGottenTo ParryPhoneCallerScript: - trainertotext HIKER, PARRY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, HIKER, PARRY1 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_PARRY iftrue .GenericCall @@ -35,6 +35,6 @@ ParryFridayDay: setflag ENGINE_PARRY_FRIDAY_AFTERNOON ParryWantsBattle: - landmarktotext ROUTE_45, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_45 setflag ENGINE_PARRY farjump PhoneScript_WantsToBattle_Male diff --git a/engine/phone/scripts/ralph.asm b/engine/phone/scripts/ralph.asm index 0baf77b33..ed23c69c3 100644 --- a/engine/phone/scripts/ralph.asm +++ b/engine/phone/scripts/ralph.asm @@ -1,11 +1,11 @@ RalphPhoneCalleeScript: - trainertotext FISHER, RALPH1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, FISHER, RALPH1 checkflag ENGINE_RALPH iftrue .Rematch farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_RALPH_WEDNESDAY_MORNING iftrue .CheckSwarm - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal WEDNESDAY, .CheckSwarm checktime MORN iftrue Ralph_WednesdayMorning @@ -15,15 +15,15 @@ RalphPhoneCalleeScript: farjump UnknownScript_0xa0940 .Rematch: - landmarktotext ROUTE_32, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_32 farjump UnknownScript_0xa0a55 .ReportSwarm: - landmarktotext ROUTE_32, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_32 farjump UnknownScript_0xa0af5 RalphPhoneCallerScript: - trainertotext FISHER, RALPH1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, FISHER, RALPH1 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_FLYPOINT_GOLDENROD iffalse .CheckSwarm @@ -41,7 +41,7 @@ RalphPhoneCallerScript: Ralph_WednesdayMorning: setflag ENGINE_RALPH_WEDNESDAY_MORNING Ralph_FightMe: - landmarktotext ROUTE_32, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_32 setflag ENGINE_RALPH farjump PhoneScript_WantsToBattle_Male @@ -49,9 +49,9 @@ Ralph_SetUpSwarm: checkflag ENGINE_FISH_SWARM iftrue .Generic setflag ENGINE_FISH_SWARM - pokenamemem QWILFISH, MEM_BUFFER_1 - landmarktotext ROUTE_32, MEM_BUFFER_2 - writebyte FISHSWARM_QWILFISH + getmonname STRING_BUFFER_4, QWILFISH + getlandmarkname STRING_BUFFER_5, ROUTE_32 + setval FISHSWARM_QWILFISH special ActivateFishingSwarm farjump UnknownScript_0xa05d6 diff --git a/engine/phone/scripts/reena.asm b/engine/phone/scripts/reena.asm index a90f8e669..56e576e07 100644 --- a/engine/phone/scripts/reena.asm +++ b/engine/phone/scripts/reena.asm @@ -1,11 +1,11 @@ ReenaPhoneCalleeScript: - trainertotext COOLTRAINERF, REENA1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, COOLTRAINERF, REENA1 checkflag ENGINE_REENA iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Female checkflag ENGINE_REENA_SUNDAY_MORNING iftrue .NotSunday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal SUNDAY, .NotSunday checktime MORN iftrue ReenaSundayMorning @@ -14,11 +14,11 @@ ReenaPhoneCalleeScript: farjump UnknownScript_0xa0928 .WantsBattle: - landmarktotext ROUTE_27, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_27 farjump UnknownScript_0xa0a46 ReenaPhoneCallerScript: - trainertotext COOLTRAINERF, REENA1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, COOLTRAINERF, REENA1 farscall PhoneScript_GreetPhone_Female checkflag ENGINE_REENA iftrue .Generic @@ -34,6 +34,6 @@ ReenaSundayMorning: setflag ENGINE_REENA_SUNDAY_MORNING ReenaWantsBattle: - landmarktotext ROUTE_27, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_27 setflag ENGINE_REENA farjump PhoneScript_WantsToBattle_Female diff --git a/engine/phone/scripts/tiffany.asm b/engine/phone/scripts/tiffany.asm index 967f97135..91d56150c 100644 --- a/engine/phone/scripts/tiffany.asm +++ b/engine/phone/scripts/tiffany.asm @@ -1,5 +1,5 @@ TiffanyPhoneCalleeScript: - trainertotext PICNICKER, TIFFANY3, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, PICNICKER, TIFFANY3 checkflag ENGINE_TIFFANY iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Female @@ -7,7 +7,7 @@ TiffanyPhoneCalleeScript: iftrue .NotTuesday checkflag ENGINE_TIFFANY_HAS_PINK_BOW iftrue .HasItem - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal TUESDAY, .NotTuesday checktime DAY iftrue TiffanyTuesdayAfternoon @@ -16,15 +16,15 @@ TiffanyPhoneCalleeScript: farjump UnknownScript_0xa09a0 .WantsBattle: - landmarktotext ROUTE_43, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_43 farjump UnknownScript_0xa0a8c .HasItem: - landmarktotext ROUTE_43, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_43 farjump UnknownScript_0xa0ae5 TiffanyPhoneCallerScript: - trainertotext PICNICKER, TIFFANY3, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, PICNICKER, TIFFANY3 farscall PhoneScript_Random4 ifequal 0, TiffanysFamilyMembers farscall PhoneScript_GreetPhone_Female @@ -52,7 +52,7 @@ TiffanyTuesdayAfternoon: setflag ENGINE_TIFFANY_TUESDAY_AFTERNOON TiffanyWantsBattle: - landmarktotext ROUTE_43, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_43 setflag ENGINE_TIFFANY farjump PhoneScript_WantsToBattle_Female @@ -66,27 +66,27 @@ TiffanysFamilyMembers: ifequal 5, .Brother .Grandma: - stringtotext GrandmaString, MEM_BUFFER_1 + getstring STRING_BUFFER_4, GrandmaString jump .PoorClefairy .Grandpa: - stringtotext GrandpaString, MEM_BUFFER_1 + getstring STRING_BUFFER_4, GrandpaString jump .PoorClefairy .Mom: - stringtotext MomString, MEM_BUFFER_1 + getstring STRING_BUFFER_4, MomString jump .PoorClefairy .Dad: - stringtotext DadString, MEM_BUFFER_1 + getstring STRING_BUFFER_4, DadString jump .PoorClefairy .Sister: - stringtotext SisterString, MEM_BUFFER_1 + getstring STRING_BUFFER_4, SisterString jump .PoorClefairy .Brother: - stringtotext BrotherString, MEM_BUFFER_1 + getstring STRING_BUFFER_4, BrotherString jump .PoorClefairy .PoorClefairy: @@ -94,5 +94,5 @@ TiffanysFamilyMembers: TiffanyHasPinkBow: setflag ENGINE_TIFFANY_HAS_PINK_BOW - landmarktotext ROUTE_43, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_43 farjump PhoneScript_FoundItem_Female diff --git a/engine/phone/scripts/todd.asm b/engine/phone/scripts/todd.asm index 3aafb740a..f9a5357a9 100644 --- a/engine/phone/scripts/todd.asm +++ b/engine/phone/scripts/todd.asm @@ -1,11 +1,11 @@ ToddPhoneCalleeScript: - trainertotext CAMPER, TODD1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, CAMPER, TODD1 checkflag ENGINE_TODD iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_TODD_SATURDAY_MORNING iftrue .NotSaturday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal SATURDAY, .NotSaturday checktime MORN iftrue ToddSaturdayMorning @@ -16,14 +16,14 @@ ToddPhoneCalleeScript: farjump UnknownScript_0xa0958 .WantsBattle: - landmarktotext ROUTE_34, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_34 farjump UnknownScript_0xa0a64 .SaleOn: farjump UnknownScript_0xa0b04 ToddPhoneCallerScript: - trainertotext CAMPER, TODD1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, CAMPER, TODD1 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_TODD iftrue .TryForSale @@ -47,7 +47,7 @@ ToddSaturdayMorning: setflag ENGINE_TODD_SATURDAY_MORNING ToddWantsBattle: - landmarktotext ROUTE_34, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_34 setflag ENGINE_TODD farjump PhoneScript_WantsToBattle_Male diff --git a/engine/phone/scripts/tully.asm b/engine/phone/scripts/tully.asm index b6bf84ba7..12adc8f7d 100644 --- a/engine/phone/scripts/tully.asm +++ b/engine/phone/scripts/tully.asm @@ -1,5 +1,5 @@ TullyPhoneCalleeScript: - trainertotext FISHER, TULLY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, FISHER, TULLY1 checkflag ENGINE_TULLY iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male @@ -7,7 +7,7 @@ TullyPhoneCalleeScript: iftrue .NotSunday checkflag ENGINE_TULLY_HAS_WATER_STONE iftrue .WaterStone - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal SUNDAY, .NotSunday checktime NITE iftrue TullySundayNight @@ -16,15 +16,15 @@ TullyPhoneCalleeScript: farjump UnknownScript_0xa0990 .WantsBattle: - landmarktotext ROUTE_42, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_42 farjump UnknownScript_0xa0a82 .WaterStone: - landmarktotext ROUTE_42, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_42 farjump UnknownScript_0xa0add TullyPhoneCallerScript: - trainertotext FISHER, TULLY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, FISHER, TULLY1 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_TULLY iftrue .Generic @@ -50,11 +50,11 @@ TullySundayNight: setflag ENGINE_TULLY_SUNDAY_NIGHT TullyWantsBattle: - landmarktotext ROUTE_42, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_42 setflag ENGINE_TULLY farjump PhoneScript_WantsToBattle_Male TullyFoundWaterStone: setflag ENGINE_TULLY_HAS_WATER_STONE - landmarktotext ROUTE_42, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_42 farjump PhoneScript_FoundItem_Male diff --git a/engine/phone/scripts/vance.asm b/engine/phone/scripts/vance.asm index 8410289cb..8ef017e40 100644 --- a/engine/phone/scripts/vance.asm +++ b/engine/phone/scripts/vance.asm @@ -1,11 +1,11 @@ VancePhoneCalleeScript: - trainertotext BIRD_KEEPER, VANCE1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BIRD_KEEPER, VANCE1 checkflag ENGINE_VANCE iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male checkflag ENGINE_VANCE_WEDNESDAY_NIGHT iftrue .NotWednesday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal WEDNESDAY, .NotWednesday checktime NITE iftrue VanceWednesdayNight @@ -14,11 +14,11 @@ VancePhoneCalleeScript: farjump VanceLookingForward .WantsBattle: - landmarktotext ROUTE_44, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_44 farjump VanceHurryHurry VancePhoneCallerScript: - trainertotext BIRD_KEEPER, VANCE1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BIRD_KEEPER, VANCE1 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_VANCE iftrue .WantsBattle @@ -35,6 +35,6 @@ VanceWednesdayNight: setflag ENGINE_VANCE_WEDNESDAY_NIGHT VanceWantsRematch: - landmarktotext ROUTE_44, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_44 setflag ENGINE_VANCE farjump PhoneScript_WantsToBattle_Male diff --git a/engine/phone/scripts/wade.asm b/engine/phone/scripts/wade.asm index 31931f06a..557b7aac6 100644 --- a/engine/phone/scripts/wade.asm +++ b/engine/phone/scripts/wade.asm @@ -1,5 +1,5 @@ WadePhoneCalleeScript: - trainertotext BUG_CATCHER, WADE1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BUG_CATCHER, WADE1 checkflag ENGINE_WADE iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male @@ -7,7 +7,7 @@ WadePhoneCalleeScript: iftrue .NotTuesday checkflag ENGINE_WADE_HAS_ITEM iftrue .HasItem - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal TUESDAY, .NotTuesday checktime NITE iftrue WadeTuesdayNight @@ -17,7 +17,7 @@ WadePhoneCalleeScript: ifequal 0, .NoContest checkflag ENGINE_DAILY_BUG_CONTEST iftrue .NoContest - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal TUESDAY, .ContestToday ifequal THURSDAY, .ContestToday ifequal SATURDAY, .ContestToday @@ -29,21 +29,21 @@ WadePhoneCalleeScript: farjump PhoneScript_BugCatchingContest .WantsBattle: - landmarktotext ROUTE_31, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_31 farjump UnknownScript_0xa0a50 .HasItem: - landmarktotext ROUTE_31, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_31 farjump UnknownScript_0xa0ab5 WadePhoneCallerScript: - trainertotext BUG_CATCHER, WADE1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BUG_CATCHER, WADE1 farscall PhoneScript_GreetPhone_Male farscall PhoneScript_Random2 ifequal 0, .NoContest checkflag ENGINE_DAILY_BUG_CONTEST iftrue .NoContest - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal TUESDAY, .ContestToday ifequal THURSDAY, .ContestToday ifequal SATURDAY, .ContestToday @@ -74,7 +74,7 @@ WadeTuesdayNight: setflag ENGINE_WADE_TUESDAY_NIGHT WadeWantsBattle2: - landmarktotext ROUTE_31, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_31 setflag ENGINE_WADE farjump PhoneScript_WantsToBattle_Male @@ -83,7 +83,7 @@ WadeFoundRare: WadeHasItem2: setflag ENGINE_WADE_HAS_ITEM - landmarktotext ROUTE_31, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_31 clearevent EVENT_WADE_HAS_BERRY clearevent EVENT_WADE_HAS_PSNCUREBERRY clearevent EVENT_WADE_HAS_PRZCUREBERRY diff --git a/engine/phone/scripts/wilton.asm b/engine/phone/scripts/wilton.asm index 9d2f0e906..6bc09685c 100644 --- a/engine/phone/scripts/wilton.asm +++ b/engine/phone/scripts/wilton.asm @@ -1,5 +1,5 @@ WiltonPhoneCalleeScript: - trainertotext FISHER, WILTON1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, FISHER, WILTON1 checkflag ENGINE_WILTON iftrue .WantsBattle farscall PhoneScript_AnswerPhone_Male @@ -7,7 +7,7 @@ WiltonPhoneCalleeScript: iftrue .NotThursday checkflag ENGINE_WILTON_HAS_ITEM iftrue .HasItem - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal THURSDAY, .NotThursday checktime MORN iftrue WiltonThursdayMorning @@ -16,15 +16,15 @@ WiltonPhoneCalleeScript: farjump WiltonHaventFoundAnything .WantsBattle: - landmarktotext ROUTE_44, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_44 farjump WiltonNotBiting .HasItem: - landmarktotext ROUTE_44, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_44 farjump WiltonWantThis WiltonPhoneCallerScript: - trainertotext FISHER, WILTON1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, FISHER, WILTON1 farscall PhoneScript_GreetPhone_Male checkflag ENGINE_WILTON iftrue .GenericCall @@ -44,13 +44,13 @@ WiltonThursdayMorning: setflag ENGINE_WILTON_THURSDAY_MORNING WiltonWantsBattle: - landmarktotext ROUTE_44, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_44 setflag ENGINE_WILTON farjump PhoneScript_WantsToBattle_Male WiltonHasItem: setflag ENGINE_WILTON_HAS_ITEM - landmarktotext ROUTE_44, MEM_BUFFER_2 + getlandmarkname STRING_BUFFER_5, ROUTE_44 clearevent EVENT_WILTON_HAS_ULTRA_BALL clearevent EVENT_WILTON_HAS_GREAT_BALL clearevent EVENT_WILTON_HAS_POKE_BALL diff --git a/macros/legacy.asm b/macros/legacy.asm index ea8d99a4b..ce35cc48d 100644 --- a/macros/legacy.asm +++ b/macros/legacy.asm @@ -26,13 +26,62 @@ domaptrigger EQUS "setmapscene" checktriggers EQUS "checkscene" dotrigger EQUS "setscene" -faceperson EQUS "faceobject" -moveperson EQUS "moveobject" -writepersonxy EQUS "writeobjectxy" -spriteface EQUS "turnobject" -objectface EQUS "turnobject" +faceperson EQUS "faceobject" +moveperson EQUS "moveobject" +writepersonxy EQUS "writeobjectxy" +spriteface EQUS "turnobject" +objectface EQUS "turnobject" +applymovement2 EQUS "applymovementlasttalked" -RAM2MEM EQUS "vartomem" +writebyte EQUS "setval" +addvar EQUS "addval" +copybytetovar EQUS "readmem" +copyvartobyte EQUS "writemem" +checkcode EQUS "readvar" +writevarcode EQUS "writevar" +writecode EQUS "loadvar" + +MEM_BUFFER_0 EQUS "STRING_BUFFER_3" +MEM_BUFFER_1 EQUS "STRING_BUFFER_4" +MEM_BUFFER_2 EQUS "STRING_BUFFER_5" + +vartomem EQUS "getnum" +mapnametotext EQUS "getcurlandmarkname" +readcoins EQUS "getcoins" + +pokenamemem: MACRO + getmonname \2, \1 +ENDM + +itemtotext: MACRO + getitemname \2, \1 +ENDM + +landmarktotext: MACRO + getlandmarkname \2, \1 +ENDM + +trainertotext: MACRO + gettrainername \3, \1, \2 +ENDM + +trainerclassname: MACRO + gettrainerclassname \2, \1 +ENDM + +name: MACRO + getname \3, \1, \2 +ENDM + +stringtotext: MACRO + getstring \2, \1 +ENDM + +readmoney: MACRO + getmoney \2, \1 +ENDM + +RAM2MEM EQUS "getnum" loadfont EQUS "opentext" loadmenudata EQUS "loadmenu" loadmenuheader EQUS "loadmenu" @@ -40,7 +89,7 @@ writebackup EQUS "closewindow" interpretmenu EQUS "_2dmenu" interpretmenu2 EQUS "verticalmenu" battlecheck EQUS "randomwildmon" -loadtrainerdata EQUS "loadmemtrainer" +loadtrainerdata EQUS "loadtemptrainer" loadpokedata EQUS "loadwildmon" returnafterbattle EQUS "reloadmapafterbattle" trainerstatus EQUS "trainerflagaction" @@ -54,6 +103,7 @@ displaylocation EQUS "landmarktotext" givepokeitem EQUS "givepokemail" checkpokeitem EQUS "checkpokemail" passtoengine EQUS "autoinput" +verbosegiveitem2 EQUS "verbosegiveitemvar" ; macros/scripts/maps.asm diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm index f5b6d7e9f..7b4013a04 100644 --- a/macros/scripts/events.asm +++ b/macros/scripts/events.asm @@ -131,15 +131,15 @@ setscene: MACRO db \1 ; scene_id ENDM - enum writebyte_command ; $15 -writebyte: MACRO - db writebyte_command + enum setval_command ; $15 +setval: MACRO + db setval_command db \1 ; value ENDM - enum addvar_command ; $16 -addvar: MACRO - db addvar_command + enum addval_command ; $16 +addval: MACRO + db addval_command db \1 ; value ENDM @@ -154,42 +154,47 @@ checkver: MACRO db checkver_command ENDM - enum copybytetovar_command ; $19 -copybytetovar: MACRO - db copybytetovar_command + enum readmem_command ; $19 +readmem: MACRO + db readmem_command dw \1 ; address ENDM - enum copyvartobyte_command ; $1a -copyvartobyte: MACRO - db copyvartobyte_command + enum writemem_command ; $1a +writemem: MACRO + db writemem_command dw \1 ; address ENDM - enum loadvar_command ; $1b + enum loadmem_command ; $1b +loadmem: MACRO + db loadmem_command + dw \1 ; address + db \2 ; value +ENDM + + enum readvar_command ; $1c +readvar: MACRO + db readvar_command + db \1 ; variable_id +ENDM + + enum writevar_command ; $1d +writevar: MACRO + db writevar_command + db \1 ; variable_id +ENDM + + enum loadvar_command ; $1e loadvar: MACRO +if STRIN("\1", "VAR_") != 1 +; LEGACY: Support for the old name of "loadmem" + loadmem \1, \2 +else db loadvar_command - dw \1 ; address - db \2 ; value -ENDM - - enum checkcode_command ; $1c -checkcode: MACRO - db checkcode_command - db \1 ; variable_id -ENDM - - enum writevarcode_command ; $1d -writevarcode: MACRO - db writevarcode_command - db \1 ; variable_id -ENDM - - enum writecode_command ; $1e -writecode: MACRO - db writecode_command db \1 ; variable_id db \2 ; value +endc ENDM enum giveitem_command ; $1f @@ -400,58 +405,58 @@ warp: MACRO db \3 ; y ENDM - enum readmoney_command ; $3d -readmoney: MACRO - db readmoney_command - db \1 ; account - db \2 ; memory + enum getmoney_command ; $3d +getmoney: MACRO + db getmoney_command + db \2 ; account + db \1 ; string_buffer ENDM - enum readcoins_command ; $3e -readcoins: MACRO - db readcoins_command - db \1 ; memory + enum getcoins_command ; $3e +getcoins: MACRO + db getcoins_command + db \1 ; string_buffer ENDM - enum vartomem_command ; $3f -vartomem: MACRO - db vartomem_command - db \1 ; memory + enum getnum_command ; $3f +getnum: MACRO + db getnum_command + db \1 ; string_buffer ENDM - enum pokenamemem_command ; $40 -pokenamemem: MACRO - db pokenamemem_command - db \1 ; pokemon - db \2 ; memory + enum getmonname_command ; $40 +getmonname: MACRO + db getmonname_command + db \2 ; pokemon + db \1 ; string_buffer ENDM - enum itemtotext_command ; $41 -itemtotext: MACRO - db itemtotext_command - db \1 ; item - db \2 ; memory + enum getitemname_command ; $41 +getitemname: MACRO + db getitemname_command + db \2 ; item + db \1 ; string_buffer ENDM - enum mapnametotext_command ; $42 -mapnametotext: MACRO - db mapnametotext_command - db \1 ; memory + enum getcurlandmarkname_command ; $42 +getcurlandmarkname: MACRO + db getcurlandmarkname_command + db \1 ; string_buffer ENDM - enum trainertotext_command ; $43 -trainertotext: MACRO - db trainertotext_command - db \1 ; trainer_id + enum gettrainername_command ; $43 +gettrainername: MACRO + db gettrainername_command db \2 ; trainer_group - db \3 ; memory + db \3 ; trainer_id + db \1 ; string_buffer ENDM - enum stringtotext_command ; $44 -stringtotext: MACRO - db stringtotext_command - dw \1 ; text_pointer - db \2 ; memory + enum getstring_command ; $44 +getstring: MACRO + db getstring_command + dw \2 ; text_pointer + db \1 ; string_buffer ENDM enum itemnotify_command ; $45 @@ -586,9 +591,9 @@ randomwildmon: MACRO db randomwildmon_command ENDM - enum loadmemtrainer_command ; $5c -loadmemtrainer: MACRO - db loadmemtrainer_command + enum loadtemptrainer_command ; $5c +loadtemptrainer: MACRO + db loadtemptrainer_command ENDM enum loadwildmon_command ; $5d @@ -624,7 +629,7 @@ ENDM enum trainertext_command ; $62 trainertext: MACRO db trainertext_command - db \1 ; which_text + db \1 ; text_id ENDM enum trainerflagaction_command ; $63 @@ -668,9 +673,9 @@ applymovement: MACRO dw \2 ; data ENDM - enum applymovement2_command ; $6a -applymovement2: MACRO - db applymovement2_command + enum applymovementlasttalked_command ; $6a +applymovementlasttalked: MACRO + db applymovementlasttalked_command dw \1 ; data ENDM @@ -765,11 +770,10 @@ earthquake: MACRO db \1 ; param ENDM - enum changemap_command ; $79 -changemap: MACRO - db changemap_command - db \1 ; map_bank - dw \2 ; map_data_pointer + enum changemapblocks_command ; $79 +changemapblocks: MACRO + db changemapblocks_command + dba \1 ; map_data_pointer ENDM enum changeblock_command ; $7a @@ -989,9 +993,9 @@ else endc ENDM - enum verbosegiveitem2_command ; $9f -verbosegiveitem2: MACRO - db verbosegiveitem2_command + enum verbosegiveitemvar_command ; $9f +verbosegiveitemvar: MACRO + db verbosegiveitemvar_command db \1 ; item db \2 ; var ENDM @@ -1025,31 +1029,31 @@ ENDM enum battletowertext_command ; $a4 battletowertext: MACRO db battletowertext_command + db \1 ; bttext_id +ENDM + + enum getlandmarkname_command ; $a5 +getlandmarkname: MACRO + db getlandmarkname_command + db \2 ; landmark_id + db \1 ; string_buffer +ENDM + + enum gettrainerclassname_command ; $a6 +gettrainerclassname: MACRO + db gettrainerclassname_command + db \2 ; trainer_group + db \1 ; string_buffer +ENDM + + enum getname_command ; $a7 +getname: MACRO + db getname_command + db \2 ; type + db \3 ; id db \1 ; memory ENDM - enum landmarktotext_command ; $a5 -landmarktotext: MACRO - db landmarktotext_command - db \1 ; id - db \2 ; memory -ENDM - - enum trainerclassname_command ; $a6 -trainerclassname: MACRO - db trainerclassname_command - db \1 ; id - db \2 ; memory -ENDM - - enum name_command ; $a7 -name: MACRO - db name_command - db \1 ; type - db \2 ; id - db \3 ; memory -ENDM - enum wait_command ; $a8 wait: MACRO db wait_command diff --git a/maps/AzaleaGym.asm b/maps/AzaleaGym.asm index f8cd6d4b7..7e2381d37 100644 --- a/maps/AzaleaGym.asm +++ b/maps/AzaleaGym.asm @@ -30,7 +30,7 @@ AzaleaGymBugsyScript: playsound SFX_GET_BADGE waitsfx setflag ENGINE_HIVEBADGE - checkcode VAR_BADGES + readvar VAR_BADGES scall AzaleaGymActivateRockets .FightDone: checkevent EVENT_GOT_TM49_FURY_CUTTER @@ -144,7 +144,7 @@ AzaleaGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext BUGSY, BUGSY1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, BUGSY, BUGSY1 jumpstd gymstatue2 BugsyText_INeverLose: diff --git a/maps/BattleTower1F.asm b/maps/BattleTower1F.asm index ca9609804..6049d9f26 100644 --- a/maps/BattleTower1F.asm +++ b/maps/BattleTower1F.asm @@ -13,10 +13,10 @@ BattleTower1F_MapScripts: db 0 ; callbacks .Scene0: - writebyte BATTLETOWERACTION_CHECKSAVEFILEISYOURS + setval BATTLETOWERACTION_CHECKSAVEFILEISYOURS special BattleTowerAction iffalse .SkipEverything - writebyte BATTLETOWERACTION_GET_CHALLENGE_STATE ; copybytetovar sBattleTowerChallengeState + setval BATTLETOWERACTION_GET_CHALLENGE_STATE ; readmem sBattleTowerChallengeState special BattleTowerAction ifequal $0, .SkipEverything ifequal $2, .priorityjump1 @@ -31,9 +31,9 @@ BattleTower1F_MapScripts: .priorityjump1 priorityjump BattleTower_LeftWithoutSaving - writebyte BATTLETOWERACTION_CHALLENGECANCELED + setval BATTLETOWERACTION_CHALLENGECANCELED special BattleTowerAction - writebyte BATTLETOWERACTION_06 + setval BATTLETOWERACTION_06 special BattleTowerAction .SkipEverything: setscene SCENE_FINISHED @@ -52,27 +52,27 @@ BattleTower1FRulesSign: end BattleTower1FReceptionistScript: - writebyte BATTLETOWERACTION_GET_CHALLENGE_STATE ; copybytetovar sBattleTowerChallengeState + setval BATTLETOWERACTION_GET_CHALLENGE_STATE ; readmem sBattleTowerChallengeState special BattleTowerAction ifequal $3, Script_BeatenAllTrainers2 ; maps/BattleTowerBattleRoom.asm opentext writetext Text_BattleTowerWelcomesYou buttonsound - writebyte BATTLETOWERACTION_CHECK_EXPLANATION_READ ; if new save file: bit 1, [sBattleTowerSaveFileFlags] + setval BATTLETOWERACTION_CHECK_EXPLANATION_READ ; if new save file: bit 1, [sBattleTowerSaveFileFlags] special BattleTowerAction ifnotequal $0, Script_Menu_ChallengeExplanationCancel jump Script_BattleTowerIntroductionYesNo Script_Menu_ChallengeExplanationCancel: writetext Text_WantToGoIntoABattleRoom - writebyte TRUE + setval TRUE special Menu_ChallengeExplanationCancel ifequal 1, Script_ChooseChallenge ifequal 2, Script_BattleTowerExplanation jump Script_BattleTowerHopeToServeYouAgain Script_ChooseChallenge: - writebyte BATTLETOWERACTION_RESETDATA ; ResetBattleTowerTrainerSRAM + setval BATTLETOWERACTION_RESETDATA ; ResetBattleTowerTrainerSRAM special BattleTowerAction special CheckForBattleTowerRules ifnotequal FALSE, Script_WaitButton @@ -83,23 +83,23 @@ Script_ChooseChallenge: special TryQuickSave iffalse Script_Menu_ChallengeExplanationCancel setscene SCENE_FINISHED - writebyte BATTLETOWERACTION_SET_EXPLANATION_READ ; set 1, [sBattleTowerSaveFileFlags] + setval BATTLETOWERACTION_SET_EXPLANATION_READ ; set 1, [sBattleTowerSaveFileFlags] special BattleTowerAction special BattleTowerRoomMenu ifequal $a, Script_Menu_ChallengeExplanationCancel ifnotequal $0, Script_MobileError - writebyte BATTLETOWERACTION_11 + setval BATTLETOWERACTION_11 special BattleTowerAction writetext Text_RightThisWayToYourBattleRoom waitbutton closetext - writebyte BATTLETOWERACTION_CHOOSEREWARD + setval BATTLETOWERACTION_CHOOSEREWARD special BattleTowerAction jump Script_WalkToBattleTowerElevator Script_ResumeBattleTowerChallenge: closetext - writebyte BATTLETOWERACTION_LOADLEVELGROUP ; load choice of level group + setval BATTLETOWERACTION_LOADLEVELGROUP ; load choice of level group special BattleTowerAction Script_WalkToBattleTowerElevator: musicfadeout MUSIC_NONE, 8 @@ -108,7 +108,7 @@ Script_WalkToBattleTowerElevator: setmapscene BATTLE_TOWER_HALLWAY, SCENE_DEFAULT follow BATTLETOWER1F_RECEPTIONIST, PLAYER applymovement BATTLETOWER1F_RECEPTIONIST, MovementData_BattleTower1FWalkToElevator - writebyte BATTLETOWERACTION_0A + setval BATTLETOWERACTION_0A special BattleTowerAction warpsound disappear BATTLETOWER1F_RECEPTIONIST @@ -118,15 +118,15 @@ Script_WalkToBattleTowerElevator: end Script_GivePlayerHisPrize: - writebyte BATTLETOWERACTION_1C + setval BATTLETOWERACTION_1C special BattleTowerAction - writebyte BATTLETOWERACTION_GIVEREWARD + setval BATTLETOWERACTION_GIVEREWARD special BattleTowerAction ifequal POTION, Script_YourPackIsStuffedFull - itemtotext USE_SCRIPT_VAR, MEM_BUFFER_1 + getitemname STRING_BUFFER_4, USE_SCRIPT_VAR giveitem ITEM_FROM_MEM, 5 writetext Text_PlayerGotFive - writebyte BATTLETOWERACTION_1D + setval BATTLETOWERACTION_1D special BattleTowerAction closetext end @@ -144,7 +144,7 @@ Script_BattleTowerIntroductionYesNo: Script_BattleTowerExplanation: writetext Text_BattleTowerIntroduction_2 Script_BattleTowerSkipExplanation: - writebyte BATTLETOWERACTION_SET_EXPLANATION_READ + setval BATTLETOWERACTION_SET_EXPLANATION_READ special BattleTowerAction jump Script_Menu_ChallengeExplanationCancel @@ -170,7 +170,7 @@ UnreferencedScript_0x9e4be: iffalse Script_Menu_ChallengeExplanationCancel special TryQuickSave iffalse Script_Menu_ChallengeExplanationCancel - writebyte BATTLETOWERACTION_SET_EXPLANATION_READ + setval BATTLETOWERACTION_SET_EXPLANATION_READ special BattleTowerAction special Function1700ba ifequal $a, Script_Menu_ChallengeExplanationCancel @@ -184,15 +184,15 @@ UnreferencedScript_0x9e4be: end UnreferencedScript_0x9e4ea: - writebyte BATTLETOWERACTION_LEVEL_CHECK + setval BATTLETOWERACTION_LEVEL_CHECK special BattleTowerAction ifnotequal $0, Script_AMonLevelExceeds - writebyte BATTLETOWERACTION_UBERS_CHECK + setval BATTLETOWERACTION_UBERS_CHECK special BattleTowerAction ifnotequal $0, Script_MayNotEnterABattleRoomUnderL70 special CheckForBattleTowerRules ifnotequal FALSE, Script_WaitButton - writebyte BATTLETOWERACTION_05 + setval BATTLETOWERACTION_05 special BattleTowerAction ifequal $0, .zero writetext Text_CantBeRegistered_PreviousRecordDeleted @@ -210,9 +210,9 @@ continue: special TryQuickSave iffalse Script_Menu_ChallengeExplanationCancel setscene SCENE_FINISHED - writebyte BATTLETOWERACTION_06 + setval BATTLETOWERACTION_06 special BattleTowerAction - writebyte BATTLETOWERACTION_12 + setval BATTLETOWERACTION_12 special BattleTowerAction writetext Text_RightThisWayToYourBattleRoom waitbutton diff --git a/maps/BattleTowerBattleRoom.asm b/maps/BattleTowerBattleRoom.asm index 43c43415f..b05075571 100644 --- a/maps/BattleTowerBattleRoom.asm +++ b/maps/BattleTowerBattleRoom.asm @@ -20,7 +20,7 @@ Script_BattleRoom: applymovement PLAYER, MovementData_BattleTowerBattleRoomPlayerWalksIn ; beat all 7 opponents in a row Script_BattleRoomLoop: - writebyte BATTLETOWERBATTLEROOM_YOUNGSTER + setval BATTLETOWERBATTLEROOM_YOUNGSTER special LoadOpponentTrainerAndPokemonWithOTSprite appear BATTLETOWERBATTLEROOM_YOUNGSTER warpsound @@ -34,7 +34,7 @@ Script_BattleRoomLoop: special FadeOutPalettes reloadmap ifnotequal $0, Script_FailedBattleTowerChallenge - copybytetovar wNrOfBeatenBattleTowerTrainers + readmem wNrOfBeatenBattleTowerTrainers ifequal BATTLETOWER_STREAK_LENGTH, Script_BeatenAllTrainers applymovement BATTLETOWERBATTLEROOM_YOUNGSTER, MovementData_BattleTowerBattleRoomOpponentWalksOut warpsound @@ -65,11 +65,11 @@ Script_DontBattleNextOpponent: writetext Text_SaveAndEndTheSession yesorno iffalse Script_DontSaveAndEndTheSession - writebyte BATTLETOWERACTION_SAVELEVELGROUP ; save level group + setval BATTLETOWERACTION_SAVELEVELGROUP ; save level group special BattleTowerAction - writebyte BATTLETOWERACTION_SAVEOPTIONS ; choose reward + setval BATTLETOWERACTION_SAVEOPTIONS ; choose reward special BattleTowerAction - writebyte BATTLETOWERACTION_SAVE_AND_QUIT ; quicksave + setval BATTLETOWERACTION_SAVE_AND_QUIT ; quicksave special BattleTowerAction playsound SFX_SAVE waitsfx @@ -79,9 +79,9 @@ Script_DontSaveAndEndTheSession: writetext Text_CancelYourBattleRoomChallenge yesorno iffalse Script_ContinueAndBattleNextOpponent - writebyte BATTLETOWERACTION_CHALLENGECANCELED + setval BATTLETOWERACTION_CHALLENGECANCELED special BattleTowerAction - writebyte BATTLETOWERACTION_06 + setval BATTLETOWERACTION_06 special BattleTowerAction closetext special FadeOutPalettes @@ -93,7 +93,7 @@ Script_FailedBattleTowerChallenge: pause 60 special BattleTowerFade warpfacing UP, BATTLE_TOWER_1F, 7, 7 - writebyte BATTLETOWERACTION_CHALLENGECANCELED + setval BATTLETOWERACTION_CHALLENGECANCELED special BattleTowerAction opentext writetext Text_ThanksForVisiting @@ -111,7 +111,7 @@ Script_BeatenAllTrainers2: jump Script_GivePlayerHisPrize UnreferencedScript_0x9f4eb: - writebyte BATTLETOWERACTION_CHALLENGECANCELED + setval BATTLETOWERACTION_CHALLENGECANCELED special BattleTowerAction opentext writetext Text_TooMuchTimeElapsedNoRegister @@ -120,9 +120,9 @@ UnreferencedScript_0x9f4eb: end UnreferencedScript_0x9f4f7: - writebyte BATTLETOWERACTION_CHALLENGECANCELED + setval BATTLETOWERACTION_CHALLENGECANCELED special BattleTowerAction - writebyte BATTLETOWERACTION_06 + setval BATTLETOWERACTION_06 special BattleTowerAction opentext writetext Text_ThanksForVisiting diff --git a/maps/BattleTowerElevator.asm b/maps/BattleTowerElevator.asm index f2b3621ba..ce7926595 100644 --- a/maps/BattleTowerElevator.asm +++ b/maps/BattleTowerElevator.asm @@ -18,7 +18,7 @@ BattleTowerElevator_MapScripts: follow BATTLETOWERELEVATOR_RECEPTIONIST, PLAYER applymovement BATTLETOWERELEVATOR_RECEPTIONIST, MovementData_BattleTowerElevatorReceptionistWalksIn applymovement PLAYER, MovementData_BattleTowerElevatorPlayerWalksIn - writebyte BATTLETOWERACTION_0A + setval BATTLETOWERACTION_0A special BattleTowerAction playsound SFX_ELEVATOR earthquake 60 diff --git a/maps/BillsFamilysHouse.asm b/maps/BillsFamilysHouse.asm index b100f1e61..0b855868c 100644 --- a/maps/BillsFamilysHouse.asm +++ b/maps/BillsFamilysHouse.asm @@ -19,7 +19,7 @@ BillScript: writetext BillImCountingOnYouText buttonsound waitsfx - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifequal PARTY_LENGTH, .NoRoom writetext ReceivedEeveeText playsound SFX_CAUGHT_MON diff --git a/maps/BlackthornCity.asm b/maps/BlackthornCity.asm index 538f325c6..2c9ff1e4c 100644 --- a/maps/BlackthornCity.asm +++ b/maps/BlackthornCity.asm @@ -21,7 +21,7 @@ BlackthornCity_MapScripts: return .Santos: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal SATURDAY, .SantosAppears disappear BLACKTHORNCITY_SANTOS return @@ -90,7 +90,7 @@ SantosScript: opentext checkevent EVENT_GOT_SPELL_TAG_FROM_SANTOS iftrue .Saturday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal SATURDAY, .NotSaturday checkevent EVENT_MET_SANTOS_OF_SATURDAY iftrue .MetSantos diff --git a/maps/BlackthornGym1F.asm b/maps/BlackthornGym1F.asm index 4627e807b..8912b792b 100644 --- a/maps/BlackthornGym1F.asm +++ b/maps/BlackthornGym1F.asm @@ -68,7 +68,7 @@ BlackthornGymClairScript: buttonsound giveitem TM_DRAGONBREATH iffalse .BagFull - itemtotext TM_DRAGONBREATH, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, TM_DRAGONBREATH writetext BlackthornGymText_ReceivedTM24 playsound SFX_ITEM waitsfx @@ -144,7 +144,7 @@ BlackthornGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext CLAIR, CLAIR1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, CLAIR, CLAIR1 jumpstd gymstatue2 ClairIntroText: diff --git a/maps/BluesHouse.asm b/maps/BluesHouse.asm index 27d46e076..15bf19aa1 100644 --- a/maps/BluesHouse.asm +++ b/maps/BluesHouse.asm @@ -9,7 +9,7 @@ BluesHouse_MapScripts: DaisyScript: faceplayer opentext - checkcode VAR_HOUR + readvar VAR_HOUR ifequal 15, .ThreePM writetext DaisyHelloText waitbutton diff --git a/maps/BurnedTowerB1F.asm b/maps/BurnedTowerB1F.asm index 716c742f4..09e41ddf3 100644 --- a/maps/BurnedTowerB1F.asm +++ b/maps/BurnedTowerB1F.asm @@ -103,7 +103,7 @@ BurnedTowerB1FEusine: writetext BurnedTowerB1FEusineText waitbutton closetext - checkcode VAR_FACING + readvar VAR_FACING ifequal UP, .Movement2 applymovement BURNEDTOWERB1F_EUSINE, BurnedTowerB1FEusineMovement1 jump .Finish diff --git a/maps/CeladonCafe.asm b/maps/CeladonCafe.asm index c3a65d67f..5ee69cddc 100644 --- a/maps/CeladonCafe.asm +++ b/maps/CeladonCafe.asm @@ -94,7 +94,7 @@ CeladonCafeTrashcan: giveitem LEFTOVERS iffalse .PackFull opentext - itemtotext LEFTOVERS, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, LEFTOVERS writetext FoundLeftoversText playsound SFX_ITEM waitsfx @@ -105,7 +105,7 @@ CeladonCafeTrashcan: .PackFull: opentext - itemtotext LEFTOVERS, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, LEFTOVERS writetext FoundLeftoversText buttonsound writetext NoRoomForLeftoversText diff --git a/maps/CeladonDeptStore6F.asm b/maps/CeladonDeptStore6F.asm index 005cb68be..edfacac05 100644 --- a/maps/CeladonDeptStore6F.asm +++ b/maps/CeladonDeptStore6F.asm @@ -42,7 +42,7 @@ CeladonDeptStore6FVendingMachine: giveitem FRESH_WATER iffalse .NotEnoughSpace takemoney YOUR_MONEY, CELADONDEPTSTORE6F_FRESH_WATER_PRICE - itemtotext FRESH_WATER, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, FRESH_WATER jump .VendItem .SodaPop: @@ -51,7 +51,7 @@ CeladonDeptStore6FVendingMachine: giveitem SODA_POP iffalse .NotEnoughSpace takemoney YOUR_MONEY, CELADONDEPTSTORE6F_SODA_POP_PRICE - itemtotext SODA_POP, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, SODA_POP jump .VendItem .Lemonade: @@ -60,7 +60,7 @@ CeladonDeptStore6FVendingMachine: giveitem LEMONADE iffalse .NotEnoughSpace takemoney YOUR_MONEY, CELADONDEPTSTORE6F_LEMONADE_PRICE - itemtotext LEMONADE, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, LEMONADE jump .VendItem .VendItem: diff --git a/maps/CeladonGameCorner.asm b/maps/CeladonGameCorner.asm index beab8cae4..c1e3ced8f 100644 --- a/maps/CeladonGameCorner.asm +++ b/maps/CeladonGameCorner.asm @@ -58,7 +58,7 @@ CeladonGameCornerFisherScript: iffalse .NoCoinCase checkcoins MAX_COINS - 1 ifequal HAVE_MORE, .FullCoinCase - stringtotext .coinname, MEM_BUFFER_1 + getstring STRING_BUFFER_4, .coinname scall .GiveCoins givecoins 18 setevent EVENT_GOT_COINS_FROM_GAMBLER_AT_CELADON @@ -112,14 +112,14 @@ CeladonGameCornerLuckySlotMachineScript: random 6 ifequal 0, CeladonGameCornerSlotMachineScript refreshscreen - writebyte FALSE + setval FALSE special SlotMachine closetext end CeladonGameCornerSlotMachineScript: refreshscreen - writebyte TRUE + setval TRUE special SlotMachine closetext end diff --git a/maps/CeladonGameCornerPrizeRoom.asm b/maps/CeladonGameCornerPrizeRoom.asm index 14052d91d..9866072a9 100644 --- a/maps/CeladonGameCornerPrizeRoom.asm +++ b/maps/CeladonGameCornerPrizeRoom.asm @@ -41,7 +41,7 @@ CeladonPrizeRoom_tmcounterloop: .DoubleTeam: checkcoins CELADONGAMECORNERPRIZEROOM_TM32_COINS ifequal HAVE_LESS, CeladonPrizeRoom_notenoughcoins - itemtotext TM_DOUBLE_TEAM, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, TM_DOUBLE_TEAM scall CeladonPrizeRoom_askbuy iffalse CeladonPrizeRoom_CancelPurchaseScript giveitem TM_DOUBLE_TEAM @@ -52,7 +52,7 @@ CeladonPrizeRoom_tmcounterloop: .Psychic: checkcoins CELADONGAMECORNERPRIZEROOM_TM29_COINS ifequal HAVE_LESS, CeladonPrizeRoom_notenoughcoins - itemtotext TM_PSYCHIC_M, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, TM_PSYCHIC_M scall CeladonPrizeRoom_askbuy iffalse CeladonPrizeRoom_CancelPurchaseScript giveitem TM_PSYCHIC_M @@ -63,7 +63,7 @@ CeladonPrizeRoom_tmcounterloop: .HyperBeam: checkcoins CELADONGAMECORNERPRIZEROOM_TM15_COINS ifequal HAVE_LESS, CeladonPrizeRoom_notenoughcoins - itemtotext TM_HYPER_BEAM, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, TM_HYPER_BEAM scall CeladonPrizeRoom_askbuy iffalse CeladonPrizeRoom_CancelPurchaseScript giveitem TM_HYPER_BEAM @@ -142,16 +142,16 @@ CeladonGameCornerPrizeRoomPokemonVendor: .Pikachu: checkcoins CELADONGAMECORNERPRIZEROOM_PIKACHU_COINS ifequal HAVE_LESS, CeladonPrizeRoom_notenoughcoins - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifequal PARTY_LENGTH, CeladonPrizeRoom_notenoughroom - pokenamemem PIKACHU, MEM_BUFFER_0 + getmonname STRING_BUFFER_3, PIKACHU scall CeladonPrizeRoom_askbuy iffalse CeladonPrizeRoom_CancelPurchaseScript waitsfx playsound SFX_TRANSACTION writetext CeladonPrizeRoom_HereYouGoText waitbutton - writebyte PIKACHU + setval PIKACHU special GameCornerPrizeMonCheckDex givepoke PIKACHU, 25 takecoins CELADONGAMECORNERPRIZEROOM_PIKACHU_COINS @@ -160,16 +160,16 @@ CeladonGameCornerPrizeRoomPokemonVendor: .Porygon: checkcoins CELADONGAMECORNERPRIZEROOM_PORYGON_COINS ifequal HAVE_LESS, CeladonPrizeRoom_notenoughcoins - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifequal PARTY_LENGTH, CeladonPrizeRoom_notenoughroom - pokenamemem PORYGON, MEM_BUFFER_0 + getmonname STRING_BUFFER_3, PORYGON scall CeladonPrizeRoom_askbuy iffalse CeladonPrizeRoom_CancelPurchaseScript waitsfx playsound SFX_TRANSACTION writetext CeladonPrizeRoom_HereYouGoText waitbutton - writebyte PORYGON + setval PORYGON special GameCornerPrizeMonCheckDex givepoke PORYGON, 15 takecoins CELADONGAMECORNERPRIZEROOM_PORYGON_COINS @@ -178,16 +178,16 @@ CeladonGameCornerPrizeRoomPokemonVendor: .Larvitar: checkcoins CELADONGAMECORNERPRIZEROOM_LARVITAR_COINS ifequal HAVE_LESS, CeladonPrizeRoom_notenoughcoins - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifequal PARTY_LENGTH, CeladonPrizeRoom_notenoughroom - pokenamemem LARVITAR, MEM_BUFFER_0 + getmonname STRING_BUFFER_3, LARVITAR scall CeladonPrizeRoom_askbuy iffalse CeladonPrizeRoom_CancelPurchaseScript waitsfx playsound SFX_TRANSACTION writetext CeladonPrizeRoom_HereYouGoText waitbutton - writebyte LARVITAR + setval LARVITAR special GameCornerPrizeMonCheckDex givepoke LARVITAR, 40 takecoins CELADONGAMECORNERPRIZEROOM_LARVITAR_COINS diff --git a/maps/CeladonGym.asm b/maps/CeladonGym.asm index e444aaa64..741985bbb 100644 --- a/maps/CeladonGym.asm +++ b/maps/CeladonGym.asm @@ -107,7 +107,7 @@ CeladonGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext ERIKA, ERIKA1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, ERIKA, ERIKA1 jumpstd gymstatue2 ErikaBeforeBattleText: diff --git a/maps/CeladonMansion3F.asm b/maps/CeladonMansion3F.asm index 29f043092..2bd6719c7 100644 --- a/maps/CeladonMansion3F.asm +++ b/maps/CeladonMansion3F.asm @@ -13,7 +13,7 @@ GameFreakGameDesignerScript: faceplayer opentext writetext GameFreakGameDesignerText - checkcode VAR_DEXCAUGHT + readvar VAR_DEXCAUGHT ifgreater NUM_POKEMON - 2 - 1, .CompletedPokedex ; ignore Mew and Celebi waitbutton closetext diff --git a/maps/CeladonPokecenter1F.asm b/maps/CeladonPokecenter1F.asm index 85097f378..0bd70e448 100644 --- a/maps/CeladonPokecenter1F.asm +++ b/maps/CeladonPokecenter1F.asm @@ -27,7 +27,7 @@ CeladonEusine: opentext writetext CeladonEusineText1 buttonsound - writebyte SUICUNE + setval SUICUNE special MonCheck iffalse .NoSuicune special BeastsCheck @@ -42,7 +42,7 @@ CeladonEusine: writetext EusineLeavesCeladonText waitbutton closetext - checkcode VAR_FACING + readvar VAR_FACING ifequal UP, .Location1 applymovement CELADONPOKECENTER1F_EUSINE, .Movement1 jump .Continue diff --git a/maps/CeruleanGym.asm b/maps/CeruleanGym.asm index 9c75c5661..f9b2f0eab 100644 --- a/maps/CeruleanGym.asm +++ b/maps/CeruleanGym.asm @@ -158,7 +158,7 @@ CeruleanGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext MISTY, MISTY1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, MISTY, MISTY1 jumpstd gymstatue2 CeruleanGymGruntRunsDownMovement: diff --git a/maps/CherrygroveCity.asm b/maps/CherrygroveCity.asm index 579ee70ac..44cc1076c 100644 --- a/maps/CherrygroveCity.asm +++ b/maps/CherrygroveCity.asm @@ -67,7 +67,7 @@ CherrygroveCityGuideGent: opentext writetext GuideGentGiftText buttonsound - stringtotext .mapcardname, MEM_BUFFER_1 + getstring STRING_BUFFER_4, .mapcardname scall .JumpstdReceiveItem setflag ENGINE_MAP_CARD writetext GotMapCardText @@ -120,7 +120,7 @@ CherrygroveSilverSceneNorth: winlosstext SilverCherrygroveWinText, SilverCherrygroveLossText setlasttalked CHERRYGROVECITY_SILVER loadtrainer RIVAL1, RIVAL1_1_TOTODILE - writecode VAR_BATTLETYPE, BATTLETYPE_CANLOSE + loadvar VAR_BATTLETYPE, BATTLETYPE_CANLOSE startbattle dontrestartmapmusic reloadmap @@ -131,7 +131,7 @@ CherrygroveSilverSceneNorth: winlosstext SilverCherrygroveWinText, SilverCherrygroveLossText setlasttalked CHERRYGROVECITY_SILVER loadtrainer RIVAL1, RIVAL1_1_CHIKORITA - writecode VAR_BATTLETYPE, BATTLETYPE_CANLOSE + loadvar VAR_BATTLETYPE, BATTLETYPE_CANLOSE startbattle dontrestartmapmusic reloadmap @@ -142,7 +142,7 @@ CherrygroveSilverSceneNorth: winlosstext SilverCherrygroveWinText, SilverCherrygroveLossText setlasttalked CHERRYGROVECITY_SILVER loadtrainer RIVAL1, RIVAL1_1_CYNDAQUIL - writecode VAR_BATTLETYPE, BATTLETYPE_CANLOSE + loadvar VAR_BATTLETYPE, BATTLETYPE_CANLOSE startbattle dontrestartmapmusic reloadmap diff --git a/maps/CianwoodGym.asm b/maps/CianwoodGym.asm index db2aa74ee..bd94710c6 100644 --- a/maps/CianwoodGym.asm +++ b/maps/CianwoodGym.asm @@ -47,7 +47,7 @@ CianwoodGymChuckScript: playsound SFX_GET_BADGE waitsfx setflag ENGINE_STORMBADGE - checkcode VAR_BADGES + readvar VAR_BADGES scall CianwoodGymActivateRockets .FightDone: checkevent EVENT_GOT_TM01_DYNAMICPUNCH @@ -136,7 +136,7 @@ CianwoodGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext CHUCK, CHUCK1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, CHUCK, CHUCK1 jumpstd gymstatue2 CianwoodGymMovement_ChuckChucksBoulder: diff --git a/maps/DayCare.asm b/maps/DayCare.asm index 7d085ede3..7c6591184 100644 --- a/maps/DayCare.asm +++ b/maps/DayCare.asm @@ -28,7 +28,7 @@ DayCareManScript_Inside: writetext DayCareManText_GiveOddEgg buttonsound closetext - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifequal PARTY_LENGTH, .PartyFull special GiveOddEgg opentext diff --git a/maps/DragonShrine.asm b/maps/DragonShrine.asm index 74a95d925..7124fa4c4 100644 --- a/maps/DragonShrine.asm +++ b/maps/DragonShrine.asm @@ -208,7 +208,7 @@ DragonShrineElder1Script: .GiveDratini: writetext DragonShrineTakeThisDratiniText waitbutton - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifequal PARTY_LENGTH, .PartyFull writetext DragonShrinePlayerReceivedDratiniText playsound SFX_CAUGHT_MON diff --git a/maps/DragonsDenB1F.asm b/maps/DragonsDenB1F.asm index 88429d132..54812317a 100644 --- a/maps/DragonsDenB1F.asm +++ b/maps/DragonsDenB1F.asm @@ -30,7 +30,7 @@ DragonsDenB1F_MapScripts: return .CheckDay: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal TUESDAY, .AppearSilver ifequal THURSDAY, .AppearSilver disappear DRAGONSDENB1F_SILVER @@ -55,7 +55,7 @@ DragonsDenB1F_ClairScene: buttonsound giveitem TM_DRAGONBREATH iffalse .BagFull - itemtotext TM_DRAGONBREATH, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, TM_DRAGONBREATH writetext NotifyReceiveDragonbreath playsound SFX_ITEM waitsfx @@ -132,7 +132,7 @@ DragonsDenB1FDragonFangScript: iffalse .BagFull disappear DRAGONSDENB1F_POKE_BALL1 opentext - itemtotext DRAGON_FANG, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, DRAGON_FANG writetext Text_FoundDragonFang playsound SFX_ITEM waitsfx @@ -142,7 +142,7 @@ DragonsDenB1FDragonFangScript: .BagFull: opentext - itemtotext DRAGON_FANG, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, DRAGON_FANG writetext Text_FoundDragonFang buttonsound writetext Text_NoRoomForDragonFang diff --git a/maps/EcruteakGym.asm b/maps/EcruteakGym.asm index 8d86f5771..5af6f3243 100644 --- a/maps/EcruteakGym.asm +++ b/maps/EcruteakGym.asm @@ -39,7 +39,7 @@ EcruteakGymMortyScript: playsound SFX_GET_BADGE waitsfx setflag ENGINE_FOGBADGE - checkcode VAR_BADGES + readvar VAR_BADGES scall EcruteakGymActivateRockets setmapscene ECRUTEAK_TIN_TOWER_ENTRANCE, SCENE_FINISHED setevent EVENT_RANG_CLEAR_BELL_1 @@ -160,7 +160,7 @@ EcruteakGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext MORTY, MORTY1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, MORTY, MORTY1 jumpstd gymstatue2 EcruteakGymPlayerStepUpMovement: diff --git a/maps/ElmsLab.asm b/maps/ElmsLab.asm index 17a6d42f1..1ccd8d500 100644 --- a/maps/ElmsLab.asm +++ b/maps/ElmsLab.asm @@ -105,10 +105,10 @@ ElmCheckEverstone: iftrue ElmGiveEverstoneScript checkevent EVENT_TOLD_ELM_ABOUT_TOGEPI_OVER_THE_PHONE iffalse ElmCheckTogepiEgg - writebyte TOGEPI + setval TOGEPI special FindPartyMonThatSpeciesYourTrainerID iftrue ShowElmTogepiScript - writebyte TOGETIC + setval TOGETIC special FindPartyMonThatSpeciesYourTrainerID iftrue ShowElmTogepiScript writetext ElmThoughtEggHatchedText @@ -117,10 +117,10 @@ ElmCheckEverstone: end ElmEggHatchedScript: - writebyte TOGEPI + setval TOGEPI special FindPartyMonThatSpeciesYourTrainerID iftrue ShowElmTogepiScript - writebyte TOGETIC + setval TOGETIC special FindPartyMonThatSpeciesYourTrainerID iftrue ShowElmTogepiScript jump ElmCheckGotEggAgain @@ -173,14 +173,14 @@ CyndaquilPokeBallScript: writetext ChoseStarterText buttonsound waitsfx - pokenamemem CYNDAQUIL, MEM_BUFFER_0 + getmonname STRING_BUFFER_3, CYNDAQUIL writetext ReceivedStarterText playsound SFX_CAUGHT_MON waitsfx buttonsound givepoke CYNDAQUIL, 5, BERRY closetext - checkcode VAR_FACING + readvar VAR_FACING ifequal RIGHT, ElmDirectionsScript applymovement PLAYER, AfterCyndaquilMovement jump ElmDirectionsScript @@ -203,7 +203,7 @@ TotodilePokeBallScript: writetext ChoseStarterText buttonsound waitsfx - pokenamemem TOTODILE, MEM_BUFFER_0 + getmonname STRING_BUFFER_3, TOTODILE writetext ReceivedStarterText playsound SFX_CAUGHT_MON waitsfx @@ -231,7 +231,7 @@ ChikoritaPokeBallScript: writetext ChoseStarterText buttonsound waitsfx - pokenamemem CHIKORITA, MEM_BUFFER_0 + getmonname STRING_BUFFER_3, CHIKORITA writetext ReceivedStarterText playsound SFX_CAUGHT_MON waitsfx @@ -309,7 +309,7 @@ ElmsLabHealingMachine_HealParty: special StubbedTrainerRankings_Healings special HealParty playmusic MUSIC_NONE - writebyte HEALMACHINE_ELMS_LAB + setval HEALMACHINE_ELMS_LAB special HealMachineAnim pause 30 special RestartMapMusic @@ -419,7 +419,7 @@ ElmGiveTicketScript: ElmJumpBackScript1: closetext - checkcode VAR_FACING + readvar VAR_FACING ifequal DOWN, ElmJumpDownScript ifequal UP, ElmJumpUpScript ifequal LEFT, ElmJumpLeftScript @@ -428,7 +428,7 @@ ElmJumpBackScript1: ElmJumpBackScript2: closetext - checkcode VAR_FACING + readvar VAR_FACING ifequal DOWN, ElmJumpUpScript ifequal UP, ElmJumpDownScript ifequal LEFT, ElmJumpRightScript @@ -498,7 +498,7 @@ AideScript_GiveYouBalls: opentext writetext AideText_GiveYouBalls buttonsound - itemtotext POKE_BALL, MEM_BUFFER_1 + getitemname STRING_BUFFER_4, POKE_BALL scall AideScript_ReceiveTheBalls giveitem POKE_BALL, 5 writetext AideText_ExplainBalls diff --git a/maps/FastShip1F.asm b/maps/FastShip1F.asm index 0d3b3fc62..a69b99aa2 100644 --- a/maps/FastShip1F.asm +++ b/maps/FastShip1F.asm @@ -87,7 +87,7 @@ FastShip1FSailor1Script: end .LetThePlayerOut: - checkcode VAR_FACING + readvar VAR_FACING ifequal RIGHT, .YouAreFacingRight applymovement FASTSHIP1F_SAILOR1, MovementData_0x7520e applymovement PLAYER, MovementData_0x75235 diff --git a/maps/FastShipCabins_NNW_NNE_NE.asm b/maps/FastShipCabins_NNW_NNE_NE.asm index 2f52b0c14..a277873c0 100644 --- a/maps/FastShipCabins_NNW_NNE_NE.asm +++ b/maps/FastShipCabins_NNW_NNE_NE.asm @@ -97,7 +97,7 @@ FastShipLazySailorScript: closetext setevent EVENT_FAST_SHIP_LAZY_SAILOR setmapscene FAST_SHIP_B1F, SCENE_FINISHED - checkcode VAR_FACING + readvar VAR_FACING ifequal RIGHT, .Movement2 applymovement FASTSHIPCABINS_NNW_NNE_NE_SAILOR, FastShipLazySailorLeavesMovement1 playsound SFX_EXIT_BUILDING diff --git a/maps/FuchsiaGym.asm b/maps/FuchsiaGym.asm index 24fa2de71..62428fb65 100644 --- a/maps/FuchsiaGym.asm +++ b/maps/FuchsiaGym.asm @@ -214,7 +214,7 @@ FuchsiaGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext JANINE, JANINE1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, JANINE, JANINE1 jumpstd gymstatue2 Movement_NinjaSpin: diff --git a/maps/GoldenrodCity.asm b/maps/GoldenrodCity.asm index 6afe0df5c..4561a5218 100644 --- a/maps/GoldenrodCity.asm +++ b/maps/GoldenrodCity.asm @@ -36,7 +36,7 @@ GoldenrodCity_MapScripts: iffalse .MoveTutorDone checkitem COIN_CASE iffalse .MoveTutorDisappear - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal WEDNESDAY, .MoveTutorAppear ifequal SATURDAY, .MoveTutorAppear .MoveTutorDisappear: @@ -72,21 +72,21 @@ MoveTutorScript: jump .Incompatible .Flamethrower: - writebyte MOVETUTOR_FLAMETHROWER + setval MOVETUTOR_FLAMETHROWER writetext UnknownText_0x1991cf special MoveTutor ifequal FALSE, .TeachMove jump .Incompatible .Thunderbolt: - writebyte MOVETUTOR_THUNDERBOLT + setval MOVETUTOR_THUNDERBOLT writetext UnknownText_0x1991cf special MoveTutor ifequal FALSE, .TeachMove jump .Incompatible .IceBeam: - writebyte MOVETUTOR_ICE_BEAM + setval MOVETUTOR_ICE_BEAM writetext UnknownText_0x1991cf special MoveTutor ifequal FALSE, .TeachMove @@ -128,7 +128,7 @@ MoveTutorScript: writetext UnknownText_0x19918b waitbutton closetext - checkcode VAR_FACING + readvar VAR_FACING ifequal LEFT, .WalkAroundPlayer applymovement GOLDENRODCITY_MOVETUTOR, MovementData_0x198a5f jump .GoInside diff --git a/maps/GoldenrodDeptStore5F.asm b/maps/GoldenrodDeptStore5F.asm index 4734656b3..c0d20b280 100644 --- a/maps/GoldenrodDeptStore5F.asm +++ b/maps/GoldenrodDeptStore5F.asm @@ -13,7 +13,7 @@ GoldenrodDeptStore5F_MapScripts: callback MAPCALLBACK_OBJECTS, .CheckIfSunday .CheckIfSunday: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal SUNDAY, .yes disappear GOLDENRODDEPTSTORE5F_RECEPTIONIST return @@ -59,7 +59,7 @@ GoldenrodDeptStore5FClerkScript: GoldenrodDeptStore5FReceptionistScript: faceplayer opentext - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal SUNDAY, .EventIsOver checkflag ENGINE_GOLDENROD_DEPT_STORE_TM27_RETURN iftrue .EventIsOver diff --git a/maps/GoldenrodDeptStore6F.asm b/maps/GoldenrodDeptStore6F.asm index 6beaf9b8f..779761305 100644 --- a/maps/GoldenrodDeptStore6F.asm +++ b/maps/GoldenrodDeptStore6F.asm @@ -31,7 +31,7 @@ GoldenrodVendingMachine: giveitem FRESH_WATER iffalse .NotEnoughSpace takemoney YOUR_MONEY, GOLDENRODDEPTSTORE6F_FRESH_WATER_PRICE - itemtotext FRESH_WATER, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, FRESH_WATER jump .VendItem .SodaPop: @@ -40,7 +40,7 @@ GoldenrodVendingMachine: giveitem SODA_POP iffalse .NotEnoughSpace takemoney YOUR_MONEY, GOLDENRODDEPTSTORE6F_SODA_POP_PRICE - itemtotext SODA_POP, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, SODA_POP jump .VendItem .Lemonade: @@ -49,7 +49,7 @@ GoldenrodVendingMachine: giveitem LEMONADE iffalse .NotEnoughSpace takemoney YOUR_MONEY, GOLDENRODDEPTSTORE6F_LEMONADE_PRICE - itemtotext LEMONADE, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, LEMONADE jump .VendItem .VendItem: diff --git a/maps/GoldenrodGameCorner.asm b/maps/GoldenrodGameCorner.asm index bd73a350e..5682701ff 100644 --- a/maps/GoldenrodGameCorner.asm +++ b/maps/GoldenrodGameCorner.asm @@ -30,7 +30,7 @@ GoldenrodGameCorner_MapScripts: iffalse .finish checkitem COIN_CASE iffalse .move_tutor_inside - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal WEDNESDAY, .move_tutor_outside ifequal SATURDAY, .move_tutor_outside .move_tutor_inside @@ -77,7 +77,7 @@ GoldenrodGameCornerTMVendor_LoopScript: .Thunder: checkcoins GOLDENRODGAMECORNER_TM25_COINS ifequal HAVE_LESS, GoldenrodGameCornerPrizeVendor_NotEnoughCoinsScript - itemtotext TM_THUNDER, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, TM_THUNDER scall GoldenrodGameCornerPrizeVendor_ConfirmPurchaseScript iffalse GoldenrodGameCornerPrizeVendor_CancelPurchaseScript giveitem TM_THUNDER @@ -88,7 +88,7 @@ GoldenrodGameCornerTMVendor_LoopScript: .Blizzard: checkcoins GOLDENRODGAMECORNER_TM14_COINS ifequal HAVE_LESS, GoldenrodGameCornerPrizeVendor_NotEnoughCoinsScript - itemtotext TM_BLIZZARD, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, TM_BLIZZARD scall GoldenrodGameCornerPrizeVendor_ConfirmPurchaseScript iffalse GoldenrodGameCornerPrizeVendor_CancelPurchaseScript giveitem TM_BLIZZARD @@ -99,7 +99,7 @@ GoldenrodGameCornerTMVendor_LoopScript: .FireBlast: checkcoins GOLDENRODGAMECORNER_TM38_COINS ifequal HAVE_LESS, GoldenrodGameCornerPrizeVendor_NotEnoughCoinsScript - itemtotext TM_FIRE_BLAST, MEM_BUFFER_0 + getitemname STRING_BUFFER_3, TM_FIRE_BLAST scall GoldenrodGameCornerPrizeVendor_ConfirmPurchaseScript iffalse GoldenrodGameCornerPrizeVendor_CancelPurchaseScript giveitem TM_FIRE_BLAST @@ -178,16 +178,16 @@ GoldenrodGameCornerPrizeMonVendorScript: .Abra: checkcoins GOLDENRODGAMECORNER_ABRA_COINS ifequal HAVE_LESS, GoldenrodGameCornerPrizeVendor_NotEnoughCoinsScript - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifequal PARTY_LENGTH, GoldenrodGameCornerPrizeMonVendor_NoRoomForPrizeScript - pokenamemem ABRA, MEM_BUFFER_0 + getmonname STRING_BUFFER_3, ABRA scall GoldenrodGameCornerPrizeVendor_ConfirmPurchaseScript iffalse GoldenrodGameCornerPrizeVendor_CancelPurchaseScript waitsfx playsound SFX_TRANSACTION writetext GoldenrodGameCornerPrizeVendorHereYouGoText waitbutton - writebyte ABRA + setval ABRA special GameCornerPrizeMonCheckDex givepoke ABRA, 5 takecoins GOLDENRODGAMECORNER_ABRA_COINS @@ -196,16 +196,16 @@ GoldenrodGameCornerPrizeMonVendorScript: .Cubone: checkcoins GOLDENRODGAMECORNER_CUBONE_COINS ifequal HAVE_LESS, GoldenrodGameCornerPrizeVendor_NotEnoughCoinsScript - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifequal PARTY_LENGTH, GoldenrodGameCornerPrizeMonVendor_NoRoomForPrizeScript - pokenamemem CUBONE, MEM_BUFFER_0 + getmonname STRING_BUFFER_3, CUBONE scall GoldenrodGameCornerPrizeVendor_ConfirmPurchaseScript iffalse GoldenrodGameCornerPrizeVendor_CancelPurchaseScript waitsfx playsound SFX_TRANSACTION writetext GoldenrodGameCornerPrizeVendorHereYouGoText waitbutton - writebyte CUBONE + setval CUBONE special GameCornerPrizeMonCheckDex givepoke CUBONE, 15 takecoins GOLDENRODGAMECORNER_CUBONE_COINS @@ -214,16 +214,16 @@ GoldenrodGameCornerPrizeMonVendorScript: .Wobbuffet: checkcoins GOLDENRODGAMECORNER_WOBBUFFET_COINS ifequal HAVE_LESS, GoldenrodGameCornerPrizeVendor_NotEnoughCoinsScript - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifequal PARTY_LENGTH, GoldenrodGameCornerPrizeMonVendor_NoRoomForPrizeScript - pokenamemem WOBBUFFET, MEM_BUFFER_0 + getmonname STRING_BUFFER_3, WOBBUFFET scall GoldenrodGameCornerPrizeVendor_ConfirmPurchaseScript iffalse GoldenrodGameCornerPrizeVendor_CancelPurchaseScript waitsfx playsound SFX_TRANSACTION writetext GoldenrodGameCornerPrizeVendorHereYouGoText waitbutton - writebyte WOBBUFFET + setval WOBBUFFET special GameCornerPrizeMonCheckDex givepoke WOBBUFFET, 15 takecoins GOLDENRODGAMECORNER_WOBBUFFET_COINS @@ -301,14 +301,14 @@ GoldenrodGameCornerSlotsMachineScript: random 6 ifequal 0, GoldenrodGameCornerLuckySlotsMachineScript refreshscreen - writebyte FALSE + setval FALSE special SlotMachine closetext end GoldenrodGameCornerLuckySlotsMachineScript: refreshscreen - writebyte TRUE + setval TRUE special SlotMachine closetext end diff --git a/maps/GoldenrodGym.asm b/maps/GoldenrodGym.asm index aa3a6e5ba..5bd01a7e1 100644 --- a/maps/GoldenrodGym.asm +++ b/maps/GoldenrodGym.asm @@ -59,7 +59,7 @@ GoldenrodGymWhitneyScript: playsound SFX_GET_BADGE waitsfx setflag ENGINE_PLAINBADGE - checkcode VAR_BADGES + readvar VAR_BADGES scall GoldenrodGymActivateRockets .GotPlainBadge: writetext WhitneyPlainBadgeText @@ -169,7 +169,7 @@ GoldenrodGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext WHITNEY, WHITNEY1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, WHITNEY, WHITNEY1 jumpstd gymstatue2 BridgetWalksUpMovement: diff --git a/maps/GoldenrodMagnetTrainStation.asm b/maps/GoldenrodMagnetTrainStation.asm index 69836e012..5744e9bdb 100644 --- a/maps/GoldenrodMagnetTrainStation.asm +++ b/maps/GoldenrodMagnetTrainStation.asm @@ -32,7 +32,7 @@ GoldenrodMagnetTrainStationOfficerScript: closetext applymovement GOLDENRODMAGNETTRAINSTATION_OFFICER, MovementData_0x55146 applymovement PLAYER, MovementData_0x5514f - writebyte FALSE + setval FALSE special MagnetTrain warpcheck newloadmap MAPSETUP_TRAIN diff --git a/maps/GoldenrodPokecenter1F.asm b/maps/GoldenrodPokecenter1F.asm index 5a6087f2f..cb5cf9147 100644 --- a/maps/GoldenrodPokecenter1F.asm +++ b/maps/GoldenrodPokecenter1F.asm @@ -14,7 +14,7 @@ GoldenrodPokecenter1FNurseScript: jumpstd pokecenternurse GoldenrodPokecenter1F_GSBallSceneLeft: - writebyte BATTLETOWERACTION_CHECKMOBILEEVENT + setval BATTLETOWERACTION_CHECKMOBILEEVENT special BattleTowerAction ifequal MOBILE_EVENT_OBJECT_GS_BALL, .gsball end @@ -46,7 +46,7 @@ GoldenrodPokecenter1F_GSBallSceneLeft: end GoldenrodPokecenter1F_GSBallSceneRight: - writebyte BATTLETOWERACTION_CHECKMOBILEEVENT + setval BATTLETOWERACTION_CHECKMOBILEEVENT special BattleTowerAction ifequal MOBILE_EVENT_OBJECT_GS_BALL, .gsball end diff --git a/maps/GoldenrodUnderground.asm b/maps/GoldenrodUnderground.asm index 9a17a9590..8f48efc4a 100644 --- a/maps/GoldenrodUnderground.asm +++ b/maps/GoldenrodUnderground.asm @@ -36,8 +36,8 @@ GoldenrodUnderground_MapScripts: clearevent EVENT_SWITCH_12 clearevent EVENT_SWITCH_13 clearevent EVENT_SWITCH_14 - writebyte 0 - copyvartobyte wUndergroundSwitchPositions + setval 0 + writemem wUndergroundSwitchPositions return .CheckBasementKey: @@ -50,7 +50,7 @@ GoldenrodUnderground_MapScripts: return .CheckDayOfWeek: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal MONDAY, .Monday ifequal TUESDAY, .Tuesday ifequal WEDNESDAY, .Wednesday @@ -157,7 +157,7 @@ TrainerPokemaniacDonald: BitterMerchantScript: opentext - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal SUNDAY, .Open ifequal SATURDAY, .Open jump GoldenrodUndergroundScript_ShopClosed @@ -171,7 +171,7 @@ BargainMerchantScript: opentext checkflag ENGINE_GOLDENROD_UNDERGROUND_MERCHANT_CLOSED iftrue GoldenrodUndergroundScript_ShopClosed - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal MONDAY, .CheckMorn jump GoldenrodUndergroundScript_ShopClosed @@ -184,7 +184,7 @@ BargainMerchantScript: OlderHaircutBrotherScript: opentext - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal TUESDAY, .DoHaircut ifequal THURSDAY, .DoHaircut ifequal SATURDAY, .DoHaircut @@ -267,7 +267,7 @@ OlderHaircutBrotherScript: YoungerHaircutBrotherScript: opentext - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal SUNDAY, .DoHaircut ifequal WEDNESDAY, .DoHaircut ifequal FRIDAY, .DoHaircut diff --git a/maps/GoldenrodUndergroundSwitchRoomEntrances.asm b/maps/GoldenrodUndergroundSwitchRoomEntrances.asm index 1ffe461af..cab427d0e 100644 --- a/maps/GoldenrodUndergroundSwitchRoomEntrances.asm +++ b/maps/GoldenrodUndergroundSwitchRoomEntrances.asm @@ -279,9 +279,9 @@ Switch1Script: writetext SwitchRoomText_OffTurnOn yesorno iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle - copybytetovar wUndergroundSwitchPositions - addvar 1 - copyvartobyte wUndergroundSwitchPositions + readmem wUndergroundSwitchPositions + addval 1 + writemem wUndergroundSwitchPositions setevent EVENT_SWITCH_1 jump GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors @@ -289,9 +289,9 @@ Switch1Script: writetext SwitchRoomText_OnTurnOff yesorno iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle - copybytetovar wUndergroundSwitchPositions - addvar -1 - copyvartobyte wUndergroundSwitchPositions + readmem wUndergroundSwitchPositions + addval -1 + writemem wUndergroundSwitchPositions clearevent EVENT_SWITCH_1 jump GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors @@ -304,9 +304,9 @@ Switch2Script: writetext SwitchRoomText_OffTurnOn yesorno iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle - copybytetovar wUndergroundSwitchPositions - addvar 2 - copyvartobyte wUndergroundSwitchPositions + readmem wUndergroundSwitchPositions + addval 2 + writemem wUndergroundSwitchPositions setevent EVENT_SWITCH_2 jump GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors @@ -314,9 +314,9 @@ Switch2Script: writetext SwitchRoomText_OnTurnOff yesorno iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle - copybytetovar wUndergroundSwitchPositions - addvar -2 - copyvartobyte wUndergroundSwitchPositions + readmem wUndergroundSwitchPositions + addval -2 + writemem wUndergroundSwitchPositions clearevent EVENT_SWITCH_2 jump GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors @@ -329,9 +329,9 @@ Switch3Script: writetext SwitchRoomText_OffTurnOn yesorno iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle - copybytetovar wUndergroundSwitchPositions - addvar 3 - copyvartobyte wUndergroundSwitchPositions + readmem wUndergroundSwitchPositions + addval 3 + writemem wUndergroundSwitchPositions setevent EVENT_SWITCH_3 jump GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors @@ -339,9 +339,9 @@ Switch3Script: writetext SwitchRoomText_OnTurnOff yesorno iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle - copybytetovar wUndergroundSwitchPositions - addvar -3 - copyvartobyte wUndergroundSwitchPositions + readmem wUndergroundSwitchPositions + addval -3 + writemem wUndergroundSwitchPositions clearevent EVENT_SWITCH_3 jump GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors @@ -354,8 +354,8 @@ EmergencySwitchScript: writetext SwitchRoomText_OffTurnOn yesorno iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle - writebyte 7 - copyvartobyte wUndergroundSwitchPositions + setval 7 + writemem wUndergroundSwitchPositions setevent EVENT_EMERGENCY_SWITCH setevent EVENT_SWITCH_1 setevent EVENT_SWITCH_2 @@ -366,8 +366,8 @@ EmergencySwitchScript: writetext SwitchRoomText_OnTurnOff yesorno iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle - writebyte 0 - copyvartobyte wUndergroundSwitchPositions + setval 0 + writemem wUndergroundSwitchPositions clearevent EVENT_EMERGENCY_SWITCH clearevent EVENT_SWITCH_1 clearevent EVENT_SWITCH_2 @@ -379,7 +379,7 @@ GoldenrodUndergroundSwitchRoomEntrances_DontToggle: end GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors: - copybytetovar wUndergroundSwitchPositions + readmem wUndergroundSwitchPositions ifequal 0, .Position0 ifequal 1, .Position1 ifequal 2, .Position2 @@ -498,8 +498,8 @@ GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors: scall .Set14 reloadmappart closetext - writebyte 6 - copyvartobyte wUndergroundSwitchPositions + setval 6 + writemem wUndergroundSwitchPositions end .Set4: diff --git a/maps/GoldenrodUndergroundWarehouse.asm b/maps/GoldenrodUndergroundWarehouse.asm index 49c4582d8..0a87959fc 100644 --- a/maps/GoldenrodUndergroundWarehouse.asm +++ b/maps/GoldenrodUndergroundWarehouse.asm @@ -29,8 +29,8 @@ GoldenrodUndergroundWarehouse_MapScripts: clearevent EVENT_SWITCH_12 clearevent EVENT_SWITCH_13 clearevent EVENT_SWITCH_14 - writebyte 0 - copyvartobyte wUndergroundSwitchPositions + setval 0 + writemem wUndergroundSwitchPositions return TrainerGruntM24: diff --git a/maps/HallOfFame.asm b/maps/HallOfFame.asm index 3d9492f14..9c4df3c02 100644 --- a/maps/HallOfFame.asm +++ b/maps/HallOfFame.asm @@ -28,7 +28,7 @@ HallOfFame_MapScripts: applymovement PLAYER, HallOfFame_SlowlyApproachMachine setscene SCENE_FINISHED pause 15 - writebyte HEALMACHINE_HALL_OF_FAME + setval HEALMACHINE_HALL_OF_FAME special HealMachineAnim setevent EVENT_BEAT_ELITE_FOUR setevent EVENT_TELEPORT_GUY diff --git a/maps/IlexForest.asm b/maps/IlexForest.asm index 91f6ad6d2..158efcd3b 100644 --- a/maps/IlexForest.asm +++ b/maps/IlexForest.asm @@ -20,7 +20,7 @@ IlexForest_MapScripts: .FarfetchdCallback: checkevent EVENT_GOT_HM01_CUT iftrue .Static - copybytetovar wFarfetchdPosition + readmem wFarfetchdPosition ifequal 1, .PositionOne ifequal 2, .PositionTwo ifequal 3, .PositionThree @@ -101,7 +101,7 @@ IlexForestCharcoalApprenticeScript: end IlexForestFarfetchdScript: - copybytetovar wFarfetchdPosition + readmem wFarfetchdPosition ifequal 1, .Position1 ifequal 2, .Position2 ifequal 3, .Position3 @@ -126,7 +126,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 25 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 2 + loadmem wFarfetchdPosition, 2 end .Position2: @@ -136,7 +136,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 20, 24 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 3 + loadmem wFarfetchdPosition, 3 end .Position2_Down: @@ -144,7 +144,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 29 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 8 + loadmem wFarfetchdPosition, 8 end .Position3: @@ -154,7 +154,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 29, 22 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 4 + loadmem wFarfetchdPosition, 4 end .Position3_Left: @@ -162,7 +162,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 25 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 2 + loadmem wFarfetchdPosition, 2 end .Position4: @@ -172,7 +172,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 28, 31 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 5 + loadmem wFarfetchdPosition, 5 end .Position4_Up: @@ -180,7 +180,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 20, 24 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 3 + loadmem wFarfetchdPosition, 3 end .Position5: @@ -192,7 +192,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 24, 35 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 6 + loadmem wFarfetchdPosition, 6 end .Position5_Left: @@ -200,7 +200,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 22, 31 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 7 + loadmem wFarfetchdPosition, 7 end .Position5_Up: @@ -208,7 +208,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 29, 22 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 4 + loadmem wFarfetchdPosition, 4 end .Position5_Right: @@ -216,7 +216,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 29, 22 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 4 + loadmem wFarfetchdPosition, 4 end .Position6: @@ -226,7 +226,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 22, 31 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 7 + loadmem wFarfetchdPosition, 7 end .Position6_Right: @@ -234,7 +234,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 28, 31 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 5 + loadmem wFarfetchdPosition, 5 end .Position7: @@ -245,7 +245,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 29 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 8 + loadmem wFarfetchdPosition, 8 end .Position7_Left: @@ -253,7 +253,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 24, 35 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 6 + loadmem wFarfetchdPosition, 6 end .Position7_Down: @@ -261,7 +261,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 28, 31 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 5 + loadmem wFarfetchdPosition, 5 end .Position8: @@ -273,7 +273,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 10, 35 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 9 + loadmem wFarfetchdPosition, 9 end .Position8_Right: @@ -281,7 +281,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 22, 31 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 7 + loadmem wFarfetchdPosition, 7 end .Position8_Up: @@ -290,7 +290,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 25 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 2 + loadmem wFarfetchdPosition, 2 end .Position9: @@ -301,7 +301,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 6, 28 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 10 + loadmem wFarfetchdPosition, 10 appear ILEXFOREST_BLACK_BELT setevent EVENT_CHARCOAL_KILN_BOSS setevent EVENT_HERDED_FARFETCHD @@ -312,7 +312,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 29 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 8 + loadmem wFarfetchdPosition, 8 end .Position9_Down: @@ -320,7 +320,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 29 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar wFarfetchdPosition, 8 + loadmem wFarfetchdPosition, 8 end .Position10: @@ -339,7 +339,7 @@ IlexForestFarfetchdScript: cry FARFETCH_D waitbutton closetext - checkcode VAR_FACING + readvar VAR_FACING end IlexForestCharcoalMasterScript: diff --git a/maps/IndigoPlateauPokecenter1F.asm b/maps/IndigoPlateauPokecenter1F.asm index bd3fb3516..406e5727c 100644 --- a/maps/IndigoPlateauPokecenter1F.asm +++ b/maps/IndigoPlateauPokecenter1F.asm @@ -46,7 +46,7 @@ PlateauRivalBattle1: iffalse PlateauRivalScriptDone checkflag ENGINE_INDIGO_PLATEAU_RIVAL_FIGHT iftrue PlateauRivalScriptDone - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal SUNDAY, PlateauRivalScriptDone ifequal TUESDAY, PlateauRivalScriptDone ifequal THURSDAY, PlateauRivalScriptDone @@ -68,7 +68,7 @@ PlateauRivalBattle2: iffalse PlateauRivalScriptDone checkflag ENGINE_INDIGO_PLATEAU_RIVAL_FIGHT iftrue PlateauRivalScriptDone - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal SUNDAY, PlateauRivalScriptDone ifequal TUESDAY, PlateauRivalScriptDone ifequal THURSDAY, PlateauRivalScriptDone diff --git a/maps/KurtsHouse.asm b/maps/KurtsHouse.asm index 6ff71e297..1087529be 100644 --- a/maps/KurtsHouse.asm +++ b/maps/KurtsHouse.asm @@ -44,7 +44,7 @@ Kurt1: closetext special FadeOutMusic setevent EVENT_AZALEA_TOWN_SLOWPOKETAIL_ROCKET - checkcode VAR_FACING + readvar VAR_FACING ifequal UP, .RunAround turnobject PLAYER, DOWN playsound SFX_FLY @@ -194,7 +194,7 @@ Kurt1: iftrue KurtMakingBallsScript writetext UnknownText_0x18e7fb buttonsound - verbosegiveitem2 LEVEL_BALL, VAR_KURT_APRICORNS + verbosegiveitemvar LEVEL_BALL, VAR_KURT_APRICORNS iffalse .NoRoomForBall clearevent EVENT_GAVE_KURT_RED_APRICORN jump ._ThatTurnedOutGreat @@ -204,7 +204,7 @@ Kurt1: iftrue KurtMakingBallsScript writetext UnknownText_0x18e7fb buttonsound - verbosegiveitem2 LURE_BALL, VAR_KURT_APRICORNS + verbosegiveitemvar LURE_BALL, VAR_KURT_APRICORNS iffalse .NoRoomForBall clearevent EVENT_GAVE_KURT_BLU_APRICORN jump ._ThatTurnedOutGreat @@ -214,7 +214,7 @@ Kurt1: iftrue KurtMakingBallsScript writetext UnknownText_0x18e7fb buttonsound - verbosegiveitem2 MOON_BALL, VAR_KURT_APRICORNS + verbosegiveitemvar MOON_BALL, VAR_KURT_APRICORNS iffalse .NoRoomForBall clearevent EVENT_GAVE_KURT_YLW_APRICORN jump ._ThatTurnedOutGreat @@ -224,7 +224,7 @@ Kurt1: iftrue KurtMakingBallsScript writetext UnknownText_0x18e7fb buttonsound - verbosegiveitem2 FRIEND_BALL, VAR_KURT_APRICORNS + verbosegiveitemvar FRIEND_BALL, VAR_KURT_APRICORNS iffalse .NoRoomForBall clearevent EVENT_GAVE_KURT_GRN_APRICORN jump ._ThatTurnedOutGreat @@ -234,7 +234,7 @@ Kurt1: iftrue KurtMakingBallsScript writetext UnknownText_0x18e7fb buttonsound - verbosegiveitem2 FAST_BALL, VAR_KURT_APRICORNS + verbosegiveitemvar FAST_BALL, VAR_KURT_APRICORNS iffalse .NoRoomForBall clearevent EVENT_GAVE_KURT_WHT_APRICORN jump ._ThatTurnedOutGreat @@ -244,7 +244,7 @@ Kurt1: iftrue KurtMakingBallsScript writetext UnknownText_0x18e7fb buttonsound - verbosegiveitem2 HEAVY_BALL, VAR_KURT_APRICORNS + verbosegiveitemvar HEAVY_BALL, VAR_KURT_APRICORNS iffalse .NoRoomForBall clearevent EVENT_GAVE_KURT_BLK_APRICORN jump ._ThatTurnedOutGreat @@ -254,7 +254,7 @@ Kurt1: iftrue KurtMakingBallsScript writetext UnknownText_0x18e7fb buttonsound - verbosegiveitem2 LOVE_BALL, VAR_KURT_APRICORNS + verbosegiveitemvar LOVE_BALL, VAR_KURT_APRICORNS iffalse .NoRoomForBall clearevent EVENT_GAVE_KURT_PNK_APRICORN jump ._ThatTurnedOutGreat @@ -292,7 +292,7 @@ Kurt1: special FadeOutMusic pause 20 showemote EMOTE_SHOCK, KURTSHOUSE_KURT1, 30 - checkcode VAR_FACING + readvar VAR_FACING ifequal UP, .GSBallRunAround turnobject PLAYER, DOWN playsound SFX_FLY diff --git a/maps/LakeOfRage.asm b/maps/LakeOfRage.asm index fbfaa93bb..910e811c3 100644 --- a/maps/LakeOfRage.asm +++ b/maps/LakeOfRage.asm @@ -32,7 +32,7 @@ LakeOfRage_MapScripts: return .Wesley: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal WEDNESDAY, .WesleyAppears disappear LAKEOFRAGE_WESLEY return @@ -85,7 +85,7 @@ RedGyarados: cry GYARADOS closetext loadwildmon GYARADOS, 30 - writecode VAR_BATTLETYPE, BATTLETYPE_SHINY + loadvar VAR_BATTLETYPE, BATTLETYPE_SHINY startbattle ifequal LOSE, .NotBeaten disappear LAKEOFRAGE_GYARADOS @@ -192,7 +192,7 @@ WesleyScript: opentext checkevent EVENT_GOT_BLACKBELT_FROM_WESLEY iftrue WesleyWednesdayScript - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal WEDNESDAY, WesleyNotWednesdayScript checkevent EVENT_MET_WESLEY_OF_WEDNESDAY iftrue .MetWesley diff --git a/maps/LakeOfRageMagikarpHouse.asm b/maps/LakeOfRageMagikarpHouse.asm index 430d2dd79..9d1a837ef 100644 --- a/maps/LakeOfRageMagikarpHouse.asm +++ b/maps/LakeOfRageMagikarpHouse.asm @@ -37,7 +37,7 @@ MagikarpLengthRaterScript: end .AskedForMagikarp: - writebyte MAGIKARP + setval MAGIKARP special FindPartyMonThatSpecies iffalse .ClearedRocketHideout writetext MagikarpLengthRaterText_YouHaveAMagikarp diff --git a/maps/LavRadioTower1F.asm b/maps/LavRadioTower1F.asm index 45bd0d208..117a13c08 100644 --- a/maps/LavRadioTower1F.asm +++ b/maps/LavRadioTower1F.asm @@ -34,7 +34,7 @@ LavRadioTower1FGentlemanScript: .ReturnedMachinePart: writetext LavRadioTower1FGentlemanText_ReturnedMachinePart buttonsound - stringtotext .expncardname, MEM_BUFFER_1 + getstring STRING_BUFFER_4, .expncardname scall .receiveitem setflag ENGINE_EXPN_CARD .GotExpnCard: diff --git a/maps/MahoganyGym.asm b/maps/MahoganyGym.asm index f578597f0..6f30b15d8 100644 --- a/maps/MahoganyGym.asm +++ b/maps/MahoganyGym.asm @@ -30,7 +30,7 @@ MahoganyGymPryceScript: playsound SFX_GET_BADGE waitsfx setflag ENGINE_GLACIERBADGE - checkcode VAR_BADGES + readvar VAR_BADGES scall MahoganyGymActivateRockets .FightDone: checkevent EVENT_GOT_TM16_ICY_WIND @@ -144,7 +144,7 @@ MahoganyGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext PRYCE, PRYCE1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, PRYCE, PRYCE1 jumpstd gymstatue2 PryceText_Intro: diff --git a/maps/MountMoonSquare.asm b/maps/MountMoonSquare.asm index 29784336e..71bd14204 100644 --- a/maps/MountMoonSquare.asm +++ b/maps/MountMoonSquare.asm @@ -25,7 +25,7 @@ MountMoonSquare_MapScripts: ClefairyDance: checkflag ENGINE_MT_MOON_SQUARE_CLEFAIRY iftrue .NoDancing - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal MONDAY, .NoDancing checktime NITE iffalse .NoDancing diff --git a/maps/MountMortarB1F.asm b/maps/MountMortarB1F.asm index c78b60fbf..c16b9faea 100644 --- a/maps/MountMortarB1F.asm +++ b/maps/MountMortarB1F.asm @@ -32,7 +32,7 @@ MountMortarB1FKiyoScript: writetext UnknownText_0x7e2c0 buttonsound waitsfx - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifequal PARTY_LENGTH, .NoRoom writetext UnknownText_0x7e355 playsound SFX_CAUGHT_MON diff --git a/maps/NationalPark.asm b/maps/NationalPark.asm index 1b87393f5..4050c0b8b 100644 --- a/maps/NationalPark.asm +++ b/maps/NationalPark.asm @@ -73,7 +73,7 @@ TrainerSchoolboyJack1: trainer SCHOOLBOY, JACK1, EVENT_BEAT_SCHOOLBOY_JACK, SchoolboyJack1SeenText, SchoolboyJack1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_SCHOOLBOY_JACK + loadvar VAR_CALLERID, PHONE_SCHOOLBOY_JACK endifjustbattled opentext checkflag ENGINE_JACK @@ -94,14 +94,14 @@ TrainerSchoolboyJack1: askforphonenumber PHONE_SCHOOLBOY_JACK ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext SCHOOLBOY, JACK1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, SCHOOLBOY, JACK1 scall .RegisteredNumber jump .NumberAccepted .Rematch: scall .RematchStd winlosstext SchoolboyJack1BeatenText, 0 - copybytetovar wJackFightCount + readmem wJackFightCount ifequal 4, .Fight4 ifequal 3, .Fight3 ifequal 2, .Fight2 @@ -123,7 +123,7 @@ TrainerSchoolboyJack1: loadtrainer SCHOOLBOY, JACK1 startbattle reloadmapafterbattle - loadvar wJackFightCount, 1 + loadmem wJackFightCount, 1 clearflag ENGINE_JACK end @@ -131,7 +131,7 @@ TrainerSchoolboyJack1: loadtrainer SCHOOLBOY, JACK2 startbattle reloadmapafterbattle - loadvar wJackFightCount, 2 + loadmem wJackFightCount, 2 clearflag ENGINE_JACK end @@ -139,7 +139,7 @@ TrainerSchoolboyJack1: loadtrainer SCHOOLBOY, JACK3 startbattle reloadmapafterbattle - loadvar wJackFightCount, 3 + loadmem wJackFightCount, 3 clearflag ENGINE_JACK end @@ -147,7 +147,7 @@ TrainerSchoolboyJack1: loadtrainer SCHOOLBOY, JACK4 startbattle reloadmapafterbattle - loadvar wJackFightCount, 4 + loadmem wJackFightCount, 4 clearflag ENGINE_JACK end @@ -201,7 +201,7 @@ TrainerPokefanfBeverly1: trainer POKEFANF, BEVERLY1, EVENT_BEAT_POKEFANF_BEVERLY, PokefanfBeverly1SeenText, PokefanfBeverly1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_POKEFAN_BEVERLY + loadvar VAR_CALLERID, PHONE_POKEFAN_BEVERLY endifjustbattled opentext checkflag ENGINE_BEVERLY_HAS_NUGGET @@ -224,7 +224,7 @@ TrainerPokefanfBeverly1: askforphonenumber PHONE_POKEFAN_BEVERLY ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext POKEFANF, BEVERLY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, POKEFANF, BEVERLY1 scall .RegisteredNumber jump .NumberAccepted diff --git a/maps/OaksLab.asm b/maps/OaksLab.asm index 86ac71ac0..b2a765573 100644 --- a/maps/OaksLab.asm +++ b/maps/OaksLab.asm @@ -23,7 +23,7 @@ Oak: buttonsound setevent EVENT_TALKED_TO_OAK_IN_KANTO .CheckBadges: - checkcode VAR_BADGES + readvar VAR_BADGES ifequal NUM_BADGES, .OpenMtSilver ifequal NUM_JOHTO_BADGES, .Complain jump .AhGood diff --git a/maps/OlivineGym.asm b/maps/OlivineGym.asm index 536d3c6e8..27f912594 100644 --- a/maps/OlivineGym.asm +++ b/maps/OlivineGym.asm @@ -25,7 +25,7 @@ OlivineGymJasmineScript: playsound SFX_GET_BADGE waitsfx setflag ENGINE_MINERALBADGE - checkcode VAR_BADGES + readvar VAR_BADGES scall OlivineGymActivateRockets .FightDone: checkevent EVENT_GOT_TM23_IRON_TAIL @@ -89,7 +89,7 @@ OlivineGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext JASMINE, JASMINE1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, JASMINE, JASMINE1 jumpstd gymstatue2 Jasmine_SteelTypeIntro: diff --git a/maps/OlivineLighthouse2F.asm b/maps/OlivineLighthouse2F.asm index 062a3e2b6..b8b730fdd 100644 --- a/maps/OlivineLighthouse2F.asm +++ b/maps/OlivineLighthouse2F.asm @@ -22,7 +22,7 @@ TrainerSailorHuey: trainer SAILOR, HUEY1, EVENT_BEAT_SAILOR_HUEY, SailorHueySeenText, SailorHueyBeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_SAILOR_HUEY + loadvar VAR_CALLERID, PHONE_SAILOR_HUEY endifjustbattled opentext checkflag ENGINE_HUEY @@ -41,14 +41,14 @@ TrainerSailorHuey: askforphonenumber PHONE_SAILOR_HUEY ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext SAILOR, HUEY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, SAILOR, HUEY1 scall .RegisteredNumber jump .NumberAccepted .WantsBattle: scall .Rematch winlosstext SailorHueyBeatenText, 0 - copybytetovar wHueyFightCount + readmem wHueyFightCount ifequal 3, .Fight3 ifequal 2, .Fight2 ifequal 1, .Fight1 @@ -66,7 +66,7 @@ TrainerSailorHuey: loadtrainer SAILOR, HUEY1 startbattle reloadmapafterbattle - loadvar wHueyFightCount, 1 + loadmem wHueyFightCount, 1 clearflag ENGINE_HUEY end @@ -74,7 +74,7 @@ TrainerSailorHuey: loadtrainer SAILOR, HUEY2 startbattle reloadmapafterbattle - loadvar wHueyFightCount, 2 + loadmem wHueyFightCount, 2 clearflag ENGINE_HUEY end @@ -82,7 +82,7 @@ TrainerSailorHuey: loadtrainer SAILOR, HUEY3 startbattle reloadmapafterbattle - loadvar wHueyFightCount, 3 + loadmem wHueyFightCount, 3 clearflag ENGINE_HUEY end diff --git a/maps/OlivineLighthouse6F.asm b/maps/OlivineLighthouse6F.asm index f0121b8ef..c7c545af8 100644 --- a/maps/OlivineLighthouse6F.asm +++ b/maps/OlivineLighthouse6F.asm @@ -67,7 +67,7 @@ OlivineLighthouseJasmine: closetext setevent EVENT_JASMINE_RETURNED_TO_GYM clearevent EVENT_OLIVINE_GYM_JASMINE - checkcode VAR_FACING + readvar VAR_FACING ifequal DOWN, .FacingDown ifequal RIGHT, .FacingRight applymovement OLIVINELIGHTHOUSE6F_JASMINE, MovementData_0x60c68 @@ -107,7 +107,7 @@ OlivineLighthouseAmphy: checkevent EVENT_JASMINE_RETURNED_TO_GYM iftrue .HealthyNow writetext AmphyPalPalooText - writebyte AMPHAROS + setval AMPHAROS special PlaySlowCry buttonsound writetext AmphyBreathingLaboredText diff --git a/maps/OlivinePort.asm b/maps/OlivinePort.asm index 22d96d1df..3e99f456e 100644 --- a/maps/OlivinePort.asm +++ b/maps/OlivinePort.asm @@ -82,7 +82,7 @@ OlivinePortWalkUpToShipScript: opentext checkevent EVENT_FAST_SHIP_FIRST_TIME iffalse .FirstTime - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal SUNDAY, .NextShipMonday ifequal SATURDAY, .NextShipMonday ifequal TUESDAY, .NextShipFriday @@ -147,7 +147,7 @@ OlivinePortSailorAfterHOFScript: iftrue OlivinePortAlreadyRodeScript checkevent EVENT_FAST_SHIP_FIRST_TIME iffalse .FirstTime - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal SUNDAY, .NextShipMonday ifequal SATURDAY, .NextShipMonday ifequal TUESDAY, .NextShipFriday @@ -165,7 +165,7 @@ OlivinePortSailorAfterHOFScript: waitbutton closetext setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_2 - checkcode VAR_FACING + readvar VAR_FACING ifequal RIGHT, .Right applymovement PLAYER, MovementData_0x74a3f jump OlivinePortSailorAtGangwayScript diff --git a/maps/PewterGym.asm b/maps/PewterGym.asm index c5e39a1c2..64773c8f4 100644 --- a/maps/PewterGym.asm +++ b/maps/PewterGym.asm @@ -70,7 +70,7 @@ PewterGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext BROCK, BROCK1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, BROCK, BROCK1 jumpstd gymstatue2 BrockIntroText: diff --git a/maps/PlayersHouse1F.asm b/maps/PlayersHouse1F.asm index b7ab18a81..f86ae16da 100644 --- a/maps/PlayersHouse1F.asm +++ b/maps/PlayersHouse1F.asm @@ -36,7 +36,7 @@ MeetMomScript: opentext writetext ElmsLookingForYouText buttonsound - stringtotext GearName, MEM_BUFFER_1 + getstring STRING_BUFFER_4, GearName scall PlayersHouse1FReceiveItemStd setflag ENGINE_POKEGEAR setflag ENGINE_PHONE_CARD diff --git a/maps/Pokecenter2F.asm b/maps/Pokecenter2F.asm index f07c4b295..0ec1532a8 100644 --- a/maps/Pokecenter2F.asm +++ b/maps/Pokecenter2F.asm @@ -93,7 +93,7 @@ LinkReceptionistScript_Trade: writetext Text_PleaseWait special CheckLinkTimeout iffalse .LinkTimedOut - copybytetovar wOtherPlayerLinkMode + readmem wOtherPlayerLinkMode iffalse .LinkedToFirstGen special CheckBothSelectedSameRoom iffalse .IncompatibleRooms @@ -155,17 +155,17 @@ LinkReceptionistScript_Trade: writetext Text_PleaseComeIn2 waitbutton closetext - writebyte FALSE + setval FALSE end .Mobile_DidNotSave: writetext Text_PleaseComeAgain closetext - writebyte TRUE + setval TRUE end BattleTradeMobile_WalkIn: - applymovement2 Pokecenter2FMobileMobileMovementData_ReceptionistWalksUpAndLeft_LookDown + applymovementlasttalked Pokecenter2FMobileMobileMovementData_ReceptionistWalksUpAndLeft_LookDown applymovement PLAYER, Pokecenter2FMobileMovementData_PlayerWalksIntoMobileBattleRoom end @@ -195,7 +195,7 @@ LinkReceptionistScript_Battle: writetext Text_PleaseWait special CheckLinkTimeout iffalse .LinkTimedOut - copybytetovar wOtherPlayerLinkMode + readmem wOtherPlayerLinkMode iffalse .LinkedToFirstGen special CheckBothSelectedSameRoom iffalse .IncompatibleRooms @@ -259,13 +259,13 @@ LinkReceptionistScript_Battle: writetext Text_PleaseComeIn2 waitbutton closetext - writebyte FALSE + setval FALSE end .Mobile_DidNotSave: writetext Text_PleaseComeAgain closetext - writebyte TRUE + setval TRUE end .SelectThreeMons: @@ -281,11 +281,11 @@ LinkReceptionistScript_Battle: waitbutton .Mobile_DidNotSelect: closetext - writebyte FALSE + setval FALSE end .Mobile_OK: - writebyte TRUE + setval TRUE end Script_TimeCapsuleClosed: @@ -322,7 +322,7 @@ LinkReceptionistScript_TimeCapsule: writetext Text_PleaseWait special CheckLinkTimeout iffalse .LinkTimedOut - copybytetovar wOtherPlayerLinkMode + readmem wOtherPlayerLinkMode iffalse .OK special CheckBothSelectedSameRoom writetext Text_IncompatibleRooms @@ -414,18 +414,18 @@ Script_WalkOutOfMobileBattleRoom: Pokecenter2F_CheckGender: checkflag ENGINE_PLAYER_IS_FEMALE iftrue .Female - applymovement2 Pokecenter2FMovementData_ReceptionistWalksUpAndLeft_LookRight + applymovementlasttalked Pokecenter2FMovementData_ReceptionistWalksUpAndLeft_LookRight applymovement PLAYER, Pokecenter2FMovementData_PlayerTakesThreeStepsUp end .Female: - applymovement2 Pokecenter2FMovementData_ReceptionistWalksUpAndLeft_LookRight_2 + applymovementlasttalked Pokecenter2FMovementData_ReceptionistWalksUpAndLeft_LookRight_2 applymovement PLAYER, Pokecenter2FMovementData_PlayerTakesTwoStepsUp opentext writetext Text_OhPleaseWait waitbutton closetext - applymovement2 Pokecenter2FMovementData_ReceptionistLooksRight + applymovementlasttalked Pokecenter2FMovementData_ReceptionistLooksRight turnobject PLAYER, LEFT opentext writetext Text_ChangeTheLook @@ -433,7 +433,7 @@ Pokecenter2F_CheckGender: closetext playsound SFX_TINGLE applymovement PLAYER, Pokecenter2FMovementData_PlayerSpinsClockwiseEndsFacingRight - writebyte (PAL_NPC_RED << 4) + setval (PAL_NPC_RED << 4) special SetPlayerPalette applymovement PLAYER, Pokecenter2FMovementData_PlayerSpinsClockwiseEndsFacingLeft setflag ENGINE_KRIS_IN_CABLE_CLUB @@ -460,7 +460,7 @@ Script_WalkOutOfLinkTradeRoom: clearflag ENGINE_KRIS_IN_CABLE_CLUB playsound SFX_TINGLE applymovement PLAYER, Pokecenter2FMovementData_PlayerSpinsClockwiseEndsFacingRight - writebyte (PAL_NPC_BLUE << 4) + setval (PAL_NPC_BLUE << 4) special SetPlayerPalette applymovement PLAYER, Pokecenter2FMovementData_PlayerSpinsClockwiseEndsFacingLeft special ReplaceKrisSprite @@ -482,7 +482,7 @@ Script_WalkOutOfLinkBattleRoom: clearflag ENGINE_KRIS_IN_CABLE_CLUB playsound SFX_TINGLE applymovement PLAYER, Pokecenter2FMovementData_PlayerSpinsClockwiseEndsFacingRight - writebyte (PAL_NPC_BLUE << 4) + setval (PAL_NPC_BLUE << 4) special SetPlayerPalette applymovement PLAYER, Pokecenter2FMovementData_PlayerSpinsClockwiseEndsFacingLeft special ReplaceKrisSprite @@ -493,45 +493,45 @@ Script_WalkOutOfLinkBattleRoom: TimeCapsuleScript_CheckPlayerGender: checkflag ENGINE_PLAYER_IS_FEMALE iftrue .Female - checkcode VAR_FACING + readvar VAR_FACING ifequal LEFT, .MaleFacingLeft ifequal RIGHT, .MaleFacingRight - applymovement2 Pokecenter2FMovementData_ReceptionistStepsLeftLooksDown + applymovementlasttalked Pokecenter2FMovementData_ReceptionistStepsLeftLooksDown applymovement PLAYER, Pokecenter2FMovementData_PlayerTakesTwoStepsUp_2 end .MaleFacingLeft: - applymovement2 Pokecenter2FMovementData_ReceptionistStepsLeftLooksDown + applymovementlasttalked Pokecenter2FMovementData_ReceptionistStepsLeftLooksDown applymovement PLAYER, Pokecenter2FMovementData_PlayerWalksLeftAndUp end .MaleFacingRight: - applymovement2 Pokecenter2FMovementData_ReceptionistStepsRightLooksDown + applymovementlasttalked Pokecenter2FMovementData_ReceptionistStepsRightLooksDown applymovement PLAYER, Pokecenter2FMovementData_PlayerWalksRightAndUp end .Female: - checkcode VAR_FACING + readvar VAR_FACING ifequal RIGHT, .FemaleFacingRight ifequal LEFT, .FemaleFacingLeft - applymovement2 Pokecenter2FMovementData_ReceptionistStepsLeftLooksRight_2 + applymovementlasttalked Pokecenter2FMovementData_ReceptionistStepsLeftLooksRight_2 applymovement PLAYER, Pokecenter2FMovementData_PlayerTakesOneStepUp_2 jump .FemaleContinue .FemaleFacingRight: - applymovement2 Pokecenter2FMovementData_ReceptionistStepsRightLooksLeft_2 + applymovementlasttalked Pokecenter2FMovementData_ReceptionistStepsRightLooksLeft_2 applymovement PLAYER, Pokecenter2FMovementData_PlayerTakesOneStepRight jump .FemaleContinue .FemaleFacingLeft: - applymovement2 Pokecenter2FMovementData_ReceptionistStepsLeftLooksRight_2 + applymovementlasttalked Pokecenter2FMovementData_ReceptionistStepsLeftLooksRight_2 applymovement PLAYER, Pokecenter2FMovementData_PlayerTakesOneStepLeft .FemaleContinue: opentext writetext Text_OhPleaseWait waitbutton closetext - checkcode VAR_FACING + readvar VAR_FACING ifnotequal UP, .FemaleChangeApperance turnobject PLAYER, LEFT .FemaleChangeApperance: @@ -541,7 +541,7 @@ TimeCapsuleScript_CheckPlayerGender: closetext playsound SFX_TINGLE applymovement PLAYER, Pokecenter2FMovementData_PlayerSpinsClockwiseEndsFacingRight - writebyte (PAL_NPC_RED << 4) + setval (PAL_NPC_RED << 4) special SetPlayerPalette applymovement PLAYER, Pokecenter2FMovementData_PlayerSpinsClockwiseEndsFacingDown faceobject PLAYER, POKECENTER2F_TIME_CAPSULE_RECEPTIONIST @@ -570,7 +570,7 @@ Script_LeftTimeCapsule: clearflag ENGINE_KRIS_IN_CABLE_CLUB playsound SFX_TINGLE applymovement PLAYER, Pokecenter2FMovementData_PlayerSpinsClockwiseEndsFacingRight - writebyte (PAL_NPC_BLUE << 4) + setval (PAL_NPC_BLUE << 4) special SetPlayerPalette applymovement PLAYER, Pokecenter2FMovementData_PlayerSpinsClockwiseEndsFacingLeft special ReplaceKrisSprite diff --git a/maps/RadioTower1F.asm b/maps/RadioTower1F.asm index 2b7a979e5..d9db0d89c 100644 --- a/maps/RadioTower1F.asm +++ b/maps/RadioTower1F.asm @@ -146,7 +146,7 @@ RadioTower1FRadioCardWomanScript: waitsfx writetext UnknownText_0x5d37b buttonsound - stringtotext .RadioCardText, MEM_BUFFER_1 + getstring STRING_BUFFER_4, .RadioCardText scall .ReceiveItem writetext UnknownText_0x5d3c0 buttonsound diff --git a/maps/RadioTower2F.asm b/maps/RadioTower2F.asm index 036a19dd5..d45e9ea14 100644 --- a/maps/RadioTower2F.asm +++ b/maps/RadioTower2F.asm @@ -106,13 +106,13 @@ Buena: iffalse .Introduction checkflag ENGINE_BUENAS_PASSWORD_2 iftrue .PlayedAlready - checkcode VAR_HOUR + readvar VAR_HOUR ifless 18, .TooEarly checkflag ENGINE_BUENAS_PASSWORD iffalse .TuneIn checkitem BLUE_CARD iffalse .NoBlueCard - checkcode VAR_BLUECARDBALANCE + readvar VAR_BLUECARDBALANCE ifequal 30, .BlueCardCapped0 playmusic MUSIC_BUENAS_PASSWORD writetext UnknownText_0x5de35 @@ -122,7 +122,7 @@ Buena: waitbutton closetext turnobject RADIOTOWER2F_BUENA, RIGHT - checkcode VAR_FACING + readvar VAR_FACING ifnotequal RIGHT, .DontNeedToMove applymovement PLAYER, MovementData_0x5d921 .DontNeedToMove: @@ -140,9 +140,9 @@ Buena: writetext UnknownText_0x5dfc1 waitbutton closetext - checkcode VAR_BLUECARDBALANCE - addvar 1 - writevarcode VAR_BLUECARDBALANCE + readvar VAR_BLUECARDBALANCE + addval 1 + writevar VAR_BLUECARDBALANCE waitsfx playsound SFX_TRANSACTION setflag ENGINE_BUENAS_PASSWORD_2 @@ -155,7 +155,7 @@ Buena: special FadeOutMusic pause 20 special RestartMapMusic - checkcode VAR_BLUECARDBALANCE + readvar VAR_BLUECARDBALANCE ifequal 30, .BlueCardCapped1 end diff --git a/maps/Route16.asm b/maps/Route16.asm index 327b90a85..bbe877245 100644 --- a/maps/Route16.asm +++ b/maps/Route16.asm @@ -5,9 +5,9 @@ Route16_MapScripts: callback MAPCALLBACK_NEWMAP, .AlwaysOnBike .AlwaysOnBike: - checkcode VAR_YCOORD + readvar VAR_YCOORD ifless 5, .CanWalk - checkcode VAR_XCOORD + readvar VAR_XCOORD ifgreater 13, .CanWalk setflag ENGINE_ALWAYS_ON_BIKE return diff --git a/maps/Route26.asm b/maps/Route26.asm index 1d1f81534..0ced38d38 100644 --- a/maps/Route26.asm +++ b/maps/Route26.asm @@ -28,7 +28,7 @@ TrainerCooltrainermGaven3: trainer COOLTRAINERM, GAVEN3, EVENT_BEAT_COOLTRAINERM_GAVEN, CooltrainermGaven3SeenText, CooltrainermGaven3BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_COOLTRAINERM_GAVEN + loadvar VAR_CALLERID, PHONE_COOLTRAINERM_GAVEN endifjustbattled opentext checkflag ENGINE_GAVEN @@ -49,14 +49,14 @@ TrainerCooltrainermGaven3: askforphonenumber PHONE_COOLTRAINERM_GAVEN ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext COOLTRAINERM, GAVEN3, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, COOLTRAINERM, GAVEN3 scall .RegisteredNumber jump .NumberAccepted .WantsBattle: scall .Rematch winlosstext CooltrainermGaven3BeatenText, 0 - copybytetovar wGavenFightCount + readmem wGavenFightCount ifequal 2, .Fight2 ifequal 1, .Fight1 ifequal 0, .LoadFight0 @@ -70,7 +70,7 @@ TrainerCooltrainermGaven3: loadtrainer COOLTRAINERM, GAVEN3 startbattle reloadmapafterbattle - loadvar wGavenFightCount, 1 + loadmem wGavenFightCount, 1 clearflag ENGINE_GAVEN end @@ -78,7 +78,7 @@ TrainerCooltrainermGaven3: loadtrainer COOLTRAINERM, GAVEN1 startbattle reloadmapafterbattle - loadvar wGavenFightCount, 2 + loadmem wGavenFightCount, 2 clearflag ENGINE_GAVEN end @@ -132,7 +132,7 @@ TrainerCooltrainerfBeth1: trainer COOLTRAINERF, BETH1, EVENT_BEAT_COOLTRAINERF_BETH, CooltrainerfBeth1SeenText, CooltrainerfBeth1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_COOLTRAINERF_BETH + loadvar VAR_CALLERID, PHONE_COOLTRAINERF_BETH endifjustbattled opentext checkflag ENGINE_BETH @@ -153,14 +153,14 @@ TrainerCooltrainerfBeth1: askforphonenumber PHONE_COOLTRAINERF_BETH ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext COOLTRAINERF, BETH1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, COOLTRAINERF, BETH1 scall .RegisteredNumber jump .NumberAccepted .WantsBattle: scall .Rematch winlosstext CooltrainerfBeth1BeatenText, 0 - copybytetovar wBethFightCount + readmem wBethFightCount ifequal 2, .Fight2 ifequal 1, .Fight1 ifequal 0, .LoadFight0 @@ -174,7 +174,7 @@ TrainerCooltrainerfBeth1: loadtrainer COOLTRAINERF, BETH1 startbattle reloadmapafterbattle - loadvar wBethFightCount, 1 + loadmem wBethFightCount, 1 clearflag ENGINE_BETH end @@ -182,7 +182,7 @@ TrainerCooltrainerfBeth1: loadtrainer COOLTRAINERF, BETH2 startbattle reloadmapafterbattle - loadvar wBethFightCount, 2 + loadmem wBethFightCount, 2 clearflag ENGINE_BETH end diff --git a/maps/Route27.asm b/maps/Route27.asm index bd39db0b7..ec2e8f9a5 100644 --- a/maps/Route27.asm +++ b/maps/Route27.asm @@ -61,7 +61,7 @@ TrainerBirdKeeperJose2: trainer BIRD_KEEPER, JOSE2, EVENT_BEAT_BIRD_KEEPER_JOSE2, BirdKeeperJose2SeenText, BirdKeeperJose2BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_BIRDKEEPER_JOSE + loadvar VAR_CALLERID, PHONE_BIRDKEEPER_JOSE endifjustbattled opentext checkflag ENGINE_JOSE @@ -84,14 +84,14 @@ TrainerBirdKeeperJose2: askforphonenumber PHONE_BIRDKEEPER_JOSE ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext BIRD_KEEPER, JOSE2, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BIRD_KEEPER, JOSE2 scall .RegisteredNumber jump .NumberAccepted .WantsBattle: scall .Rematch winlosstext BirdKeeperJose2BeatenText, 0 - copybytetovar wJoseFightCount + readmem wJoseFightCount ifequal 2, .Fight2 ifequal 1, .Fight1 ifequal 0, .LoadFight0 @@ -105,7 +105,7 @@ TrainerBirdKeeperJose2: loadtrainer BIRD_KEEPER, JOSE2 startbattle reloadmapafterbattle - loadvar wJoseFightCount, 1 + loadmem wJoseFightCount, 1 clearflag ENGINE_JOSE end @@ -113,7 +113,7 @@ TrainerBirdKeeperJose2: loadtrainer BIRD_KEEPER, JOSE1 startbattle reloadmapafterbattle - loadvar wJoseFightCount, 2 + loadmem wJoseFightCount, 2 clearflag ENGINE_JOSE end @@ -196,7 +196,7 @@ TrainerCooltrainerfReena: trainer COOLTRAINERF, REENA1, EVENT_BEAT_COOLTRAINERF_REENA, CooltrainerfReenaSeenText, CooltrainerfReenaBeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_COOLTRAINERF_REENA + loadvar VAR_CALLERID, PHONE_COOLTRAINERF_REENA endifjustbattled opentext checkflag ENGINE_REENA @@ -217,14 +217,14 @@ TrainerCooltrainerfReena: askforphonenumber PHONE_COOLTRAINERF_REENA ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext COOLTRAINERF, REENA1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, COOLTRAINERF, REENA1 scall .RegisteredNumber jump .NumberAccepted .WantsBattle: scall .Rematch winlosstext CooltrainerfReenaBeatenText, 0 - copybytetovar wReenaFightCount + readmem wReenaFightCount ifequal 2, .Fight2 ifequal 1, .Fight1 ifequal 0, .LoadFight0 @@ -238,7 +238,7 @@ TrainerCooltrainerfReena: loadtrainer COOLTRAINERF, REENA1 startbattle reloadmapafterbattle - loadvar wReenaFightCount, 1 + loadmem wReenaFightCount, 1 clearflag ENGINE_REENA end @@ -246,7 +246,7 @@ TrainerCooltrainerfReena: loadtrainer COOLTRAINERF, REENA2 startbattle reloadmapafterbattle - loadvar wReenaFightCount, 2 + loadmem wReenaFightCount, 2 clearflag ENGINE_REENA end diff --git a/maps/Route29.asm b/maps/Route29.asm index 3b3322f13..392396f55 100644 --- a/maps/Route29.asm +++ b/maps/Route29.asm @@ -31,7 +31,7 @@ Route29_MapScripts: return .DoesTuscanyAppear: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal TUESDAY, .TuscanyDisappears appear ROUTE29_TUSCANY return @@ -105,7 +105,7 @@ Script_RefusedTutorial2: CatchingTutorialDudeScript: faceplayer opentext - checkcode VAR_BOXSPACE + readvar VAR_BOXSPACE ifequal 0, .BoxFull checkevent EVENT_LEARNED_TO_CATCH_POKEMON iftrue .BoxFull @@ -169,7 +169,7 @@ TuscanyScript: opentext checkevent EVENT_GOT_PINK_BOW_FROM_TUSCANY iftrue TuscanyTuesdayScript - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal TUESDAY, TuscanyNotTuesdayScript checkevent EVENT_MET_TUSCANY_OF_TUESDAY iftrue .MetTuscany diff --git a/maps/Route30.asm b/maps/Route30.asm index a7d066601..90c4ece81 100644 --- a/maps/Route30.asm +++ b/maps/Route30.asm @@ -40,7 +40,7 @@ TrainerYoungsterJoey: trainer YOUNGSTER, JOEY1, EVENT_BEAT_YOUNGSTER_JOEY, YoungsterJoey1SeenText, YoungsterJoey1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_YOUNGSTER_JOEY + loadvar VAR_CALLERID, PHONE_YOUNGSTER_JOEY endifjustbattled opentext checkflag ENGINE_JOEY @@ -61,14 +61,14 @@ TrainerYoungsterJoey: askforphonenumber PHONE_YOUNGSTER_JOEY ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext YOUNGSTER, JOEY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, YOUNGSTER, JOEY1 scall .RegisteredNumber jump .NumberAccepted .Rematch: scall .RematchStd winlosstext YoungsterJoey1BeatenText, 0 - copybytetovar wJoeyFightCount + readmem wJoeyFightCount ifequal 4, .Fight4 ifequal 3, .Fight3 ifequal 2, .Fight2 @@ -90,7 +90,7 @@ TrainerYoungsterJoey: loadtrainer YOUNGSTER, JOEY1 startbattle reloadmapafterbattle - loadvar wJoeyFightCount, 1 + loadmem wJoeyFightCount, 1 clearflag ENGINE_JOEY end @@ -98,7 +98,7 @@ TrainerYoungsterJoey: loadtrainer YOUNGSTER, JOEY2 startbattle reloadmapafterbattle - loadvar wJoeyFightCount, 2 + loadmem wJoeyFightCount, 2 clearflag ENGINE_JOEY end @@ -106,7 +106,7 @@ TrainerYoungsterJoey: loadtrainer YOUNGSTER, JOEY3 startbattle reloadmapafterbattle - loadvar wJoeyFightCount, 3 + loadmem wJoeyFightCount, 3 clearflag ENGINE_JOEY end @@ -114,7 +114,7 @@ TrainerYoungsterJoey: loadtrainer YOUNGSTER, JOEY4 startbattle reloadmapafterbattle - loadvar wJoeyFightCount, 4 + loadmem wJoeyFightCount, 4 clearflag ENGINE_JOEY end diff --git a/maps/Route31.asm b/maps/Route31.asm index 1a7ba7205..e0a1a9db4 100644 --- a/maps/Route31.asm +++ b/maps/Route31.asm @@ -26,7 +26,7 @@ TrainerBugCatcherWade1: trainer BUG_CATCHER, WADE1, EVENT_BEAT_BUG_CATCHER_WADE, BugCatcherWade1SeenText, BugCatcherWade1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_BUG_CATCHER_WADE + loadvar VAR_CALLERID, PHONE_BUG_CATCHER_WADE endifjustbattled opentext checkflag ENGINE_WADE @@ -49,14 +49,14 @@ TrainerBugCatcherWade1: askforphonenumber PHONE_BUG_CATCHER_WADE ifequal PHONE_CONTACTS_FULL, .PhoneFullSTD ifequal PHONE_CONTACT_REFUSED, .DeclinedNumberSTD - trainertotext BUG_CATCHER, WADE1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BUG_CATCHER, WADE1 scall .RegisterNumberSTD jump .AcceptedNumberSTD .WadeRematch: scall .RematchSTD winlosstext BugCatcherWade1BeatenText, 0 - copybytetovar wWadeFightCount + readmem wWadeFightCount ifequal 4, .Fight4 ifequal 3, .Fight3 ifequal 2, .Fight2 @@ -78,7 +78,7 @@ TrainerBugCatcherWade1: loadtrainer BUG_CATCHER, WADE1 startbattle reloadmapafterbattle - loadvar wWadeFightCount, 1 + loadmem wWadeFightCount, 1 clearflag ENGINE_WADE end @@ -86,7 +86,7 @@ TrainerBugCatcherWade1: loadtrainer BUG_CATCHER, WADE2 startbattle reloadmapafterbattle - loadvar wWadeFightCount, 2 + loadmem wWadeFightCount, 2 clearflag ENGINE_WADE end @@ -94,7 +94,7 @@ TrainerBugCatcherWade1: loadtrainer BUG_CATCHER, WADE3 startbattle reloadmapafterbattle - loadvar wWadeFightCount, 3 + loadmem wWadeFightCount, 3 clearflag ENGINE_WADE end @@ -102,7 +102,7 @@ TrainerBugCatcherWade1: loadtrainer BUG_CATCHER, WADE4 startbattle reloadmapafterbattle - loadvar wWadeFightCount, 4 + loadmem wWadeFightCount, 4 clearflag ENGINE_WADE end diff --git a/maps/Route32.asm b/maps/Route32.asm index bab9ce66a..d4d5dac1a 100644 --- a/maps/Route32.asm +++ b/maps/Route32.asm @@ -33,7 +33,7 @@ Route32_MapScripts: end .Frieda: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal FRIDAY, .FriedaAppears disappear ROUTE32_FRIEDA return @@ -167,7 +167,7 @@ TrainerFisherRalph1: trainer FISHER, RALPH1, EVENT_BEAT_FISHER_RALPH, FisherRalph1SeenText, FisherRalph1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_FISHER_RALPH + loadvar VAR_CALLERID, PHONE_FISHER_RALPH endifjustbattled opentext checkflag ENGINE_RALPH @@ -190,14 +190,14 @@ TrainerFisherRalph1: askforphonenumber PHONE_FISHER_RALPH ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext FISHER, RALPH1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, FISHER, RALPH1 scall .RegisteredNumber jump .NumberAccepted .Rematch: scall .RematchStd winlosstext FisherRalph1BeatenText, 0 - copybytetovar wRalphFightCount + readmem wRalphFightCount ifequal 4, .Fight4 ifequal 3, .Fight3 ifequal 2, .Fight2 @@ -219,7 +219,7 @@ TrainerFisherRalph1: loadtrainer FISHER, RALPH1 startbattle reloadmapafterbattle - loadvar wRalphFightCount, 1 + loadmem wRalphFightCount, 1 clearflag ENGINE_RALPH end @@ -227,7 +227,7 @@ TrainerFisherRalph1: loadtrainer FISHER, RALPH2 startbattle reloadmapafterbattle - loadvar wRalphFightCount, 2 + loadmem wRalphFightCount, 2 clearflag ENGINE_RALPH end @@ -235,7 +235,7 @@ TrainerFisherRalph1: loadtrainer FISHER, RALPH3 startbattle reloadmapafterbattle - loadvar wRalphFightCount, 3 + loadmem wRalphFightCount, 3 clearflag ENGINE_RALPH end @@ -243,7 +243,7 @@ TrainerFisherRalph1: loadtrainer FISHER, RALPH4 startbattle reloadmapafterbattle - loadvar wRalphFightCount, 4 + loadmem wRalphFightCount, 4 clearflag ENGINE_RALPH end @@ -303,7 +303,7 @@ TrainerPicnickerLiz1: trainer PICNICKER, LIZ1, EVENT_BEAT_PICNICKER_LIZ, PicnickerLiz1SeenText, PicnickerLiz1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_PICNICKER_LIZ + loadvar VAR_CALLERID, PHONE_PICNICKER_LIZ endifjustbattled opentext checkflag ENGINE_LIZ @@ -324,14 +324,14 @@ TrainerPicnickerLiz1: askforphonenumber PHONE_PICNICKER_LIZ ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext PICNICKER, LIZ1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, PICNICKER, LIZ1 scall .RegisteredNumber jump .NumberAccepted .Rematch: scall .RematchStd winlosstext PicnickerLiz1BeatenText, 0 - copybytetovar wLizFightCount + readmem wLizFightCount ifequal 4, .Fight4 ifequal 3, .Fight3 ifequal 2, .Fight2 @@ -353,7 +353,7 @@ TrainerPicnickerLiz1: loadtrainer PICNICKER, LIZ1 startbattle reloadmapafterbattle - loadvar wLizFightCount, 1 + loadmem wLizFightCount, 1 clearflag ENGINE_LIZ end @@ -361,7 +361,7 @@ TrainerPicnickerLiz1: loadtrainer PICNICKER, LIZ2 startbattle reloadmapafterbattle - loadvar wLizFightCount, 2 + loadmem wLizFightCount, 2 clearflag ENGINE_LIZ end @@ -369,7 +369,7 @@ TrainerPicnickerLiz1: loadtrainer PICNICKER, LIZ3 startbattle reloadmapafterbattle - loadvar wLizFightCount, 3 + loadmem wLizFightCount, 3 clearflag ENGINE_LIZ end @@ -377,7 +377,7 @@ TrainerPicnickerLiz1: loadtrainer PICNICKER, LIZ4 startbattle reloadmapafterbattle - loadvar wLizFightCount, 4 + loadmem wLizFightCount, 4 clearflag ENGINE_LIZ end @@ -454,7 +454,7 @@ FriedaScript: opentext checkevent EVENT_GOT_POISON_BARB_FROM_FRIEDA iftrue .Friday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal FRIDAY, .NotFriday checkevent EVENT_MET_FRIEDA_OF_FRIDAY iftrue .MetFrieda diff --git a/maps/Route33.asm b/maps/Route33.asm index eb88baaa6..f8e771626 100644 --- a/maps/Route33.asm +++ b/maps/Route33.asm @@ -15,7 +15,7 @@ TrainerHikerAnthony: trainer HIKER, ANTHONY2, EVENT_BEAT_HIKER_ANTHONY, HikerAnthony2SeenText, HikerAnthony2BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_HIKER_ANTHONY + loadvar VAR_CALLERID, PHONE_HIKER_ANTHONY endifjustbattled opentext checkflag ENGINE_ANTHONY @@ -38,14 +38,14 @@ TrainerHikerAnthony: askforphonenumber PHONE_HIKER_ANTHONY ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext HIKER, ANTHONY2, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, HIKER, ANTHONY2 scall .RegisteredNumber jump .NumberAccepted .Rematch: scall .RematchStd winlosstext HikerAnthony2BeatenText, 0 - copybytetovar wAnthonyFightCount + readmem wAnthonyFightCount ifequal 4, .Fight4 ifequal 3, .Fight3 ifequal 2, .Fight2 @@ -67,7 +67,7 @@ TrainerHikerAnthony: loadtrainer HIKER, ANTHONY2 startbattle reloadmapafterbattle - loadvar wAnthonyFightCount, 1 + loadmem wAnthonyFightCount, 1 clearflag ENGINE_ANTHONY end @@ -75,7 +75,7 @@ TrainerHikerAnthony: loadtrainer HIKER, ANTHONY1 startbattle reloadmapafterbattle - loadvar wAnthonyFightCount, 2 + loadmem wAnthonyFightCount, 2 clearflag ENGINE_ANTHONY end @@ -83,7 +83,7 @@ TrainerHikerAnthony: loadtrainer HIKER, ANTHONY3 startbattle reloadmapafterbattle - loadvar wAnthonyFightCount, 3 + loadmem wAnthonyFightCount, 3 clearflag ENGINE_ANTHONY end @@ -91,7 +91,7 @@ TrainerHikerAnthony: loadtrainer HIKER, ANTHONY4 startbattle reloadmapafterbattle - loadvar wAnthonyFightCount, 4 + loadmem wAnthonyFightCount, 4 clearflag ENGINE_ANTHONY end diff --git a/maps/Route34.asm b/maps/Route34.asm index 8e52a151e..a72d65a8d 100644 --- a/maps/Route34.asm +++ b/maps/Route34.asm @@ -59,7 +59,7 @@ DayCareManScript_Outside: closetext ifequal TRUE, .end_fail clearflag ENGINE_DAY_CARE_MAN_HAS_EGG - checkcode VAR_FACING + readvar VAR_FACING ifequal RIGHT, .walk_around_player applymovement ROUTE34_GRAMPS, Route34MovementData_DayCareManWalksBackInside playsound SFX_ENTER_DOOR @@ -89,7 +89,7 @@ TrainerCamperTodd1: trainer CAMPER, TODD1, EVENT_BEAT_CAMPER_TODD, CamperTodd1SeenText, CamperTodd1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_CAMPER_TODD + loadvar VAR_CALLERID, PHONE_CAMPER_TODD endifjustbattled opentext checkflag ENGINE_TODD @@ -112,14 +112,14 @@ TrainerCamperTodd1: askforphonenumber PHONE_CAMPER_TODD ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext CAMPER, TODD1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, CAMPER, TODD1 scall .RegisteredNumber jump .NumberAccepted .Rematch: scall .RematchStd winlosstext CamperTodd1BeatenText, 0 - copybytetovar wToddFightCount + readmem wToddFightCount ifequal 4, .Fight4 ifequal 3, .Fight3 ifequal 2, .Fight2 @@ -141,7 +141,7 @@ TrainerCamperTodd1: loadtrainer CAMPER, TODD1 startbattle reloadmapafterbattle - loadvar wToddFightCount, 1 + loadmem wToddFightCount, 1 clearflag ENGINE_TODD end @@ -149,7 +149,7 @@ TrainerCamperTodd1: loadtrainer CAMPER, TODD2 startbattle reloadmapafterbattle - loadvar wToddFightCount, 2 + loadmem wToddFightCount, 2 clearflag ENGINE_TODD end @@ -157,7 +157,7 @@ TrainerCamperTodd1: loadtrainer CAMPER, TODD3 startbattle reloadmapafterbattle - loadvar wToddFightCount, 3 + loadmem wToddFightCount, 3 clearflag ENGINE_TODD end @@ -165,7 +165,7 @@ TrainerCamperTodd1: loadtrainer CAMPER, TODD4 startbattle reloadmapafterbattle - loadvar wToddFightCount, 4 + loadmem wToddFightCount, 4 clearflag ENGINE_TODD end @@ -214,7 +214,7 @@ TrainerPicnickerGina1: trainer PICNICKER, GINA1, EVENT_BEAT_PICNICKER_GINA, PicnickerGina1SeenText, PicnickerGina1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_PICNICKER_GINA + loadvar VAR_CALLERID, PHONE_PICNICKER_GINA endifjustbattled opentext checkflag ENGINE_GINA @@ -237,14 +237,14 @@ TrainerPicnickerGina1: askforphonenumber PHONE_PICNICKER_GINA ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext PICNICKER, GINA1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, PICNICKER, GINA1 scall .RegisteredNumber jump .NumberAccepted .Rematch: scall .RematchStd winlosstext PicnickerGina1BeatenText, 0 - copybytetovar wGinaFightCount + readmem wGinaFightCount ifequal 4, .Fight4 ifequal 3, .Fight3 ifequal 2, .Fight2 @@ -266,7 +266,7 @@ TrainerPicnickerGina1: loadtrainer PICNICKER, GINA1 startbattle reloadmapafterbattle - loadvar wGinaFightCount, 1 + loadmem wGinaFightCount, 1 clearflag ENGINE_GINA end @@ -274,7 +274,7 @@ TrainerPicnickerGina1: loadtrainer PICNICKER, GINA2 startbattle reloadmapafterbattle - loadvar wGinaFightCount, 2 + loadmem wGinaFightCount, 2 clearflag ENGINE_GINA end @@ -282,7 +282,7 @@ TrainerPicnickerGina1: loadtrainer PICNICKER, GINA3 startbattle reloadmapafterbattle - loadvar wGinaFightCount, 3 + loadmem wGinaFightCount, 3 clearflag ENGINE_GINA end @@ -290,7 +290,7 @@ TrainerPicnickerGina1: loadtrainer PICNICKER, GINA4 startbattle reloadmapafterbattle - loadvar wGinaFightCount, 4 + loadmem wGinaFightCount, 4 clearflag ENGINE_GINA end diff --git a/maps/Route35.asm b/maps/Route35.asm index 48c05058d..dc3f17014 100644 --- a/maps/Route35.asm +++ b/maps/Route35.asm @@ -31,7 +31,7 @@ TrainerJugglerIrwin: trainer JUGGLER, IRWIN1, EVENT_BEAT_JUGGLER_IRWIN, JugglerIrwin1SeenText, JugglerIrwin1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_JUGGLER_IRWIN + loadvar VAR_CALLERID, PHONE_JUGGLER_IRWIN endifjustbattled opentext checkcellnum PHONE_JUGGLER_IRWIN @@ -50,7 +50,7 @@ TrainerJugglerIrwin: askforphonenumber PHONE_JUGGLER_IRWIN ifequal PHONE_CONTACTS_FULL, Route35PhoneFullM ifequal PHONE_CONTACT_REFUSED, Route35NumberDeclinedM - trainertotext JUGGLER, IRWIN1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, JUGGLER, IRWIN1 scall Route35RegisteredNumberM jump Route35NumberAcceptedM @@ -130,7 +130,7 @@ TrainerBugCatcherArnie: trainer BUG_CATCHER, ARNIE1, EVENT_BEAT_BUG_CATCHER_ARNIE, BugCatcherArnieSeenText, BugCatcherArnieBeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_BUG_CATCHER_ARNIE + loadvar VAR_CALLERID, PHONE_BUG_CATCHER_ARNIE endifjustbattled opentext checkflag ENGINE_ARNIE @@ -153,14 +153,14 @@ TrainerBugCatcherArnie: askforphonenumber PHONE_BUG_CATCHER_ARNIE ifequal PHONE_CONTACTS_FULL, Route35PhoneFullM ifequal PHONE_CONTACT_REFUSED, Route35NumberDeclinedM - trainertotext BUG_CATCHER, ARNIE1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BUG_CATCHER, ARNIE1 scall Route35RegisteredNumberM jump Route35NumberAcceptedM .WantsBattle: scall Route35RematchM winlosstext BugCatcherArnieBeatenText, 0 - copybytetovar wArnieFightCount + readmem wArnieFightCount ifequal 4, .Fight4 ifequal 3, .Fight3 ifequal 2, .Fight2 @@ -182,7 +182,7 @@ TrainerBugCatcherArnie: loadtrainer BUG_CATCHER, ARNIE1 startbattle reloadmapafterbattle - loadvar wArnieFightCount, 1 + loadmem wArnieFightCount, 1 clearflag ENGINE_ARNIE end @@ -190,7 +190,7 @@ TrainerBugCatcherArnie: loadtrainer BUG_CATCHER, ARNIE2 startbattle reloadmapafterbattle - loadvar wArnieFightCount, 2 + loadmem wArnieFightCount, 2 clearflag ENGINE_ARNIE end @@ -198,7 +198,7 @@ TrainerBugCatcherArnie: loadtrainer BUG_CATCHER, ARNIE3 startbattle reloadmapafterbattle - loadvar wArnieFightCount, 3 + loadmem wArnieFightCount, 3 clearflag ENGINE_ARNIE end @@ -206,7 +206,7 @@ TrainerBugCatcherArnie: loadtrainer BUG_CATCHER, ARNIE4 startbattle reloadmapafterbattle - loadvar wArnieFightCount, 4 + loadmem wArnieFightCount, 4 clearflag ENGINE_ARNIE end diff --git a/maps/Route35GoldenrodGate.asm b/maps/Route35GoldenrodGate.asm index 71a1e510b..5608b57f9 100644 --- a/maps/Route35GoldenrodGate.asm +++ b/maps/Route35GoldenrodGate.asm @@ -23,7 +23,7 @@ RandyScript: writetext UnknownText_0x69e48 buttonsound waitsfx - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifequal PARTY_LENGTH, .partyfull writetext UnknownText_0x69eb8 playsound SFX_KEY_ITEM diff --git a/maps/Route35NationalParkGate.asm b/maps/Route35NationalParkGate.asm index 6a24bba32..4f9026979 100644 --- a/maps/Route35NationalParkGate.asm +++ b/maps/Route35NationalParkGate.asm @@ -34,7 +34,7 @@ Route35NationalParkGate_MapScripts: return .CheckIfContestAvailable: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal TUESDAY, .SetContestOfficer ifequal THURSDAY, .SetContestOfficer ifequal SATURDAY, .SetContestOfficer @@ -55,9 +55,9 @@ Route35NationalParkGate_MapScripts: applymovement PLAYER, MovementData_0x6a2e2 turnobject ROUTE35NATIONALPARKGATE_OFFICER1, RIGHT opentext - checkcode VAR_CONTESTMINUTES - addvar 1 - vartomem MEM_BUFFER_0 + readvar VAR_CONTESTMINUTES + addval 1 + getnum STRING_BUFFER_3 writetext UnknownText_0x6a79a yesorno iffalse .GoBackToContest @@ -78,7 +78,7 @@ Route35NationalParkGate_MapScripts: end Route35OfficerScriptContest: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal SUNDAY, Route35NationalParkGate_NoContestToday ifequal MONDAY, Route35NationalParkGate_NoContestToday ifequal WEDNESDAY, Route35NationalParkGate_NoContestToday @@ -91,7 +91,7 @@ Route35OfficerScriptContest: writetext UnknownText_0x6a2eb yesorno iffalse Route35NationalParkGate_DeclinedToParticipate - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifgreater 1, Route35NationalParkGate_LeaveTheRestBehind special ContestDropOffMons clearevent EVENT_LEFT_MONS_WITH_CONTEST_OFFICER @@ -116,7 +116,7 @@ Route35NationalParkGate_OkayToProceed: end Route35NationalParkGate_EnterContest: - checkcode VAR_FACING + readvar VAR_FACING ifequal LEFT, Route35NationalParkGate_FacingLeft applymovement PLAYER, MovementData_0x6a2e5 end @@ -126,9 +126,9 @@ Route35NationalParkGate_FacingLeft: end Route35NationalParkGate_LeaveTheRestBehind: - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifless PARTY_LENGTH, Route35NationalParkGate_LessThanFullParty - checkcode VAR_BOXSPACE + readvar VAR_BOXSPACE ifequal 0, Route35NationalParkGate_NoRoomInBox Route35NationalParkGate_LessThanFullParty: diff --git a/maps/Route36.asm b/maps/Route36.asm index d9845bc30..bb490d1df 100644 --- a/maps/Route36.asm +++ b/maps/Route36.asm @@ -24,7 +24,7 @@ Route36_MapScripts: end .ArthurCallback: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal THURSDAY, .ArthurAppears disappear ROUTE36_ARTHUR return @@ -106,7 +106,7 @@ Route36FloriaScript: waitbutton closetext clearevent EVENT_FLORIA_AT_FLOWER_SHOP - checkcode VAR_FACING + readvar VAR_FACING ifequal UP, .Up applymovement ROUTE36_FLORIA, FloriaMovement1 disappear ROUTE36_FLORIA @@ -168,7 +168,7 @@ TrainerSchoolboyAlan1: trainer SCHOOLBOY, ALAN1, EVENT_BEAT_SCHOOLBOY_ALAN, SchoolboyAlan1SeenText, SchoolboyAlan1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_SCHOOLBOY_ALAN + loadvar VAR_CALLERID, PHONE_SCHOOLBOY_ALAN endifjustbattled opentext checkflag ENGINE_ALAN @@ -191,14 +191,14 @@ TrainerSchoolboyAlan1: askforphonenumber PHONE_SCHOOLBOY_ALAN ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext SCHOOLBOY, ALAN1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, SCHOOLBOY, ALAN1 scall .RegisteredNumber jump .NumberAccepted .ChooseRematch: scall .Rematch winlosstext SchoolboyAlan1BeatenText, 0 - copybytetovar wAlanFightCount + readmem wAlanFightCount ifequal 4, .Fight4 ifequal 3, .Fight3 ifequal 2, .Fight2 @@ -220,7 +220,7 @@ TrainerSchoolboyAlan1: loadtrainer SCHOOLBOY, ALAN1 startbattle reloadmapafterbattle - loadvar wAlanFightCount, 1 + loadmem wAlanFightCount, 1 clearflag ENGINE_ALAN end @@ -228,7 +228,7 @@ TrainerSchoolboyAlan1: loadtrainer SCHOOLBOY, ALAN2 startbattle reloadmapafterbattle - loadvar wAlanFightCount, 2 + loadmem wAlanFightCount, 2 clearflag ENGINE_ALAN end @@ -236,7 +236,7 @@ TrainerSchoolboyAlan1: loadtrainer SCHOOLBOY, ALAN3 startbattle reloadmapafterbattle - loadvar wAlanFightCount, 3 + loadmem wAlanFightCount, 3 clearflag ENGINE_ALAN end @@ -244,7 +244,7 @@ TrainerSchoolboyAlan1: loadtrainer SCHOOLBOY, ALAN4 startbattle reloadmapafterbattle - loadvar wAlanFightCount, 4 + loadmem wAlanFightCount, 4 clearflag ENGINE_ALAN end @@ -318,7 +318,7 @@ ArthurScript: opentext checkevent EVENT_GOT_HARD_STONE_FROM_ARTHUR iftrue .AlreadyGotStone - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal THURSDAY, ArthurNotThursdayScript checkevent EVENT_MET_ARTHUR_OF_THURSDAY iftrue .MetArthur diff --git a/maps/Route36NationalParkGate.asm b/maps/Route36NationalParkGate.asm index 86c415813..30ea3abf3 100644 --- a/maps/Route36NationalParkGate.asm +++ b/maps/Route36NationalParkGate.asm @@ -45,7 +45,7 @@ Route36NationalParkGate_MapScripts: .CheckIfContestAvailable: checkevent EVENT_WARPED_FROM_ROUTE_35_NATIONAL_PARK_GATE iftrue .Return - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal TUESDAY, .SetContestOfficer ifequal THURSDAY, .SetContestOfficer ifequal SATURDAY, .SetContestOfficer @@ -64,9 +64,9 @@ Route36NationalParkGate_MapScripts: .LeavingContestEarly: turnobject PLAYER, UP opentext - checkcode VAR_CONTESTMINUTES - addvar 1 - vartomem MEM_BUFFER_0 + readvar VAR_CONTESTMINUTES + addval 1 + getnum STRING_BUFFER_3 writetext UnknownText_0x6b284 yesorno iffalse .GoBackToContest @@ -139,7 +139,7 @@ Route36NationalParkGate_MapScripts: end Route36OfficerScriptContest: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal SUNDAY, _ContestNotOn ifequal MONDAY, _ContestNotOn ifequal WEDNESDAY, _ContestNotOn @@ -152,7 +152,7 @@ Route36OfficerScriptContest: writetext UnknownText_0x6add5 yesorno iffalse .DecidedNotToJoinContest - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifgreater 1, .LeaveMonsWithOfficer special ContestDropOffMons clearevent EVENT_LEFT_MONS_WITH_CONTEST_OFFICER @@ -179,9 +179,9 @@ Route36OfficerScriptContest: end .LeaveMonsWithOfficer: - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifless PARTY_LENGTH, .ContinueLeavingMons - checkcode VAR_BOXSPACE + readvar VAR_BOXSPACE ifequal 0, .BoxFull .ContinueLeavingMons: special CheckFirstMonIsEgg diff --git a/maps/Route37.asm b/maps/Route37.asm index 98cf05d20..326e0a870 100644 --- a/maps/Route37.asm +++ b/maps/Route37.asm @@ -14,7 +14,7 @@ Route37_MapScripts: callback MAPCALLBACK_OBJECTS, .Sunny .Sunny: - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal SUNDAY, .SunnyAppears disappear ROUTE37_SUNNY return @@ -61,7 +61,7 @@ SunnyScript: opentext checkevent EVENT_GOT_MAGNET_FROM_SUNNY iftrue SunnySundayScript - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal SUNDAY, SunnyNotSundayScript checkevent EVENT_MET_SUNNY_OF_SUNDAY iftrue .MetSunny diff --git a/maps/Route38.asm b/maps/Route38.asm index d8cd9370b..ee49612e7 100644 --- a/maps/Route38.asm +++ b/maps/Route38.asm @@ -38,7 +38,7 @@ TrainerLassDana1: trainer LASS, DANA1, EVENT_BEAT_LASS_DANA, LassDana1SeenText, LassDana1BeatenText, 0, .Script .Script - writecode VAR_CALLERID, PHONE_LASS_DANA + loadvar VAR_CALLERID, PHONE_LASS_DANA endifjustbattled opentext checkflag ENGINE_DANA @@ -61,14 +61,14 @@ TrainerLassDana1: askforphonenumber PHONE_LASS_DANA ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .DeclinedPhoneNumber - trainertotext LASS, DANA1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, LASS, DANA1 scall .RegisteredPhoneNumber jump .NumberAccepted .DanaRematch: scall .Rematch winlosstext LassDana1BeatenText, 0 - copybytetovar wDanaFightCount + readmem wDanaFightCount ifequal 4, .Fight4 ifequal 3, .Fight3 ifequal 2, .Fight2 @@ -90,7 +90,7 @@ TrainerLassDana1: loadtrainer LASS, DANA1 startbattle reloadmapafterbattle - loadvar wDanaFightCount, 1 + loadmem wDanaFightCount, 1 clearflag ENGINE_DANA end @@ -98,7 +98,7 @@ TrainerLassDana1: loadtrainer LASS, DANA2 startbattle reloadmapafterbattle - loadvar wDanaFightCount, 2 + loadmem wDanaFightCount, 2 clearflag ENGINE_DANA end @@ -106,7 +106,7 @@ TrainerLassDana1: loadtrainer LASS, DANA3 startbattle reloadmapafterbattle - loadvar wDanaFightCount, 3 + loadmem wDanaFightCount, 3 clearflag ENGINE_DANA end @@ -114,7 +114,7 @@ TrainerLassDana1: loadtrainer LASS, DANA4 startbattle reloadmapafterbattle - loadvar wDanaFightCount, 4 + loadmem wDanaFightCount, 4 clearflag ENGINE_DANA end @@ -176,7 +176,7 @@ TrainerSchoolboyChad1: trainer SCHOOLBOY, CHAD1, EVENT_BEAT_SCHOOLBOY_CHAD, SchoolboyChad1SeenText, SchoolboyChad1BeatenText, 0, .Script .Script - writecode VAR_CALLERID, PHONE_SCHOOLBOY_CHAD + loadvar VAR_CALLERID, PHONE_SCHOOLBOY_CHAD endifjustbattled opentext checkflag ENGINE_CHAD @@ -197,14 +197,14 @@ TrainerSchoolboyChad1: askforphonenumber PHONE_SCHOOLBOY_CHAD ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .SaidNo - trainertotext SCHOOLBOY, CHAD1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, SCHOOLBOY, CHAD1 scall .RegisteredChad jump .HaveChadsNumber .ChadRematch: scall .Rematch winlosstext SchoolboyChad1BeatenText, 0 - copybytetovar wChadFightCount + readmem wChadFightCount ifequal 4, .Fight4 ifequal 3, .Fight3 ifequal 2, .Fight2 @@ -226,7 +226,7 @@ TrainerSchoolboyChad1: loadtrainer SCHOOLBOY, CHAD1 startbattle reloadmapafterbattle - loadvar wChadFightCount, 1 + loadmem wChadFightCount, 1 clearflag ENGINE_CHAD end @@ -234,7 +234,7 @@ TrainerSchoolboyChad1: loadtrainer SCHOOLBOY, CHAD2 startbattle reloadmapafterbattle - loadvar wChadFightCount, 2 + loadmem wChadFightCount, 2 clearflag ENGINE_CHAD end @@ -242,7 +242,7 @@ TrainerSchoolboyChad1: loadtrainer SCHOOLBOY, CHAD3 startbattle reloadmapafterbattle - loadvar wChadFightCount, 3 + loadmem wChadFightCount, 3 clearflag ENGINE_CHAD end @@ -250,7 +250,7 @@ TrainerSchoolboyChad1: loadtrainer SCHOOLBOY, CHAD4 startbattle reloadmapafterbattle - loadvar wChadFightCount, 4 + loadmem wChadFightCount, 4 clearflag ENGINE_CHAD end diff --git a/maps/Route39.asm b/maps/Route39.asm index 8a37655a2..498ac690f 100644 --- a/maps/Route39.asm +++ b/maps/Route39.asm @@ -27,7 +27,7 @@ TrainerPokefanmDerek: trainer POKEFANM, DEREK1, EVENT_BEAT_POKEFANM_DEREK, PokefanmDerekSeenText, PokefanmDerekBeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_POKEFANM_DEREK + loadvar VAR_CALLERID, PHONE_POKEFANM_DEREK endifjustbattled opentext checkflag ENGINE_DEREK_HAS_NUGGET @@ -50,7 +50,7 @@ TrainerPokefanmDerek: askforphonenumber PHONE_POKEFANM_DEREK ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext POKEFANM, DEREK1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, POKEFANM, DEREK1 scall .RegisteredNumber jump .NumberAccepted diff --git a/maps/Route39Barn.asm b/maps/Route39Barn.asm index ce3522d9a..2fae06697 100644 --- a/maps/Route39Barn.asm +++ b/maps/Route39Barn.asm @@ -49,7 +49,7 @@ MoomooScript: checkevent EVENT_HEALED_MOOMOO iftrue .HappyCow writetext MoomooWeakMooText - writebyte MILTANK + setval MILTANK special PlaySlowCry buttonsound writetext Route39BarnItsCryIsWeakText @@ -67,9 +67,9 @@ MoomooScript: checkitem BERRY iffalse .NoBerriesInBag takeitem BERRY - copybytetovar wMooMooBerries - addvar 1 - copyvartobyte wMooMooBerries + readmem wMooMooBerries + addval 1 + writemem wMooMooBerries ifequal 3, .ThreeBerries ifequal 5, .FiveBerries ifequal 7, .SevenBerries diff --git a/maps/Route40.asm b/maps/Route40.asm index 4d58dfe98..b7c8d79ca 100644 --- a/maps/Route40.asm +++ b/maps/Route40.asm @@ -20,7 +20,7 @@ Route40_MapScripts: .MonicaCallback: clearevent EVENT_BATTLE_TOWER_OUTSIDE_SAILOR - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal MONDAY, .MonicaAppears disappear ROUTE40_MONICA return @@ -95,7 +95,7 @@ MonicaScript: opentext checkevent EVENT_GOT_SHARP_BEAK_FROM_MONICA iftrue .Monday - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifnotequal MONDAY, .NotMonday checkevent EVENT_MET_MONICA_OF_MONDAY iftrue .MetMonica diff --git a/maps/Route42.asm b/maps/Route42.asm index ff154b6c0..8ea0b1b07 100644 --- a/maps/Route42.asm +++ b/maps/Route42.asm @@ -38,7 +38,7 @@ TrainerFisherTully: trainer FISHER, TULLY1, EVENT_BEAT_FISHER_TULLY, FisherTullySeenText, FisherTullyBeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_FISHER_TULLY + loadvar VAR_CALLERID, PHONE_FISHER_TULLY endifjustbattled opentext checkflag ENGINE_TULLY @@ -61,14 +61,14 @@ TrainerFisherTully: askforphonenumber PHONE_FISHER_TULLY ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext FISHER, TULLY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, FISHER, TULLY1 scall .RegisteredNumber jump .NumberAccepted .WantsBattle: scall .Rematch winlosstext FisherTullyBeatenText, 0 - copybytetovar wTullyFightCount + readmem wTullyFightCount ifequal 3, .Fight3 ifequal 2, .Fight2 ifequal 1, .Fight1 @@ -86,7 +86,7 @@ TrainerFisherTully: loadtrainer FISHER, TULLY1 startbattle reloadmapafterbattle - loadvar wTullyFightCount, 1 + loadmem wTullyFightCount, 1 clearflag ENGINE_TULLY end @@ -94,7 +94,7 @@ TrainerFisherTully: loadtrainer FISHER, TULLY2 startbattle reloadmapafterbattle - loadvar wTullyFightCount, 2 + loadmem wTullyFightCount, 2 clearflag ENGINE_TULLY end @@ -102,7 +102,7 @@ TrainerFisherTully: loadtrainer FISHER, TULLY3 startbattle reloadmapafterbattle - loadvar wTullyFightCount, 3 + loadmem wTullyFightCount, 3 clearflag ENGINE_TULLY end diff --git a/maps/Route43.asm b/maps/Route43.asm index ebb0e2371..bffbcffde 100644 --- a/maps/Route43.asm +++ b/maps/Route43.asm @@ -50,7 +50,7 @@ TrainerPokemaniacBrent: trainer POKEMANIAC, BRENT1, EVENT_BEAT_POKEMANIAC_BRENT, PokemaniacBrentSeenText, PokemaniacBrentBeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_POKEMANIAC_BRENT + loadvar VAR_CALLERID, PHONE_POKEMANIAC_BRENT endifjustbattled opentext checkflag ENGINE_BRENT @@ -71,14 +71,14 @@ TrainerPokemaniacBrent: askforphonenumber PHONE_POKEMANIAC_BRENT ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext POKEMANIAC, BRENT1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, POKEMANIAC, BRENT1 scall .RegisteredNumber jump .NumberAccepted .WantsBattle: scall .Rematch winlosstext PokemaniacBrentBeatenText, 0 - copybytetovar wBrentFightCount + readmem wBrentFightCount ifequal 3, .Fight3 ifequal 2, .Fight2 ifequal 1, .Fight1 @@ -96,7 +96,7 @@ TrainerPokemaniacBrent: loadtrainer POKEMANIAC, BRENT1 startbattle reloadmapafterbattle - loadvar wBrentFightCount, 1 + loadmem wBrentFightCount, 1 clearflag ENGINE_BRENT end @@ -104,7 +104,7 @@ TrainerPokemaniacBrent: loadtrainer POKEMANIAC, BRENT2 startbattle reloadmapafterbattle - loadvar wBrentFightCount, 2 + loadmem wBrentFightCount, 2 clearflag ENGINE_BRENT end @@ -112,7 +112,7 @@ TrainerPokemaniacBrent: loadtrainer POKEMANIAC, BRENT3 startbattle reloadmapafterbattle - loadvar wBrentFightCount, 3 + loadmem wBrentFightCount, 3 clearflag ENGINE_BRENT end @@ -177,7 +177,7 @@ TrainerPicnickerTiffany: trainer PICNICKER, TIFFANY3, EVENT_BEAT_PICNICKER_TIFFANY, PicnickerTiffanySeenText, PicnickerTiffanyBeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_PICNICKER_TIFFANY + loadvar VAR_CALLERID, PHONE_PICNICKER_TIFFANY endifjustbattled opentext checkflag ENGINE_TIFFANY @@ -202,14 +202,14 @@ TrainerPicnickerTiffany: askforphonenumber PHONE_PICNICKER_TIFFANY ifequal PHONE_CONTACTS_FULL, .PhoneFull ifequal PHONE_CONTACT_REFUSED, .NumberDeclined - trainertotext PICNICKER, TIFFANY3, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, PICNICKER, TIFFANY3 scall .RegisteredNumber jump .NumberAccepted .WantsBattle: scall .Rematch winlosstext PicnickerTiffanyBeatenText, 0 - copybytetovar wTiffanyFightCount + readmem wTiffanyFightCount ifequal 3, .Fight3 ifequal 2, .Fight2 ifequal 1, .Fight1 @@ -227,7 +227,7 @@ TrainerPicnickerTiffany: loadtrainer PICNICKER, TIFFANY3 startbattle reloadmapafterbattle - loadvar wTiffanyFightCount, 1 + loadmem wTiffanyFightCount, 1 clearflag ENGINE_TIFFANY end @@ -235,7 +235,7 @@ TrainerPicnickerTiffany: loadtrainer PICNICKER, TIFFANY1 startbattle reloadmapafterbattle - loadvar wTiffanyFightCount, 2 + loadmem wTiffanyFightCount, 2 clearflag ENGINE_TIFFANY end @@ -243,7 +243,7 @@ TrainerPicnickerTiffany: loadtrainer PICNICKER, TIFFANY2 startbattle reloadmapafterbattle - loadvar wTiffanyFightCount, 3 + loadmem wTiffanyFightCount, 3 clearflag ENGINE_TIFFANY end diff --git a/maps/Route43Gate.asm b/maps/Route43Gate.asm index 69869991d..9d9b11994 100644 --- a/maps/Route43Gate.asm +++ b/maps/Route43Gate.asm @@ -32,7 +32,7 @@ Route43Gate_MapScripts: .RocketTakeover: playmusic MUSIC_ROCKET_ENCOUNTER - checkcode VAR_FACING + readvar VAR_FACING ifequal DOWN, RocketScript_Southbound ifequal UP, RocketScript_Northbound setscene SCENE_FINISHED diff --git a/maps/Route44.asm b/maps/Route44.asm index f5f9f24bf..f1837c732 100644 --- a/maps/Route44.asm +++ b/maps/Route44.asm @@ -20,7 +20,7 @@ TrainerBirdKeeperVance1: trainer BIRD_KEEPER, VANCE1, EVENT_BEAT_BIRD_KEEPER_VANCE, BirdKeeperVance1SeenText, BirdKeeperVance1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_BIRDKEEPER_VANCE + loadvar VAR_CALLERID, PHONE_BIRDKEEPER_VANCE endifjustbattled opentext checkflag ENGINE_VANCE @@ -41,14 +41,14 @@ TrainerBirdKeeperVance1: askforphonenumber PHONE_BIRDKEEPER_VANCE ifequal PHONE_CONTACTS_FULL, Route44PhoneFullM ifequal PHONE_CONTACT_REFUSED, Route44NumberDeclinedM - trainertotext BIRD_KEEPER, VANCE1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BIRD_KEEPER, VANCE1 scall Route44RegisteredNumberM jump Route44NumberAcceptedM .WantsBattle: scall Route44RematchM winlosstext BirdKeeperVance1BeatenText, 0 - copybytetovar wVanceFightCount + readmem wVanceFightCount ifequal 2, .Fight2 ifequal 1, .Fight1 ifequal 0, .LoadFight0 @@ -62,7 +62,7 @@ TrainerBirdKeeperVance1: loadtrainer BIRD_KEEPER, VANCE1 startbattle reloadmapafterbattle - loadvar wVanceFightCount, 1 + loadmem wVanceFightCount, 1 clearflag ENGINE_VANCE end @@ -70,7 +70,7 @@ TrainerBirdKeeperVance1: loadtrainer BIRD_KEEPER, VANCE2 startbattle reloadmapafterbattle - loadvar wVanceFightCount, 2 + loadmem wVanceFightCount, 2 clearflag ENGINE_VANCE end @@ -162,7 +162,7 @@ TrainerFisherWilton1: trainer FISHER, WILTON1, EVENT_BEAT_FISHER_WILTON, FisherWilton1SeenText, FisherWilton1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_FISHER_WILTON + loadvar VAR_CALLERID, PHONE_FISHER_WILTON endifjustbattled opentext checkflag ENGINE_WILTON @@ -185,14 +185,14 @@ TrainerFisherWilton1: askforphonenumber PHONE_FISHER_WILTON ifequal PHONE_CONTACTS_FULL, Route44PhoneFullM ifequal PHONE_CONTACT_REFUSED, Route44NumberDeclinedM - trainertotext FISHER, WILTON1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, FISHER, WILTON1 scall Route44RegisteredNumberM jump Route44NumberAcceptedM .WantsBattle: scall Route44RematchM winlosstext FisherWilton1BeatenText, 0 - copybytetovar wWiltonFightCount + readmem wWiltonFightCount ifequal 2, .Fight2 ifequal 1, .Fight1 ifequal 0, .LoadFight0 @@ -206,7 +206,7 @@ TrainerFisherWilton1: loadtrainer FISHER, WILTON1 startbattle reloadmapafterbattle - loadvar wWiltonFightCount, 1 + loadmem wWiltonFightCount, 1 clearflag ENGINE_WILTON end @@ -214,7 +214,7 @@ TrainerFisherWilton1: loadtrainer FISHER, WILTON2 startbattle reloadmapafterbattle - loadvar wWiltonFightCount, 2 + loadmem wWiltonFightCount, 2 clearflag ENGINE_WILTON end diff --git a/maps/Route45.asm b/maps/Route45.asm index e26525441..1bfcef972 100644 --- a/maps/Route45.asm +++ b/maps/Route45.asm @@ -22,7 +22,7 @@ TrainerBlackbeltKenji: trainer BLACKBELT_T, KENJI3, EVENT_BEAT_BLACKBELT_KENJI, BlackbeltKenji3SeenText, BlackbeltKenji3BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_BLACKBELT_KENJI + loadvar VAR_CALLERID, PHONE_BLACKBELT_KENJI endifjustbattled opentext checkcellnum PHONE_BLACKBELT_KENJI @@ -42,12 +42,12 @@ TrainerBlackbeltKenji: askforphonenumber PHONE_BLACKBELT_KENJI ifequal PHONE_CONTACTS_FULL, Route45PhoneFullM ifequal PHONE_CONTACT_REFUSED, Route45NumberDeclinedM - trainertotext BLACKBELT_T, KENJI3, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, BLACKBELT_T, KENJI3 scall Route45RegisteredNumberM jump Route45NumberAcceptedM .Registered: - checkcode VAR_KENJI_BREAK + readvar VAR_KENJI_BREAK ifnotequal 1, Route45NumberAcceptedM checktime MORN iftrue .Morning @@ -148,7 +148,7 @@ TrainerHikerParry: trainer HIKER, PARRY3, EVENT_BEAT_HIKER_PARRY, HikerParry3SeenText, HikerParry3BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_HIKER_PARRY + loadvar VAR_CALLERID, PHONE_HIKER_PARRY endifjustbattled opentext checkflag ENGINE_PARRY @@ -169,14 +169,14 @@ TrainerHikerParry: askforphonenumber PHONE_HIKER_PARRY ifequal PHONE_CONTACTS_FULL, Route45PhoneFullM ifequal PHONE_CONTACT_REFUSED, Route45NumberDeclinedM - trainertotext HIKER, PARRY1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, HIKER, PARRY1 scall Route45RegisteredNumberM jump Route45NumberAcceptedM .WantsBattle: scall Route45RematchM winlosstext HikerParry3BeatenText, 0 - copybytetovar wParryFightCount + readmem wParryFightCount ifequal 2, .Fight2 ifequal 1, .Fight1 ifequal 0, .LoadFight0 @@ -190,7 +190,7 @@ TrainerHikerParry: loadtrainer HIKER, PARRY3 startbattle reloadmapafterbattle - loadvar wParryFightCount, 1 + loadmem wParryFightCount, 1 clearflag ENGINE_PARRY end @@ -198,7 +198,7 @@ TrainerHikerParry: loadtrainer HIKER, PARRY1 startbattle reloadmapafterbattle - loadvar wParryFightCount, 2 + loadmem wParryFightCount, 2 clearflag ENGINE_PARRY end diff --git a/maps/Route46.asm b/maps/Route46.asm index 4fc813c35..fca785099 100644 --- a/maps/Route46.asm +++ b/maps/Route46.asm @@ -26,7 +26,7 @@ TrainerPicnickerErin1: trainer PICNICKER, ERIN1, EVENT_BEAT_PICNICKER_ERIN, PicnickerErin1SeenText, PicnickerErin1BeatenText, 0, .Script .Script: - writecode VAR_CALLERID, PHONE_PICNICKER_ERIN + loadvar VAR_CALLERID, PHONE_PICNICKER_ERIN endifjustbattled opentext checkflag ENGINE_ERIN @@ -47,14 +47,14 @@ TrainerPicnickerErin1: askforphonenumber PHONE_PICNICKER_ERIN ifequal PHONE_CONTACTS_FULL, Route46PhoneFullF ifequal PHONE_CONTACT_REFUSED, Route46NumberDeclinedF - trainertotext PICNICKER, ERIN1, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, PICNICKER, ERIN1 scall Route46RegisteredNumberF jump Route46NumberAcceptedF .WantsBattle: scall Route46RematchF winlosstext PicnickerErin1BeatenText, 0 - copybytetovar wErinFightCount + readmem wErinFightCount ifequal 2, .Fight2 ifequal 1, .Fight1 ifequal 0, .LoadFight0 @@ -68,7 +68,7 @@ TrainerPicnickerErin1: loadtrainer PICNICKER, ERIN1 startbattle reloadmapafterbattle - loadvar wErinFightCount, 1 + loadmem wErinFightCount, 1 clearflag ENGINE_ERIN end @@ -76,7 +76,7 @@ TrainerPicnickerErin1: loadtrainer PICNICKER, ERIN2 startbattle reloadmapafterbattle - loadvar wErinFightCount, 2 + loadmem wErinFightCount, 2 clearflag ENGINE_ERIN end diff --git a/maps/RuinsOfAlphAerodactylChamber.asm b/maps/RuinsOfAlphAerodactylChamber.asm index a42c2b20c..c5aa497f4 100644 --- a/maps/RuinsOfAlphAerodactylChamber.asm +++ b/maps/RuinsOfAlphAerodactylChamber.asm @@ -47,7 +47,7 @@ RuinsOfAlphAerodactylChamber_MapScripts: RuinsOfAlphAerodactylChamberPuzzle: refreshscreen - writebyte UNOWNPUZZLE_AERODACTYL + setval UNOWNPUZZLE_AERODACTYL special UnownPuzzle closetext iftrue .PuzzleComplete @@ -81,7 +81,7 @@ RuinsOfAlphAerodactylChamberDescriptionSign: RuinsOfAlphAerodactylChamberWallPatternLeft: opentext writetext RuinsOfAlphAerodactylChamberWallPatternLeftText - writebyte UNOWNWORDS_LIGHT + setval UNOWNWORDS_LIGHT special DisplayUnownWords closetext end @@ -91,7 +91,7 @@ RuinsOfAlphAerodactylChamberWallPatternRight: iftrue .WallOpen opentext writetext RuinsOfAlphAerodactylChamberWallPatternRightText - writebyte UNOWNWORDS_LIGHT + setval UNOWNWORDS_LIGHT special DisplayUnownWords closetext end diff --git a/maps/RuinsOfAlphHoOhChamber.asm b/maps/RuinsOfAlphHoOhChamber.asm index 0a8aeefc5..4c30e0466 100644 --- a/maps/RuinsOfAlphHoOhChamber.asm +++ b/maps/RuinsOfAlphHoOhChamber.asm @@ -48,7 +48,7 @@ RuinsOfAlphHoOhChamber_MapScripts: RuinsOfAlphHoOhChamberPuzzle: refreshscreen - writebyte UNOWNPUZZLE_HO_OH + setval UNOWNPUZZLE_HO_OH special UnownPuzzle closetext iftrue .PuzzleComplete @@ -82,7 +82,7 @@ RuinsOfAlphHoOhChamberDescriptionSign: RuinsOfAlphHoOhChamberWallPatternLeft: opentext writetext RuinsOfAlphHoOhChamberWallPatternLeftText - writebyte UNOWNWORDS_HO_OH + setval UNOWNWORDS_HO_OH special DisplayUnownWords closetext end @@ -92,7 +92,7 @@ RuinsOfAlphHoOhChamberWallPatternRight: iftrue .WallOpen opentext writetext RuinsOfAlphHoOhChamberWallPatternRightText - writebyte UNOWNWORDS_HO_OH + setval UNOWNWORDS_HO_OH special DisplayUnownWords closetext end diff --git a/maps/RuinsOfAlphKabutoChamber.asm b/maps/RuinsOfAlphKabutoChamber.asm index 09453956b..f5e11cb24 100644 --- a/maps/RuinsOfAlphKabutoChamber.asm +++ b/maps/RuinsOfAlphKabutoChamber.asm @@ -54,7 +54,7 @@ RuinsOfAlphKabutoChamberReceptionistScript: RuinsOfAlphKabutoChamberPuzzle: refreshscreen - writebyte UNOWNPUZZLE_KABUTO + setval UNOWNPUZZLE_KABUTO special UnownPuzzle closetext iftrue .PuzzleComplete @@ -83,7 +83,7 @@ RuinsOfAlphKabutoChamberPuzzle: RuinsOfAlphKabutoChamberScientistScript: faceplayer opentext - checkcode VAR_UNOWNCOUNT + readvar VAR_UNOWNCOUNT ifequal NUM_UNOWN, .AllUnownCaught checkevent EVENT_WALL_OPENED_IN_KABUTO_CHAMBER iftrue .WallOpen @@ -119,7 +119,7 @@ RuinsOfAlphKabutoChamberDescriptionSign: RuinsOfAlphKabutoChamberWallPatternLeft: opentext writetext RuinsOfAlphKabutoChamberWallPatternLeftText - writebyte UNOWNWORDS_ESCAPE + setval UNOWNWORDS_ESCAPE special DisplayUnownWords closetext end @@ -129,7 +129,7 @@ RuinsOfAlphKabutoChamberWallPatternRight: iftrue .WallOpen opentext writetext RuinsOfAlphKabutoChamberWallPatternRightText - writebyte UNOWNWORDS_ESCAPE + setval UNOWNWORDS_ESCAPE special DisplayUnownWords closetext end diff --git a/maps/RuinsOfAlphOmanyteChamber.asm b/maps/RuinsOfAlphOmanyteChamber.asm index 1a8387405..d1243cc9c 100644 --- a/maps/RuinsOfAlphOmanyteChamber.asm +++ b/maps/RuinsOfAlphOmanyteChamber.asm @@ -48,7 +48,7 @@ RuinsOfAlphOmanyteChamber_MapScripts: RuinsOfAlphOmanyteChamberPuzzle: refreshscreen - writebyte UNOWNPUZZLE_OMANYTE + setval UNOWNPUZZLE_OMANYTE special UnownPuzzle closetext iftrue .PuzzleComplete @@ -82,7 +82,7 @@ RuinsOfAlphOmanyteChamberDescriptionSign: RuinsOfAlphOmanyteChamberWallPatternLeft: opentext writetext RuinsOfAlphOmanyteChamberWallPatternLeftText - writebyte UNOWNWORDS_WATER + setval UNOWNWORDS_WATER special DisplayUnownWords closetext end @@ -92,7 +92,7 @@ RuinsOfAlphOmanyteChamberWallPatternRight: iftrue .WallOpen opentext writetext RuinsOfAlphOmanyteChamberWallPatternRightText - writebyte UNOWNWORDS_WATER + setval UNOWNWORDS_WATER special DisplayUnownWords closetext end diff --git a/maps/RuinsOfAlphOutside.asm b/maps/RuinsOfAlphOutside.asm index 394ea368e..fcd539b93 100644 --- a/maps/RuinsOfAlphOutside.asm +++ b/maps/RuinsOfAlphOutside.asm @@ -27,7 +27,7 @@ RuinsOfAlphOutside_MapScripts: jump .NoScientist .MaybeScientist: - checkcode VAR_UNOWNCOUNT + readvar VAR_UNOWNCOUNT ifgreater 2, .YesScientist jump .NoScientist diff --git a/maps/RuinsOfAlphResearchCenter.asm b/maps/RuinsOfAlphResearchCenter.asm index d455ebf64..4c9ee01c4 100644 --- a/maps/RuinsOfAlphResearchCenter.asm +++ b/maps/RuinsOfAlphResearchCenter.asm @@ -60,7 +60,7 @@ RuinsOfAlphResearchCenter_MapScripts: RuinsOfAlphResearchCenterScientist3Script: faceplayer opentext - checkcode VAR_UNOWNCOUNT + readvar VAR_UNOWNCOUNT ifequal NUM_UNOWN, .PrinterAvailable writetext RuinsOfAlphResearchCenterScientist3Text waitbutton @@ -76,7 +76,7 @@ RuinsOfAlphResearchCenterScientist3Script: RuinsOfAlphResearchCenterScientist1Script: faceplayer opentext - checkcode VAR_UNOWNCOUNT + readvar VAR_UNOWNCOUNT ifequal NUM_UNOWN, .GotAllUnown checkflag ENGINE_UNOWN_DEX iftrue .GotUnownDex @@ -109,7 +109,7 @@ RuinsOfAlphResearchCenterScientist1Script: RuinsOfAlphResearchCenterScientist2Script: faceplayer opentext - checkcode VAR_UNOWNCOUNT + readvar VAR_UNOWNCOUNT ifequal NUM_UNOWN, .GotAllUnown checkevent EVENT_MADE_UNOWN_APPEAR_IN_RUINS iftrue .UnownAppeared @@ -134,7 +134,7 @@ RuinsOfAlphResearchCenterComputer: opentext checkevent EVENT_RUINS_OF_ALPH_RESEARCH_CENTER_SCIENTIST iftrue .SkipChecking - checkcode VAR_UNOWNCOUNT + readvar VAR_UNOWNCOUNT ifequal NUM_UNOWN, .GotAllUnown .SkipChecking: writetext RuinsOfAlphResearchCenterComputerText @@ -152,7 +152,7 @@ RuinsOfAlphResearchCenterPrinter: opentext checkevent EVENT_RUINS_OF_ALPH_RESEARCH_CENTER_SCIENTIST iftrue .SkipChecking - checkcode VAR_UNOWNCOUNT + readvar VAR_UNOWNCOUNT ifequal NUM_UNOWN, .PrinterAvailable .SkipChecking: writetext RuinsOfAlphResearchCenterPrinterText_DoesntWork diff --git a/maps/SaffronGym.asm b/maps/SaffronGym.asm index e9376a6e9..b7579f1a4 100644 --- a/maps/SaffronGym.asm +++ b/maps/SaffronGym.asm @@ -109,7 +109,7 @@ SaffronGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext SABRINA, SABRINA1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, SABRINA, SABRINA1 jumpstd gymstatue2 SabrinaIntroText: diff --git a/maps/SaffronMagnetTrainStation.asm b/maps/SaffronMagnetTrainStation.asm index fe8af17ed..361fc087d 100644 --- a/maps/SaffronMagnetTrainStation.asm +++ b/maps/SaffronMagnetTrainStation.asm @@ -34,7 +34,7 @@ SaffronMagnetTrainStationOfficerScript: closetext applymovement SAFFRONMAGNETTRAINSTATION_OFFICER, MovementData_0x18a88f applymovement PLAYER, MovementData_0x18a898 - writebyte TRUE + setval TRUE special MagnetTrain warpcheck newloadmap MAPSETUP_TRAIN diff --git a/maps/TeamRocketBaseB1F.asm b/maps/TeamRocketBaseB1F.asm index 28c22882f..20e56ebb3 100644 --- a/maps/TeamRocketBaseB1F.asm +++ b/maps/TeamRocketBaseB1F.asm @@ -450,7 +450,7 @@ VoltorbExplodingTrap: cry VOLTORB special FadeInPalettes setlasttalked -1 - writecode VAR_BATTLETYPE, BATTLETYPE_TRAP + loadvar VAR_BATTLETYPE, BATTLETYPE_TRAP loadwildmon VOLTORB, 23 startbattle end @@ -460,7 +460,7 @@ GeodudeExplodingTrap: cry GEODUDE special FadeInPalettes setlasttalked -1 - writecode VAR_BATTLETYPE, BATTLETYPE_TRAP + loadvar VAR_BATTLETYPE, BATTLETYPE_TRAP loadwildmon GEODUDE, 21 startbattle end @@ -470,7 +470,7 @@ KoffingExplodingTrap: cry KOFFING special FadeInPalettes setlasttalked -1 - writecode VAR_BATTLETYPE, BATTLETYPE_TRAP + loadvar VAR_BATTLETYPE, BATTLETYPE_TRAP loadwildmon KOFFING, 21 startbattle end diff --git a/maps/TeamRocketBaseB2F.asm b/maps/TeamRocketBaseB2F.asm index 9b05d82e0..8337ae2b1 100644 --- a/maps/TeamRocketBaseB2F.asm +++ b/maps/TeamRocketBaseB2F.asm @@ -175,7 +175,7 @@ LanceHealsCommon: closetext setscene SCENE_TEAMROCKETBASEB2F_ROCKET_BOSS setevent EVENT_LANCE_HEALED_YOU_IN_TEAM_ROCKET_BASE - checkcode VAR_FACING + readvar VAR_FACING ifequal RIGHT, .FacingRight applymovement TEAMROCKETBASEB2F_LANCE, MovementData_0x6d212 disappear TEAMROCKETBASEB2F_LANCE diff --git a/maps/TinTower1F.asm b/maps/TinTower1F.asm index 821658d0d..0d70c3d3a 100644 --- a/maps/TinTower1F.asm +++ b/maps/TinTower1F.asm @@ -46,7 +46,7 @@ TinTower1F_MapScripts: checkevent EVENT_FOUGHT_SUICUNE iftrue .FoughtSuicune appear TINTOWER1F_SUICUNE - writebyte RAIKOU + setval RAIKOU special MonCheck iftrue .NoRaikou appear TINTOWER1F_RAIKOU @@ -55,7 +55,7 @@ TinTower1F_MapScripts: .NoRaikou: disappear TINTOWER1F_RAIKOU .CheckEntei: - writebyte ENTEI + setval ENTEI special MonCheck iftrue .NoEntei appear TINTOWER1F_ENTEI @@ -84,7 +84,7 @@ TinTower1F_MapScripts: .SuicuneBattle: applymovement PLAYER, TinTowerPlayerMovement1 pause 15 - writebyte RAIKOU + setval RAIKOU special MonCheck iftrue .Next1 ; if player caught Raikou, he doesn't appear in Tin Tower applymovement TINTOWER1F_RAIKOU, TinTowerRaikouMovement1 @@ -97,7 +97,7 @@ TinTower1F_MapScripts: playsound SFX_EXIT_BUILDING waitsfx .Next1: - writebyte ENTEI + setval ENTEI special MonCheck iftrue .Next2 ; if player caught Entei, he doesn't appear in Tin Tower applymovement TINTOWER1F_ENTEI, TinTowerEnteiMovement1 @@ -117,7 +117,7 @@ TinTower1F_MapScripts: cry SUICUNE pause 20 loadwildmon SUICUNE, 40 - writecode VAR_BATTLETYPE, BATTLETYPE_SUICUNE + loadvar VAR_BATTLETYPE, BATTLETYPE_SUICUNE startbattle dontrestartmapmusic disappear TINTOWER1F_SUICUNE diff --git a/maps/TinTowerRoof.asm b/maps/TinTowerRoof.asm index 33971dd1d..e3b1e6107 100644 --- a/maps/TinTowerRoof.asm +++ b/maps/TinTowerRoof.asm @@ -30,7 +30,7 @@ TinTowerHoOh: pause 15 closetext setevent EVENT_FOUGHT_HO_OH - writecode VAR_BATTLETYPE, BATTLETYPE_FORCEITEM + loadvar VAR_BATTLETYPE, BATTLETYPE_FORCEITEM loadwildmon HO_OH, 60 startbattle disappear TINTOWERROOF_HO_OH diff --git a/maps/TrainerHouseB1F.asm b/maps/TrainerHouseB1F.asm index 464dd65b2..e09724d59 100644 --- a/maps/TrainerHouseB1F.asm +++ b/maps/TrainerHouseB1F.asm @@ -20,11 +20,11 @@ TrainerHouseReceptionistScript: buttonsound special TrainerHouse iffalse .GetCal3Name - trainertotext CAL, CAL2, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, CAL, CAL2 jump .GotName .GetCal3Name: - trainertotext CAL, CAL3, MEM_BUFFER_0 + gettrainername STRING_BUFFER_3, CAL, CAL3 .GotName: writetext TrainerHouseB1FYourOpponentIsText buttonsound diff --git a/maps/UnionCaveB2F.asm b/maps/UnionCaveB2F.asm index 2c3b63973..d24e263c0 100644 --- a/maps/UnionCaveB2F.asm +++ b/maps/UnionCaveB2F.asm @@ -15,7 +15,7 @@ UnionCaveB2F_MapScripts: .Lapras: checkflag ENGINE_UNION_CAVE_LAPRAS iftrue .NoAppear - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal FRIDAY, .Appear .NoAppear: disappear UNIONCAVEB2F_LAPRAS diff --git a/maps/VermilionCity.asm b/maps/VermilionCity.asm index 26caecfec..de1b34d17 100644 --- a/maps/VermilionCity.asm +++ b/maps/VermilionCity.asm @@ -52,7 +52,7 @@ VermilionSnorlax: pause 15 cry SNORLAX closetext - writecode VAR_BATTLETYPE, BATTLETYPE_FORCEITEM + loadvar VAR_BATTLETYPE, BATTLETYPE_FORCEITEM loadwildmon SNORLAX, 50 startbattle disappear VERMILIONCITY_BIG_SNORLAX @@ -65,7 +65,7 @@ VermilionGymBadgeGuy: opentext checkevent EVENT_GOT_HP_UP_FROM_VERMILION_GUY iftrue .AlreadyGotItem - checkcode VAR_BADGES + readvar VAR_BADGES ifequal NUM_BADGES, .AllBadges ifgreater 13, .MostBadges ifgreater 9, .SomeBadges diff --git a/maps/VermilionGym.asm b/maps/VermilionGym.asm index d6cdcd30d..3a9c3f7bf 100644 --- a/maps/VermilionGym.asm +++ b/maps/VermilionGym.asm @@ -99,7 +99,7 @@ VermilionGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext LT_SURGE, LT_SURGE1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, LT_SURGE, LT_SURGE1 jumpstd gymstatue2 LtSurgeIntroText: diff --git a/maps/VermilionPort.asm b/maps/VermilionPort.asm index cf21a05df..638f4a9b5 100644 --- a/maps/VermilionPort.asm +++ b/maps/VermilionPort.asm @@ -84,7 +84,7 @@ VermilionPortWalkUpToShipScript: iftrue .skip turnobject PLAYER, LEFT opentext - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal MONDAY, .NextShipWednesday ifequal TUESDAY, .NextShipWednesday ifequal THURSDAY, .NextShipSunday @@ -146,7 +146,7 @@ VermilionPortSailorScript: opentext checkevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 iftrue VermilionPortAlreadyRodeScript - checkcode VAR_WEEKDAY + readvar VAR_WEEKDAY ifequal MONDAY, .NextShipWednesday ifequal TUESDAY, .NextShipWednesday ifequal THURSDAY, .NextShipSunday diff --git a/maps/VictoryRoadGate.asm b/maps/VictoryRoadGate.asm index 451bf9371..a2c996a1c 100644 --- a/maps/VictoryRoadGate.asm +++ b/maps/VictoryRoadGate.asm @@ -26,7 +26,7 @@ VictoryRoadGateBadgeCheckScript: opentext writetext VictoryRoadGateOfficerText buttonsound - checkcode VAR_BADGES + readvar VAR_BADGES ifgreater NUM_JOHTO_BADGES - 1, .AllEightBadges writetext VictoryRoadGateNotEnoughBadgesText waitbutton diff --git a/maps/VioletGym.asm b/maps/VioletGym.asm index 36561ce12..4d8c8f7dc 100644 --- a/maps/VioletGym.asm +++ b/maps/VioletGym.asm @@ -27,7 +27,7 @@ VioletGymFalknerScript: playsound SFX_GET_BADGE waitsfx setflag ENGINE_ZEPHYRBADGE - checkcode VAR_BADGES + readvar VAR_BADGES scall VioletGymActivateRockets .FightDone: checkevent EVENT_GOT_TM31_MUD_SLAP @@ -107,7 +107,7 @@ VioletGymStatue: iftrue .Beaten jumpstd gymstatue1 .Beaten: - trainertotext FALKNER, FALKNER1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, FALKNER, FALKNER1 jumpstd gymstatue2 FalknerIntroText: diff --git a/maps/VioletPokecenter1F.asm b/maps/VioletPokecenter1F.asm index ca11063d6..a309ed245 100644 --- a/maps/VioletPokecenter1F.asm +++ b/maps/VioletPokecenter1F.asm @@ -22,10 +22,10 @@ VioletPokecenter1F_ElmsAideScript: .AskTakeEgg: yesorno iffalse .RefusedEgg - checkcode VAR_PARTYCOUNT + readvar VAR_PARTYCOUNT ifequal PARTY_LENGTH, .PartyFull giveegg TOGEPI, 5 - stringtotext .eggname, MEM_BUFFER_1 + getstring STRING_BUFFER_4, .eggname scall .AideGivesEgg setevent EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE clearevent EVENT_ELMS_AIDE_IN_LAB @@ -34,7 +34,7 @@ VioletPokecenter1F_ElmsAideScript: writetext UnknownText_0x695c5 waitbutton closetext - checkcode VAR_FACING + readvar VAR_FACING ifequal UP, .AideWalksAroundPlayer turnobject PLAYER, DOWN applymovement VIOLETPOKECENTER1F_SCIENTIST, MovementData_AideWalksStraightOutOfPokecenter diff --git a/maps/ViridianGym.asm b/maps/ViridianGym.asm index ac0003fd5..930ea6603 100644 --- a/maps/ViridianGym.asm +++ b/maps/ViridianGym.asm @@ -58,7 +58,7 @@ ViridianGymStatue: jumpstd gymstatue1 .Beaten: - trainertotext BLUE, BLUE1, MEM_BUFFER_1 + gettrainername STRING_BUFFER_4, BLUE, BLUE1 jumpstd gymstatue2 LeaderBlueBeforeText: diff --git a/maps/WhirlIslandLugiaChamber.asm b/maps/WhirlIslandLugiaChamber.asm index 4381a3636..b1c9e9a16 100644 --- a/maps/WhirlIslandLugiaChamber.asm +++ b/maps/WhirlIslandLugiaChamber.asm @@ -30,7 +30,7 @@ Lugia: pause 15 closetext setevent EVENT_FOUGHT_LUGIA - writecode VAR_BATTLETYPE, BATTLETYPE_FORCEITEM + loadvar VAR_BATTLETYPE, BATTLETYPE_FORCEITEM loadwildmon LUGIA, 60 startbattle disappear WHIRLISLANDLUGIACHAMBER_LUGIA