-
Notifications
You must be signed in to change notification settings - Fork 1k
Item Descriptions
Xillicis edited this page Mar 16, 2023
·
2 revisions
Code by Rangi42 (in Red Star/Blue Star).
DEF BAG_ITEM_CAPACITY EQU 20
DEF PC_ITEM_CAPACITY EQU 50
; text box IDs
const_def 1
const MESSAGE_BOX ; $01
const_skip ; $02
const MENU_TEMPLATE_03 ; $03 unused
const FIELD_MOVE_MON_MENU ; $04
const JP_MOCHIMONO_MENU_TEMPLATE ; $05
- const USE_TOSS_MENU_TEMPLATE ; $06
+ const USE_INFO_TOSS_MENU_TEMPLATE ; $06
const MENU_TEMPLATE_07 ; $07 unused
const JP_SAVE_MESSAGE_MENU_TEMPLATE ; $08
...
...
TextBoxTextAndCoordTable:
; text box ID, upper-left X, upper-left Y, lower-right X, lower-right Y, text pointer, text X, text Y
text_box_text JP_MOCHIMONO_MENU_TEMPLATE, 0, 0, 14, 17, JapaneseMochimonoText, 3, 0
- text_box_text USE_TOSS_MENU_TEMPLATE, 13, 10, 19, 14, UseTossText, 15, 11
+ text_box_text USE_INFO_TOSS_MENU_TEMPLATE, 13, 10, 19, 16, UseInfoTossText, 15, 11
text_box_text JP_SAVE_MESSAGE_MENU_TEMPLATE, 0, 0, 7, 5, JapaneseSaveMessageText, 2, 2
text_box_text JP_SPEED_OPTIONS_MENU_TEMPLATE, 0, 6, 5, 10, JapaneseSpeedOptionsText, 2, 7
text_box_text BATTLE_MENU_TEMPLATE, 8, 12, 19, 17, BattleMenuText, 10, 14
text_box_text SAFARI_BATTLE_MENU_TEMPLATE, 0, 12, 19, 17, SafariZoneBattleMenuText, 2, 14
text_box_text SWITCH_STATS_CANCEL_MENU_TEMPLATE, 11, 11, 19, 17, SwitchStatsCancelText, 13, 12
text_box_text BUY_SELL_QUIT_MENU_TEMPLATE, 0, 0, 10, 6, BuySellQuitText, 2, 1
text_box_text MONEY_BOX_TEMPLATE, 11, 0, 19, 2, MoneyText, 13, 0
text_box_text JP_AH_MENU_TEMPLATE, 7, 6, 11, 10, JapaneseAhText, 8, 8
text_box_text JP_POKEDEX_MENU_TEMPLATE, 11, 8, 19, 17, JapanesePokedexMenu, 12, 10
BuySellQuitText:
db "BUY"
next "SELL"
next "QUIT@"
db "@" ; unused
-UseTossText:
- db "USE"
- next "TOSS@"
+UseInfoTossText:
+ db "USE"
+ next "INFO"
+ next "TOSS@"
JapaneseSaveMessageText:
db "きろく"
next "メッセージ@"
JapaneseSpeedOptionsText:
...
engine/menus/start_sub_menus.asm:
...
StartMenu_Item::
...
.choseItem
; erase menu cursor (blank each tile in front of an item name)
ld a, " "
ldcoord_a 5, 4
ldcoord_a 5, 6
ldcoord_a 5, 8
ldcoord_a 5, 10
call PlaceUnfilledArrowMenuCursor
xor a
ld [wMenuItemToSwap], a
- ld a, [wcf91]
- cp BICYCLE
- jp z, .useOrTossItem
-.notBicycle1
- ld a, USE_TOSS_MENU_TEMPLATE
+ ld a, USE_INFO_TOSS_MENU_TEMPLATE
ld [wTextBoxID], a
call DisplayTextBoxID
ld hl, wTopMenuItemY
ld a, 11
ld [hli], a ; top menu item Y
ld a, 14
ld [hli], a ; top menu item X
xor a
ld [hli], a ; current menu item ID
inc hl
- inc a ; a = 1
+ ld a, 2
ld [hli], a ; max menu item ID
ld a, A_BUTTON | B_BUTTON
ld [hli], a ; menu watched keys
xor a
ld [hl], a ; old menu item id
call HandleMenuInput
call PlaceUnfilledArrowMenuCursor
bit BIT_B_BUTTON, a
jr z, .useOrTossItem
jp ItemMenuLoop
.useOrTossItem ; if the player made the choice to use or toss the item
ld a, [wcf91]
ld [wd11e], a
call GetItemName
call CopyToStringBuffer
- ld a, [wcf91]
+ ld a, [wCurrentMenuItem]
+ cp a, 2
+ jr z, .tossItem
+ cp a, 1
+ jp z, .infoItem
-; use item
ld a, [wcf91]
cp BICYCLE
- jr nz, .notBicycle2
+ jr nz, .notBicycle
ld a, [wd732]
bit 5, a
jr z, .useItem_closeMenu
ld hl, CannotGetOffHereText
call PrintText
jp ItemMenuLoop
-.notBicycle2
- ld a, [wCurrentMenuItem]
- and a
- jr nz, .tossItem
-; use item
+.notBicycle
+ xor a
- ld [wPseudoItemID], a ; a must be 0 due to above conditional jump
+ ld [wPseudoItemID], a
ld a, [wcf91]
cp HM01
jr nc, .useItem_partyMenu
ld hl, UsableItems_CloseMenu
ld de, 1
call IsInArray
jr c, .useItem_partyMenu
call UseItem
jp ItemMenuLoop
.useItem_closeMenu
xor a
ld [wPseudoItemID], a
call UseItem
ld a, [wActionResultOrTookBattleTurn]
and a
jp z, ItemMenuLoop
jp CloseStartMenu
.useItem_partyMenu
ld a, [wUpdateSpritesEnabled]
push af
call UseItem
ld a, [wActionResultOrTookBattleTurn]
cp $02
jp z, .partyMenuNotDisplayed
call GBPalWhiteOutWithDelay3
call RestoreScreenTilesAndReloadTilePatterns
pop af
ld [wUpdateSpritesEnabled], a
jp StartMenu_Item
.partyMenuNotDisplayed
pop af
ld [wUpdateSpritesEnabled], a
jp ItemMenuLoop
.tossItem
call IsKeyItem
ld a, [wIsKeyItem]
and a
jr nz, .skipAskingQuantity
ld a, [wcf91]
call IsItemHM
jr c, .skipAskingQuantity
call DisplayChooseQuantityMenu
inc a
jr z, .tossZeroItems
.skipAskingQuantity
ld hl, wNumBagItems
call TossItem
.tossZeroItems
jp ItemMenuLoop
+.infoItem
+ farcall DisplayItemDescription
+ jp ItemMenuLoop
...
Now you need to create item_descriptions.asm
in data/text
:
_MasterBallDescription::
text "The best BALL. It"
next "never misses."
prompt
_UltraBallDescription::
text "A BALL with a high"
next "rate of success."
prompt
_GreatBallDescription::
text "A BALL with a de-"
next "cent success rate."
prompt
_PokeBallDescription::
text "An item for catch-"
next "ing #MON."
prompt
_TownMapDescription::
text "Shows your present"
next "location."
prompt
_BicycleDescription::
text "A collapsible bike"
next "for fast movement."
prompt
_MoonStoneDescription::
_FireStoneDescription::
_ThunderStoneDescription::
_WaterStoneDescription::
_LeafStoneDescription::
text "Evolves certain"
next "kinds of #MON."
prompt
_AntidoteDescription::
text "Cures poisoned"
next "#MON."
prompt
_BurnHealDescription::
text "Heals burned"
next "#MON."
prompt
_IceHealDescription::
text "Defrosts frozen"
next "#MON."
prompt
_AwakeningDescription::
text "Awakens sleeping"
next "#MON."
prompt
_ParlyzHealDescription::
text "Heals paralyzed"
next "#MON."
prompt
_FullRestoreDescription::
text "Fully restores HP"
next "and status."
prompt
_MaxPotionDescription::
text "Fully restores"
next "#MON HP."
prompt
_HyperPotionDescription::
text "Restores #MON"
next "HP by 200."
prompt
_SuperPotionDescription::
text "Restores #MON"
next "HP by 50."
prompt
_PotionDescription::
text "Restores #MON"
next "HP by 20."
prompt
_EscapeRopeDescription::
text "Use for escaping"
next "from caves, etc."
prompt
_RepelDescription::
text "Repels weak #-"
next "MON for 100 steps."
prompt
_OldAmberDescription::
text "Fossilized resin"
next "containing DNA."
prompt
_HPUpDescription::
text "Raises the HP of"
next "one #MON."
prompt
_ProteinDescription::
text "Raises ATTACK of"
next "one #MON."
prompt
_IronDescription::
text "Raises DEFENSE of"
next "one #MON."
prompt
_CarbosDescription::
text "Raises SPEED of"
next "one #MON."
prompt
_CalciumDescription::
text "Raises SPECIAL"
next "of one #MON."
prompt
_RareCandyDescription::
text "Raises level of a"
next "#MON by one."
prompt
_DomeFossilDescription::
_HelixFossilDescription::
text "A fossilized"
next "#MON shell."
prompt
_SecretKeyDescription::
text "Opens doors."
prompt
_BikeVoucherDescription::
text "Exchange for a new"
next "BICYCLE."
prompt
_XAccuracyDescription::
text "Raises accuracy."
next "(1 BTL)"
prompt
_CardKeyDescription::
text "Opens shutters in"
next "SILPH CO."
prompt
_NuggetDescription::
text "Made of pure gold."
next "Sell high."
prompt
_PokeDollDescription::
text "Use to escape from"
next "a wild #MON."
prompt
_FullHealDescription::
text "Eliminates all"
next "status problems."
prompt
_ReviveDescription::
text "Restores a fainted"
next "#MON to 1/2 HP."
prompt
_MaxReviveDescription::
text "Fully restores a"
next "fainted #MON."
prompt
_GuardSpecDescription::
text "Prevents stats"
next "reduction. (1 BTL)"
prompt
_SuperRepelDescription::
text "Repels weak #-"
next "MON for 200 steps."
prompt
_MaxRepelDescription::
text "Repels weak #-"
next "MON for 250 steps."
prompt
_DireHitDescription::
text "Ups critical hit"
next "ratio. (1 BTL)"
prompt
_FreshWaterDescription::
text "Restores #MON"
next "HP by 50."
prompt
_SodaPopDescription::
text "Restores #MON"
next "HP by 60."
prompt
_LemonadeDescription::
text "Restores #MON"
next "HP by 80."
prompt
_SSTicketDescription::
text "A ticket for the"
next "S.S.ANNE."
prompt
_GoldTeethDescription::
text "Gold dentures lost"
next "by the WARDEN."
prompt
_XAttackDescription::
text "Raises ATTACK."
next "(1 BTL)"
prompt
_XDefendDescription::
text "Raises DEFENSE."
next "(1 BTL)"
prompt
_XSpeedDescription::
text "Raises SPEED."
next "(1 BTL)"
prompt
_XSpecialDescription::
text "Raises SPECIAL."
next "(1 BTL)"
prompt
_CoinCaseDescription::
text "Holds up to 9,999"
next "game coins."
prompt
_OaksParcelDescription::
text "A parcel belonging"
next "to PROF.OAK."
prompt
_ItemfinderDescription::
text "Checks for unseen"
next "items in the area."
prompt
_SilphScopeDescription::
text "A scope to see in-"
next "visible #MON."
prompt
_PokeFluteDescription::
text "Instantly awakens"
next "any #MON."
prompt
_LiftKeyDescription::
text "Key to the lift in"
next "the ROCKET base."
prompt
_ExpAllDescription::
text "Shares battle EXP."
next "points."
prompt
_OldRodDescription::
text "Use by water to"
next "fish for #MON."
prompt
_GoodRodDescription::
text "A good ROD for"
next "catching #MON."
prompt
_SuperRodDescription::
text "The best ROD for"
next "catching #MON."
prompt
_PPUpDescription::
text "Raises max PP of"
next "a selected move."
prompt
_EtherDescription::
text "Restores PP of one"
next "move by 10."
prompt
_MaxEtherDescription::
text "Fully restores PP"
next "of one move."
prompt
_ElixerDescription::
text "Restores PP of all"
next "moves by 10."
prompt
_MaxElixerDescription::
text "Fully restores the"
next "PP of one #MON."
prompt
_HM01Description::
text "Cuts using claws,"
next "scythes, etc."
prompt
_HM02Description::
text "1st turn: Fly"
next "2nd turn: Attack"
prompt
_HM03Description::
text "A strong water-"
next "type attack."
prompt
_HM04Description::
text "A powerful physi-"
next "cal attack."
prompt
_HM05Description::
text "Blinds the foe to"
next "reduce accuracy."
prompt
_TM01Description::
text "A powerful punch"
next "thrown very hard."
prompt
_TM02Description::
text "1st turn: Prepare"
next "2nd turn: Attack"
prompt
_TM03Description::
text "A dance that in-"
next "creases ATTACK."
prompt
_TM04Description::
text "Blows away the foe"
next "and ends battle."
prompt
_TM05Description::
text "A powerful kicking"
next "attack."
prompt
_TM06Description::
text "A poison move with"
next "increasing damage."
prompt
_TM07Description::
text "A one-hit KO,"
next "drill attack."
prompt
_TM08Description::
text "An attack that may"
next "cause paralysis."
prompt
_TM09Description::
text "A tackle that also"
next "hurts the user."
prompt
_TM10Description::
text "A tackle that also"
next "hurts the user."
prompt
_TM11Description::
text "An attack that may"
next "lower SPEED."
prompt
_TM12Description::
text "Squirts water to"
next "attack."
prompt
_TM13Description::
text "An attack that may"
next "freeze the foe."
prompt
_TM14Description::
text "An attack that may"
next "freeze the foe."
prompt
_TM15Description::
text "1st turn: Attack"
next "2nd turn: Rest"
prompt
_TM16Description::
text "Throws coins. Gets"
next "them back later."
prompt
_TM17Description::
text "An attack that al-"
next "so hurts the user."
prompt
_TM18Description::
text "Returns a physical"
next "blow double."
prompt
_TM19Description::
text "The user's level"
next "equals damage HP."
prompt
_TM20Description::
text "Raises ATTACK if"
next "the user is hit."
prompt
_TM21Description::
text "Steals 1/2 of the"
next "damage inflicted."
prompt
_TM22Description::
text "1st turn: Prepare"
next "2nd turn: Attack"
prompt
_TM23Description::
text "Always inflicts"
next "40HP damage."
prompt
_TM24Description::
text "An attack that may"
next "cause paralysis."
prompt
_TM25Description::
text "An attack that may"
next "cause paralysis."
prompt
_TM26Description::
text "Tough but useless"
next "vs. flying foes."
prompt
_TM27Description::
text "A ground-type,"
next "one-hit KO attack."
prompt
_TM28Description::
text "1st turn: Burrow"
next "2nd turn: Attack"
prompt
_TM29Description::
text "An attack that may"
next "lower SPECIAL."
prompt
_TM30Description::
text "A move for fleeing"
next "from battle."
prompt
_TM31Description::
text "Copies a move used"
next "by the foe."
prompt
_TM32Description::
text "Heightens evasive-"
next "ness."
prompt
_TM33Description::
text "Raises DEFENSE"
next "with a barrier."
prompt
_TM34Description::
text "Waits 2-3 turns to"
next "hit back double."
prompt
_TM35Description::
text "Randomly uses any"
next "#MON move."
prompt
_TM36Description::
text "Powerful but makes"
next "the user faint."
prompt
_TM37Description::
text "Eggs are hurled at"
next "the foe."
prompt
_TM38Description::
text "An attack that"
next "may cause a burn."
prompt
_TM39Description::
text "An attack that"
next "never misses."
prompt
_TM40Description::
text "1st turn: Prepare"
next "2nd turn: Attack"
prompt
_TM41Description::
text "Restores HP by 1/2"
next "the user's max HP."
prompt
_TM42Description::
text "Steals HP from a"
next "sleeping victim."
prompt
_TM43Description::
text "1st turn: Prepare"
next "2nd turn: Attack"
prompt
_TM44Description::
text "Sleep for 2 turns"
next "to fully recover."
prompt
_TM45Description::
text "A move that may"
next "cause paralysis."
prompt
_TM46Description::
text "An attack with"
next "variable power."
prompt
_TM47Description::
text "Very powerful but"
next "makes user faint."
prompt
_TM48Description::
text "An attack that may"
next "cause flinching."
prompt
_TM49Description::
text "Fires three kinds"
next "of beams at once."
prompt
_TM50Description::
text "Makes a decoy with"
next "1/4 user's max HP."
prompt
_UnusedItemDescription::
text "?"
prompt
Now create the file item_descriptions.asm
in engine/menus
:
The descriptions follow the item's ID in constants/item_constants.asm.
DisplayItemDescription::
ld a, [wcf91]
dec a
cp a, HM01 - 1
jr c, .ok
sub HM01 - FLOOR_B2F
.ok
ld hl, ItemDescriptionPointers
ld bc, 5
call AddNTimes
jp PrintText
ItemDescriptionPointers:
text_far _MasterBallDescription
text_end
text_far _UltraBallDescription
text_end
text_far _GreatBallDescription
text_end
text_far _PokeBallDescription
text_end
text_far _TownMapDescription
text_end
text_far _BicycleDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _MoonStoneDescription
text_end
text_far _AntidoteDescription
text_end
text_far _BurnHealDescription
text_end
text_far _IceHealDescription
text_end
text_far _AwakeningDescription
text_end
text_far _ParlyzHealDescription
text_end
text_far _FullRestoreDescription
text_end
text_far _MaxPotionDescription
text_end
text_far _HyperPotionDescription
text_end
text_far _SuperPotionDescription
text_end
text_far _PotionDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _EscapeRopeDescription
text_end
text_far _RepelDescription
text_end
text_far _OldAmberDescription
text_end
text_far _FireStoneDescription
text_end
text_far _ThunderStoneDescription
text_end
text_far _WaterStoneDescription
text_end
text_far _HPUpDescription
text_end
text_far _ProteinDescription
text_end
text_far _IronDescription
text_end
text_far _CarbosDescription
text_end
text_far _CalciumDescription
text_end
text_far _RareCandyDescription
text_end
text_far _DomeFossilDescription
text_end
text_far _HelixFossilDescription
text_end
text_far _SecretKeyDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _BikeVoucherDescription
text_end
text_far _XAccuracyDescription
text_end
text_far _LeafStoneDescription
text_end
text_far _CardKeyDescription
text_end
text_far _NuggetDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _PokeDollDescription
text_end
text_far _FullHealDescription
text_end
text_far _ReviveDescription
text_end
text_far _MaxReviveDescription
text_end
text_far _GuardSpecDescription
text_end
text_far _SuperRepelDescription
text_end
text_far _MaxRepelDescription
text_end
text_far _DireHitDescription
text_end
text_far _UnusedItemDescription
text_end
text_far _FreshWaterDescription
text_end
text_far _SodaPopDescription
text_end
text_far _LemonadeDescription
text_end
text_far _SSTicketDescription
text_end
text_far _GoldTeethDescription
text_end
text_far _XAttackDescription
text_end
text_far _XDefendDescription
text_end
text_far _XSpeedDescription
text_end
text_far _XSpecialDescription
text_end
text_far _CoinCaseDescription
text_end
text_far _OaksParcelDescription
text_end
text_far _ItemfinderDescription
text_end
text_far _SilphScopeDescription
text_end
text_far _PokeFluteDescription
text_end
text_far _LiftKeyDescription
text_end
text_far _ExpAllDescription
text_end
text_far _OldRodDescription
text_end
text_far _GoodRodDescription
text_end
text_far _SuperRodDescription
text_end
text_far _PPUpDescription
text_end
text_far _EtherDescription
text_end
text_far _MaxEtherDescription
text_end
text_far _ElixerDescription
text_end
text_far _MaxElixerDescription
text_end
text_far _HM01Description
text_end
text_far _HM02Description
text_end
text_far _HM03Description
text_end
text_far _HM04Description
text_end
text_far _HM05Description
text_end
text_far _TM01Description
text_end
text_far _TM02Description
text_end
text_far _TM03Description
text_end
text_far _TM04Description
text_end
text_far _TM05Description
text_end
text_far _TM06Description
text_end
text_far _TM07Description
text_end
text_far _TM08Description
text_end
text_far _TM09Description
text_end
text_far _TM10Description
text_end
text_far _TM11Description
text_end
text_far _TM12Description
text_end
text_far _TM13Description
text_end
text_far _TM14Description
text_end
text_far _TM15Description
text_end
text_far _TM16Description
text_end
text_far _TM17Description
text_end
text_far _TM18Description
text_end
text_far _TM19Description
text_end
text_far _TM20Description
text_end
text_far _TM21Description
text_end
text_far _TM22Description
text_end
text_far _TM23Description
text_end
text_far _TM24Description
text_end
text_far _TM25Description
text_end
text_far _TM26Description
text_end
text_far _TM27Description
text_end
text_far _TM28Description
text_end
text_far _TM29Description
text_end
text_far _TM30Description
text_end
text_far _TM31Description
text_end
text_far _TM32Description
text_end
text_far _TM33Description
text_end
text_far _TM34Description
text_end
text_far _TM35Description
text_end
text_far _TM36Description
text_end
text_far _TM37Description
text_end
text_far _TM38Description
text_end
text_far _TM39Description
text_end
text_far _TM40Description
text_end
text_far _TM41Description
text_end
text_far _TM42Description
text_end
text_far _TM43Description
text_end
text_far _TM44Description
text_end
text_far _TM45Description
text_end
text_far _TM46Description
text_end
text_far _TM47Description
text_end
text_far _TM48Description
text_end
text_far _TM49Description
text_end
text_far _TM50Description
text_end
Now adding that two new files to Game's memory.
...
SECTION "Move Names", ROMX
INCLUDE "data/moves/names.asm"
+SECTION "Item Descriptions", ROMX
+INCLUDE "data/text/item_descriptions.asm"
...
SECTION "bank1E", ROMX
INCLUDE "engine/battle/animations.asm"
INCLUDE "engine/overworld/cut2.asm"
INCLUDE "engine/overworld/dust_smoke.asm"
INCLUDE "gfx/fishing.asm"
INCLUDE "data/moves/animations.asm"
INCLUDE "data/battle_anims/subanimations.asm"
INCLUDE "data/battle_anims/frame_blocks.asm"
INCLUDE "engine/movie/evolution.asm"
INCLUDE "engine/overworld/elevator.asm"
INCLUDE "engine/items/tm_prices.asm"
+SECTION "Engine Spillover", ROMX
+INCLUDE "engine/menus/item_descriptions.asm"