From 7eeba327bd6dc235a33f06a7779e3b3c52f04475 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 19 Jun 2019 18:03:24 -0400 Subject: Dump items and start decomp item_use --- Makefile | 4 + asm/item_use.s | 610 +- data/data_835B488.s | 14 +- data/data_8471F00.s | 356 +- data/text/move_descriptions.inc | 711 +- include/berry_pouch.h | 7 + include/bike.h | 2 + include/constants/global.h | 79 + include/constants/items.h | 7 - include/field_fadetransition.h | 1 + include/field_player_avatar.h | 2 + include/field_weather.h | 1 + include/global.h | 74 +- include/item.h | 12 +- include/item_menu.h | 5 + include/item_use.h | 33 + include/mail.h | 1 + include/overworld.h | 3 + include/strings.h | 3 + json_data_rules.mk | 9 + ld_script.txt | 3 + src/data/items.json | 6062 +++++++++++ src/data/items.json.txt | 31 + src/item.c | 8 + src/item_use.c | 242 + sym_ewram.txt | 5 +- tools/jsonproc/.gitignore | 1 + tools/jsonproc/Makefile | 20 + tools/jsonproc/inja.hpp | 3396 ++++++ tools/jsonproc/jsonproc.cpp | 91 + tools/jsonproc/jsonproc.h | 32 + tools/jsonproc/nlohmann/json.hpp | 20842 +++++++++++++++++++++++++++++++++++++ 32 files changed, 31611 insertions(+), 1056 deletions(-) create mode 100644 include/berry_pouch.h create mode 100644 include/constants/global.h create mode 100644 json_data_rules.mk create mode 100644 src/data/items.json create mode 100644 src/data/items.json.txt create mode 100644 src/item.c create mode 100644 src/item_use.c create mode 100644 tools/jsonproc/.gitignore create mode 100644 tools/jsonproc/Makefile create mode 100644 tools/jsonproc/inja.hpp create mode 100644 tools/jsonproc/jsonproc.cpp create mode 100644 tools/jsonproc/jsonproc.h create mode 100644 tools/jsonproc/nlohmann/json.hpp diff --git a/Makefile b/Makefile index a5de0f9da..5d01ba6b9 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,7 @@ PREPROC := tools/preproc/preproc RAMSCRGEN := tools/ramscrgen/ramscrgen FIX := tools/gbafix/gbafix MAPJSON := tools/mapjson/mapjson +JSONPROC := tools/jsonproc/jsonproc # Clear the default suffixes .SUFFIXES: @@ -103,6 +104,7 @@ tools: @$(MAKE) -C tools/mid2agb @$(MAKE) -C tools/gbafix @$(MAKE) -C tools/mapjson + @$(MAKE) -C tools/jsonproc # For contributors to make sure a change didn't affect the contents of the ROM. compare: rom @@ -126,6 +128,7 @@ clean: tidy @$(MAKE) clean -C tools/mid2agb @$(MAKE) clean -C tools/gbafix @$(MAKE) clean -C tools/mapjson + @$(MAKE) clean -C tools/jsonproc tidy: rm -f $(ROM) $(ELF) $(MAP) @@ -135,6 +138,7 @@ tidy: include graphics_file_rules.mk include tileset_rules.mk include map_data_rules.mk +include json_data_rules.mk %.s: ; %.png: ; diff --git a/asm/item_use.s b/asm/item_use.s index 723eb5ee6..bf4aaaf4d 100644 --- a/asm/item_use.s +++ b/asm/item_use.s @@ -5,608 +5,6 @@ .text - thumb_func_start sub_80A0FBC -sub_80A0FBC: @ 80A0FBC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, _080A0FD8 @ =gSpecialVar_ItemId - ldrh r0, [r1] - cmp r0, 0xAF - bne _080A0FE0 - ldr r0, _080A0FDC @ =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrb r0, [r1, 0x10] - b _080A0FE6 - .align 2, 0 -_080A0FD8: .4byte gSpecialVar_ItemId -_080A0FDC: .4byte gTasks -_080A0FE0: - ldrh r0, [r1] - bl ItemId_GetType -_080A0FE6: - subs r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, _080A1010 @ =gSpecialVar_ItemId - ldrh r0, [r0] - bl GetPocketByItemId - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bne _080A1018 - ldr r0, _080A1014 @ =gUnknown_83E2954 - lsls r1, r4, 2 - adds r1, r0 - ldr r0, [r1] - bl sub_813D934 - adds r0, r5, 0 - bl sub_813D808 - b _080A1032 - .align 2, 0 -_080A1010: .4byte gSpecialVar_ItemId -_080A1014: .4byte gUnknown_83E2954 -_080A1018: - ldr r0, _080A1038 @ =gUnknown_83E2954 - lsls r1, r4, 2 - adds r1, r0 - ldr r0, [r1] - bl sub_8108EE0 - cmp r4, 0x1 - bne _080A102C - bl sub_8108CB4 -_080A102C: - adds r0, r5, 0 - bl sub_8108B50 -_080A1032: - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_080A1038: .4byte gUnknown_83E2954 - thumb_func_end sub_80A0FBC - - thumb_func_start sub_80A103C -sub_80A103C: @ 80A103C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, _080A1064 @ =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0xE - ldrsh r0, [r0, r1] - cmp r0, 0x1 - beq _080A1070 - ldr r1, _080A1068 @ =gFieldCallback - ldr r0, _080A106C @ =sub_80A1084 - str r0, [r1] - adds r0, r2, 0 - bl sub_80A0FBC - b _080A107A - .align 2, 0 -_080A1064: .4byte gTasks -_080A1068: .4byte gFieldCallback -_080A106C: .4byte sub_80A1084 -_080A1070: - ldr r0, _080A1080 @ =gUnknown_2039998 - ldr r1, [r0] - adds r0, r2, 0 - bl _call_via_r1 -_080A107A: - pop {r0} - bx r0 - .align 2, 0 -_080A1080: .4byte gUnknown_2039998 - thumb_func_end sub_80A103C - - thumb_func_start sub_80A1084 -sub_80A1084: @ 80A1084 - push {lr} - bl sub_807DC00 - ldr r0, _080A1098 @ =sub_80A109C - movs r1, 0x8 - bl CreateTask - pop {r0} - bx r0 - .align 2, 0 -_080A1098: .4byte sub_80A109C - thumb_func_end sub_80A1084 - - thumb_func_start sub_80A109C -sub_80A109C: @ 80A109C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_807AA70 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A10B8 - ldr r0, _080A10C0 @ =gUnknown_2039998 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 -_080A10B8: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080A10C0: .4byte gUnknown_2039998 - thumb_func_end sub_80A109C - - thumb_func_start sub_80A10C4 -sub_80A10C4: @ 80A10C4 - push {r4-r7,lr} - adds r4, r1, 0 - adds r1, r3, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r5, _080A10F0 @ =gStringVar4 - adds r0, r5, 0 - bl StringExpandPlaceholders - cmp r4, 0 - bne _080A10F8 - ldr r3, _080A10F4 @ =sub_810A1F8 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_8108E70 - b _080A1104 - .align 2, 0 -_080A10F0: .4byte gStringVar4 -_080A10F4: .4byte sub_810A1F8 -_080A10F8: - ldr r3, _080A110C @ =sub_80A112C - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl DisplayItemMessageOnField -_080A1104: - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080A110C: .4byte sub_80A112C - thumb_func_end sub_80A10C4 - - thumb_func_start sub_80A1110 -sub_80A1110: @ 80A1110 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r3, _080A1128 @ =gUnknown_8416425 - movs r2, 0x4 - bl sub_80A10C4 - pop {r0} - bx r0 - .align 2, 0 -_080A1128: .4byte gUnknown_8416425 - thumb_func_end sub_80A1110 - - thumb_func_start sub_80A112C -sub_80A112C: @ 80A112C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0x1 - bl ClearDialogWindowAndFrame - adds r0, r4, 0 - bl DestroyTask - bl sub_80696C0 - bl ScriptContext2_Disable - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A112C - - thumb_func_start sub_80A1150 -sub_80A1150: @ 80A1150 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl ItemId_GetPocket - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _080A1168 - movs r0, 0x1 - b _080A117E -_080A1168: - adds r0, r4, 0 - bl ItemId_GetFieldFunc - ldr r1, _080A1178 @ =sub_80A1750 - cmp r0, r1 - beq _080A117C - movs r0, 0 - b _080A117E - .align 2, 0 -_080A1178: .4byte sub_80A1750 -_080A117C: - movs r0, 0x2 -_080A117E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A1150 - - thumb_func_start sub_80A1184 -sub_80A1184: @ 80A1184 - ldr r1, _080A118C @ =gFieldCallback2 - ldr r0, _080A1190 @ =sub_80A1194 - str r0, [r1] - bx lr - .align 2, 0 -_080A118C: .4byte gFieldCallback2 -_080A1190: .4byte sub_80A1194 - thumb_func_end sub_80A1184 - - thumb_func_start sub_80A1194 -sub_80A1194: @ 80A1194 - push {lr} - bl player_bitmagic - bl ScriptContext2_Enable - bl sub_807DC00 - ldr r0, _080A11B8 @ =sub_80A11C0 - movs r1, 0xA - bl CreateTask - ldr r1, _080A11BC @ =gUnknown_2031DE0 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - pop {r1} - bx r1 - .align 2, 0 -_080A11B8: .4byte sub_80A11C0 -_080A11BC: .4byte gUnknown_2031DE0 - thumb_func_end sub_80A1194 - - thumb_func_start sub_80A11C0 -sub_80A11C0: @ 80A11C0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_807AA70 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A11E0 - bl UnfreezeMapObjects - bl ScriptContext2_Disable - adds r0, r4, 0 - bl DestroyTask -_080A11E0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A11C0 - - thumb_func_start sub_80A11E8 -sub_80A11E8: @ 80A11E8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, _080A1204 @ =sub_80A1208 - bl sub_8108EE0 - adds r0, r4, 0 - bl sub_8108B50 - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080A1204: .4byte sub_80A1208 - thumb_func_end sub_80A11E8 - - thumb_func_start sub_80A1208 -sub_80A1208: @ 80A1208 - push {lr} - sub sp, 0x24 - mov r1, sp - ldr r0, _080A1224 @ =gSpecialVar_ItemId - ldrh r0, [r0] - strh r0, [r1, 0x20] - ldr r1, _080A1228 @ =UseFameCheckerFromMenu - mov r0, sp - movs r2, 0 - bl sub_80BEBEC - add sp, 0x24 - pop {r0} - bx r0 - .align 2, 0 -_080A1224: .4byte gSpecialVar_ItemId -_080A1228: .4byte UseFameCheckerFromMenu - thumb_func_end sub_80A1208 - - thumb_func_start sub_80A122C -sub_80A122C: @ 80A122C - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x83 - lsls r0, 4 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A129A - adds r0, r4, 0 - bl MetatileBehavior_ReturnFalse_17 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A129A - adds r0, r4, 0 - bl MetatileBehavior_ReturnFalse_18 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A129A - adds r0, r4, 0 - bl MetatileBehavior_ReturnFalse_15 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A129A - adds r0, r4, 0 - bl MetatileBehavior_ReturnFalse_16 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A12BC -_080A129A: - ldr r1, _080A12B4 @ =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xE] - ldr r3, _080A12B8 @ =gUnknown_8416451 - adds r0, r5, 0 - movs r2, 0x2 - bl sub_80A10C4 - b _080A12F6 - .align 2, 0 -_080A12B4: .4byte gTasks -_080A12B8: .4byte gUnknown_8416451 -_080A12BC: - bl sub_8055C9C - cmp r0, 0x1 - bne _080A12E4 - bl sub_80BD540 - lsls r0, 24 - cmp r0, 0 - bne _080A12E4 - ldr r1, _080A12DC @ =gUnknown_2039998 - ldr r0, _080A12E0 @ =sub_80A1304 - str r0, [r1] - adds r0, r5, 0 - bl sub_80A103C - b _080A12F6 - .align 2, 0 -_080A12DC: .4byte gUnknown_2039998 -_080A12E0: .4byte sub_80A1304 -_080A12E4: - ldr r0, _080A1300 @ =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrb r1, [r1, 0xE] - adds r0, r5, 0 - bl sub_80A1110 -_080A12F6: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_080A1300: .4byte gTasks - thumb_func_end sub_80A122C - - thumb_func_start sub_80A1304 -sub_80A1304: @ 80A1304 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x6 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - bne _080A131C - movs r0, 0xB - bl PlaySE -_080A131C: - movs r0, 0x6 - bl sub_80BD5C8 - bl sub_80696C0 - bl ScriptContext2_Disable - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A1304 - - thumb_func_start sub_80A1338 -sub_80A1338: @ 80A1338 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A137C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A1360 - ldr r1, _080A1358 @ =gUnknown_2039998 - ldr r0, _080A135C @ =ItemUseOnFieldCB_Rod - str r0, [r1] - adds r0, r4, 0 - bl sub_80A103C - b _080A1372 - .align 2, 0 -_080A1358: .4byte gUnknown_2039998 -_080A135C: .4byte ItemUseOnFieldCB_Rod -_080A1360: - ldr r0, _080A1378 @ =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrb r1, [r1, 0xE] - adds r0, r4, 0 - bl sub_80A1110 -_080A1372: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080A1378: .4byte gTasks - thumb_func_end sub_80A1338 - - thumb_func_start sub_80A137C -sub_80A137C: @ 80A137C - push {r4-r6,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r6, r0, 16 - lsls r0, r6, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl MetatileBehavior_IsWaterfall - lsls r0, 24 - cmp r0, 0 - bne _080A1404 - movs r0, 0x10 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - bne _080A1404 - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - bne _080A13D4 - bl IsPlayerFacingSurfableFishableWater - lsls r0, 24 - cmp r0, 0 - beq _080A1404 -_080A13D0: - movs r0, 0x1 - b _080A1406 -_080A13D4: - adds r0, r5, 0 - bl MetatileBehavior_IsSurfable - lsls r0, 24 - cmp r0, 0 - beq _080A13F4 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridIsImpassableAt - lsls r0, 24 - cmp r0, 0 - beq _080A13D0 -_080A13F4: - lsls r0, r6, 24 - lsrs r0, 24 - bl MetatileBehavior_ReturnFalse_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A13D0 -_080A1404: - movs r0, 0 -_080A1406: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80A137C - - thumb_func_start ItemUseOnFieldCB_Rod -ItemUseOnFieldCB_Rod: @ 80A1410 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, _080A1434 @ =gSpecialVar_ItemId - ldrh r0, [r0] - bl ItemId_GetSecondaryId - lsls r0, 24 - lsrs r0, 24 - bl sub_805D2C0 - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080A1434: .4byte gSpecialVar_ItemId - thumb_func_end ItemUseOnFieldCB_Rod - - thumb_func_start ItemUseOutOfBattle_Itemfinder -ItemUseOutOfBattle_Itemfinder: @ 80A1438 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x27 - bl IncrementGameStat - ldr r1, _080A1458 @ =gUnknown_2039998 - ldr r0, _080A145C @ =sub_813EC8C - str r0, [r1] - adds r0, r4, 0 - bl sub_80A103C - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080A1458: .4byte gUnknown_2039998 -_080A145C: .4byte sub_813EC8C - thumb_func_end ItemUseOutOfBattle_Itemfinder - thumb_func_start sub_80A1460 sub_80A1460: @ 80A1460 push {r4,r5,lr} @@ -1534,7 +932,7 @@ ItemUseOutOfBattle_EscapeRope: @ 80A1BAC movs r0, 0x4 movs r1, 0 bl ItemUse_SetQuestLogEvent - ldr r1, _080A1BE4 @ =gUnknown_2039998 + ldr r1, _080A1BE4 @ =sItemUseOnFieldCB ldr r0, _080A1BE8 @ =sub_80A1C08 str r0, [r1] adds r0, r4, 0 @@ -1543,7 +941,7 @@ ItemUseOutOfBattle_EscapeRope: @ 80A1BAC .align 2, 0 _080A1BDC: .4byte gSpecialVar_ItemId _080A1BE0: .4byte gMapHeader -_080A1BE4: .4byte gUnknown_2039998 +_080A1BE4: .4byte sItemUseOnFieldCB _080A1BE8: .4byte sub_80A1C08 _080A1BEC: ldr r0, _080A1C04 @ =gTasks @@ -1809,7 +1207,7 @@ _080A1DE8: .4byte gMapHeader _080A1DEC: .4byte gSaveBlock1Ptr _080A1DF0: .4byte gTasks _080A1DF4: - ldr r1, _080A1E04 @ =gUnknown_2039998 + ldr r1, _080A1E04 @ =sItemUseOnFieldCB ldr r0, _080A1E08 @ =Task_VsSeeker_0 str r0, [r1] adds r0, r2, 0 @@ -1818,7 +1216,7 @@ _080A1E00: pop {r0} bx r0 .align 2, 0 -_080A1E04: .4byte gUnknown_2039998 +_080A1E04: .4byte sItemUseOnFieldCB _080A1E08: .4byte Task_VsSeeker_0 thumb_func_end sub_80A1D9C diff --git a/data/data_835B488.s b/data/data_835B488.s index b606d92b4..34df69079 100644 --- a/data/data_835B488.s +++ b/data/data_835B488.s @@ -546,11 +546,9 @@ gUnknown_83D4164:: @ 83D4164 .section .rodata.83D4E4C gUnknown_83D4E4C:: - .incbin "baserom.gba", 0x3D4E54, 0x61D4 - -gItems:: @ 83DB028 - .incbin "baserom.gba", 0x3DB028, 0x4074 + .incbin "baserom.gba", 0x3D4E54, 0x78 + .section .rodata.83DF09C gUnknown_83DF09C:: @ 83DF09C .incbin "baserom.gba", 0x3DF09C, 0x18 @@ -780,7 +778,13 @@ gUnknown_83E27AC:: @ 83E27AC .incbin "baserom.gba", 0x3E27AC, 0x1A8 gUnknown_83E2954:: @ 83E2954 - .incbin "baserom.gba", 0x3E2954, 0x134 + .4byte sub_8124C8C + .4byte CB2_ReturnToField + .4byte NULL + .4byte NULL + +gUnknown_83E2964:: @ 83E2964 + .incbin "baserom.gba", 0x3E2964, 0x124 gUnknown_83E2A88:: @ 83E2A88 .incbin "baserom.gba", 0x3E2A88, 0x4F0 diff --git a/data/data_8471F00.s b/data/data_8471F00.s index d90870d14..364b5458d 100644 --- a/data/data_8471F00.s +++ b/data/data_8471F00.s @@ -341,5 +341,359 @@ gUnknown_84827B4:: @ 84827B4 .include "data/text/move_descriptions.inc" + .align 2, 0 gUnknown_84886E8:: @ 84886E8 - .incbin "baserom.gba", 0x4886E8, 0x588 + .4byte gMoveDescription_Pound + .4byte gMoveDescription_KarateChop + .4byte gMoveDescription_DoubleSlap + .4byte gMoveDescription_CometPunch + .4byte gMoveDescription_MegaPunch + .4byte gMoveDescription_PayDay + .4byte gMoveDescription_FirePunch + .4byte gMoveDescription_IcePunch + .4byte gMoveDescription_ThunderPunch + .4byte gMoveDescription_Scratch + .4byte gMoveDescription_ViceGrip + .4byte gMoveDescription_Guillotine + .4byte gMoveDescription_RazorWind + .4byte gMoveDescription_SwordsDance + .4byte gMoveDescription_Cut + .4byte gMoveDescription_Gust + .4byte gMoveDescription_WingAttack + .4byte gMoveDescription_Whirlwind + .4byte gMoveDescription_Fly + .4byte gMoveDescription_Bind + .4byte gMoveDescription_Slam + .4byte gMoveDescription_VineWhip + .4byte gMoveDescription_Stomp + .4byte gMoveDescription_DoubleKick + .4byte gMoveDescription_MegaKick + .4byte gMoveDescription_JumpKick + .4byte gMoveDescription_RollingKick + .4byte gMoveDescription_SandAttack + .4byte gMoveDescription_Headbutt + .4byte gMoveDescription_HornAttack + .4byte gMoveDescription_FuryAttack + .4byte gMoveDescription_HornDrill + .4byte gMoveDescription_Tackle + .4byte gMoveDescription_BodySlam + .4byte gMoveDescription_Wrap + .4byte gMoveDescription_TakeDown + .4byte gMoveDescription_Thrash + .4byte gMoveDescription_DoubleEdge + .4byte gMoveDescription_TailWhip + .4byte gMoveDescription_PoisonSting + .4byte gMoveDescription_Twineedle + .4byte gMoveDescription_PinMissile + .4byte gMoveDescription_Leer + .4byte gMoveDescription_Bite + .4byte gMoveDescription_Growl + .4byte gMoveDescription_Roar + .4byte gMoveDescription_Sing + .4byte gMoveDescription_Supersonic + .4byte gMoveDescription_SonicBoom + .4byte gMoveDescription_Disable + .4byte gMoveDescription_Acid + .4byte gMoveDescription_Ember + .4byte gMoveDescription_Flamethrower + .4byte gMoveDescription_Mist + .4byte gMoveDescription_WaterGun + .4byte gMoveDescription_HydroPump + .4byte gMoveDescription_Surf + .4byte gMoveDescription_IceBeam + .4byte gMoveDescription_Blizzard + .4byte gMoveDescription_Psybeam + .4byte gMoveDescription_BubbleBeam + .4byte gMoveDescription_AuroraBeam + .4byte gMoveDescription_HyperBeam + .4byte gMoveDescription_Peck + .4byte gMoveDescription_DrillPeck + .4byte gMoveDescription_Submission + .4byte gMoveDescription_LowKick + .4byte gMoveDescription_Counter + .4byte gMoveDescription_SeismicToss + .4byte gMoveDescription_Strength + .4byte gMoveDescription_Absorb + .4byte gMoveDescription_MegaDrain + .4byte gMoveDescription_LeechSeed + .4byte gMoveDescription_Growth + .4byte gMoveDescription_RazorLeaf + .4byte gMoveDescription_SolarBeam + .4byte gMoveDescription_PoisonPowder + .4byte gMoveDescription_StunSpore + .4byte gMoveDescription_SleepPowder + .4byte gMoveDescription_PetalDance + .4byte gMoveDescription_StringShot + .4byte gMoveDescription_DragonRage + .4byte gMoveDescription_FireSpin + .4byte gMoveDescription_ThunderShock + .4byte gMoveDescription_Thunderbolt + .4byte gMoveDescription_ThunderWave + .4byte gMoveDescription_Thunder + .4byte gMoveDescription_RockThrow + .4byte gMoveDescription_Earthquake + .4byte gMoveDescription_Fissure + .4byte gMoveDescription_Dig + .4byte gMoveDescription_Toxic + .4byte gMoveDescription_Confusion + .4byte gMoveDescription_Psychic + .4byte gMoveDescription_Hypnosis + .4byte gMoveDescription_Meditate + .4byte gMoveDescription_Agility + .4byte gMoveDescription_QuickAttack + .4byte gMoveDescription_Rage + .4byte gMoveDescription_Teleport + .4byte gMoveDescription_NightShade + .4byte gMoveDescription_Mimic + .4byte gMoveDescription_Screech + .4byte gMoveDescription_DoubleTeam + .4byte gMoveDescription_Recover + .4byte gMoveDescription_Harden + .4byte gMoveDescription_Minimize + .4byte gMoveDescription_Smokescreen + .4byte gMoveDescription_ConfuseRay + .4byte gMoveDescription_Withdraw + .4byte gMoveDescription_DefenseCurl + .4byte gMoveDescription_Barrier + .4byte gMoveDescription_LightScreen + .4byte gMoveDescription_Haze + .4byte gMoveDescription_Reflect + .4byte gMoveDescription_FocusEnergy + .4byte gMoveDescription_Bide + .4byte gMoveDescription_Metronome + .4byte gMoveDescription_MirrorMove + .4byte gMoveDescription_SelfDestruct + .4byte gMoveDescription_EggBomb + .4byte gMoveDescription_Lick + .4byte gMoveDescription_Smog + .4byte gMoveDescription_Sludge + .4byte gMoveDescription_BoneClub + .4byte gMoveDescription_FireBlast + .4byte gMoveDescription_Waterfall + .4byte gMoveDescription_Clamp + .4byte gMoveDescription_Swift + .4byte gMoveDescription_SkullBash + .4byte gMoveDescription_SpikeCannon + .4byte gMoveDescription_Constrict + .4byte gMoveDescription_Amnesia + .4byte gMoveDescription_Kinesis + .4byte gMoveDescription_SoftBoiled + .4byte gMoveDescription_HiJumpKick + .4byte gMoveDescription_Glare + .4byte gMoveDescription_DreamEater + .4byte gMoveDescription_PoisonGas + .4byte gMoveDescription_Barrage + .4byte gMoveDescription_LeechLife + .4byte gMoveDescription_LovelyKiss + .4byte gMoveDescription_SkyAttack + .4byte gMoveDescription_Transform + .4byte gMoveDescription_Bubble + .4byte gMoveDescription_DizzyPunch + .4byte gMoveDescription_Spore + .4byte gMoveDescription_Flash + .4byte gMoveDescription_Psywave + .4byte gMoveDescription_Splash + .4byte gMoveDescription_AcidArmor + .4byte gMoveDescription_Crabhammer + .4byte gMoveDescription_Explosion + .4byte gMoveDescription_FurySwipes + .4byte gMoveDescription_Bonemerang + .4byte gMoveDescription_Rest + .4byte gMoveDescription_RockSlide + .4byte gMoveDescription_HyperFang + .4byte gMoveDescription_Sharpen + .4byte gMoveDescription_Conversion + .4byte gMoveDescription_TriAttack + .4byte gMoveDescription_SuperFang + .4byte gMoveDescription_Slash + .4byte gMoveDescription_Substitute + .4byte gMoveDescription_Struggle + .4byte gMoveDescription_Sketch + .4byte gMoveDescription_TripleKick + .4byte gMoveDescription_Thief + .4byte gMoveDescription_SpiderWeb + .4byte gMoveDescription_MindReader + .4byte gMoveDescription_Nightmare + .4byte gMoveDescription_FlameWheel + .4byte gMoveDescription_Snore + .4byte gMoveDescription_Curse + .4byte gMoveDescription_Flail + .4byte gMoveDescription_Conversion2 + .4byte gMoveDescription_Aeroblast + .4byte gMoveDescription_CottonSpore + .4byte gMoveDescription_Reversal + .4byte gMoveDescription_Spite + .4byte gMoveDescription_PowderSnow + .4byte gMoveDescription_Protect + .4byte gMoveDescription_MachPunch + .4byte gMoveDescription_ScaryFace + .4byte gMoveDescription_FaintAttack + .4byte gMoveDescription_SweetKiss + .4byte gMoveDescription_BellyDrum + .4byte gMoveDescription_SludgeBomb + .4byte gMoveDescription_MudSlap + .4byte gMoveDescription_Octazooka + .4byte gMoveDescription_Spikes + .4byte gMoveDescription_ZapCannon + .4byte gMoveDescription_Foresight + .4byte gMoveDescription_DestinyBond + .4byte gMoveDescription_PerishSong + .4byte gMoveDescription_IcyWind + .4byte gMoveDescription_Detect + .4byte gMoveDescription_BoneRush + .4byte gMoveDescription_LockOn + .4byte gMoveDescription_Outrage + .4byte gMoveDescription_Sandstorm + .4byte gMoveDescription_GigaDrain + .4byte gMoveDescription_Endure + .4byte gMoveDescription_Charm + .4byte gMoveDescription_Rollout + .4byte gMoveDescription_FalseSwipe + .4byte gMoveDescription_Swagger + .4byte gMoveDescription_MilkDrink + .4byte gMoveDescription_Spark + .4byte gMoveDescription_FuryCutter + .4byte gMoveDescription_SteelWing + .4byte gMoveDescription_MeanLook + .4byte gMoveDescription_Attract + .4byte gMoveDescription_SleepTalk + .4byte gMoveDescription_HealBell + .4byte gMoveDescription_Return + .4byte gMoveDescription_Present + .4byte gMoveDescription_Frustration + .4byte gMoveDescription_Safeguard + .4byte gMoveDescription_PainSplit + .4byte gMoveDescription_SacredFire + .4byte gMoveDescription_Magnitude + .4byte gMoveDescription_DynamicPunch + .4byte gMoveDescription_Megahorn + .4byte gMoveDescription_DragonBreath + .4byte gMoveDescription_BatonPass + .4byte gMoveDescription_Encore + .4byte gMoveDescription_Pursuit + .4byte gMoveDescription_RapidSpin + .4byte gMoveDescription_SweetScent + .4byte gMoveDescription_IronTail + .4byte gMoveDescription_MetalClaw + .4byte gMoveDescription_VitalThrow + .4byte gMoveDescription_MorningSun + .4byte gMoveDescription_Synthesis + .4byte gMoveDescription_Moonlight + .4byte gMoveDescription_HiddenPower + .4byte gMoveDescription_CrossChop + .4byte gMoveDescription_Twister + .4byte gMoveDescription_RainDance + .4byte gMoveDescription_SunnyDay + .4byte gMoveDescription_Crunch + .4byte gMoveDescription_MirrorCoat + .4byte gMoveDescription_PsychUp + .4byte gMoveDescription_ExtremeSpeed + .4byte gMoveDescription_AncientPower + .4byte gMoveDescription_ShadowBall + .4byte gMoveDescription_FutureSight + .4byte gMoveDescription_RockSmash + .4byte gMoveDescription_Whirlpool + .4byte gMoveDescription_BeatUp + .4byte gMoveDescription_FakeOut + .4byte gMoveDescription_Uproar + .4byte gMoveDescription_Stockpile + .4byte gMoveDescription_SpitUp + .4byte gMoveDescription_Swallow + .4byte gMoveDescription_HeatWave + .4byte gMoveDescription_Hail + .4byte gMoveDescription_Torment + .4byte gMoveDescription_Flatter + .4byte gMoveDescription_WillOWisp + .4byte gMoveDescription_Memento + .4byte gMoveDescription_Facade + .4byte gMoveDescription_FocusPunch + .4byte gMoveDescription_SmellingSalt + .4byte gMoveDescription_FollowMe + .4byte gMoveDescription_NaturePower + .4byte gMoveDescription_Charge + .4byte gMoveDescription_Taunt + .4byte gMoveDescription_HelpingHand + .4byte gMoveDescription_Trick + .4byte gMoveDescription_RolePlay + .4byte gMoveDescription_Wish + .4byte gMoveDescription_Assist + .4byte gMoveDescription_Ingrain + .4byte gMoveDescription_Superpower + .4byte gMoveDescription_MagicCoat + .4byte gMoveDescription_Recycle + .4byte gMoveDescription_Revenge + .4byte gMoveDescription_BrickBreak + .4byte gMoveDescription_Yawn + .4byte gMoveDescription_KnockOff + .4byte gMoveDescription_Endeavor + .4byte gMoveDescription_Eruption + .4byte gMoveDescription_SkillSwap + .4byte gMoveDescription_Imprison + .4byte gMoveDescription_Refresh + .4byte gMoveDescription_Grudge + .4byte gMoveDescription_Snatch + .4byte gMoveDescription_SecretPower + .4byte gMoveDescription_Dive + .4byte gMoveDescription_ArmThrust + .4byte gMoveDescription_Camouflage + .4byte gMoveDescription_TailGlow + .4byte gMoveDescription_LusterPurge + .4byte gMoveDescription_MistBall + .4byte gMoveDescription_FeatherDance + .4byte gMoveDescription_TeeterDance + .4byte gMoveDescription_BlazeKick + .4byte gMoveDescription_MudSport + .4byte gMoveDescription_IceBall + .4byte gMoveDescription_NeedleArm + .4byte gMoveDescription_SlackOff + .4byte gMoveDescription_HyperVoice + .4byte gMoveDescription_PoisonFang + .4byte gMoveDescription_CrushClaw + .4byte gMoveDescription_BlastBurn + .4byte gMoveDescription_HydroCannon + .4byte gMoveDescription_MeteorMash + .4byte gMoveDescription_Astonish + .4byte gMoveDescription_WeatherBall + .4byte gMoveDescription_Aromatherapy + .4byte gMoveDescription_FakeTears + .4byte gMoveDescription_AirCutter + .4byte gMoveDescription_Overheat + .4byte gMoveDescription_OdorSleuth + .4byte gMoveDescription_RockTomb + .4byte gMoveDescription_SilverWind + .4byte gMoveDescription_MetalSound + .4byte gMoveDescription_GrassWhistle + .4byte gMoveDescription_Tickle + .4byte gMoveDescription_CosmicPower + .4byte gMoveDescription_WaterSpout + .4byte gMoveDescription_SignalBeam + .4byte gMoveDescription_ShadowPunch + .4byte gMoveDescription_Extrasensory + .4byte gMoveDescription_SkyUppercut + .4byte gMoveDescription_SandTomb + .4byte gMoveDescription_SheerCold + .4byte gMoveDescription_MuddyWater + .4byte gMoveDescription_BulletSeed + .4byte gMoveDescription_AerialAce + .4byte gMoveDescription_IcicleSpear + .4byte gMoveDescription_IronDefense + .4byte gMoveDescription_Block + .4byte gMoveDescription_Howl + .4byte gMoveDescription_DragonClaw + .4byte gMoveDescription_FrenzyPlant + .4byte gMoveDescription_BulkUp + .4byte gMoveDescription_Bounce + .4byte gMoveDescription_MudShot + .4byte gMoveDescription_PoisonTail + .4byte gMoveDescription_Covet + .4byte gMoveDescription_VoltTackle + .4byte gMoveDescription_MagicalLeaf + .4byte gMoveDescription_WaterSport + .4byte gMoveDescription_CalmMind + .4byte gMoveDescription_LeafBlade + .4byte gMoveDescription_DragonDance + .4byte gMoveDescription_RockBlast + .4byte gMoveDescription_ShockWave + .4byte gMoveDescription_WaterPulse + .4byte gMoveDescription_DoomDesire + .4byte gMoveDescription_PsychoBoost diff --git a/data/text/move_descriptions.inc b/data/text/move_descriptions.inc index 9a7130eb3..94a4d0ca8 100644 --- a/data/text/move_descriptions.inc +++ b/data/text/move_descriptions.inc @@ -1,1065 +1,1062 @@ -gUnknown_8482834:: +gMoveDescription_Pound:: .string "A physical attack\ndelivered with a\nlong tail or a\nforeleg, etc.$" -gUnknown_8482874:: @ 8482874 +gMoveDescription_KarateChop:: @ 8482874 .string "The foe is attacked\nwith a sharp chop.\nIt has a high\ncritical-hit ratio.$" -gUnknown_84828BD:: @ 84828BD +gMoveDescription_DoubleSlap:: @ 84828BD .string "The foe is slapped\nrepeatedly, back\nand forth, two to\nfive times.$" -gUnknown_84828FF:: @ 84828FF +gMoveDescription_CometPunch:: @ 84828FF .string "The foe is hit with\na flurry of punches\nthat strike two to\nfive times.$" -gUnknown_8482946:: @ 8482946 +gMoveDescription_MegaPunch:: @ 8482946 .string "The foe is slugged\nby a punch thrown\nwith muscle-packed\npower.$" -gUnknown_8482985:: @ 8482985 +gMoveDescription_PayDay:: @ 8482985 .string "Numerous coins are\nhurled at the foe.\nMoney is earned\nafter battle.$" -gUnknown_84829C9:: @ 84829C9 +gMoveDescription_FirePunch:: @ 84829C9 .string "The foe is punched\nwith a fiery fist.\nIt may leave the\nfoe with a burn.$" -gUnknown_8482A11:: @ 8482A11 +gMoveDescription_IcePunch:: @ 8482A11 .string "The foe is punched\nwith an icy fist.\nIt may leave the\nfoe frozen.$" -gUnknown_8482A53:: @ 8482A53 +gMoveDescription_ThunderPunch:: @ 8482A53 .string "The foe is punched\nwith an electrified\nfist. It may leave\nthe foe paralyzed.$" -gUnknown_8482AA0:: @ 8482AA0 +gMoveDescription_Scratch:: @ 8482AA0 .string "Hard, pointed, and\nsharp claws rake\nthe foe.$" -gUnknown_8482ACD:: @ 8482ACD +gMoveDescription_ViceGrip:: @ 8482ACD .string "Huge, impressive\npincers grip and\nsqueeze the foe.$" -gUnknown_8482B00:: @ 8482B00 +gMoveDescription_Guillotine:: @ 8482B00 .string "A vicious tearing\nattack with pincers.\nThe foe will faint\nif it hits.$" -gUnknown_8482B46:: @ 8482B46 +gMoveDescription_RazorWind:: @ 8482B46 .string "Blades of wind hit\nthe foe on the 2nd\nturn. It has a high\ncritical-hit ratio.$" -gUnknown_8482B94:: @ 8482B94 +gMoveDescription_SwordsDance:: @ 8482B94 .string "A frenetic dance of\nfighting. It sharply\nraises the ATTACK\nstat.$" -gUnknown_8482BD5:: @ 8482BD5 +gMoveDescription_Cut:: @ 8482BD5 .string "A basic attack.\nIt can be used to\ncut down thin trees\nand grass.$" -gUnknown_8482C16:: @ 8482C16 +gMoveDescription_Gust:: @ 8482C16 .string "Strikes the foe\nwith a gust of wind\nwhipped up by\nwings.$" -gUnknown_8482C4F:: @ 8482C4F +gMoveDescription_WingAttack:: @ 8482C4F .string "The foe is struck\nwith large, imposing\nwings spread wide.$" -gUnknown_8482C89:: @ 8482C89 +gMoveDescription_Whirlwind:: @ 8482C89 .string "The foe is made to\nswitch out with an\nally. In the wild,\nthe battle ends.$" -gUnknown_8482CD3:: @ 8482CD3 +gMoveDescription_Fly:: @ 8482CD3 .string "A 2-turn move that\nhits on the 2nd\nturn. Use it to fly\nto any known town.$" -gUnknown_8482D1D:: @ 8482D1D +gMoveDescription_Bind:: @ 8482D1D .string "A long body or\ntentacles are used\nto bind the foe for\ntwo to five turns.$" -gUnknown_8482D66:: @ 8482D66 +gMoveDescription_Slam:: @ 8482D66 .string "The foe is struck\nwith a long tail,\nvines, etc.$" -gUnknown_8482D96:: @ 8482D96 +gMoveDescription_VineWhip:: @ 8482D96 .string "The foe is struck\nwith slender, whip-\nlike vines.$" -gUnknown_8482DC8:: @ 8482DC8 +gMoveDescription_Stomp:: @ 8482DC8 .string "The foe is stomped\nwith a big foot.\nIt may make the\nfoe flinch.$" -gUnknown_8482E08:: @ 8482E08 +gMoveDescription_DoubleKick:: @ 8482E08 .string "Two legs are used\nto quickly kick the\nfoe twice in one\nturn.$" -gUnknown_8482E45:: @ 8482E45 +gMoveDescription_MegaKick:: @ 8482E45 .string "The foe is attacked\nby a kick fired\nwith muscle-packed\npower.$" -gUnknown_8482E83:: @ 8482E83 +gMoveDescription_JumpKick:: @ 8482E83 .string "The user jumps up\nhigh, then kicks.\nIf it misses, the\nuser hurts itself.$" -gUnknown_8482ECC:: @ 8482ECC +gMoveDescription_RollingKick:: @ 8482ECC .string "A quick kick from a\nrolling spin.\nIt may make the\nfoe flinch.$" -gUnknown_8482F0A:: @ 8482F0A +gMoveDescription_SandAttack:: @ 8482F0A .string "A lot of sand is\nhurled in the foe's\nface, reducing its\naccuracy.$" -gUnknown_8482F4C:: @ 8482F4C +gMoveDescription_Headbutt:: @ 8482F4C .string "The user sticks its\nhead out and rams.\nIt may make the\nfoe flinch.$" -gUnknown_8482F8F:: @ 8482F8F +gMoveDescription_HornAttack:: @ 8482F8F .string "The foe is jabbed\nwith a sharply\npointed horn to\ninflict damage.$" -gUnknown_8482FD0:: @ 8482FD0 +gMoveDescription_FuryAttack:: @ 8482FD0 .string "The foe is jabbed\nrepeatedly with a\nhorn or beak two to\nfive times.$" -gUnknown_8483014:: @ 8483014 +gMoveDescription_HornDrill:: @ 8483014 .string "The horn is rotated\nlike a drill to ram.\nThe foe will faint\nif it hits.$" -gUnknown_848305C:: @ 848305C +gMoveDescription_Tackle:: @ 848305C .string "A physical attack\nin which the user\ncharges, full body,\ninto the foe.$" -gUnknown_84830A2:: @ 84830A2 +gMoveDescription_BodySlam:: @ 84830A2 .string "The user drops its\nfull body on the\nfoe. It may leave\nthe foe paralyzed.$" -gUnknown_84830EB:: @ 84830EB +gMoveDescription_Wrap:: @ 84830EB .string "A long body or\nvines are used to\nwrap the foe for\ntwo to five turns.$" -gUnknown_8483130:: @ 8483130 +gMoveDescription_TakeDown:: @ 8483130 .string "A reckless, full-\nbody charge attack\nthat also hurts the\nuser a little.$" -gUnknown_8483178:: @ 8483178 +gMoveDescription_Thrash:: @ 8483178 .string "The user rampages\nabout for two to\nthree turns, then\nbecomes confused.$" -gUnknown_84831BF:: @ 84831BF +gMoveDescription_DoubleEdge:: @ 84831BF .string "A reckless, life-\nrisking tackle that\nalso hurts the user\na little.$" -gUnknown_8483203:: @ 8483203 +gMoveDescription_TailWhip:: @ 8483203 .string "The user wags its\ntail cutely, making\nthe foe lower its\nDEFENSE stat.$" -gUnknown_8483249:: @ 8483249 +gMoveDescription_PoisonSting:: @ 8483249 .string "The foe is stabbed\nwith a toxic barb,\netc. It may poison\nthe foe.$" -gUnknown_848328B:: @ 848328B +gMoveDescription_Twineedle:: @ 848328B .string "The foe is stabbed\ntwice with foreleg\nstingers. It may\npoison the foe.$" -gUnknown_84832D2:: @ 84832D2 +gMoveDescription_PinMissile:: @ 84832D2 .string "Sharp pins are shot\nat the foe and hit\ntwo to five times\nat once.$" -gUnknown_8483314:: @ 8483314 +gMoveDescription_Leer:: @ 8483314 .string "The foe is given an\nintimidating look\nthat lowers its\nDEFENSE stat.$" -gUnknown_8483358:: @ 8483358 +gMoveDescription_Bite:: @ 8483358 .string "The user bites with\nvicious fangs.\nIt may make the\nfoe flinch.$" -gUnknown_8483397:: @ 8483397 +gMoveDescription_Growl:: @ 8483397 .string "The user growls in\na cute way, making\nthe foe lower its\nATTACK stat.$" -gUnknown_84833DC:: @ 84833DC +gMoveDescription_Roar:: @ 84833DC .string "The foe is made to\nswitch out with an\nally. In the wild,\nthe battle ends.$" -gUnknown_8483426:: @ 8483426 +gMoveDescription_Sing:: @ 8483426 .string "A soothing song\nin a calming voice\nlulls the foe into\na deep slumber.$" -gUnknown_848346C:: @ 848346C +gMoveDescription_Supersonic:: @ 848346C .string "The user generates\nodd sound waves.\nIt may confuse the\nfoe.$" -gUnknown_84834A8:: @ 84834A8 +gMoveDescription_SonicBoom:: @ 84834A8 .string "The foe is hit with\na shock wave that\nalways inflicts 20-\nHP damage.$" -gUnknown_84834ED:: @ 84834ED +gMoveDescription_Disable:: @ 84834ED .string "For a few turns,\nit prevents the foe\nfrom using the move\nit last used.$" -gUnknown_8483534:: @ 8483534 +gMoveDescription_Acid:: @ 8483534 .string "The foe is sprayed\nwith a harsh, hide-\nmelting acid that\nmay lower DEFENSE.$" -gUnknown_8483580:: @ 8483580 +gMoveDescription_Ember:: @ 8483580 .string "The foe is attacked\nwith small flames.\nThe foe may suffer\na burn.$" -gUnknown_84835C2:: @ 84835C2 +gMoveDescription_Flamethrower:: @ 84835C2 .string "The foe is scorched\nwith intense flames.\nThe foe may suffer\na burn.$" -gUnknown_8483606:: @ 8483606 +gMoveDescription_Mist:: @ 8483606 .string "The ally party is\nprotected by a\nmist that prevents\nstat reductions.$" -gUnknown_848364B:: @ 848364B +gMoveDescription_WaterGun:: @ 848364B .string "The foe is struck\nwith a lot of water\nexpelled forcibly\nfrom the mouth.$" -gUnknown_8483693:: @ 8483693 +gMoveDescription_HydroPump:: @ 8483693 .string "A high volume of\nwater is blasted at\nthe foe under great\npressure.$" -gUnknown_84836D6:: @ 84836D6 +gMoveDescription_Surf:: @ 84836D6 .string "A big wave crashes\ndown on the foe.\nCan also be used\nfor crossing water.$" -gUnknown_848371F:: @ 848371F +gMoveDescription_IceBeam:: @ 848371F .string "The foe is struck\nwith an icy beam.\nIt may freeze the\nfoe solid.$" -gUnknown_8483760:: @ 8483760 +gMoveDescription_Blizzard:: @ 8483760 .string "The foe is blasted\nwith a blizzard.\nIt may freeze the\nfoe solid.$" -gUnknown_84837A1:: @ 84837A1 +gMoveDescription_Psybeam:: @ 84837A1 .string "A peculiar ray is\nshot at the foe.\nIt may leave the\nfoe confused.$" -gUnknown_84837E3:: @ 84837E3 +gMoveDescription_BubbleBeam:: @ 84837E3 .string "A spray of bubbles\nstrikes the foe.\nIt may lower the\nfoe's SPEED stat.$" -gUnknown_848382A:: @ 848382A +gMoveDescription_AuroraBeam:: @ 848382A .string "A rainbow-colored\nattack beam.\nIt may lower the\nfoe's ATTACK stat.$" -gUnknown_848386D:: @ 848386D +gMoveDescription_HyperBeam:: @ 848386D .string "A severely damaging\nattack that makes\nthe user rest on\nthe next turn.$" -gUnknown_84838B3:: @ 84838B3 +gMoveDescription_Peck:: @ 84838B3 .string "The foe is jabbed\nwith a sharply\npointed beak or\nhorn.$" -gUnknown_84838EA:: @ 84838EA +gMoveDescription_DrillPeck:: @ 84838EA .string "A corkscrewing\nattack with the\nsharp beak acting\nas a drill.$" -gUnknown_8483927:: @ 8483927 +gMoveDescription_Submission:: @ 8483927 .string "A reckless, full-\nbody throw attack\nthat also hurts the\nuser a little.$" -gUnknown_848396E:: @ 848396E +gMoveDescription_LowKick:: @ 848396E .string "A low, tripping kick\nthat inflicts more\ndamage on heavier\nfoes.$" -gUnknown_84839AE:: @ 84839AE +gMoveDescription_Counter:: @ 84839AE .string "A retaliation move\nthat counters any\nphysical hit with\ndouble the damage.$" -gUnknown_84839F8:: @ 84839F8 +gMoveDescription_SeismicToss:: @ 84839F8 .string "A gravity-fed throw\nthat causes damage\nmatching the user's\nlevel.$" -gUnknown_8483A3A:: @ 8483A3A +gMoveDescription_Strength:: @ 8483A3A .string "The foe is slugged\nat maximum power.\nCan also be used\nto move boulders.$" -gUnknown_8483A82:: @ 8483A82 +gMoveDescription_Absorb:: @ 8483A82 .string "An attack that\nabsorbs half the\ndamage it inflicted\nto restore HP.$" -gUnknown_8483AC5:: @ 8483AC5 +gMoveDescription_MegaDrain:: @ 8483AC5 .string "A tough attack that\ndrains half the\ndamage it inflicted\nto restore HP.$" -gUnknown_8483B0C:: @ 8483B0C +gMoveDescription_LeechSeed:: @ 8483B0C .string "A seed is planted\non the foe to steal\nsome HP for the \nuser on every turn.$" -gUnknown_8483B57:: @ 8483B57 +gMoveDescription_Growth:: @ 8483B57 .string "The user's body is\nforced to grow,\nraising the SP.\nATK stat.$" -gUnknown_8483B94:: @ 8483B94 +gMoveDescription_RazorLeaf:: @ 8483B94 .string "The foe is hit with\na cutting leaf.\nIt has a high\ncritical-hit ratio.$" -gUnknown_8483BDA:: @ 8483BDA +gMoveDescription_SolarBeam:: @ 8483BDA .string "A 2-turn move that\nblasts the foe with\nabsorbed energy in\nthe 2nd turn.$" -gUnknown_8483C22:: @ 8483C22 +gMoveDescription_PoisonPowder:: @ 8483C22 .string "A cloud of toxic\ndust is scattered.\nIt may poison the\nfoe.$" -gUnknown_8483C5D:: @ 8483C5D +gMoveDescription_StunSpore:: @ 8483C5D .string "Paralyzing dust is\nscattered wildly.\nIt may paralyze\nthe foe.$" -gUnknown_8483C9B:: @ 8483C9B +gMoveDescription_SleepPowder:: @ 8483C9B .string "A sleep-inducing\ndust is scattered\nin high volume\naround a foe.$" -gUnknown_8483CDB:: @ 8483CDB +gMoveDescription_PetalDance:: @ 8483CDB .string "The user attacks\nwith petals for two\nto three turns,\nthen gets confused.$" -gUnknown_8483D24:: @ 8483D24 +gMoveDescription_StringShot:: @ 8483D24 .string "The foe is bound\nwith strings shot\nfrom the mouth to\nreduce its SPEED.$" -gUnknown_8483D6B:: @ 8483D6B +gMoveDescription_DragonRage:: @ 8483D6B .string "The foe is hit with\na shock wave that\nalways inflicts 40-\nHP damage.$" -gUnknown_8483DB0:: @ 8483DB0 +gMoveDescription_FireSpin:: @ 8483DB0 .string "The foe is trapped\nin an intense spiral\nof fire that rages\ntwo to five turns.$" -gUnknown_8483DFE:: @ 8483DFE +gMoveDescription_ThunderShock:: @ 8483DFE .string "An electric shock\nattack that may\nalso leave the foe\nparalyzed.$" -gUnknown_8483E3E:: @ 8483E3E +gMoveDescription_Thunderbolt:: @ 8483E3E .string "A strong electrical\nattack that may\nalso leave the foe\nparalyzed.$" -gUnknown_8483E80:: @ 8483E80 +gMoveDescription_ThunderWave:: @ 8483E80 .string "A weak electric\nshock that is sure\nto cause paralysis\nif it hits.$" -gUnknown_8483EC2:: @ 8483EC2 +gMoveDescription_Thunder:: @ 8483EC2 .string "A brutal lightning\nattack that may\nalso leave the foe\nparalyzed.$" -gUnknown_8483F03:: @ 8483F03 +gMoveDescription_RockThrow:: @ 8483F03 .string "The foe is attacked\nwith a shower of\nsmall, easily\nthrown rocks.$" -gUnknown_8483F44:: @ 8483F44 +gMoveDescription_Earthquake:: @ 8483F44 .string "An earthquake that\nstrikes all POKéMON\nin battle excluding\nthe user.$" -gUnknown_8483F89:: @ 8483F89 +gMoveDescription_Fissure:: @ 8483F89 .string "The foe is dropped\ninto a fissure.\nThe foe faints if it\nhits.$" -gUnknown_8483FC7:: @ 8483FC7 +gMoveDescription_Dig:: @ 8483FC7 .string "An attack that hits\non the 2nd turn.\nCan also be used\nto exit dungeons.$" -gUnknown_848400F:: @ 848400F +gMoveDescription_Toxic:: @ 848400F .string "A move that badly\npoisons the foe.\nIts poison damage\nworsens every turn.$" -gUnknown_8484058:: @ 8484058 +gMoveDescription_Confusion:: @ 8484058 .string "A weak telekinetic\nattack that may\nalso leave the foe\nconfused.$" -gUnknown_8484098:: @ 8484098 +gMoveDescription_Psychic:: @ 8484098 .string "A strong telekinetic\nattack. It may also\nlower the foe's\nSP. DEF stat.$" -gUnknown_84840DF:: @ 84840DF +gMoveDescription_Hypnosis:: @ 84840DF .string "Hypnotic suggestion\nis used to make the\nfoe fall into a\ndeep sleep.$" -gUnknown_8484123:: @ 8484123 +gMoveDescription_Meditate:: @ 8484123 .string "The user meditates\nto awaken its power\nand raise its\nATTACK stat.$" -gUnknown_8484165:: @ 8484165 +gMoveDescription_Agility:: @ 8484165 .string "The user relaxes\nand lightens its\nbody to sharply\nboost its SPEED.$" -gUnknown_84841A8:: @ 84841A8 +gMoveDescription_QuickAttack:: @ 84841A8 .string "An almost invisibly\nfast attack that\nis certain to strike\nfirst.$" -gUnknown_84841E9:: @ 84841E9 +gMoveDescription_Rage:: @ 84841E9 .string "An attack that\nbecomes stronger\neach time the user\nis hit in battle.$" -gUnknown_848422E:: @ 848422E +gMoveDescription_Teleport:: @ 848422E .string "Use it to flee from\nany wild POKéMON.\nAlso warps to the\nlast POKé CENTER.$" -gUnknown_8484278:: @ 8484278 +gMoveDescription_NightShade:: @ 8484278 .string "An attack with a\nmirage that inflicts\ndamage matching\nthe user's level.$" -gUnknown_84842C0:: @ 84842C0 +gMoveDescription_Mimic:: @ 84842C0 .string "The user copies the\nmove last used by\nthe foe for the\nrest of the battle.$" -gUnknown_848430A:: @ 848430A +gMoveDescription_Screech:: @ 848430A .string "An ear-splitting\nscreech is emitted\nto sharply reduce\nthe foe's DEFENSE.$" -gUnknown_8484353:: @ 8484353 +gMoveDescription_DoubleTeam:: @ 8484353 .string "The user creates\nillusory copies of\nitself to raise its\nevasiveness.$" -gUnknown_8484398:: @ 8484398 +gMoveDescription_Recover:: @ 8484398 .string "A self-healing move\nthat restores HP by\nup to half of the\nuser's maximum HP.$" -gUnknown_84843E5:: @ 84843E5 +gMoveDescription_Harden:: @ 84843E5 .string "The user stiffens\nall the muscles in\nits body to raise\nits DEFENSE stat.$" -gUnknown_848442E:: @ 848442E +gMoveDescription_Minimize:: @ 848442E .string "The user compresses\nall the cells in its\nbody to raise its\nevasiveness.$" -gUnknown_8484476:: @ 8484476 +gMoveDescription_Smokescreen:: @ 8484476 .string "An obscuring cloud\nof smoke or ink\nreduces the foe's\naccuracy.$" -gUnknown_84844B5:: @ 84844B5 +gMoveDescription_ConfuseRay:: @ 84844B5 .string "The foe is exposed\nto a sinister ray\nthat triggers\nconfusion.$" -gUnknown_84844F3:: @ 84844F3 +gMoveDescription_Withdraw:: @ 84844F3 .string "The user withdraws\nits body in its hard\nshell, raising its\nDEFENSE stat.$" -gUnknown_848453C:: @ 848453C +gMoveDescription_DefenseCurl:: @ 848453C .string "The user curls up\nto conceal weak\nspots and raise its\nDEFENSE stat.$" -gUnknown_8484580:: @ 8484580 +gMoveDescription_Barrier:: @ 8484580 .string "The user creates a\nsturdy wall that\nsharply raises its\nDEFENSE stat.$" -gUnknown_84845C5:: @ 84845C5 +gMoveDescription_LightScreen:: @ 84845C5 .string "A wall of light\ncuts damage from\nSP. ATK attacks\nfor five turns.$" -gUnknown_8484606:: @ 8484606 +gMoveDescription_Haze:: @ 8484606 .string "Eliminates all stat\nchanges among all\nPOKéMON engaged in\nbattle.$" -gUnknown_8484647:: @ 8484647 +gMoveDescription_Reflect:: @ 8484647 .string "A wall of light\ncuts damage from\nphysical attacks\nfor five turns.$" -gUnknown_8484689:: @ 8484689 +gMoveDescription_FocusEnergy:: @ 8484689 .string "The user takes a\ndeep breath and\nfocuses to raise its\ncritical-hit ratio.$" -gUnknown_84846D3:: @ 84846D3 +gMoveDescription_Bide:: @ 84846D3 .string "The user endures\nattacks for two\nturns, then strikes\nback double.$" -gUnknown_8484715:: @ 8484715 +gMoveDescription_Metronome:: @ 8484715 .string "Waggles a finger\nand stimulates the\nbrain into using any\nmove at random.$" -gUnknown_848475E:: @ 848475E +gMoveDescription_MirrorMove:: @ 848475E .string "The user counters\nthe move last used\nby the foe with the\nsame move.$" -gUnknown_84847A2:: @ 84847A2 +gMoveDescription_SelfDestruct:: @ 84847A2 .string "The user blows up\nto inflict severe\ndamage, even\nmaking itself faint.$" -gUnknown_84847E8:: @ 84847E8 +gMoveDescription_EggBomb:: @ 84847E8 .string "A large egg is\nhurled with great\nforce at the foe to\ninflict damage.$" -gUnknown_848482D:: @ 848482D +gMoveDescription_Lick:: @ 848482D .string "The foe is licked\nand hit with a long\ntongue. It may\nalso paralyze.$" -gUnknown_8484871:: @ 8484871 +gMoveDescription_Smog:: @ 8484871 .string "The foe is attacked\nwith exhaust gases.\nIt may also poison\nthe foe.$" -gUnknown_84848B5:: @ 84848B5 +gMoveDescription_Sludge:: @ 84848B5 .string "Toxic sludge is\nhurled at the foe.\nIt may poison the\ntarget.$" -gUnknown_84848F2:: @ 84848F2 +gMoveDescription_BoneClub:: @ 84848F2 .string "The foe is clubbed\nwith a bone held in\nhand. It may make\nthe foe flinch.$" -gUnknown_848493B:: @ 848493B +gMoveDescription_FireBlast:: @ 848493B .string "The foe is hit with\nan intense flame.\nIt may leave the\ntarget with a burn.$" -gUnknown_8484986:: @ 8484986 +gMoveDescription_Waterfall:: @ 8484986 .string "A powerful charge\nattack. It can also\nbe used to climb\na waterfall.$" -gUnknown_84849CA:: @ 84849CA +gMoveDescription_Clamp:: @ 84849CA .string "The foe is clamped\nand squeezed by\nthe user's shell for\ntwo to five turns.$" -gUnknown_8484A15:: @ 8484A15 +gMoveDescription_Swift:: @ 8484A15 .string "Star-shaped rays\nthat never miss are\nfired at all foes in\nbattle.$" -gUnknown_8484A57:: @ 8484A57 +gMoveDescription_SkullBash:: @ 8484A57 .string "The user raises its\nDEFENSE in the 1st\nturn, then attacks\nin the 2nd turn.$" -gUnknown_8484AA2:: @ 8484AA2 +gMoveDescription_SpikeCannon:: @ 8484AA2 .string "Sharp spikes are\nfired at the foe to\nstrike two to five\ntimes.$" -gUnknown_8484AE1:: @ 8484AE1 +gMoveDescription_Constrict:: @ 8484AE1 .string "The foe is attacked\nwith long tentacles\nor vines. It may\nlower SPEED.$" -gUnknown_8484B27:: @ 8484B27 +gMoveDescription_Amnesia:: @ 8484B27 .string "Forgets about\nsomething and\nsharply raises\nSP. DEF.$" -gUnknown_8484B5B:: @ 8484B5B +gMoveDescription_Kinesis:: @ 8484B5B .string "The user distracts\nthe foe by bending\na spoon. It may\nlower accuracy.$" -gUnknown_8484BA1:: @ 8484BA1 +gMoveDescription_SoftBoiled:: @ 8484BA1 .string "Heals the user by\nup to half its full\nHP. It can be used\nto heal an ally.$" -gUnknown_8484BEB:: @ 8484BEB +gMoveDescription_HiJumpKick:: @ 8484BEB .string "A strong jumping\nknee kick. If it\nmisses, the user is\nhurt.$" -gUnknown_8484C27:: @ 8484C27 +gMoveDescription_Glare:: @ 8484C27 .string "The user intimidates\nthe foe with the\ndesign on its belly\nto cause paralysis.$" -gUnknown_8484C75:: @ 8484C75 +gMoveDescription_DreamEater:: @ 8484C75 .string "Absorbs half the\ndamage it inflicted\non a sleeping foe\nto restore HP.$" -gUnknown_8484CBB:: @ 8484CBB +gMoveDescription_PoisonGas:: @ 8484CBB .string "The foe is sprayed\nwith a cloud of\ntoxic gas that may\npoison the foe.$" -gUnknown_8484D01:: @ 8484D01 +gMoveDescription_Barrage:: @ 8484D01 .string "Round objects are\nhurled at the foe\nto strike two to\nfive times.$" -gUnknown_8484D42:: @ 8484D42 +gMoveDescription_LeechLife:: @ 8484D42 .string "An attack that\nabsorbs half the\ndamage it inflicted\nto restore HP.$" -gUnknown_8484D85:: @ 8484D85 +gMoveDescription_LovelyKiss:: @ 8484D85 .string "The user forces a\nkiss on the foe\nwith a scary face\nthat induces sleep.$" -gUnknown_8484DCD:: @ 8484DCD +gMoveDescription_SkyAttack:: @ 8484DCD .string "A 2nd-turn attack\nmove with a high\ncritical-hit ratio.\nThe foe may flinch.$" -gUnknown_8484E18:: @ 8484E18 +gMoveDescription_Transform:: @ 8484E18 .string "The user transforms\ninto a copy of the\nfoe with even the\nsame move set.$" -gUnknown_8484E60:: @ 8484E60 +gMoveDescription_Bubble:: @ 8484E60 .string "A spray of bubbles\nhits the foe.\nIt may lower the\nfoe's SPEED stat.$" -gUnknown_8484EA4:: @ 8484EA4 +gMoveDescription_DizzyPunch:: @ 8484EA4 .string "The foe is hit with\na rhythmic punch\nthat may leave it\nconfused.$" -gUnknown_8484EE5:: @ 8484EE5 +gMoveDescription_Spore:: @ 8484EE5 .string "The user scatters\nbursts of fine\nspores that induce\nsleep.$" -gUnknown_8484F20:: @ 8484F20 +gMoveDescription_Flash:: @ 8484F20 .string "A blast of light\nthat cuts the foe's\naccuracy. It also\nilluminates caves.$" -gUnknown_8484F6A:: @ 8484F6A +gMoveDescription_Psywave:: @ 8484F6A .string "The foe is attacked\nwith an odd, hot\nenergy wave that\nvaries in intensity.$" -gUnknown_8484FB5:: @ 8484FB5 +gMoveDescription_Splash:: @ 8484FB5 .string "The user just flops\nand splashes around\nwithout having any\neffect.$" -gUnknown_8484FF8:: @ 8484FF8 +gMoveDescription_AcidArmor:: @ 8484FF8 .string "The user alters its\ncells to liquefy\nitself and sharply\nraise DEFENSE.$" -gUnknown_848503F:: @ 848503F +gMoveDescription_Crabhammer:: @ 848503F .string "A large pincer is\nused to hammer the\nfoe. It has a high\ncritical-hit ratio.$" -gUnknown_848508B:: @ 848508B +gMoveDescription_Explosion:: @ 848508B .string "The user explodes\nto inflict terrible\ndamage even while\nfainting itself.$" -gUnknown_84850D4:: @ 84850D4 +gMoveDescription_FurySwipes:: @ 84850D4 .string "The foe is raked\nwith sharp claws or\nscythes two to five\ntimes.$" -gUnknown_8485114:: @ 8485114 +gMoveDescription_Bonemerang:: @ 8485114 .string "The user throws a\nbone that hits the\nfoe once, then once\nagain on return.$" -gUnknown_848515E:: @ 848515E +gMoveDescription_Rest:: @ 848515E .string "The user sleeps for\ntwo turns to fully\nrestore HP and heal\nany status problem.$" -gUnknown_84851AD:: @ 84851AD +gMoveDescription_RockSlide:: @ 84851AD .string "Large boulders are\nhurled at the foe.\nIt may make the\nfoe flinch.$" -gUnknown_84851EF:: @ 84851EF +gMoveDescription_HyperFang:: @ 84851EF .string "The foe is attacked\nwith sharp fangs.\nIt may make the\nfoe flinch.$" -gUnknown_8485231:: @ 8485231 +gMoveDescription_Sharpen:: @ 8485231 .string "The user reduces\nits polygon count\nto sharpen edges\nand raise ATTACK.$" -gUnknown_8485277:: @ 8485277 +gMoveDescription_Conversion:: @ 8485277 .string "The user changes\nits type to match\nthe type of one of\nits moves.$" -gUnknown_84852B8:: @ 84852B8 +gMoveDescription_TriAttack:: @ 84852B8 .string "A simultaneous\n3-beam attack that\nmay paralyze, burn,\nor freeze the foe.$" -gUnknown_8485301:: @ 8485301 +gMoveDescription_SuperFang:: @ 8485301 .string "The user attacks\nwith sharp fangs\nand halves the\nfoe's HP.$" -gUnknown_848533C:: @ 848533C +gMoveDescription_Slash:: @ 848533C .string "The foe is slashed\nwith claws, etc.\nIt has a high\ncritical-hit ratio.$" -gUnknown_8485382:: @ 8485382 +gMoveDescription_Substitute:: @ 8485382 .string "The user creates a\ndecoy using one-\nquarter of its full\nHP.$" -gUnknown_84853BE:: @ 84853BE +gMoveDescription_Struggle:: @ 84853BE .string "An attack that is\nused only if there\nis no PP. It also\nhurts the user.$" -gUnknown_8485405:: @ 8485405 +gMoveDescription_Sketch:: @ 8485405 .string "This move copies\nthe move last used\nby the foe, then\ndisappears.$" -gUnknown_8485446:: @ 8485446 +gMoveDescription_TripleKick:: @ 8485446 .string "A 3-kick attack\nthat becomes more\npowerful with each\nsuccessive hit.$" -gUnknown_848548B:: @ 848548B +gMoveDescription_Thief:: @ 848548B .string "An attack that may\ntake the foe's held\nitem if the user\nisn't holding one.$" -gUnknown_84854D6:: @ 84854D6 +gMoveDescription_SpiderWeb:: @ 84854D6 .string "Ensnares the foe \nwith sticky string\nso it doesn't flee\nor switch out.$" -gUnknown_848551D:: @ 848551D +gMoveDescription_MindReader:: @ 848551D .string "The user predicts\nthe foe's action to\nensure its next\nattack hits.$" -gUnknown_8485560:: @ 8485560 +gMoveDescription_Nightmare:: @ 8485560 .string "A sleeping foe is\nshown a nightmare\nthat inflicts some\ndamage every turn.$" -gUnknown_84855AA:: @ 84855AA +gMoveDescription_FlameWheel:: @ 84855AA .string "The user makes a\nfiery charge at the\nfoe. It may cause\na burn.$" -gUnknown_84855E9:: @ 84855E9 +gMoveDescription_Snore:: @ 84855E9 .string "An attack that can\nbe used only while\nasleep. It may\ncause flinching.$" -gUnknown_848562F:: @ 848562F +gMoveDescription_Curse:: @ 848562F .string "A move that works\ndifferently for the\nGHOST-type and all\nthe other types.$" -gUnknown_8485679:: @ 8485679 +gMoveDescription_Flail:: @ 8485679 .string "A desperate attack\nthat becomes more\npowerful the less\nHP the user has.$" -gUnknown_84856C1:: @ 84856C1 +gMoveDescription_Conversion2:: @ 84856C1 .string "The user changes\ntype to make itself\nresistant to the\nlast attack it took.$" -gUnknown_848570C:: @ 848570C +gMoveDescription_Aeroblast:: @ 848570C .string "A vortex of air is\nshot at the foe.\nIt has a high\ncritical-hit ratio.$" -gUnknown_8485752:: @ 8485752 +gMoveDescription_CottonSpore:: @ 8485752 .string "Cotton-like spores\ncling to the foe,\nsharply reducing\nits SPEED stat.$" -gUnknown_8485798:: @ 8485798 +gMoveDescription_Reversal:: @ 8485798 .string "An all-out attack\nthat becomes more\npowerful the less\nHP the user has.$" -gUnknown_84857DF:: @ 84857DF +gMoveDescription_Spite:: @ 84857DF .string "A move that cuts\n2 to 5 PP from the\nmove last used by\nthe foe.$" -gUnknown_848581E:: @ 848581E +gMoveDescription_PowderSnow:: @ 848581E .string "Blasts the foe with\na snowy gust.\nIt may cause\nfreezing.$" -gUnknown_8485857:: @ 8485857 +gMoveDescription_Protect:: @ 8485857 .string "Enables the user to\nevade all attacks.\nIt may fail if used\nin succession.$" -gUnknown_84858A1:: @ 84858A1 +gMoveDescription_MachPunch:: @ 84858A1 .string "A punch thrown at\nblinding speed.\nIt is certain to\nstrike first.$" -gUnknown_84858E2:: @ 84858E2 +gMoveDescription_ScaryFace:: @ 84858E2 .string "Frightens the foe\nwith a scary face\nto sharply reduce\nits SPEED.$" -gUnknown_8485923:: @ 8485923 +gMoveDescription_FaintAttack:: @ 8485923 .string "The user draws up\nclose to the foe\ndisarmingly, then\nhits without fail.$" -gUnknown_848596B:: @ 848596B +gMoveDescription_SweetKiss:: @ 848596B .string "The user kisses\nthe foe with sweet\ncuteness that\ncauses confusion.$" -gUnknown_84859AE:: @ 84859AE +gMoveDescription_BellyDrum:: @ 84859AE .string "The user maximizes\nits ATTACK stat at\nthe cost of half\nits full HP.$" -gUnknown_84859F2:: @ 84859F2 +gMoveDescription_SludgeBomb:: @ 84859F2 .string "Filthy sludge is\nhurled at the foe.\nIt may poison the\ntarget.$" -gUnknown_8485A30:: @ 8485A30 +gMoveDescription_MudSlap:: @ 8485A30 .string "Mud is hurled in\nthe foe's face to\ninflict damage and\nlower its accuracy.$" -gUnknown_8485A7A:: @ 8485A7A +gMoveDescription_Octazooka:: @ 8485A7A .string "Ink is blasted in\nthe foe's face or\neyes to damage and\nlower accuracy.$" -gUnknown_8485AC1:: @ 8485AC1 +gMoveDescription_Spikes:: @ 8485AC1 .string "A trap of spikes is\nlaid around the\nfoe's party to hurt\nfoes switching in.$" -gUnknown_8485B0C:: @ 8485B0C +gMoveDescription_ZapCannon:: @ 8485B0C .string "An electric blast is\nfired like a cannon\nto inflict damage\nand paralyze.$" -gUnknown_8485B55:: @ 8485B55 +gMoveDescription_Foresight:: @ 8485B55 .string "Completely negates\nthe foe's efforts to\nheighten its ability\nto evade.$" -gUnknown_8485B9C:: @ 8485B9C +gMoveDescription_DestinyBond:: @ 8485B9C .string "If the user faints,\nthe foe delivering\nthe final hit also\nfaints.$" -gUnknown_8485BDE:: @ 8485BDE +gMoveDescription_PerishSong:: @ 8485BDE .string "Any battler that\nhears this faints\nin three turns\nunless it switches.$" -gUnknown_8485C24:: @ 8485C24 +gMoveDescription_IcyWind:: @ 8485C24 .string "A chilling wind is\nused to attack.\nIt also lowers the\nSPEED stat.$" -gUnknown_8485C66:: @ 8485C66 +gMoveDescription_Detect:: @ 8485C66 .string "Enables the user to\nevade all attacks.\nIt may fail if used\nin succession.$" -gUnknown_8485CB0:: @ 8485CB0 +gMoveDescription_BoneRush:: @ 8485CB0 .string "The user strikes\nthe foe with a bone\nin hand two to five\ntimes.$" -gUnknown_8485CF0:: @ 8485CF0 +gMoveDescription_LockOn:: @ 8485CF0 .string "The user locks on\nto the foe, making\nthe next move sure\nto hit.$" -gUnknown_8485D30:: @ 8485D30 +gMoveDescription_Outrage:: @ 8485D30 .string "The user thrashes\nabout for two to\nthree turns, then\nbecomes confused.$" -gUnknown_8485D77:: @ 8485D77 +gMoveDescription_Sandstorm:: @ 8485D77 .string "A 5-turn sandstorm\nthat damages all\ntypes except ROCK,\nGROUND, and STEEL.$" -gUnknown_8485DC1:: @ 8485DC1 +gMoveDescription_GigaDrain:: @ 8485DC1 .string "A harsh attack that\nabsorbs half the\ndamage it inflicted\nto restore HP.$" -gUnknown_8485E09:: @ 8485E09 +gMoveDescription_Endure:: @ 8485E09 .string "The user endures\nany hit with 1 HP\nleft. It may fail if\nused in succession.$" -gUnknown_8485E55:: @ 8485E55 +gMoveDescription_Charm:: @ 8485E55 .string "The foe is charmed\nby the user's cute\nappeals, sharply\ncutting its ATTACK.$" -gUnknown_8485EA0:: @ 8485EA0 +gMoveDescription_Rollout:: @ 8485EA0 .string "A 5-turn rolling\nattack that becomes\nstronger each time\nit hits.$" -gUnknown_8485EE1:: @ 8485EE1 +gMoveDescription_FalseSwipe:: @ 8485EE1 .string "A restrained attack\nthat always leaves\nthe foe with at\nleast 1 HP.$" -gUnknown_8485F24:: @ 8485F24 +gMoveDescription_Swagger:: @ 8485F24 .string "A move that makes\nthe foe confused,\nbut also sharply\nraises its ATTACK.$" -gUnknown_8485F6C:: @ 8485F6C +gMoveDescription_MilkDrink:: @ 8485F6C .string "Heals the user by\nup to half its full\nHP. It can be used\nto heal an ally.$" -gUnknown_8485FB6:: @ 8485FB6 +gMoveDescription_Spark:: @ 8485FB6 .string "An electrically\ncharged tackle that\nmay also paralyze\nthe foe.$" -gUnknown_8485FF5:: @ 8485FF5 +gMoveDescription_FuryCutter:: @ 8485FF5 .string "An attack that\ngrows stronger on\neach successive\nhit.$" -gUnknown_848602B:: @ 848602B +gMoveDescription_SteelWing:: @ 848602B .string "The foe is hit with\nwings of steel.\nIt may also raise\nthe user's DEFENSE.$" -gUnknown_8486075:: @ 8486075 +gMoveDescription_MeanLook:: @ 8486075 .string "The foe is fixed\nwith a mean look\nthat prevents it\nfrom escaping.$" -gUnknown_84860B7:: @ 84860B7 +gMoveDescription_Attract:: @ 84860B7 .string "If it is the other\ngender, the foe is\nmade infatuated and\nunlikely to attack.$" -gUnknown_8486105:: @ 8486105 +gMoveDescription_SleepTalk:: @ 8486105 .string "While asleep, the\nuser randomly uses\none of the moves it\nknows.$" -gUnknown_8486145:: @ 8486145 +gMoveDescription_HealBell:: @ 8486145 .string "A soothing bell\nchimes to heal the\nstatus problems of\nall allies.$" -gUnknown_8486187:: @ 8486187 +gMoveDescription_Return:: @ 8486187 .string "This attack move\ngrows more powerful\nthe more the user\nlikes its TRAINER.$" -gUnknown_84861D1:: @ 84861D1 +gMoveDescription_Present:: @ 84861D1 .string "The foe is given a\nbooby-trapped gift.\nIt restores HP\nsometimes, however.$" -gUnknown_848621B:: @ 848621B +gMoveDescription_Frustration:: @ 848621B .string "This attack move\ngrows more powerful\nthe less the user\nlikes its TRAINER.$" -gUnknown_8486265:: @ 8486265 +gMoveDescription_Safeguard:: @ 8486265 .string "It protects the\nuser's party from\nall status problems\nfor five turns.$" -gUnknown_84862AB:: @ 84862AB +gMoveDescription_PainSplit:: @ 84862AB .string "The user adds its\nHP to the foe's HP,\nthen equally shares\nthe total HP.$" -gUnknown_84862F3:: @ 84862F3 +gMoveDescription_SacredFire:: @ 84862F3 .string "A mystical and\npowerful fire\nattack that may\ninflict a burn.$" -gUnknown_8486330:: @ 8486330 +gMoveDescription_Magnitude:: @ 8486330 .string "A ground-shaking\nattack against all\nstanding POKéMON.\nIts power varies.$" -gUnknown_8486378:: @ 8486378 +gMoveDescription_DynamicPunch:: @ 8486378 .string "The foe is punched\nwith the user's full\npower. It confuses\nthe foe if it hits.$" -gUnknown_84863C7:: @ 84863C7 +gMoveDescription_Megahorn:: @ 84863C7 .string "A brutal ramming\nattack delivered\nwith a tough and\nimpressive horn.$" -gUnknown_848640B:: @ 848640B +gMoveDescription_DragonBreath:: @ 848640B .string "The foe is hit with\nan incredible blast\nof breath that may\nalso paralyze.$" -gUnknown_8486455:: @ 8486455 +gMoveDescription_BatonPass:: @ 8486455 .string "The user switches\nout, passing along\nany stat changes\nto the new battler.$" -gUnknown_848649F:: @ 848649F +gMoveDescription_Encore:: @ 848649F .string "Makes the foe use\nthe move it last\nused repeatedly for\ntwo to six turns.$" -gUnknown_84864E8:: @ 84864E8 +gMoveDescription_Pursuit:: @ 84864E8 .string "An attack move that\nworks especially\nwell on a foe that\nis switching out.$" -gUnknown_8486532:: @ 8486532 +gMoveDescription_RapidSpin:: @ 8486532 .string "An attack that\nfrees the user from\nBIND, WRAP, LEECH\nSEED, and SPIKES.$" -gUnknown_8486579:: @ 8486579 +gMoveDescription_SweetScent:: @ 8486579 .string "Allures the foe to\nreduce evasiveness.\nIt also attracts\nwild POKéMON.$" -gUnknown_84865BF:: @ 84865BF +gMoveDescription_IronTail:: @ 84865BF .string "An attack with a\nsteel-hard tail.\nIt may lower the\nfoe's DEFENSE stat.$" -gUnknown_8486606:: @ 8486606 +gMoveDescription_MetalClaw:: @ 8486606 .string "The foe is attacked\nwith steel claws.\nIt may also raise\nthe user's ATTACK.$" -gUnknown_8486651:: @ 8486651 +gMoveDescription_VitalThrow:: @ 8486651 .string "Makes the user\nattack after the\nfoe. In return,\nit will not miss.$" -gUnknown_8486693:: @ 8486693 +gMoveDescription_MorningSun:: @ 8486693 .string "Restores the user's\nHP. The amount of\nHP regained varies\nwith the weather.$" -gUnknown_84866DE:: @ 84866DE +gMoveDescription_Synthesis:: @ 84866DE .string "Restores the user's\nHP. The amount of\nHP regained varies\nwith the weather.$" -gUnknown_8486729:: @ 8486729 +gMoveDescription_Moonlight:: @ 8486729 .string "Restores the user's\nHP. The amount of\nHP regained varies\nwith the weather.$" -gUnknown_8486774:: @ 8486774 +gMoveDescription_HiddenPower:: @ 8486774 .string "An attack that\nvaries in type and\nintensity depending\non the user.$" -gUnknown_84867B7:: @ 84867B7 +gMoveDescription_CrossChop:: @ 84867B7 .string "The foe is hit with\ndouble chops.\nIt has a high\ncritical-hit ratio.$" -gUnknown_84867FB:: @ 84867FB +gMoveDescription_Twister:: @ 84867FB .string "A vicious twister\nattacks the foe.\nIt may make the\nfoe flinch.$" -gUnknown_848683A:: @ 848683A +gMoveDescription_RainDance:: @ 848683A .string "A heavy rain falls\nfor five turns,\npowering up WATER-\ntype moves.$" -gUnknown_848687C:: @ 848687C +gMoveDescription_SunnyDay:: @ 848687C .string "The sun blazes for\nfive turns, powering\nup FIRE-type\nmoves.$" -gUnknown_84868B8:: @ 84868B8 +gMoveDescription_Crunch:: @ 84868B8 .string "The foe is crunched\nwith sharp fangs.\nIt may lower the\nfoe's SP. DEF.$" -gUnknown_84868FE:: @ 84868FE +gMoveDescription_MirrorCoat:: @ 84868FE .string "A retaliation move\nthat pays back the\nfoe's special attack\ndouble.$" -gUnknown_8486941:: @ 8486941 +gMoveDescription_PsychUp:: @ 8486941 .string "The user hypnotizes\nitself into copying\nany stat change\nmade by the foe.$" -gUnknown_848698A:: @ 848698A +gMoveDescription_ExtremeSpeed:: @ 848698A .string "A blindingly speedy\ncharge attack that\nalways goes before\nany other.$" -gUnknown_84869CF:: @ 84869CF +gMoveDescription_AncientPower:: @ 84869CF .string "An ancient power is\nused to attack. It\nmay also raise all\nthe user's stats.$" -gUnknown_8486A1B:: @ 8486A1B +gMoveDescription_ShadowBall:: @ 8486A1B .string "A shadowy blob is\nhurled at the foe.\nMay also lower the\nfoe's SP. DEF.$" -gUnknown_8486A62:: @ 8486A62 +gMoveDescription_FutureSight:: @ 8486A62 .string "Two turns after\nthis move is used,\nthe foe is attacked\npsychically.$" -gUnknown_8486AA6:: @ 8486AA6 +gMoveDescription_RockSmash:: @ 8486AA6 .string "An attack that may\nalso cut DEFENSE.\nIt can also smash\ncracked boulders.$" -gUnknown_8486AEF:: @ 8486AEF +gMoveDescription_Whirlpool:: @ 8486AEF .string "The foe is trapped\nin a fast, vicious\nwhirlpool for two\nto five turns.$" -gUnknown_8486B36:: @ 8486B36 +gMoveDescription_BeatUp:: @ 8486B36 .string "All party POKéMON\njoin in the attack.\nThe more allies,\nthe more damage.$" -gUnknown_8486B7E:: @ 8486B7E +gMoveDescription_FakeOut:: @ 8486B7E .string "An attack that hits\nfirst and causes\nflinching. Usable\nonly on 1st turn.$" -gUnknown_8486BC7:: @ 8486BC7 +gMoveDescription_Uproar:: @ 8486BC7 .string "The user attacks in\nan uproar that\nprevents sleep for\ntwo to five turns.$" -gUnknown_8486C10:: @ 8486C10 +gMoveDescription_Stockpile:: @ 8486C10 .string "The user charges\nup power for use\nlater. It can be\nused three times.$" -gUnknown_8486C55:: @ 8486C55 +gMoveDescription_SpitUp:: @ 8486C55 .string "The power built\nusing STOCKPILE is\nreleased at once\nfor attack.$" -gUnknown_8486C95:: @ 8486C95 +gMoveDescription_Swallow:: @ 8486C95 .string "The energy it built\nusing STOCKPILE is\nabsorbed to restore\nHP.$" -gUnknown_8486CD4:: @ 8486CD4 +gMoveDescription_HeatWave:: @ 8486CD4 .string "The user exhales a\nheated breath to\nattack. It may also\ninflict a burn.$" -gUnknown_8486D1C:: @ 8486D1C +gMoveDescription_Hail:: @ 8486D1C .string "A hailstorm lasting\nfive turns damages\nall POKéMON except\nthe ICE-type.$" -gUnknown_8486D64:: @ 8486D64 +gMoveDescription_Torment:: @ 8486D64 .string "It enrages the foe,\nmaking it incapable\nof using the same\nmove successively.$" -gUnknown_8486DB1:: @ 8486DB1 +gMoveDescription_Flatter:: @ 8486DB1 .string "Flattery is used to\nconfuse the foe,\nbut its SP. ATK\nalso rises.$" -gUnknown_8486DF2:: @ 8486DF2 +gMoveDescription_WillOWisp:: @ 8486DF2 .string "A sinister, bluish\nwhite flame is shot\nat the foe to\ninflict a burn.$" -gUnknown_8486E37:: @ 8486E37 +gMoveDescription_Memento:: @ 8486E37 .string "The user faints,\nbut sharply lowers\nthe foe's ATTACK\nand SP. ATK.$" -gUnknown_8486E79:: @ 8486E79 +gMoveDescription_Facade:: @ 8486E79 .string "An attack that is\nboosted if user is\nburned, poisoned,\nor paralyzed.$" -gUnknown_8486EBE:: @ 8486EBE +gMoveDescription_FocusPunch:: @ 8486EBE .string "An attack that is\nexecuted last.\nThe user flinches\nif hit beforehand.$" -gUnknown_8486F04:: @ 8486F04 +gMoveDescription_SmellingSalt:: @ 8486F04 .string "Doubly effective on\na paralyzed foe,\nbut it also cures\nthe foe's paralysis.$" -gUnknown_8486F50:: @ 8486F50 +gMoveDescription_FollowMe:: @ 8486F50 .string "The user draws\nattention to itself,\nmaking foes attack\nonly the user.$" -gUnknown_8486F96:: @ 8486F96 +gMoveDescription_NaturePower:: @ 8486F96 .string "An attack that\nchanges type\ndepending on the\nuser's location.$" -gUnknown_8486FD4:: @ 8486FD4 +gMoveDescription_Charge:: @ 8486FD4 .string "The user charges\npower to boost the\nELECTRIC move it\nuses next.$" -gUnknown_8487014:: @ 8487014 +gMoveDescription_Taunt:: @ 8487014 .string "The foe is taunted\ninto a rage that\nallows it to use\nonly attack moves.$" -gUnknown_848705C:: @ 848705C +gMoveDescription_HelpingHand:: @ 848705C .string "A move that boosts\nthe power of the\nally's attack in a\nbattle.$" -gUnknown_848709B:: @ 848709B +gMoveDescription_Trick:: @ 848709B .string "A move that tricks\nthe foe into\ntrading held items\nwith the user.$" -gUnknown_84870DD:: @ 84870DD +gMoveDescription_RolePlay:: @ 84870DD .string "The user mimics the\nfoe completely and\ncopies the foe's\nability.$" -gUnknown_848711E:: @ 848711E +gMoveDescription_Wish:: @ 848711E .string "A self-healing move\nthat restores half\nthe full HP on the\nnext turn.$" -gUnknown_8487163:: @ 8487163 +gMoveDescription_Assist:: @ 8487163 .string "The user randomly\npicks and uses a\nmove of an allied\nPOKéMON.$" -gUnknown_84871A1:: @ 84871A1 +gMoveDescription_Ingrain:: @ 84871A1 .string "The user lays roots\nthat restore HP on\nevery turn.\nIt can't switch out.$" -gUnknown_84871E9:: @ 84871E9 +gMoveDescription_Superpower:: @ 84871E9 .string "A powerful attack,\nbut it also lowers\nthe user's ATTACK\nand DEFENSE stats.$" -gUnknown_8487234:: @ 8487234 +gMoveDescription_MagicCoat:: @ 8487234 .string "Reflects back the\nfoe's LEECH SEED\nand any status-\ndamaging move.$" -gUnknown_8487276:: @ 8487276 +gMoveDescription_Recycle:: @ 8487276 .string "A move that\nrecycles a used\nitem for use once\nmore.$" -gUnknown_84872AA:: @ 84872AA +gMoveDescription_Revenge:: @ 84872AA .string "An attack move that\ngains in intensity if\nthe target has hurt\nthe user.$" -gUnknown_84872F2:: @ 84872F2 +gMoveDescription_BrickBreak:: @ 84872F2 .string "An attack that also\nbreaks any barrier\nlike LIGHT SCREEN\nand REFLECT.$" -gUnknown_8487338:: @ 8487338 +gMoveDescription_Yawn:: @ 8487338 .string "A huge yawn lulls\nthe foe into falling\nasleep on the next\nturn.$" -gUnknown_8487378:: @ 8487378 +gMoveDescription_KnockOff:: @ 8487378 .string "Knocks down the\nfoe's held item to\nprevent its use\nduring the battle.$" -gUnknown_84873BE:: @ 84873BE +gMoveDescription_Endeavor:: @ 84873BE .string "Gains power the\nfewer HP the user\nhas compared with\nthe foe.$" -gUnknown_84873FB:: @ 84873FB +gMoveDescription_Eruption:: @ 84873FB .string "The higher the\nuser's HP, the more\npowerful this\nattack becomes.$" -gUnknown_848743C:: @ 848743C +gMoveDescription_SkillSwap:: @ 848743C .string "The user employs\nits psychic power\nto swap abilities\nwith the foe.$" -gUnknown_848747F:: @ 848747F +gMoveDescription_Imprison:: @ 848747F .string "Prevents foes from\nusing any move\nthat is also known\nby the user.$" -gUnknown_84874C1:: @ 84874C1 +gMoveDescription_Refresh:: @ 84874C1 .string "A self-healing move\nthat cures the user\nof a poisoning,\nburn, or paralysis.$" -gUnknown_848750D:: @ 848750D +gMoveDescription_Grudge:: @ 848750D .string "If the user faints,\nthis move deletes\nthe PP of the move\nthat finished it.$" -gUnknown_8487558:: @ 8487558 +gMoveDescription_Snatch:: @ 8487558 .string "Steals the effects\nof the foe's\nhealing or status-\nchanging move.$" -gUnknown_848759A:: @ 848759A +gMoveDescription_SecretPower:: @ 848759A .string "An attack that may\nhave an additional\neffect that varies\nwith the terrain.$" -gUnknown_84875E5:: @ 84875E5 +gMoveDescription_Dive:: @ 84875E5 .string "The user dives\nunderwater on the\nfirst turn and\nstrikes next turn.$" -gUnknown_8487628:: @ 8487628 +gMoveDescription_ArmThrust:: @ 8487628 .string "A quick flurry of\nstraight-arm\npunches that hit\ntwo to five times.$" -gUnknown_848766B:: @ 848766B +gMoveDescription_Camouflage:: @ 848766B .string "Alters the user's\ntype depending on\nthe location's\nterrain.$" -gUnknown_84876A7:: @ 84876A7 +gMoveDescription_TailGlow:: @ 84876A7 .string "The user flashes a\nlight that sharply\nraises its SP. ATK\nstat.$" -gUnknown_84876E6:: @ 84876E6 +gMoveDescription_LusterPurge:: @ 84876E6 .string "A burst of light\ninjures the foe. It\nmay also lower the\nfoe's SP. DEF.$" -gUnknown_848772D:: @ 848772D +gMoveDescription_MistBall:: @ 848772D .string "A flurry of down\nhits the foe. It\nmay also lower the\nfoe's SP. ATK.$" -gUnknown_8487771:: @ 8487771 +gMoveDescription_FeatherDance:: @ 8487771 .string "The foe is covered\nwith a mass of down\nthat sharply cuts\nthe ATTACK stat.$" -gUnknown_84877BB:: @ 84877BB +gMoveDescription_TeeterDance:: @ 84877BB .string "A wobbly dance\nthat confuses all\nthe POKéMON in\nbattle.$" -gUnknown_84877F3:: @ 84877F3 +gMoveDescription_BlazeKick:: @ 84877F3 .string "A fiery kick with a\nhigh critical-hit\nratio. It may also\nburn the foe.$" -gUnknown_848783A:: @ 848783A +gMoveDescription_MudSport:: @ 848783A .string "Weakens ELECTRIC-\ntype attacks while\nthe user is in the\nbattle.$" -gUnknown_848787A:: @ 848787A +gMoveDescription_IceBall:: @ 848787A .string "A 5-turn rolling\nattack that becomes\nstronger each time\nit rolls.$" -gUnknown_84878BC:: @ 84878BC +gMoveDescription_NeedleArm:: @ 84878BC .string "An attack using\nthorny arms.\nIt may make the\nfoe flinch.$" -gUnknown_84878F5:: @ 84878F5 +gMoveDescription_SlackOff:: @ 84878F5 .string "The user slacks off\nand restores its HP\nby half its full\nHP.$" -gUnknown_8487932:: @ 8487932 +gMoveDescription_HyperVoice:: @ 8487932 .string "The user lets loose\na horribly loud\nshout with the\npower to damage.$" -gUnknown_8487976:: @ 8487976 +gMoveDescription_PoisonFang:: @ 8487976 .string "The foe is bitten\nwith toxic fangs.\nIt may also badly\npoison the foe.$" -gUnknown_84879BC:: @ 84879BC +gMoveDescription_CrushClaw:: @ 84879BC .string "The foe is attacked\nwith sharp claws.\nIt may also lower\nthe foe's DEFENSE.$" -gUnknown_8487A07:: @ 8487A07 +gMoveDescription_BlastBurn:: @ 8487A07 .string "The foe is hit with\na huge explosion.\nThe user can't move\non the next turn.$" -gUnknown_8487A53:: @ 8487A53 +gMoveDescription_HydroCannon:: @ 8487A53 .string "The foe is hit with\na watery cannon.\nThe user can't move\non the next turn.$" -gUnknown_8487A9E:: @ 8487A9E +gMoveDescription_MeteorMash:: @ 8487A9E .string "The foe is hit with\na hard, fast punch.\nIt may also raise\nthe user's ATTACK.$" -gUnknown_8487AEB:: @ 8487AEB +gMoveDescription_Astonish:: @ 8487AEB .string "An attack using a\nstartling shout.\nIt also may make\nthe foe flinch.$" -gUnknown_8487B2F:: @ 8487B2F +gMoveDescription_WeatherBall:: @ 8487B2F .string "An attack that\nvaries in power and\ntype depending on\nthe weather.$" -gUnknown_8487B71:: @ 8487B71 +gMoveDescription_Aromatherapy:: @ 8487B71 .string "A soothing scent is\nreleased to heal\nall status problems\nin the user's party.$" -gUnknown_8487BBF:: @ 8487BBF +gMoveDescription_FakeTears:: @ 8487BBF .string "The user feigns\ncrying to sharply\nlower the foe's\nSP. DEF stat.$" -gUnknown_8487BFF:: @ 8487BFF +gMoveDescription_AirCutter:: @ 8487BFF .string "The foe is hit with\nrazor-like wind.\nIt has a high\ncritical-hit ratio.$" -gUnknown_8487C46:: @ 8487C46 +gMoveDescription_Overheat:: @ 8487C46 .string "An intense attack\nthat also sharply\nreduces the user's\nSP. ATK stat.$" -gUnknown_8487C8B:: @ 8487C8B +gMoveDescription_OdorSleuth:: @ 8487C8B .string "Completely negates\nthe foe's efforts to\nheighten its ability\nto evade.$" -gUnknown_8487CD2:: @ 8487CD2 +gMoveDescription_RockTomb:: @ 8487CD2 .string "Boulders are hurled\nat the foe. It also\nlowers the foe's\nSPEED if it hits.$" -gUnknown_8487D1D:: @ 8487D1D +gMoveDescription_SilverWind:: @ 8487D1D .string "The foe is attacked\nwith a silver dust.\nIt may raise all\nthe user's stats.$" -gUnknown_8487D68:: @ 8487D68 +gMoveDescription_MetalSound:: @ 8487D68 .string "A horrible metallic\nscreech is used to\nsharply lower the\nfoe's SP. DEF.$" -gUnknown_8487DB0:: @ 8487DB0 +gMoveDescription_GrassWhistle:: @ 8487DB0 .string "A pleasant melody\nis played to lull\nthe foe into a deep\nsleep.$" -gUnknown_8487DEF:: @ 8487DEF +gMoveDescription_Tickle:: @ 8487DEF .string "The foe is made to\nlaugh, reducing its\nATTACK and DEFENSE\nstats.$" -gUnknown_8487E30:: @ 8487E30 +gMoveDescription_CosmicPower:: @ 8487E30 .string "The user absorbs a\nmystic power to\nraise its DEFENSE\nand SP. DEF.$" -gUnknown_8487E72:: @ 8487E72 +gMoveDescription_WaterSpout:: @ 8487E72 .string "The higher the\nuser's HP, the more\npowerful this\nattack becomes.$" -gUnknown_8487EB3:: @ 8487EB3 +gMoveDescription_SignalBeam:: @ 8487EB3 .string "The foe is hit with\na flashing beam\nthat may also\ncause confusion.$" -gUnknown_8487EF6:: @ 8487EF6 +gMoveDescription_ShadowPunch:: @ 8487EF6 .string "The user throws a\npunch from the\nshadows. It cannot\nbe evaded.$" -gUnknown_8487F35:: @ 8487F35 +gMoveDescription_Extrasensory:: @ 8487F35 .string "The user attacks\nwith an odd power\nthat may make the\nfoe flinch.$" -gUnknown_8487F76:: @ 8487F76 +gMoveDescription_SkyUppercut:: @ 8487F76 .string "The user attacks\nwith an uppercut\nthrown skywards\nwith force.$" -gUnknown_8487FB4:: @ 8487FB4 +gMoveDescription_SandTomb:: @ 8487FB4 .string "The foe is trapped\ninside a painful\nsandstorm for two\nto five turns.$" -gUnknown_8487FF9:: @ 8487FF9 +gMoveDescription_SheerCold:: @ 8487FF9 .string "The foe is attacked\nwith ultimate cold\nthat causes fainting\nif it hits.$" -gUnknown_8488041:: @ 8488041 +gMoveDescription_MuddyWater:: @ 8488041 .string "The user attacks\nwith muddy water.\nIt may also lower\nthe foe's accuracy.$" -gUnknown_848808A:: @ 848808A +gMoveDescription_BulletSeed:: @ 848808A .string "The user shoots\nseeds at the foe.\nTwo to five seeds\nare shot at once.$" -gUnknown_84880D0:: @ 84880D0 +gMoveDescription_AerialAce:: @ 84880D0 .string "An extremely fast\nattack against one\ntarget. It can't be\nevaded.$" -gUnknown_8488111:: @ 8488111 +gMoveDescription_IcicleSpear:: @ 8488111 .string "Sharp icicles are\nfired at the foe.\nIt strikes two to\nfive times.$" -gUnknown_8488153:: @ 8488153 +gMoveDescription_IronDefense:: @ 8488153 .string "The user hardens\nits body's surface\nto sharply raise its\nDEFENSE stat.$" -gUnknown_848819A:: @ 848819A +gMoveDescription_Block:: @ 848819A .string "The user blocks the\nfoe's way with arms\nspread wide to\nprevent escape.$" -gUnknown_84881E1:: @ 84881E1 +gMoveDescription_Howl:: @ 84881E1 .string "The user howls to\nraise its spirit and\nboost its ATTACK\nstat.$" -gUnknown_848821F:: @ 848821F +gMoveDescription_DragonClaw:: @ 848821F .string "Sharp, huge claws\nhook and slash the\nfoe quickly and\nwith great power.$" -gUnknown_8488266:: @ 8488266 +gMoveDescription_FrenzyPlant:: @ 8488266 .string "The foe is hit with\nan enormous branch.\nThe user can't move\non the next turn.$" -gUnknown_84882B4:: @ 84882B4 +gMoveDescription_BulkUp:: @ 84882B4 .string "The user bulks up\nits body to boost\nboth its ATTACK and\nDEFENSE stats.$" -gUnknown_84882FB:: @ 84882FB +gMoveDescription_Bounce:: @ 84882FB .string "The user bounces\non the foe on the\n2nd turn. It may\nparalyze the foe.$" -gUnknown_8488341:: @ 8488341 +gMoveDescription_MudShot:: @ 8488341 .string "The user attacks by\nhurling mud.\nIt also reduces the\nfoe's SPEED.$" -gUnknown_8488383:: @ 8488383 +gMoveDescription_PoisonTail:: @ 8488383 .string "An attack with a\nhigh critical-hit\nratio. It may also\npoison the foe.$" -gUnknown_84883C9:: @ 84883C9 +gMoveDescription_Covet:: @ 84883C9 .string "A cutely executed\nattack that also\nsteals the foe's\nhold item.$" -gUnknown_8488408:: @ 8488408 +gMoveDescription_VoltTackle:: @ 8488408 .string "The user throws an\nelectrified tackle.\nIt hurts the user\na little.$" -gUnknown_848844B:: @ 848844B +gMoveDescription_MagicalLeaf:: @ 848844B .string "The foe is attacked\nwith a strange leaf\nthat cannot be\nevaded.$" -gUnknown_848848A:: @ 848848A +gMoveDescription_WaterSport:: @ 848848A .string "Weakens FIRE-type\nattacks while the\nuser is in the\nbattle.$" -gUnknown_84884C5:: @ 84884C5 +gMoveDescription_CalmMind:: @ 84884C5 .string "The user focuses\nits mind to raise\nthe SP. ATK and\nSP. DEF stats.$" -gUnknown_8488507:: @ 8488507 +gMoveDescription_LeafBlade:: @ 8488507 .string "The foe is slashed\nwith a sharp leaf.\nIt has a high\ncritical-hit ratio.$" -gUnknown_848854F:: @ 848854F +gMoveDescription_DragonDance:: @ 848854F .string "A mystic, powerful\ndance that boosts\nthe user's ATTACK\nand SPEED stats.$" -gUnknown_8488597:: @ 8488597 +gMoveDescription_RockBlast:: @ 8488597 .string "The user hurls two\nto five hard rocks\nat the foe to\nattack.$" -gUnknown_84885D3:: @ 84885D3 +gMoveDescription_ShockWave:: @ 84885D3 .string "A rapid jolt of\nelectricity strikes\nthe foe. It can't\nbe evaded.$" -gUnknown_8488614:: @ 8488614 +gMoveDescription_WaterPulse:: @ 8488614 .string "An attack with a\npulsing blast of\nwater. It may also\nconfuse the foe.$" -gUnknown_848865A:: @ 848865A +gMoveDescription_DoomDesire:: @ 848865A .string "A move that attacks\nthe foe with a\nblast of light two\nturns after use.$" -gUnknown_84886A1:: @ 84886A1 +gMoveDescription_PsychoBoost:: @ 84886A1 .string "An intense attack\nthat also sharply\nreduces the user's\nSP. ATK stat.$" -gUnknown_84886E6:: @ 84886E6 - .string " " - diff --git a/include/berry_pouch.h b/include/berry_pouch.h new file mode 100644 index 000000000..8427afc7e --- /dev/null +++ b/include/berry_pouch.h @@ -0,0 +1,7 @@ +#ifndef GUARD_BERRY_POUCH_H +#define GUARD_BERRY_POUCH_H + +void sub_813D808(u8 taskId); +void sub_813D934(void (*)(void)); + +#endif //GUARD_BERRY_POUCH_H diff --git a/include/bike.h b/include/bike.h index 468c48273..9185afb31 100644 --- a/include/bike.h +++ b/include/bike.h @@ -2,5 +2,7 @@ #define GUARD_BIKE_H void sub_80BD620(u32 unkC, u32 unk10); +bool8 sub_80BD540(void); +void sub_80BD5C8(u8 flags); #endif //GUARD_BIKE_H diff --git a/include/constants/global.h b/include/constants/global.h new file mode 100644 index 000000000..4e798d1ef --- /dev/null +++ b/include/constants/global.h @@ -0,0 +1,79 @@ +#ifndef GUARD_CONSTANTS_GLOBAL_H +#define GUARD_CONSTANTS_GLOBAL_H + +#define POKEMON_SLOTS_NUMBER 412 + +#define ITEM_NAME_LENGTH 14 +#define POKEMON_NAME_LENGTH 10 +#define OT_NAME_LENGTH 7 + +enum +{ + VERSION_SAPPHIRE = 1, + VERSION_RUBY = 2, + VERSION_EMERALD = 3, + VERSION_FIRE_RED = 4, + VERSION_LEAF_GREEN = 5, +}; + +enum LanguageId { + LANGUAGE_JAPANESE = 1, + LANGUAGE_ENGLISH = 2, + LANGUAGE_FRENCH = 3, + LANGUAGE_ITALIAN = 4, + LANGUAGE_GERMAN = 5, + // 6 goes unused but the theory is it was meant to be Korean + LANGUAGE_SPANISH = 7, +}; + +#define GAME_LANGUAGE (LANGUAGE_ENGLISH) + +#define PC_ITEMS_COUNT 30 +#define BAG_ITEMS_COUNT 42 +#define BAG_KEYITEMS_COUNT 30 +#define BAG_POKEBALLS_COUNT 13 +#define BAG_TMHM_COUNT 58 +#define BAG_BERRIES_COUNT 43 + +enum +{ + MALE, + FEMALE +}; + +enum +{ + OPTIONS_BUTTON_MODE_NORMAL, + OPTIONS_BUTTON_MODE_LR, + OPTIONS_BUTTON_MODE_L_EQUALS_A +}; + +enum +{ + OPTIONS_TEXT_SPEED_SLOW, + OPTIONS_TEXT_SPEED_MID, + OPTIONS_TEXT_SPEED_FAST +}; + +enum +{ + OPTIONS_SOUND_MONO, + OPTIONS_SOUND_STEREO +}; + +enum +{ + OPTIONS_BATTLE_STYLE_SHIFT, + OPTIONS_BATTLE_STYLE_SET +}; + +enum +{ + POCKET_ITEMS = 1, + POCKET_KEY_ITEMS, + POCKET_POKE_BALLS, + POCKET_TM_CASE, + POCKET_BERRY_POUCH, +}; + +#endif //GUARD_CONSTANTS_GLOBAL_H diff --git a/include/constants/items.h b/include/constants/items.h index cc73119e6..6959ad358 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -395,11 +395,4 @@ // Check if the item is one that can be used on a Pokemon. #define IS_POKEMON_ITEM(item) ((item) >= ITEM_POTION && (item) <= ITEM_0B2) -// POCKETS -#define POCKET_ITEMS 1 -#define POCKET_KEY_ITEMS 2 -#define POCKET_POKE_BALLS 3 -#define POCKET_TM_CASE 4 -#define POCKET_BERRY_POUCH 5 - #endif // GUARD_CONSTANTS_ITEMS_H diff --git a/include/field_fadetransition.h b/include/field_fadetransition.h index d0856c84c..4ba350491 100644 --- a/include/field_fadetransition.h +++ b/include/field_fadetransition.h @@ -14,5 +14,6 @@ void sub_807E500(void); void sub_807DF64(void); void sub_807DC18(void); void FieldCallback_ReturnToEventScript2(void); +void sub_807DC00(void); #endif // GUARD_FIELD_FADETRANSITION_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index b365a9d92..4871bd082 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -22,5 +22,7 @@ void sub_805D9C4(struct Sprite *sprite); void sub_805D154(u8 direction); void sub_805DAE4(u8 direction); void SetPlayerAvatarTransitionFlags(u16 a); +bool8 IsPlayerFacingSurfableFishableWater(void); +void sub_805D2C0(u8 secondaryId); #endif //GUARD_FIELD_PLAYER_AVATAR_H diff --git a/include/field_weather.h b/include/field_weather.h index cf0e34d06..13a1b4fcb 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -13,5 +13,6 @@ void DoCurrentWeather(void); void SetSav1WeatherFromCurrMapHeader(void); void sub_807B0C4(u16 *, u16 *, u32); void PlayRainStoppingSoundEffect(void); +bool8 sub_807AA70(void); #endif // GUARD_WEATHER_H diff --git a/include/global.h b/include/global.h index d08a1e0df..050c311e4 100644 --- a/include/global.h +++ b/include/global.h @@ -4,6 +4,7 @@ #include "config.h" #include "gba/gba.h" #include +#include "constants/global.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); @@ -39,10 +40,6 @@ // Converts a number to Q4.12 fixed-point format #define Q_4_12(n) ((s16)((n) * 4096)) -#define POKEMON_SLOTS_NUMBER 412 -#define POKEMON_NAME_LENGTH 10 -#define OT_NAME_LENGTH 7 - #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) >= (b) ? (a) : (b)) @@ -79,75 +76,6 @@ extern u8 gStringVar2[]; extern u8 gStringVar3[]; extern u8 gStringVar4[]; -enum -{ - VERSION_SAPPHIRE = 1, - VERSION_RUBY = 2, - VERSION_EMERALD = 3, - VERSION_FIRE_RED = 4, - VERSION_LEAF_GREEN = 5, -}; - -enum LanguageId { - LANGUAGE_JAPANESE = 1, - LANGUAGE_ENGLISH = 2, - LANGUAGE_FRENCH = 3, - LANGUAGE_ITALIAN = 4, - LANGUAGE_GERMAN = 5, - // 6 goes unused but the theory is it was meant to be Korean - LANGUAGE_SPANISH = 7, -}; - -#define GAME_LANGUAGE (LANGUAGE_ENGLISH) - -#define PC_ITEMS_COUNT 30 -#define BAG_ITEMS_COUNT 42 -#define BAG_KEYITEMS_COUNT 30 -#define BAG_POKEBALLS_COUNT 13 -#define BAG_TMHM_COUNT 58 -#define BAG_BERRIES_COUNT 43 - -enum -{ - MALE, - FEMALE -}; - -enum -{ - OPTIONS_BUTTON_MODE_NORMAL, - OPTIONS_BUTTON_MODE_LR, - OPTIONS_BUTTON_MODE_L_EQUALS_A -}; - -enum -{ - OPTIONS_TEXT_SPEED_SLOW, - OPTIONS_TEXT_SPEED_MID, - OPTIONS_TEXT_SPEED_FAST -}; - -enum -{ - OPTIONS_SOUND_MONO, - OPTIONS_SOUND_STEREO -}; - -enum -{ - OPTIONS_BATTLE_STYLE_SHIFT, - OPTIONS_BATTLE_STYLE_SET -}; - -enum -{ - BAG_ITEMS = 1, - BAG_POKEBALLS, - BAG_TMsHMs, - BAG_BERRIES, - BAG_KEYITEMS -}; - struct Coords16 { s16 x; diff --git a/include/item.h b/include/item.h index f5a8db699..f21c207e0 100644 --- a/include/item.h +++ b/include/item.h @@ -1,18 +1,20 @@ -#ifndef ITEM_H -#define ITEM_H +#ifndef GUARD_ITEM_H +#define GUARD_ITEM_H + +#include "global.h" typedef void (*ItemUseFunc)(u8); struct Item { - u8 name[14]; + u8 name[ITEM_NAME_LENGTH]; u16 itemId; u16 price; u8 holdEffect; u8 holdEffectParam; const u8 *description; u8 importance; - u8 unk19; + u8 exitsBagOnUse; u8 pocket; u8 type; ItemUseFunc fieldUseFunc; @@ -76,4 +78,4 @@ u16 GetBagItemId(u16 *); void ItemPcCompaction(void); void RemoveItemFromPC(u16 itemId, u16 quantity); -#endif // ITEM_H +#endif // GUARD_ITEM_H diff --git a/include/item_menu.h b/include/item_menu.h index 2d4be4fd7..b4815d164 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -28,5 +28,10 @@ void sub_8108CF0(void); void sub_810B108(u8); void UseFameCheckerFromMenu(void); void ItemMenu_MoveItemSlotToNewPositionInArray(struct ItemSlot * slots, int pos1, int pos2); +void sub_8108B50(u8 taskId); +void sub_8108CB4(void); +void sub_8108EE0(void (*)(void)); +void sub_8108E70(u8, u8, const u8 *, void (*)(u8)); +void sub_810A1F8(u8 taskId); #endif //GUARD_ITEM_MENU_H diff --git a/include/item_use.h b/include/item_use.h index 04e61ab59..a34090af1 100644 --- a/include/item_use.h +++ b/include/item_use.h @@ -6,4 +6,37 @@ void sub_80A1E0C(u8); void ItemUse_SetQuestLogEvent(u8, struct Pokemon *, u16, u16); +void sub_80A11E8(u8 taskId); +void sub_80A122C(u8 taskId); +void sub_80A1338(u8 taskId); +void sub_80A1460(u8 taskId); +void sub_80A14E8(u8 taskId); +void sub_80A156C(u8 taskId); +void sub_80A16E0(u8 taskId); +void sub_80A16FC(u8 taskId); +void sub_80A1718(u8 taskId); +void sub_80A1734(u8 taskId); +void sub_80A1750(u8 taskId); +void sub_80A176C(u8 taskId); +void sub_80A1788(u8 taskId); +void sub_80A1820(u8 taskId); +void sub_80A18B8(u8 taskId); +void sub_80A18EC(u8 taskId); +void sub_80A1998(u8 taskId); +void sub_80A1A94(u8 taskId); +void sub_80A1C60(u8 taskId); +void sub_80A1CF8(u8 taskId); +void sub_80A1D9C(u8 taskId); +void sub_80A1E1C(u8 taskId); +void sub_80A1E64(u8 taskId); +void sub_80A1E7C(u8 taskId); +void sub_80A1FBC(u8 taskId); +void sub_80A1FF4(u8 taskId); +void sub_80A2010(u8 taskId); +void sub_80A2238(u8 taskId); +void ItemUseOutOfBattle_EscapeRope(u8 taskId); +void ItemUseOutOfBattle_EnigmaBerry(u8 taskId); +void ItemUseInBattle_EnigmaBerry(u8 taskId); +void ItemUseOutOfBattle_Itemfinder(u8 taskId); + #endif //GUARD_ITEM_USE_H diff --git a/include/mail.h b/include/mail.h index 5d6ad559b..8cfca66dd 100644 --- a/include/mail.h +++ b/include/mail.h @@ -21,5 +21,6 @@ bool8 MonHasMail(struct Pokemon *mon); void TakeMailFromMon(struct Pokemon *mon); u8 GiveMailToMon2(struct Pokemon *mon, struct MailStruct *mail); void ClearMailStruct(struct MailStruct *mail); +void sub_80BEBEC(u16 *, void (*)(void), u8); #endif // GUARD_MAIL_H diff --git a/include/overworld.h b/include/overworld.h index b8cf58b4d..122d73736 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -31,6 +31,8 @@ extern MainCallback gFieldCallback; extern struct WarpData gUnknown_2031DBC; +extern u8 gUnknown_2031DE0; + void IncrementGameStat(u8 index); void Overworld_SetMapObjTemplateCoords(u8, s16, s16); @@ -112,5 +114,6 @@ void sub_805671C(void); void sub_8055DC4(void); bool8 sub_8055FC4(void); bool8 is_light_level_8_or_9(u8 mapType); +bool32 sub_8055C9C(void); #endif //GUARD_ROM4_H diff --git a/include/strings.h b/include/strings.h index 08dd25174..805516cec 100644 --- a/include/strings.h +++ b/include/strings.h @@ -161,4 +161,7 @@ extern const u8 gText_WithdrawItem[]; extern const u8 gText_Withdraw[]; extern const u8 gText_ReturnToPC[]; +extern const u8 gUnknown_8416425[]; +extern const u8 gUnknown_8416451[]; + #endif //GUARD_STRINGS_H diff --git a/json_data_rules.mk b/json_data_rules.mk new file mode 100644 index 000000000..1c731078a --- /dev/null +++ b/json_data_rules.mk @@ -0,0 +1,9 @@ +# JSON files are run through jsonproc, which is a tool that converts JSON data to an output file +# based on an Inja template. https://github.com/pantor/inja + +AUTO_GEN_TARGETS += src/data/items.h + +src/data/items.h: src/data/items.json src/data/items.json.txt + $(JSONPROC) $^ $@ + +$(BUILD_DIR)/src/item.o: C_DEP += src/data/items.h diff --git a/ld_script.txt b/ld_script.txt index dd4d92731..64f6928c4 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -153,6 +153,7 @@ SECTIONS { src/fldeff_berrytree.o(.text); asm/field_special_scene.o(.text); asm/safari_zone.o(.text); + src/item_use.o(.text); asm/item_use.o(.text); asm/battle_anim_effects_1.o(.text); asm/battle_anim_effects_2.o(.text); @@ -410,6 +411,8 @@ SECTIONS { data/data_835B488.o(.rodata); src/item_menu_icons.o(.rodata); data/data_835B488.o(.rodata.83D4E4C); + src/item.o(.rodata); + data/data_835B488.o(.rodata.83DF09C); src/heal_location.o(.rodata); data/data_835B488.o(.rodata.83EEC98); src/battle_ai_script_commands.o(.rodata); diff --git a/src/data/items.json b/src/data/items.json new file mode 100644 index 000000000..10d28d899 --- /dev/null +++ b/src/data/items.json @@ -0,0 +1,6062 @@ +{ + "items": [ + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "MASTER BALL", + "itemId": "ITEM_MASTER_BALL", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The best BALL with the ultimate\\nperformance. It will catch any wild\\nPOKéMON without fail.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_POKE_BALLS", + "type": 0, + "fieldUseFunc": "NULL", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E1C", + "secondaryId": 0 + }, + { + "english": "ULTRA BALL", + "itemId": "ITEM_ULTRA_BALL", + "price": 1200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A very high-grade BALL that offers\\na higher POKéMON catch rate than\\na GREAT BALL.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_POKE_BALLS", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E1C", + "secondaryId": 1 + }, + { + "english": "GREAT BALL", + "itemId": "ITEM_GREAT_BALL", + "price": 600, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A good, quality BALL that offers\\na higher POKéMON catch rate than\\na standard POKé BALL.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_POKE_BALLS", + "type": 2, + "fieldUseFunc": "NULL", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E1C", + "secondaryId": 2 + }, + { + "english": "POK\u00e9 BALL", + "itemId": "ITEM_POKE_BALL", + "price": 200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A BALL thrown to catch a wild\\nPOKéMON. It is designed in a\\ncapsule style.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_POKE_BALLS", + "type": 3, + "fieldUseFunc": "NULL", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E1C", + "secondaryId": 3 + }, + { + "english": "SAFARI BALL", + "itemId": "ITEM_SAFARI_BALL", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A special BALL that is used only in\\nthe SAFARI ZONE. It is finished in\\na camouflage pattern.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_POKE_BALLS", + "type": 4, + "fieldUseFunc": "NULL", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E1C", + "secondaryId": 4 + }, + { + "english": "NET BALL", + "itemId": "ITEM_NET_BALL", + "price": 1000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A somewhat different BALL that\\nworks especially well on WATER- and\\nBUG-type POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_POKE_BALLS", + "type": 5, + "fieldUseFunc": "NULL", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E1C", + "secondaryId": 5 + }, + { + "english": "DIVE BALL", + "itemId": "ITEM_DIVE_BALL", + "price": 1000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A somewhat different BALL that\\nworks especially well on POKéMON\\ndeep in the sea.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_POKE_BALLS", + "type": 6, + "fieldUseFunc": "NULL", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E1C", + "secondaryId": 6 + }, + { + "english": "NEST BALL", + "itemId": "ITEM_NEST_BALL", + "price": 1000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A somewhat different BALL that\\nworks especially well on weaker\\nPOKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_POKE_BALLS", + "type": 7, + "fieldUseFunc": "NULL", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E1C", + "secondaryId": 7 + }, + { + "english": "REPEAT BALL", + "itemId": "ITEM_REPEAT_BALL", + "price": 1000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A somewhat different BALL that\\nworks especially well on POKéMON\\ncaught before.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_POKE_BALLS", + "type": 8, + "fieldUseFunc": "NULL", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E1C", + "secondaryId": 8 + }, + { + "english": "TIMER BALL", + "itemId": "ITEM_TIMER_BALL", + "price": 1000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A somewhat different BALL that\\nbecomes progressively better the\\nmore turns there are in a battle.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_POKE_BALLS", + "type": 9, + "fieldUseFunc": "NULL", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E1C", + "secondaryId": 9 + }, + { + "english": "LUXURY BALL", + "itemId": "ITEM_LUXURY_BALL", + "price": 1000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A comfortable BALL that makes a\\ncaptured wild POKéMON quickly grow\\nfriendly.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_POKE_BALLS", + "type": 10, + "fieldUseFunc": "NULL", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E1C", + "secondaryId": 10 + }, + { + "english": "PREMIER BALL", + "itemId": "ITEM_PREMIER_BALL", + "price": 200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A rare BALL that has been\\nspecially made to commemorate an\\nevent of some sort.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_POKE_BALLS", + "type": 11, + "fieldUseFunc": "NULL", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E1C", + "secondaryId": 11 + }, + { + "english": "POTION", + "itemId": "ITEM_POTION", + "price": 300, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 20, + "description_english": "A spray-type wound medicine.\\nIt restores the HP of one POKéMON\\nby 20 points.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "ANTIDOTE", + "itemId": "ITEM_ANTIDOTE", + "price": 100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A spray-type medicine.\\nIt heals one POKéMON from a\\npoisoning.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "BURN HEAL", + "itemId": "ITEM_BURN_HEAL", + "price": 250, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A spray-type medicine.\\nIt heals one POKéMON of a burn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "ICE HEAL", + "itemId": "ITEM_ICE_HEAL", + "price": 250, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A spray-type medicine.\\nIt defrosts a frozen POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "AWAKENING", + "itemId": "ITEM_AWAKENING", + "price": 250, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A spray-type medicine.\\nIt awakens a sleeping POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "PARLYZ HEAL", + "itemId": "ITEM_PARALYZE_HEAL", + "price": 200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A spray-type medicine.\\nIt heals one POKéMON from\\nparalysis.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "FULL RESTORE", + "itemId": "ITEM_FULL_RESTORE", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 255, + "description_english": "A medicine that fully restores the\\nHP and heals any status problems\\nof one POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "MAX POTION", + "itemId": "ITEM_MAX_POTION", + "price": 2500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 255, + "description_english": "A spray-type wound medicine.\\nIt fully restores the HP of one\\nPOKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "HYPER POTION", + "itemId": "ITEM_HYPER_POTION", + "price": 1200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 200, + "description_english": "A spray-type wound medicine.\\nIt restores the HP of one POKéMON\\nby 200 points.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "SUPER POTION", + "itemId": "ITEM_SUPER_POTION", + "price": 700, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 50, + "description_english": "A spray-type wound medicine.\\nIt restores the HP of one POKéMON\\nby 50 points.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "FULL HEAL", + "itemId": "ITEM_FULL_HEAL", + "price": 600, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A spray-type medicine.\\nIt heals all the status problems of\\none POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "REVIVE", + "itemId": "ITEM_REVIVE", + "price": 1500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A medicine that revives a fainted\\nPOKéMON, restoring HP by half the\\nmaximum amount.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "MAX REVIVE", + "itemId": "ITEM_MAX_REVIVE", + "price": 4000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A medicine that revives a fainted\\nPOKéMON, restoring HP fully.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "FRESH WATER", + "itemId": "ITEM_FRESH_WATER", + "price": 200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 50, + "description_english": "Water with a high mineral content.\\nIt restores the HP of one POKéMON\\nby 50 points.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "SODA POP", + "itemId": "ITEM_SODA_POP", + "price": 300, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 60, + "description_english": "A fizzy soda drink.\\nIt restores the HP of one POKéMON\\nby 60 points.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "LEMONADE", + "itemId": "ITEM_LEMONADE", + "price": 350, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 80, + "description_english": "A very sweet drink.\\nIt restores the HP of one POKéMON\\nby 80 points.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "MOOMOO MILK", + "itemId": "ITEM_MOOMOO_MILK", + "price": 500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 100, + "description_english": "Highly nutritious milk.\\nIt restores the HP of one POKéMON\\nby 100 points.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "ENERGYPOWDER", + "itemId": "ITEM_ENERGY_POWDER", + "price": 500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A very bitter medicine powder.\\nIt restores the HP of one POKéMON\\nby 50 points.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "ENERGY ROOT", + "itemId": "ITEM_ENERGY_ROOT", + "price": 800, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A very bitter root.\\nIt restores the HP of one POKéMON\\nby 200 points.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "HEAL POWDER", + "itemId": "ITEM_HEAL_POWDER", + "price": 450, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A very bitter medicine powder.\\nIt heals all the status problems of\\none POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "REVIVAL HERB", + "itemId": "ITEM_REVIVAL_HERB", + "price": 2800, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A very bitter medicinal herb.\\nIt revives a fainted POKéMON,\\nrestoring HP fully.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "ETHER", + "itemId": "ITEM_ETHER", + "price": 1200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 10, + "description_english": "Restores a selected move's PP by\\n10 points for one POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16FC", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FF4", + "secondaryId": 0 + }, + { + "english": "MAX ETHER", + "itemId": "ITEM_MAX_ETHER", + "price": 2000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 255, + "description_english": "Fully restores a selected move's PP\\nfor one POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16FC", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FF4", + "secondaryId": 0 + }, + { + "english": "ELIXIR", + "itemId": "ITEM_ELIXIR", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 10, + "description_english": "Restores the PP of all moves for\\none POKéMON by 10 points each.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16FC", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FF4", + "secondaryId": 0 + }, + { + "english": "MAX ELIXIR", + "itemId": "ITEM_MAX_ELIXIR", + "price": 4500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 255, + "description_english": "Fully restores the PP of all moves\\nfor one POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16FC", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FF4", + "secondaryId": 0 + }, + { + "english": "LAVA COOKIE", + "itemId": "ITEM_LAVA_COOKIE", + "price": 200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "LAVARIDGE TOWN's local specialty.\\nIt heals all the status problems of\\none POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "BLUE FLUTE", + "itemId": "ITEM_BLUE_FLUTE", + "price": 100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A blue glass flute that awakens\\na sleeping POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "YELLOW FLUTE", + "itemId": "ITEM_YELLOW_FLUTE", + "price": 200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A yellow glass flute that snaps one\\nPOKéMON out of confusion.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "RED FLUTE", + "itemId": "ITEM_RED_FLUTE", + "price": 300, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A red glass flute that snaps one\\nPOKéMON out of infatuation.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "BLACK FLUTE", + "itemId": "ITEM_BLACK_FLUTE", + "price": 400, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 50, + "description_english": "A black glass flute.\\nWhen blown, it makes wild POKéMON\\nless likely to appear.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A1A94", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "WHITE FLUTE", + "itemId": "ITEM_WHITE_FLUTE", + "price": 500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 150, + "description_english": "A white glass flute.\\nWhen blown, it makes wild POKéMON\\nmore likely to appear.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A1A94", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BERRY JUICE", + "itemId": "ITEM_BERRY_JUICE", + "price": 100, + "holdEffect": "HOLD_EFFECT_RESTORE_HP", + "holdEffectParam": 20, + "description_english": "A 100% pure juice.\\nIt restores the HP of one POKéMON\\nby 20 points.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "SACRED ASH", + "itemId": "ITEM_SACRED_ASH", + "price": 200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Revives all fainted POKéMON,\\nrestoring HP fully.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A176C", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SHOAL SALT", + "itemId": "ITEM_SHOAL_SALT", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Pure salt obtained from deep inside\\nthe SHOAL CAVE. It is extremely\\nsalty.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SHOAL SHELL", + "itemId": "ITEM_SHOAL_SHELL", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A pretty seashell found deep inside\\nthe SHOAL CAVE. It is striped in\\nblue and white.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "RED SHARD", + "itemId": "ITEM_RED_SHARD", + "price": 200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A small red shard.\\nIt appears to be from some sort of\\na tool made long ago.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BLUE SHARD", + "itemId": "ITEM_BLUE_SHARD", + "price": 200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A small blue shard.\\nIt appears to be from some sort of\\na tool made long ago.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "YELLOW SHARD", + "itemId": "ITEM_YELLOW_SHARD", + "price": 200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A small yellow shard.\\nIt appears to be from some sort of\\na tool made long ago.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "GREEN SHARD", + "itemId": "ITEM_GREEN_SHARD", + "price": 200, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A small green shard.\\nIt appears to be from some sort of\\na tool made long ago.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "HP UP", + "itemId": "ITEM_HP_UP", + "price": 9800, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A nutritious drink for POKéMON.\\nIt raises the base HP of one\\nPOKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "PROTEIN", + "itemId": "ITEM_PROTEIN", + "price": 9800, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A nutritious drink for POKéMON.\\nIt raises the base ATTACK stat of\\none POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "IRON", + "itemId": "ITEM_IRON", + "price": 9800, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A nutritious drink for POKéMON.\\nIt raises the base DEFENSE stat of\\none POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "CARBOS", + "itemId": "ITEM_CARBOS", + "price": 9800, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A nutritious drink for POKéMON.\\nIt raises the base SPEED stat of\\none POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "CALCIUM", + "itemId": "ITEM_CALCIUM", + "price": 9800, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A nutritious drink for POKéMON.\\nIt raises the base SP. ATK stat\\nof one POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "RARE CANDY", + "itemId": "ITEM_RARE_CANDY", + "price": 4800, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A candy that is packed with energy.\\nIt raises the level of a POKéMON\\nby one.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A1734", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "PP UP", + "itemId": "ITEM_PP_UP", + "price": 9800, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Slightly raises the maximum PP of\\na selected move for one POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A1718", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "ZINC", + "itemId": "ITEM_ZINC", + "price": 9800, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A nutritious drink for POKéMON.\\nIt raises the base SP. DEF stat\\nof one POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "PP MAX", + "itemId": "ITEM_PP_MAX", + "price": 9800, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Raises the PP of a selected move\\nto its maximum level for one\\nPOKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A1718", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "GUARD SPEC.", + "itemId": "ITEM_GUARD_SPEC", + "price": 700, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An item that prevents stat reduction\\namong party POKéMON for five turns\\nafter use.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E7C", + "secondaryId": 0 + }, + { + "english": "DIRE HIT", + "itemId": "ITEM_DIRE_HIT", + "price": 650, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Raises the critical-hit ratio of\\nPOKéMON in battle. Wears off if the\\nPOKéMON is withdrawn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E7C", + "secondaryId": 0 + }, + { + "english": "X ATTACK", + "itemId": "ITEM_X_ATTACK", + "price": 500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Raises the ATTACK stat of POKéMON\\nin battle. Wears off if the POKéMON\\nis withdrawn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E7C", + "secondaryId": 0 + }, + { + "english": "X DEFEND", + "itemId": "ITEM_X_DEFEND", + "price": 550, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Raises the DEFENSE stat of POKéMON\\nin battle. Wears off if the POKéMON\\nis withdrawn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E7C", + "secondaryId": 0 + }, + { + "english": "X SPEED", + "itemId": "ITEM_X_SPEED", + "price": 350, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Raises the SPEED stat of POKéMON\\nin battle. Wears off if the POKéMON\\nis withdrawn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E7C", + "secondaryId": 0 + }, + { + "english": "X ACCURACY", + "itemId": "ITEM_X_ACCURACY", + "price": 950, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Raises the accuracy stat of\\nPOKéMON in battle. Wears off if the\\nPOKéMON is withdrawn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E7C", + "secondaryId": 0 + }, + { + "english": "X SPECIAL", + "itemId": "ITEM_X_SPECIAL", + "price": 350, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Raises the SP. ATK stat of\\nPOKéMON in battle. Wears off if the\\nPOKéMON is withdrawn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E7C", + "secondaryId": 0 + }, + { + "english": "POK\u00e9 DOLL", + "itemId": "ITEM_POKE_DOLL", + "price": 1000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An attractive doll.\\nUse it to flee from any battle with\\na wild POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 2, + "battleUseFunc": "sub_80A2010", + "secondaryId": 0 + }, + { + "english": "FLUFFY TAIL", + "itemId": "ITEM_FLUFFY_TAIL", + "price": 1000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An attractive item.\\nUse it to flee from any battle with\\na wild POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 2, + "battleUseFunc": "sub_80A2010", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SUPER REPEL", + "itemId": "ITEM_SUPER_REPEL", + "price": 500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 200, + "description_english": "Prevents weak wild POKéMON from\\nappearing for 200 steps.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A1998", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "MAX REPEL", + "itemId": "ITEM_MAX_REPEL", + "price": 700, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 250, + "description_english": "Prevents weak wild POKéMON from\\nappearing for 250 steps.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A1998", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "ESCAPE ROPE", + "itemId": "ITEM_ESCAPE_ROPE", + "price": 550, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A long, durable rope.\\nUse it to escape instantly from a\\ncave or a dungeon.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 2, + "fieldUseFunc": "ItemUseOutOfBattle_EscapeRope", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "REPEL", + "itemId": "ITEM_REPEL", + "price": 350, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 100, + "description_english": "Prevents weak wild POKéMON from\\nappearing for 100 steps.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A1998", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SUN STONE", + "itemId": "ITEM_SUN_STONE", + "price": 2100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A peculiar stone that makes certain\\nspecies of POKéMON evolve.\\nIt is as red as the sun.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A1750", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "MOON STONE", + "itemId": "ITEM_MOON_STONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A peculiar stone that makes certain\\nspecies of POKéMON evolve.\\nIt is as black as the night sky.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A1750", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "FIRE STONE", + "itemId": "ITEM_FIRE_STONE", + "price": 2100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A peculiar stone that makes certain\\nspecies of POKéMON evolve.\\nIt is colored orange.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A1750", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "THUNDERSTONE", + "itemId": "ITEM_THUNDER_STONE", + "price": 2100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A peculiar stone that makes certain\\nspecies of POKéMON evolve.\\nIt has a thunderbolt pattern.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A1750", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "WATER STONE", + "itemId": "ITEM_WATER_STONE", + "price": 2100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A peculiar stone that makes certain\\nspecies of POKéMON evolve.\\nIt is a clear light blue.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A1750", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "LEAF STONE", + "itemId": "ITEM_LEAF_STONE", + "price": 2100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A peculiar stone that makes certain\\nspecies of POKéMON evolve.\\nIt has a leaf pattern.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 1, + "fieldUseFunc": "sub_80A1750", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "TINYMUSHROOM", + "itemId": "ITEM_TINY_MUSHROOM", + "price": 500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A small and rare mushroom.\\nIt is quite popular among certain\\npeople.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BIG MUSHROOM", + "itemId": "ITEM_BIG_MUSHROOM", + "price": 5000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A large and rare mushroom.\\nIt is very popular among certain\\npeople.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "PEARL", + "itemId": "ITEM_PEARL", + "price": 1400, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A relatively small pearl that\\nsparkles in a pretty silver color.\\nIt can be sold cheaply.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BIG PEARL", + "itemId": "ITEM_BIG_PEARL", + "price": 7500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A quite-large pearl that sparkles\\nin a pretty silver color.\\nIt can be sold at a high price.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "STARDUST", + "itemId": "ITEM_STARDUST", + "price": 2000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A pretty red sand with a loose,\\nsilky feel.\\nIt can be sold at a high price.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "STAR PIECE", + "itemId": "ITEM_STAR_PIECE", + "price": 9800, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A shard of a pretty gem that\\nsparkles in a red color.\\nIt can be sold at a high price.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "NUGGET", + "itemId": "ITEM_NUGGET", + "price": 10000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A nugget of pure gold that gives\\noff a lustrous gleam.\\nIt can be sold at a high price.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "HEART SCALE", + "itemId": "ITEM_HEART_SCALE", + "price": 100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A pretty, heart-shaped scale that\\nis extremely rare. It glows faintly\\nin the colors of a rainbow.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "ORANGE MAIL", + "itemId": "ITEM_ORANGE_MAIL", + "price": 50, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of MAIL featuring a cute\\nZIGZAGOON print.\\nIt is to be held by a POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 0, + "fieldUseFunc": "sub_80A11E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "HARBOR MAIL", + "itemId": "ITEM_HARBOR_MAIL", + "price": 50, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of MAIL featuring a cute\\nWINGULL print.\\nIt is to be held by a POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 0, + "fieldUseFunc": "sub_80A11E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 1 + }, + { + "english": "GLITTER MAIL", + "itemId": "ITEM_GLITTER_MAIL", + "price": 50, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of MAIL featuring a cute\\nPIKACHU print.\\nIt is to be held by a POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 0, + "fieldUseFunc": "sub_80A11E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 2 + }, + { + "english": "MECH MAIL", + "itemId": "ITEM_MECH_MAIL", + "price": 50, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of MAIL featuring a cute\\nMAGNEMITE print.\\nIt is to be held by a POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 0, + "fieldUseFunc": "sub_80A11E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 3 + }, + { + "english": "WOOD MAIL", + "itemId": "ITEM_WOOD_MAIL", + "price": 50, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of MAIL featuring a cute\\nSLAKOTH print.\\nIt is to be held by a POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 0, + "fieldUseFunc": "sub_80A11E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 4 + }, + { + "english": "WAVE MAIL", + "itemId": "ITEM_WAVE_MAIL", + "price": 50, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of MAIL featuring a cute\\nWAILMER print.\\nIt is to be held by a POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 0, + "fieldUseFunc": "sub_80A11E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 5 + }, + { + "english": "BEAD MAIL", + "itemId": "ITEM_BEAD_MAIL", + "price": 50, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of MAIL to be held by a\\nPOKéMON. It will bear the print of\\nthe POKéMON holding it.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 0, + "fieldUseFunc": "sub_80A11E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 6 + }, + { + "english": "SHADOW MAIL", + "itemId": "ITEM_SHADOW_MAIL", + "price": 50, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of MAIL featuring a cute\\nDUSKULL print.\\nIt is to be held by a POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 0, + "fieldUseFunc": "sub_80A11E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 7 + }, + { + "english": "TROPIC MAIL", + "itemId": "ITEM_TROPIC_MAIL", + "price": 50, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of MAIL featuring a cute\\nBELLOSSOM print.\\nIt is to be held by a POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 0, + "fieldUseFunc": "sub_80A11E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 8 + }, + { + "english": "DREAM MAIL", + "itemId": "ITEM_DREAM_MAIL", + "price": 50, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of MAIL to be held by a\\nPOKéMON. It will bear the print of\\nthe POKéMON holding it.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 0, + "fieldUseFunc": "sub_80A11E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 9 + }, + { + "english": "FAB MAIL", + "itemId": "ITEM_FAB_MAIL", + "price": 50, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of MAIL featuring a\\ngorgeous, extravagant print.\\nIt is to be held by a POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 0, + "fieldUseFunc": "sub_80A11E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 10 + }, + { + "english": "RETRO MAIL", + "itemId": "ITEM_RETRO_MAIL", + "price": 50, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of MAIL featuring a print\\nof three cute POKéMON.\\nIt is to be held by a POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 0, + "fieldUseFunc": "sub_80A11E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 11 + }, + { + "english": "CHERI BERRY", + "itemId": "ITEM_CHERI_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CURE_PAR", + "holdEffectParam": 0, + "description_english": "When held by a POKéMON, it will be\\nused in battle to heal paralysis.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "CHESTO BERRY", + "itemId": "ITEM_CHESTO_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CURE_SLP", + "holdEffectParam": 0, + "description_english": "When held by a POKéMON, it will be\\nused in battle to wake up.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "PECHA BERRY", + "itemId": "ITEM_PECHA_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CURE_PSN", + "holdEffectParam": 0, + "description_english": "When held by a POKéMON, it will be\\nused in battle to cure poison.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "RAWST BERRY", + "itemId": "ITEM_RAWST_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CURE_BRN", + "holdEffectParam": 0, + "description_english": "When held by a POKéMON, it will be\\nused in battle to heal a burn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "ASPEAR BERRY", + "itemId": "ITEM_ASPEAR_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CURE_FRZ", + "holdEffectParam": 0, + "description_english": "When held by a POKéMON, it will be\\nused in battle for defrosting.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "LEPPA BERRY", + "itemId": "ITEM_LEPPA_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_RESTORE_PP", + "holdEffectParam": 10, + "description_english": "When held by a POKéMON, it will be\\nused in battle to restore 10 PP.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 1, + "fieldUseFunc": "sub_80A16FC", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FF4", + "secondaryId": 0 + }, + { + "english": "ORAN BERRY", + "itemId": "ITEM_ORAN_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_RESTORE_HP", + "holdEffectParam": 10, + "description_english": "When held by a POKéMON, it will be\\nused in battle to restore 10 HP.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "PERSIM BERRY", + "itemId": "ITEM_PERSIM_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CURE_CONFUSION", + "holdEffectParam": 0, + "description_english": "When held by a POKéMON, it will be\\nused in battle to lift confusion.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "LUM BERRY", + "itemId": "ITEM_LUM_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CURE_STATUS", + "holdEffectParam": 0, + "description_english": "When held by a POKéMON, it will be\\nused in battle to heal any problem.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "SITRUS BERRY", + "itemId": "ITEM_SITRUS_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_RESTORE_HP", + "holdEffectParam": 30, + "description_english": "When held by a POKéMON, it will be\\nused in battle to restore 30 HP.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 1, + "fieldUseFunc": "sub_80A16E0", + "battleUsage": 1, + "battleUseFunc": "sub_80A1FBC", + "secondaryId": 0 + }, + { + "english": "FIGY BERRY", + "itemId": "ITEM_FIGY_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CONFUSE_SPICY", + "holdEffectParam": 8, + "description_english": "A hold item that restores HP but\\nmay cause confusion when used.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "WIKI BERRY", + "itemId": "ITEM_WIKI_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CONFUSE_DRY", + "holdEffectParam": 8, + "description_english": "A hold item that restores HP but\\nmay cause confusion when used.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "MAGO BERRY", + "itemId": "ITEM_MAGO_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CONFUSE_SWEET", + "holdEffectParam": 8, + "description_english": "A hold item that restores HP but\\nmay cause confusion when used.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "AGUAV BERRY", + "itemId": "ITEM_AGUAV_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CONFUSE_BITTER", + "holdEffectParam": 8, + "description_english": "A hold item that restores HP but\\nmay cause confusion when used.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "IAPAPA BERRY", + "itemId": "ITEM_IAPAPA_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CONFUSE_SOUR", + "holdEffectParam": 8, + "description_english": "A hold item that restores HP but\\nmay cause confusion when used.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "RAZZ BERRY", + "itemId": "ITEM_RAZZ_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BLUK BERRY", + "itemId": "ITEM_BLUK_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "NANAB BERRY", + "itemId": "ITEM_NANAB_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "WEPEAR BERRY", + "itemId": "ITEM_WEPEAR_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "PINAP BERRY", + "itemId": "ITEM_PINAP_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "POMEG BERRY", + "itemId": "ITEM_POMEG_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "KELPSY BERRY", + "itemId": "ITEM_KELPSY_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "QUALOT BERRY", + "itemId": "ITEM_QUALOT_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "HONDEW BERRY", + "itemId": "ITEM_HONDEW_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "GREPA BERRY", + "itemId": "ITEM_GREPA_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "TAMATO BERRY", + "itemId": "ITEM_TAMATO_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "CORNN BERRY", + "itemId": "ITEM_CORNN_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "MAGOST BERRY", + "itemId": "ITEM_MAGOST_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "RABUTA BERRY", + "itemId": "ITEM_RABUTA_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "NOMEL BERRY", + "itemId": "ITEM_NOMEL_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SPELON BERRY", + "itemId": "ITEM_SPELON_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "PAMTRE BERRY", + "itemId": "ITEM_PAMTRE_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "WATMEL BERRY", + "itemId": "ITEM_WATMEL_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "DURIN BERRY", + "itemId": "ITEM_DURIN_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BELUE BERRY", + "itemId": "ITEM_BELUE_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "LIECHI BERRY", + "itemId": "ITEM_LIECHI_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_ATTACK_UP", + "holdEffectParam": 4, + "description_english": "When held by a POKéMON, it raises\\nthe ATTACK stat in a pinch.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "GANLON BERRY", + "itemId": "ITEM_GANLON_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_DEFENSE_UP", + "holdEffectParam": 4, + "description_english": "When held by a POKéMON, it raises\\nthe DEFENSE stat in a pinch.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SALAC BERRY", + "itemId": "ITEM_SALAC_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_SPEED_UP", + "holdEffectParam": 4, + "description_english": "When held by a POKéMON, it raises\\nthe SPEED stat in a pinch.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "PETAYA BERRY", + "itemId": "ITEM_PETAYA_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_SP_ATTACK_UP", + "holdEffectParam": 4, + "description_english": "When held by a POKéMON, it raises\\nthe SP. ATK stat in a pinch.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "APICOT BERRY", + "itemId": "ITEM_APICOT_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_SP_DEFENSE_UP", + "holdEffectParam": 4, + "description_english": "When held by a POKéMON, it raises\\nthe SP. DEF stat in a pinch.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "LANSAT BERRY", + "itemId": "ITEM_LANSAT_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_CRITICAL_UP", + "holdEffectParam": 4, + "description_english": "When held by a POKéMON, it raises\\nthe critical-hit ratio in a pinch.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "STARF BERRY", + "itemId": "ITEM_STARF_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_RANDOM_STAT_UP", + "holdEffectParam": 4, + "description_english": "When held by a POKéMON, it sharply\\nraises one stat in a pinch.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "ENIGMA BERRY", + "itemId": "ITEM_ENIGMA_BERRY", + "price": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Can be ground up into a powder as\\nan ingredient for medicine.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_BERRY_POUCH", + "type": 4, + "fieldUseFunc": "ItemUseOutOfBattle_EnigmaBerry", + "battleUsage": 1, + "battleUseFunc": "ItemUseInBattle_EnigmaBerry", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BRIGHTPOWDER", + "itemId": "ITEM_BRIGHT_POWDER", + "price": 10, + "holdEffect": "HOLD_EFFECT_EVASION_UP", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nIt casts a tricky glare that lowers\\nthe opponent's accuracy.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "WHITE HERB", + "itemId": "ITEM_WHITE_HERB", + "price": 100, + "holdEffect": "HOLD_EFFECT_RESTORE_STATS", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nIt restores any lowered stat in\\nbattle. It can be used only once.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "MACHO BRACE", + "itemId": "ITEM_MACHO_BRACE", + "price": 3000, + "holdEffect": "HOLD_EFFECT_MACHO_BRACE", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nIt promotes strong growth but\\nlowers SPEED while it is held.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "EXP. SHARE", + "itemId": "ITEM_EXP_SHARE", + "price": 3000, + "holdEffect": "HOLD_EFFECT_EXP_SHARE", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nThe holder gets a share of EXP.\\npoints without having to battle.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "QUICK CLAW", + "itemId": "ITEM_QUICK_CLAW", + "price": 100, + "holdEffect": "HOLD_EFFECT_QUICK_CLAW", + "holdEffectParam": 20, + "description_english": "An item to be held by a POKéMON.\\nA light and sharp claw. The holder\\nmay be able to strike first.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SOOTHE BELL", + "itemId": "ITEM_SOOTHE_BELL", + "price": 100, + "holdEffect": "HOLD_EFFECT_HAPPINESS_UP", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nA bell with a comforting chime that\\nmakes the holder calm and friendly.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "MENTAL HERB", + "itemId": "ITEM_MENTAL_HERB", + "price": 100, + "holdEffect": "HOLD_EFFECT_CURE_ATTRACT", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nIt snaps the holder out of\\ninfatuation. It can be used once.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "CHOICE BAND", + "itemId": "ITEM_CHOICE_BAND", + "price": 100, + "holdEffect": "HOLD_EFFECT_CHOICE_BAND", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nIt powers up one move, which\\nbecomes the only usable one.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "KING'S ROCK", + "itemId": "ITEM_KINGS_ROCK", + "price": 100, + "holdEffect": "HOLD_EFFECT_FLINCH", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nIt may cause the foe to flinch\\nupon taking damage.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SILVERPOWDER", + "itemId": "ITEM_SILVER_POWDER", + "price": 100, + "holdEffect": "HOLD_EFFECT_BUG_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA shiny silver powder that boosts\\nthe power of BUG-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "AMULET COIN", + "itemId": "ITEM_AMULET_COIN", + "price": 100, + "holdEffect": "HOLD_EFFECT_DOUBLE_PRIZE", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nIt doubles the battle money if the\\nholding POKéMON takes part.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "CLEANSE TAG", + "itemId": "ITEM_CLEANSE_TAG", + "price": 200, + "holdEffect": "HOLD_EFFECT_REPEL", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nIt repels wild POKéMON if the\\nholder is first in the party.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SOUL DEW", + "itemId": "ITEM_SOUL_DEW", + "price": 200, + "holdEffect": "HOLD_EFFECT_SOUL_DEW", + "holdEffectParam": 0, + "description_english": "An orb to be held by a LATIOS or\\nLATIAS. It raises the SP. ATK\\nand SP. DEF stats.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "DEEPSEATOOTH", + "itemId": "ITEM_DEEP_SEA_TOOTH", + "price": 200, + "holdEffect": "HOLD_EFFECT_DEEP_SEA_TOOTH", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nA fang that gleams a sharp silver.\\nIt raises the SP. ATK stat.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "DEEPSEASCALE", + "itemId": "ITEM_DEEP_SEA_SCALE", + "price": 200, + "holdEffect": "HOLD_EFFECT_DEEP_SEA_SCALE", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nA scale that shines a faint pink.\\nIt raises the SP. DEF stat.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SMOKE BALL", + "itemId": "ITEM_SMOKE_BALL", + "price": 200, + "holdEffect": "HOLD_EFFECT_CAN_ALWAYS_RUN", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nThe holding POKéMON can flee from\\nany wild POKéMON for sure.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "EVERSTONE", + "itemId": "ITEM_EVERSTONE", + "price": 200, + "holdEffect": "HOLD_EFFECT_PREVENT_EVOLVE", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nThe holding POKéMON is prevented\\nfrom evolving.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "FOCUS BAND", + "itemId": "ITEM_FOCUS_BAND", + "price": 200, + "holdEffect": "HOLD_EFFECT_FOCUS_BAND", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nThe holding POKéMON may endure an\\nattack, leaving just 1 HP.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "LUCKY EGG", + "itemId": "ITEM_LUCKY_EGG", + "price": 200, + "holdEffect": "HOLD_EFFECT_LUCKY_EGG", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nAn egg filled with happiness that\\nearns extra EXP. points in battle.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SCOPE LENS", + "itemId": "ITEM_SCOPE_LENS", + "price": 200, + "holdEffect": "HOLD_EFFECT_SCOPE_LENS", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nA lens that boosts the critical-hit\\nratio of the holding POKéMON.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "METAL COAT", + "itemId": "ITEM_METAL_COAT", + "price": 100, + "holdEffect": "HOLD_EFFECT_STEEL_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA special metallic film that boosts\\nthe power of STEEL-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "LEFTOVERS", + "itemId": "ITEM_LEFTOVERS", + "price": 200, + "holdEffect": "HOLD_EFFECT_LEFTOVERS", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nThe holding POKéMON gradually\\nregains HP during battle.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "DRAGON SCALE", + "itemId": "ITEM_DRAGON_SCALE", + "price": 2100, + "holdEffect": "HOLD_EFFECT_DRAGON_SCALE", + "holdEffectParam": 10, + "description_english": "A thick and tough scale.\\nA DRAGON-type POKéMON may be\\nholding it.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "LIGHT BALL", + "itemId": "ITEM_LIGHT_BALL", + "price": 100, + "holdEffect": "HOLD_EFFECT_LIGHT_BALL", + "holdEffectParam": 0, + "description_english": "An orb to be held by a PIKACHU\\nthat raises the SP. ATK stat.\\nTouching it may cause a shock.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SOFT SAND", + "itemId": "ITEM_SOFT_SAND", + "price": 100, + "holdEffect": "HOLD_EFFECT_GROUND_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA loose, silky sand that boosts the\\npower of GROUND-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "HARD STONE", + "itemId": "ITEM_HARD_STONE", + "price": 100, + "holdEffect": "HOLD_EFFECT_ROCK_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nAn unbreakable stone that boosts\\nthe power of ROCK-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "MIRACLE SEED", + "itemId": "ITEM_MIRACLE_SEED", + "price": 100, + "holdEffect": "HOLD_EFFECT_GRASS_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA seed imbued with life that boosts\\nthe power of GRASS-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BLACKGLASSES", + "itemId": "ITEM_BLACK_GLASSES", + "price": 100, + "holdEffect": "HOLD_EFFECT_DARK_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA shady-looking pair of glasses\\nthat boosts DARK-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BLACK BELT", + "itemId": "ITEM_BLACK_BELT", + "price": 100, + "holdEffect": "HOLD_EFFECT_FIGHTING_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA belt that boosts determination\\nand FIGHTING-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "MAGNET", + "itemId": "ITEM_MAGNET", + "price": 100, + "holdEffect": "HOLD_EFFECT_ELECTRIC_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA powerful magnet that boosts the\\npower of ELECTRIC-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "MYSTIC WATER", + "itemId": "ITEM_MYSTIC_WATER", + "price": 100, + "holdEffect": "HOLD_EFFECT_WATER_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA teardrop-shaped gem that boosts\\nthe power of WATER-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SHARP BEAK", + "itemId": "ITEM_SHARP_BEAK", + "price": 100, + "holdEffect": "HOLD_EFFECT_FLYING_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA long, sharp beak that boosts the\\npower of FLYING-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "POISON BARB", + "itemId": "ITEM_POISON_BARB", + "price": 100, + "holdEffect": "HOLD_EFFECT_POISON_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA small, poisonous barb that boosts\\nthe power of POISON-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "NEVERMELTICE", + "itemId": "ITEM_NEVER_MELT_ICE", + "price": 100, + "holdEffect": "HOLD_EFFECT_ICE_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA piece of ice that repels heat\\nand boosts ICE-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SPELL TAG", + "itemId": "ITEM_SPELL_TAG", + "price": 100, + "holdEffect": "HOLD_EFFECT_GHOST_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA sinister, eerie tag that boosts\\nGHOST-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "TWISTEDSPOON", + "itemId": "ITEM_TWISTED_SPOON", + "price": 100, + "holdEffect": "HOLD_EFFECT_PSYCHIC_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA spoon imbued with telekinetic\\npower boosts PSYCHIC-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "CHARCOAL", + "itemId": "ITEM_CHARCOAL", + "price": 9800, + "holdEffect": "HOLD_EFFECT_FIRE_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA combustible fuel that boosts the\\npower of FIRE-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "DRAGON FANG", + "itemId": "ITEM_DRAGON_FANG", + "price": 100, + "holdEffect": "HOLD_EFFECT_DRAGON_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA hard and sharp fang that boosts\\nthe power of DRAGON-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SILK SCARF", + "itemId": "ITEM_SILK_SCARF", + "price": 100, + "holdEffect": "HOLD_EFFECT_NORMAL_POWER", + "holdEffectParam": 10, + "description_english": "An item to be held by a POKéMON.\\nA sumptuous scarf that boosts the\\npower of NORMAL-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "UP-GRADE", + "itemId": "ITEM_UP_GRADE", + "price": 2100, + "holdEffect": "HOLD_EFFECT_UP_GRADE", + "holdEffectParam": 0, + "description_english": "A transparent device filled with all\\nsorts of data.\\nIt is made by SILPH CO.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SHELL BELL", + "itemId": "ITEM_SHELL_BELL", + "price": 200, + "holdEffect": "HOLD_EFFECT_SHELL_BELL", + "holdEffectParam": 8, + "description_english": "An item to be held by a POKéMON.\\nThe holding POKéMON regains some\\nHP upon striking the foe.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SEA INCENSE", + "itemId": "ITEM_SEA_INCENSE", + "price": 9600, + "holdEffect": "HOLD_EFFECT_WATER_POWER", + "holdEffectParam": 5, + "description_english": "An item to be held by a POKéMON.\\nIt slightly boosts the power of\\nWATER-type moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "LAX INCENSE", + "itemId": "ITEM_LAX_INCENSE", + "price": 9600, + "holdEffect": "HOLD_EFFECT_EVASION_UP", + "holdEffectParam": 5, + "description_english": "An item to be held by a POKéMON.\\nIts tricky aroma slightly reduces\\nthe foe's accuracy.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "LUCKY PUNCH", + "itemId": "ITEM_LUCKY_PUNCH", + "price": 10, + "holdEffect": "HOLD_EFFECT_LUCKY_PUNCH", + "holdEffectParam": 0, + "description_english": "A glove to be held by a CHANSEY.\\nIt raises CHANSEY's critical-hit\\nratio.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "METAL POWDER", + "itemId": "ITEM_METAL_POWDER", + "price": 10, + "holdEffect": "HOLD_EFFECT_METAL_POWDER", + "holdEffectParam": 0, + "description_english": "A fine, hard powder to be held by\\na DITTO.\\nIt raises DITTO's DEFENSE stat.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "THICK CLUB", + "itemId": "ITEM_THICK_CLUB", + "price": 500, + "holdEffect": "HOLD_EFFECT_THICK_CLUB", + "holdEffectParam": 0, + "description_english": "A hard bone of some sort to be\\nheld by a CUBONE or MAROWAK.\\nIt raises the ATTACK stat.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "STICK", + "itemId": "ITEM_STICK", + "price": 200, + "holdEffect": "HOLD_EFFECT_STICK", + "holdEffectParam": 0, + "description_english": "A stick of leek to be held by a\\nFARFETCH'D. It raises FARFETCH'D's\\ncritical-hit ratio.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "RED SCARF", + "itemId": "ITEM_RED_SCARF", + "price": 100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nIt boosts the holding POKéMON's\\nCOOL condition in CONTESTS.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BLUE SCARF", + "itemId": "ITEM_BLUE_SCARF", + "price": 100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nIt boosts the holding POKéMON's\\nBEAUTY condition in CONTESTS.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "PINK SCARF", + "itemId": "ITEM_PINK_SCARF", + "price": 100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nIt boosts the holding POKéMON's\\nCUTE condition in CONTESTS.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "GREEN SCARF", + "itemId": "ITEM_GREEN_SCARF", + "price": 100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nIt boosts the holding POKéMON's\\nSMART condition in CONTESTS.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "YELLOW SCARF", + "itemId": "ITEM_YELLOW_SCARF", + "price": 100, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An item to be held by a POKéMON.\\nIt boosts the holding POKéMON's\\nTOUGH condition in CONTESTS.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "MACH BIKE", + "itemId": "ITEM_MACH_BIKE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A folding bicycle that is at least\\ntwice as fast as walking.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 2, + "fieldUseFunc": "sub_80A122C", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "COIN CASE", + "itemId": "ITEM_COIN_CASE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A case for holding COINS obtained\\nat the GAME CORNER.\\nIt holds up to 9,999 COINS.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A1460", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "ITEMFINDER", + "itemId": "ITEM_ITEMFINDER", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A device used for finding items.\\nIf there is a hidden item nearby\\nwhen it is used, it emits a signal.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 2, + "fieldUseFunc": "ItemUseOutOfBattle_Itemfinder", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "OLD ROD", + "itemId": "ITEM_OLD_ROD", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An old and beat-up fishing rod.\\nUse it by any body of water to \\nfish for wild POKéMON.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 2, + "fieldUseFunc": "sub_80A1338", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "GOOD ROD", + "itemId": "ITEM_GOOD_ROD", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A new, good-quality fishing rod.\\nUse it by any body of water to \\nfish for wild POKéMON.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 2, + "fieldUseFunc": "sub_80A1338", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 1 + }, + { + "english": "SUPER ROD", + "itemId": "ITEM_SUPER_ROD", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An awesome, high-tech fishing rod.\\nUse it by any body of water to fish\\nfor wild POKéMON.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 2, + "fieldUseFunc": "sub_80A1338", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 2 + }, + { + "english": "S.S. TICKET", + "itemId": "ITEM_SS_TICKET", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The ticket required for sailing on\\nthe ferry S.S. ANNE.\\nIt has a drawing of a ship on it.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "CONTEST PASS", + "itemId": "ITEM_CONTEST_PASS", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The pass required for entering\\nPOKéMON CONTESTS. It has a\\ndrawing of an award ribbon on it.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "WAILMER PAIL", + "itemId": "ITEM_WAILMER_PAIL", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A nifty watering pail.\\nUse it to promote strong growth in\\nBERRIES planted in soft soil.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "DEVON GOODS", + "itemId": "ITEM_DEVON_GOODS", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A package that contains mechanical\\nparts of some sort made by the\\nDEVON CORPORATION.", + "importance": 2, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SOOT SACK", + "itemId": "ITEM_SOOT_SACK", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A sack used to collect volcanic\\nash automatically during walks\\nover deep ash.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BASEMENT KEY", + "itemId": "ITEM_BASEMENT_KEY", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The key to NEW MAUVILLE, which\\nwas constructed beneath MAUVILLE\\nCITY.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "ACRO BIKE", + "itemId": "ITEM_ACRO_BIKE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A folding bicycle that is capable\\nof stunts like jumps and wheelies.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 2, + "fieldUseFunc": "sub_80A122C", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 1 + }, + { + "english": "{POKEBLOCK} CASE", + "itemId": "ITEM_POKEBLOCK_CASE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A case for holding {POKEBLOCK}S made\\nwith a BERRY BLENDER. It releases\\none {POKEBLOCK} when shaken.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "LETTER", + "itemId": "ITEM_LETTER", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An extremely important letter to\\nSTEVEN from the PRESIDENT of the\\nDEVON CORPORATION.", + "importance": 2, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "EON TICKET", + "itemId": "ITEM_EON_TICKET", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The ticket required for sailing on a\\nferry to a distant southern island.\\nIt features a drawing of an island.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 1 + }, + { + "english": "RED ORB", + "itemId": "ITEM_RED_ORB", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An orb that glows red.\\nIt is said to contain an incredible\\npower from ancient times.", + "importance": 2, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BLUE ORB", + "itemId": "ITEM_BLUE_ORB", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An orb that glows blue.\\nIt is said to contain an incredible\\npower from ancient times.", + "importance": 2, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SCANNER", + "itemId": "ITEM_SCANNER", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A device used to search for\\nlife-forms in water.\\nIt looks too difficult to use.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "GO-GOGGLES", + "itemId": "ITEM_GO_GOGGLES", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A pair of protective goggles.\\nThey enable a TRAINER to travel\\nthrough even desert sandstorms.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "METEORITE", + "itemId": "ITEM_METEORITE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A meteorite that fell from space\\nonto MT. MOON long ago.\\nIt is very lumpy and hard.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "RM. 1 KEY", + "itemId": "ITEM_ROOM_1_KEY", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A key that opens the door to Room\\n1 inside the ABANDONED SHIP.\\nIt is old and looks easily broken.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "RM. 2 KEY", + "itemId": "ITEM_ROOM_2_KEY", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A key that opens the door to Room\\n2 inside the ABANDONED SHIP.\\nIt is old and looks easily broken.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "RM. 4 KEY", + "itemId": "ITEM_ROOM_4_KEY", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A key that opens the door to Room\\n4 inside the ABANDONED SHIP.\\nIt is old and looks easily broken.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "RM. 6 KEY", + "itemId": "ITEM_ROOM_6_KEY", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A key that opens the door to Room\\n6 inside the ABANDONED SHIP.\\nIt is old and looks easily broken.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "STORAGE KEY", + "itemId": "ITEM_STORAGE_KEY", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A key that opens the storage hold\\ninside the ABANDONED SHIP.\\nIt is old and looks easily broken.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "ROOT FOSSIL", + "itemId": "ITEM_ROOT_FOSSIL", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A fossil of an ancient, seafloor-\\ndwelling POKéMON. It appears to be\\npart of a plant root.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "CLAW FOSSIL", + "itemId": "ITEM_CLAW_FOSSIL", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A fossil of an ancient, seafloor-\\ndwelling POKéMON. It appears to be\\npart of a claw.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "DEVON SCOPE", + "itemId": "ITEM_DEVON_SCOPE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A scope that signals the presence\\nof any unseeable POKéMON.\\nIt is made by the DEVON CORP.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "TM01", + "itemId": "ITEM_TM01", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An extremely powerful attack.\\nHowever, if the user is hit before\\nusing the move, they will flinch.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "FocusPunch" + }, + { + "english": "TM02", + "itemId": "ITEM_TM02", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Sharp, huge claws hook and slash\\nthe foe quickly and with great\\npower.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "DragonClaw" + }, + { + "english": "TM03", + "itemId": "ITEM_TM03", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The foe is hit with a pulsing blast\\nof water. It may also confuse the\\ntarget.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "WaterPulse" + }, + { + "english": "TM04", + "itemId": "ITEM_TM04", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The user calms its spirit and\\nfocuses its mind to raise its\\nSP. ATK and SP. DEF stats.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "CalmMind" + }, + { + "english": "TM05", + "itemId": "ITEM_TM05", + "price": 1000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A savage roar that causes the foe\\nto switch out of battle. In the\\nwild, ROAR ends the battle.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Roar" + }, + { + "english": "TM06", + "itemId": "ITEM_TM06", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A move that leaves the foe badly\\npoisoned. Its poison damage worsens\\nevery turn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Toxic" + }, + { + "english": "TM07", + "itemId": "ITEM_TM07", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Summons a hailstorm that lasts for\\nfive turns. The hailstorm damages\\nall types except the ICE type.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Hail" + }, + { + "english": "TM08", + "itemId": "ITEM_TM08", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The user tightens all its muscles\\nand bulks up, boosting both its\\nATTACK and DEFENSE stats.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "BulkUp" + }, + { + "english": "TM09", + "itemId": "ITEM_TM09", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The user shoots seeds at the foe\\nin rapid succession. Two to five\\nseeds are shot at once.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "BulletSeed" + }, + { + "english": "TM10", + "itemId": "ITEM_TM10", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A variable move that changes type\\nand power depending on the POKéMON\\nusing it.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "HiddenPower" + }, + { + "english": "TM11", + "itemId": "ITEM_TM11", + "price": 2000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The weather is turned sunny for\\nfive turns. Over that time, FIRE-\\ntype moves are powered up.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "SunnyDay" + }, + { + "english": "TM12", + "itemId": "ITEM_TM12", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A taunted foe may become enraged.\\nIt will then only be able to use\\nattack moves.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Taunt" + }, + { + "english": "TM13", + "itemId": "ITEM_TM13", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An icy-cold beam is shot at the\\nfoe. It may leave the target\\nfrozen.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "IceBeam" + }, + { + "english": "TM14", + "itemId": "ITEM_TM14", + "price": 5500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A vicious snow-and-wind attack that\\nstrikes all foes in battle. It may\\ncause freezing.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Blizzard" + }, + { + "english": "TM15", + "itemId": "ITEM_TM15", + "price": 7500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A harsh attack that inflicts severe\\ndamage on the foe. However, the\\nuser must rest the next turn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "HyperBeam" + }, + { + "english": "TM16", + "itemId": "ITEM_TM16", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A wall of light is created over\\nfive turns. It reduces damage from\\nSP. ATK attacks.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "LightScreen" + }, + { + "english": "TM17", + "itemId": "ITEM_TM17", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The user is completely protected\\nfrom attack in the turn it is used.\\nIt may fail if used in succession.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Protect" + }, + { + "english": "TM18", + "itemId": "ITEM_TM18", + "price": 2000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A heavy rain is summoned for five\\nturns. Over that time, WATER-type\\nmoves are powered up.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "RainDance" + }, + { + "english": "TM19", + "itemId": "ITEM_TM19", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The user strikes the foe with\\ntentacles or roots, stealing the\\ntarget's HP and healing itself.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "GigaDrain" + }, + { + "english": "TM20", + "itemId": "ITEM_TM20", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Protects the party with a shield\\nagainst all status problems over\\nfive turns.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Safeguard" + }, + { + "english": "TM21", + "itemId": "ITEM_TM21", + "price": 1000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "This attack move grows more\\npowerful the more the POKéMON\\ndislikes its TRAINER.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Frustration" + }, + { + "english": "TM22", + "itemId": "ITEM_TM22", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A 2-turn attack that uses the first\\nturn for absorbing sunlight, then\\nblasting the foe in the next turn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "SolarBeam" + }, + { + "english": "TM23", + "itemId": "ITEM_TM23", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The foe is slammed with a sturdy\\ntail of steel. It may lower the\\ntarget's DEFENSE stat.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "IronTail" + }, + { + "english": "TM24", + "itemId": "ITEM_TM24", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A massive jolt of electricity is\\nlaunched at the foe. It may cause\\nparalysis.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Thunderbolt" + }, + { + "english": "TM25", + "itemId": "ITEM_TM25", + "price": 5500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Strikes the foe with a huge\\nthunderbolt. It may cause\\nparalysis.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Thunder" + }, + { + "english": "TM26", + "itemId": "ITEM_TM26", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Causes an earthquake that strikes\\nall POKéMON in battle, excluding\\nthe user.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Earthquake" + }, + { + "english": "TM27", + "itemId": "ITEM_TM27", + "price": 1000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "This attack move grows more\\npowerful the more the POKéMON\\nlikes its TRAINER.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Return" + }, + { + "english": "TM28", + "itemId": "ITEM_TM28", + "price": 2000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A 2-turn attack in which the user\\ndigs underground, then strikes.\\nIt can be used to exit dungeons.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Dig" + }, + { + "english": "TM29", + "itemId": "ITEM_TM29", + "price": 2000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A powerful blast of telekinetic\\nenergy strikes the foe. It may\\nlower the target's SP. DEF stat.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Psychic" + }, + { + "english": "TM30", + "itemId": "ITEM_TM30", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The foe is attacked with a shadowy\\nlump. It may lower the target's\\nSP. DEF stat.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "ShadowBall" + }, + { + "english": "TM31", + "itemId": "ITEM_TM31", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Strikes the foe with a rock-hard\\nfist, etc. It shatters barriers such\\nas REFLECT and LIGHT SCREEN.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "BrickBreak" + }, + { + "english": "TM32", + "itemId": "ITEM_TM32", + "price": 2000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The user begins moving so quickly\\nthat it creates illusory copies to\\nraise its evasiveness.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "DoubleTeam" + }, + { + "english": "TM33", + "itemId": "ITEM_TM33", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A tough barrier is put up over five\\nturns. It reduces damage from\\nphysical attacks over that time.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Reflect" + }, + { + "english": "TM34", + "itemId": "ITEM_TM34", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A rapid jolt of electricity strikes\\nthe foe. This attack is impossible\\nto evade.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "ShockWave" + }, + { + "english": "TM35", + "itemId": "ITEM_TM35", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The foe is roasted with a heavy\\nblast of fire. It may leave the\\ntarget with a burn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Flamethrower" + }, + { + "english": "TM36", + "itemId": "ITEM_TM36", + "price": 1000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Toxic sludge is hurled at the foe\\nwith great force. It may also\\npoison the target.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "SludgeBomb" + }, + { + "english": "TM37", + "itemId": "ITEM_TM37", + "price": 2000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Summons a sandstorm that lasts for\\nfive turns. It damages all types\\nexcept ROCK, GROUND, and STEEL.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Sandstorm" + }, + { + "english": "TM38", + "itemId": "ITEM_TM38", + "price": 5500, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The foe is incinerated with an\\nintense flame. It may leave the\\ntarget with a burn.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "FireBlast" + }, + { + "english": "TM39", + "itemId": "ITEM_TM39", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Boulders are hurled at the foe.\\nIt also lowers the target's SPEED\\nstat if it hits.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "RockTomb" + }, + { + "english": "TM40", + "itemId": "ITEM_TM40", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An extremely fast attack against\\none target. It is impossible to\\nevade.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "AerialAce" + }, + { + "english": "TM41", + "itemId": "ITEM_TM41", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "If enraged by this move, the target\\nbecomes incapable of using the same\\nmove twice in a row.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Torment" + }, + { + "english": "TM42", + "itemId": "ITEM_TM42", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An attack move that becomes very\\npowerful if the user is poisoned,\\nburned, or paralyzed.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Facade" + }, + { + "english": "TM43", + "itemId": "ITEM_TM43", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An attack move that may have an\\nadditional effect depending on the\\nbattle terrain.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "SecretPower" + }, + { + "english": "TM44", + "itemId": "ITEM_TM44", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A move that makes the user fall\\nasleep over two turns to restore HP\\nand heal any status problems.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Rest" + }, + { + "english": "TM45", + "itemId": "ITEM_TM45", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The foe, if it is the opposite\\ngender as the user, becomes\\ninfatuated and may not attack.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Attract" + }, + { + "english": "TM46", + "itemId": "ITEM_TM46", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An attack that gives the user an\\nopportunity to steal the foe's hold\\nitem.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Thief" + }, + { + "english": "TM47", + "itemId": "ITEM_TM47", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The foe is struck with steel-hard\\nwings. It may also raise the user's\\nDEFENSE stat.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "SteelWing" + }, + { + "english": "TM48", + "itemId": "ITEM_TM48", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A special power is transmitted to\\nthe foe, causing it to switch\\nabilities with the user.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "SkillSwap" + }, + { + "english": "TM49", + "itemId": "ITEM_TM49", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A move that steals the effects of\\nany status-changing or healing move\\nthat the foe tries to use.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Snatch" + }, + { + "english": "TM50", + "itemId": "ITEM_TM50", + "price": 3000, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A maximum-power attack of great\\nferocity, but one that also sharply\\nreduces the user's SP. ATK stat.", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Overheat" + }, + { + "english": "HM01", + "itemId": "ITEM_HM01", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Attacks the foe with sharp blades\\nor claws. It can also cut down thin\\ntrees and grass outside of battle.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Cut" + }, + { + "english": "HM02", + "itemId": "ITEM_HM02", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The user flies up on the first turn,\\nthen attacks next turn. It can be\\nused to fly to any known town.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Fly" + }, + { + "english": "HM03", + "itemId": "ITEM_HM03", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Creates a huge wave, then crashes\\nit down on the foe. It can be used\\nfor traveling on water.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Surf" + }, + { + "english": "HM04", + "itemId": "ITEM_HM04", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The user builds enormous power,\\nthen slams the foe. It can be used\\nfor moving large, round boulders.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Strength" + }, + { + "english": "HM05", + "itemId": "ITEM_HM05", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Looses a powerful blast of light\\nthat reduces the foe's accuracy.\\nIt also lights up dark caves.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Flash" + }, + { + "english": "HM06", + "itemId": "ITEM_HM06", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Hits the foe with a rock-crushingly\\ntough attack. It can smash cracked\\nboulders.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "RockSmash" + }, + { + "english": "HM07", + "itemId": "ITEM_HM07", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A powerful charge attack. It can\\nbe used for climbing a torrential\\nwaterfall.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Waterfall" + }, + { + "english": "HM08", + "itemId": "ITEM_HM08", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A 2-turn attack in which the user\\ndives underwater on the first turn,\\nthen strikes in the next turn.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_TM_CASE", + "type": 1, + "fieldUseFunc": "NULL", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0, + "moveId": "Dive" + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "????????", + "itemId": "ITEM_NONE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "?????", + "importance": 0, + "exitsBagOnUse": 0, + "pocket": "POCKET_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "OAK'S PARCEL", + "itemId": "ITEM_OAKS_PARCEL", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A parcel to be delivered to PROF.\\nOAK from VIRIDIAN CITY's POKéMON\\nMART.", + "importance": 2, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "POK\u00e9 FLUTE", + "itemId": "ITEM_POKE_FLUTE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A flute that is said to instantly\\nawaken any POKéMON. It has a\\nlovely tone.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A156C", + "battleUsage": 2, + "battleUseFunc": "sub_80A1E64", + "secondaryId": 0 + }, + { + "english": "SECRET KEY", + "itemId": "ITEM_SECRET_KEY", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "The key to CINNABAR ISLAND GYM's\\nfront door. It is colored red and\\ndecorated.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BIKE VOUCHER", + "itemId": "ITEM_BIKE_VOUCHER", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "Take this voucher to the BIKE SHOP\\nin CERULEAN CITY and exchange it\\nfor a bicycle.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "GOLD TEETH", + "itemId": "ITEM_GOLD_TEETH", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A set of false teeth lost by the\\nSAFARI ZONE'S WARDEN. It makes his\\nsmile sparkle.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "OLD AMBER", + "itemId": "ITEM_OLD_AMBER", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A piece of amber that contains\\nthe genes of an ancient POKéMON.\\nIt is clear with a reddish tint.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "CARD KEY", + "itemId": "ITEM_CARD_KEY", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A card-type key that unlocks doors\\nin SILPH CO.'s HEAD OFFICE in\\nSAFFRON CITY.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "LIFT KEY", + "itemId": "ITEM_LIFT_KEY", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A key that operates the elevator\\nin TEAM ROCKET's HIDEOUT.\\nIt bears the TEAM ROCKET logo.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "HELIX FOSSIL", + "itemId": "ITEM_HELIX_FOSSIL", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A fossil of an ancient, seafloor-\\ndwelling POKéMON. It appears to be\\npart of a seashell.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "DOME FOSSIL", + "itemId": "ITEM_DOME_FOSSIL", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A fossil of an ancient, seafloor-\\ndwelling POKéMON. It appears to be\\npart of a shell.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SILPH SCOPE", + "itemId": "ITEM_SILPH_SCOPE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A scope that makes unseeable\\nPOKéMON visible.\\nIt is made by SILPH CO.", + "importance": 1, + "exitsBagOnUse": 0, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BICYCLE", + "itemId": "ITEM_BICYCLE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A folding bicycle that allows\\nfaster movement than the RUNNING\\nSHOES.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 2, + "fieldUseFunc": "sub_80A122C", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "TOWN MAP", + "itemId": "ITEM_TOWN_MAP", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A very convenient map that can be\\nviewed anytime. It even shows your \\npresent location.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A1C60", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "VS SEEKER", + "itemId": "ITEM_VS_SEEKER", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A device that indicates TRAINERS\\nwho want to battle. The battery\\ncharges while traveling.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 2, + "fieldUseFunc": "sub_80A1D9C", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "FAME CHECKER", + "itemId": "ITEM_FAME_CHECKER", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A device that enables you to\\nrecall what you've heard and seen\\nabout famous people.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A1CF8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "TM CASE", + "itemId": "ITEM_TM_CASE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A case that holds TMs and HMs.\\nIt is attached to the BAG's\\ncompartment for important items.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A1788", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "BERRY POUCH", + "itemId": "ITEM_BERRY_POUCH", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A pouch for carrying BERRIES.\\nIt is attached to the BAG's\\ncompartment for important items.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A1820", + "battleUsage": 3, + "battleUseFunc": "sub_80A18B8", + "secondaryId": 0 + }, + { + "english": "TEACHY TV", + "itemId": "ITEM_TEACHY_TV", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A television set that is tuned to\\na program with useful tips for\\nnovice TRAINERS.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 2, + "fieldUseFunc": "sub_80A18EC", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "TRI-PASS", + "itemId": "ITEM_TRI_PASS", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A pass for ferries between ONE,\\nTWO, and THREE ISLAND.\\nIt has a drawing of three islands.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "RAINBOW PASS", + "itemId": "ITEM_RAINBOW_PASS", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A pass for ferries between\\nVERMILION and the SEVII ISLANDS.\\nIt features a drawing of a rainbow.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "TEA", + "itemId": "ITEM_TEA", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An aromatic tea prepared by an old\\nlady. It will slake even the worst\\nthirst.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "MYSTICTICKET", + "itemId": "ITEM_MYSTIC_TICKET", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A ticket required to board the ship\\nto NAVEL ROCK.\\nIt glows with a mystic light.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "AURORATICKET", + "itemId": "ITEM_AURORA_TICKET", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A ticket required to board the ship\\nto BIRTH ISLAND.\\nIt glows beautifully.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "POWDER JAR", + "itemId": "ITEM_POWDER_JAR", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "A jar for storing BERRY POWDER\\nmade using a BERRY CRUSHER.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A14E8", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "RUBY", + "itemId": "ITEM_RUBY", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An exquisitely beautiful gem that\\nhas a red glow.\\nIt symbolizes passion.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + }, + { + "english": "SAPPHIRE", + "itemId": "ITEM_SAPPHIRE", + "price": 0, + "holdEffect": "HOLD_EFFECT_NONE", + "holdEffectParam": 0, + "description_english": "An exquisitely beautiful gem that\\nhas a blue glow.\\nIt symbolizes honesty.", + "importance": 1, + "exitsBagOnUse": 1, + "pocket": "POCKET_KEY_ITEMS", + "type": 4, + "fieldUseFunc": "sub_80A2238", + "battleUsage": 0, + "battleUseFunc": "NULL", + "secondaryId": 0 + } + ] +} \ No newline at end of file diff --git a/src/data/items.json.txt b/src/data/items.json.txt new file mode 100644 index 000000000..0daa783aa --- /dev/null +++ b/src/data/items.json.txt @@ -0,0 +1,31 @@ +{{ doNotModifyHeader }} +## for item in items +## if item.pocket == "POCKET_TM_CASE" +extern const u8 gMoveDescription_{{ item.moveId }}[]; +## endif +{% if item.itemId != "ITEM_NONE" %}const u8 gItemDescription_{{ item.itemId }}[] = _("{{ item.description_english }}");{% endif %} +## endfor +const u8 gItemDescription_ITEM_NONE[] = _("?????"); + +const struct Item gItems[] = { + {% for item in items %}{ + .name = _("{{ item.english }}"), + .itemId = {{ item.itemId }}, + .price = {{ item.price }}, + .holdEffect = {{ item.holdEffect }}, + .holdEffectParam = {{ item.holdEffectParam }}, +## if item.pocket == "POCKET_TM_CASE" + .description = gMoveDescription_{{ item.moveId }}, +## else + .description = gItemDescription_{{ item.itemId }}, +## endif + .importance = {{ item.importance }}, + .exitsBagOnUse = {{ item.exitsBagOnUse }}, + .pocket = {{ item.pocket }}, + .type = {{ item.type }}, + .fieldUseFunc = {{ item.fieldUseFunc }}, + .battleUsage = {{ item.battleUsage }}, + .battleUseFunc = {{ item.battleUseFunc }}, + .secondaryId = {{ item.secondaryId }} + }, {% endfor %} +}; diff --git a/src/item.c b/src/item.c new file mode 100644 index 000000000..5ea771c05 --- /dev/null +++ b/src/item.c @@ -0,0 +1,8 @@ +#include "global.h" +#include "item.h" +#include "item_use.h" +#include "constants/hold_effects.h" +#include "constants/items.h" + +// Item descriptions and data +#include "data/items.h" diff --git a/src/item_use.c b/src/item_use.c new file mode 100644 index 000000000..bb259da51 --- /dev/null +++ b/src/item_use.c @@ -0,0 +1,242 @@ +#include "global.h" +#include "berry_pouch.h" +#include "bike.h" +#include "event_data.h" +#include "field_fadetransition.h" +#include "field_map_obj_helpers.h" +#include "field_player_avatar.h" +#include "field_weather.h" +#include "fieldmap.h" +#include "item.h" +#include "item_menu.h" +#include "mail.h" +#include "map_obj_80688E4.h" +#include "map_obj_lock.h" +#include "metatile_behavior.h" +#include "new_menu_helpers.h" +#include "overworld.h" +#include "script.h" +#include "sound.h" +#include "string_util.h" +#include "strings.h" +#include "task.h" +#include "constants/flags.h" +#include "constants/items.h" +#include "constants/songs.h" + +EWRAM_DATA void (*sItemUseOnFieldCB)(u8 taskId) = NULL; + +void sub_80A1084(void); +void sub_80A109C(u8 taskId); +void sub_80A112C(u8 taskId); +void sub_80A11C0(u8 taskId); +bool8 sub_80A1194(void); +void sub_80A1208(void); +void ItemUseOnFieldCB_Bicycle(u8 taskId); +bool8 ItemUseCheckFunc_Rod(void); +void ItemUseOnFieldCB_Rod(u8 taskId); +void sub_813EC8C(u8 taskId); +void sub_80A1750(u8 taskId); + +extern void (*const gUnknown_83E2954[])(void); + +void sub_80A0FBC(u8 taskId) +{ + u8 itemType; + if (gSpecialVar_ItemId == ITEM_ENIGMA_BERRY) + itemType = gTasks[taskId].data[4] - 1; + else + itemType = ItemId_GetType(gSpecialVar_ItemId) - 1; + if (GetPocketByItemId(gSpecialVar_ItemId) == POCKET_BERRY_POUCH) + { + sub_813D934(gUnknown_83E2954[itemType]); + sub_813D808(taskId); + } + else + { + sub_8108EE0(gUnknown_83E2954[itemType]); + if (itemType == 1) + sub_8108CB4(); + sub_8108B50(taskId); + } +} + +void sub_80A103C(u8 taskId) +{ + if (gTasks[taskId].data[3] != 1) + { + gFieldCallback = sub_80A1084; + sub_80A0FBC(taskId); + } + else + sItemUseOnFieldCB(taskId); +} + +void sub_80A1084(void) +{ + sub_807DC00(); + CreateTask(sub_80A109C, 8); +} + +void sub_80A109C(u8 taskId) +{ + if (sub_807AA70() == TRUE) + { + sItemUseOnFieldCB(taskId); + } +} + +void sub_80A10C4(u8 taskId, bool8 a1, u8 a2, const u8 * str) +{ + StringExpandPlaceholders(gStringVar4, str); + if (a1 == FALSE) + sub_8108E70(taskId, a2, gStringVar4, sub_810A1F8); + else + DisplayItemMessageOnField(taskId, a2, gStringVar4, sub_80A112C); +} + +void sub_80A1110(u8 taskId, bool8 a1) +{ + sub_80A10C4(taskId, a1, 4, gUnknown_8416425); +} + +void sub_80A112C(u8 taskId) +{ + ClearDialogWindowAndFrame(0, 1); + DestroyTask(taskId); + sub_80696C0(); + ScriptContext2_Disable(); +} + +u8 sub_80A1150(u16 itemId) +{ + if (ItemId_GetPocket(itemId) == POCKET_TM_CASE) + return 1; + else if (ItemId_GetFieldFunc(itemId) == sub_80A1750) + return 2; + else + return 0; +} + +void sub_80A1184(void) +{ + gFieldCallback2 = sub_80A1194; +} + +bool8 sub_80A1194(void) +{ + player_bitmagic(); + ScriptContext2_Enable(); + sub_807DC00(); + CreateTask(sub_80A11C0, 10); + gUnknown_2031DE0 = 0; + return TRUE; +} + +void sub_80A11C0(u8 taskId) +{ + if (sub_807AA70() == TRUE) + { + UnfreezeMapObjects(); + ScriptContext2_Disable(); + DestroyTask(taskId); + } +} + +void sub_80A11E8(u8 taskId) +{ + sub_8108EE0(sub_80A1208); + sub_8108B50(taskId); +} + +void sub_80A1208(void) +{ + u16 buffer[18]; + + buffer[16] = gSpecialVar_ItemId; + sub_80BEBEC(buffer, UseFameCheckerFromMenu, 0); +} + +void sub_80A122C(u8 taskId) +{ + s16 x, y; + u8 behavior; + + PlayerGetDestCoords(&x, &y); + behavior = MapGridGetMetatileBehaviorAt(x, y); + + if (FlagGet(FLAG_0x830) == TRUE + || MetatileBehavior_ReturnFalse_17(behavior) == TRUE + || MetatileBehavior_ReturnFalse_18(behavior) == TRUE + || MetatileBehavior_ReturnFalse_15(behavior) == TRUE + || MetatileBehavior_ReturnFalse_16(behavior) == TRUE) + sub_80A10C4(taskId, gTasks[taskId].data[3], 2, gUnknown_8416451); + else if (sub_8055C9C() == TRUE && !sub_80BD540()) + { + sItemUseOnFieldCB = ItemUseOnFieldCB_Bicycle; + sub_80A103C(taskId); + } + else + sub_80A1110(taskId, gTasks[taskId].data[3]); +} + +void ItemUseOnFieldCB_Bicycle(u8 taskId) +{ + if (!TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_MACH_BIKE | PLAYER_AVATAR_FLAG_ACRO_BIKE)) + PlaySE(SE_JITENSYA); + sub_80BD5C8(PLAYER_AVATAR_FLAG_MACH_BIKE | PLAYER_AVATAR_FLAG_ACRO_BIKE); + sub_80696C0(); + ScriptContext2_Disable(); + DestroyTask(taskId); +} + +void sub_80A1338(u8 taskId) +{ + if (ItemUseCheckFunc_Rod() == TRUE) + { + sItemUseOnFieldCB = ItemUseOnFieldCB_Rod; + sub_80A103C(taskId); + } + else + sub_80A1110(taskId, gTasks[taskId].data[3]); +} + +bool8 ItemUseCheckFunc_Rod(void) +{ + s16 x, y; + u16 behavior; + + GetXYCoordsOneStepInFrontOfPlayer(&x, &y); + behavior = MapGridGetMetatileBehaviorAt(x, y); + + if (MetatileBehavior_IsWaterfall(behavior)) + return FALSE; + if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_4)) + return FALSE; + if (!TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING)) + { + if (IsPlayerFacingSurfableFishableWater()) + return TRUE; + } + else + { + if (MetatileBehavior_IsSurfable(behavior) && !MapGridIsImpassableAt(x, y)) + return TRUE; + if (MetatileBehavior_ReturnFalse_6(behavior) == TRUE) + return TRUE; + } + return FALSE; +} + +void ItemUseOnFieldCB_Rod(u8 taskId) +{ + sub_805D2C0(ItemId_GetSecondaryId(gSpecialVar_ItemId)); + DestroyTask(taskId); +} + +void ItemUseOutOfBattle_Itemfinder(u8 taskId) +{ + IncrementGameStat(GAME_STAT_USED_ITEMFINDER); + sItemUseOnFieldCB = sub_813EC8C; + sub_80A103C(taskId); +} diff --git a/sym_ewram.txt b/sym_ewram.txt index 197ffc157..0541f4d07 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -985,9 +985,10 @@ gUnknown_2039994: @ 2039994 gUnknown_2039996: @ 2039996 .space 0x2 -gUnknown_2039998: @ 2039998 - .space 0x4 + .align 2 + .include "src/item_use.o" + .align 2 gUnknown_203999C: @ 203999C .space 0x8 diff --git a/tools/jsonproc/.gitignore b/tools/jsonproc/.gitignore new file mode 100644 index 000000000..a613cf2d7 --- /dev/null +++ b/tools/jsonproc/.gitignore @@ -0,0 +1 @@ +jsonproc diff --git a/tools/jsonproc/Makefile b/tools/jsonproc/Makefile new file mode 100644 index 000000000..b415e7b41 --- /dev/null +++ b/tools/jsonproc/Makefile @@ -0,0 +1,20 @@ +CXX := g++ + +CXXFLAGS := -Wall -std=c++11 -O2 + +INCLUDES := -I . + +SRCS := jsonproc.cpp + +HEADERS := jsonproc.h inja.hpp nlohmann/json.hpp + +.PHONY: clean + +all: jsonproc + @: + +jsonproc: $(SRCS) $(HEADERS) + $(CXX) $(CXXFLAGS) $(INCLUDES) $(SRCS) -o $@ $(LDFLAGS) + +clean: + $(RM) jsonproc jsonproc.exe diff --git a/tools/jsonproc/inja.hpp b/tools/jsonproc/inja.hpp new file mode 100644 index 000000000..3b7263546 --- /dev/null +++ b/tools/jsonproc/inja.hpp @@ -0,0 +1,3396 @@ +// MIT License + +// Copyright (c) 2018 lbersch + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + + +// --- + + +// Copyright (c) 2009-2018 FIRST +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of the FIRST nor the +// names of its contributors may be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef PANTOR_INJA_HPP +#define PANTOR_INJA_HPP + +#include +#include +#include +#include +#include +#include +#include + +#include + +// #include "environment.hpp" +#ifndef PANTOR_INJA_ENVIRONMENT_HPP +#define PANTOR_INJA_ENVIRONMENT_HPP + +#include +#include +#include +#include + +#include + +// #include "config.hpp" +#ifndef PANTOR_INJA_CONFIG_HPP +#define PANTOR_INJA_CONFIG_HPP + +#include +#include + +// #include "string_view.hpp" +// Copyright 2017-2019 by Martin Moene +// +// string-view lite, a C++17-like string_view for C++98 and later. +// For more information see https://github.com/martinmoene/string-view-lite +// +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + + +#ifndef NONSTD_SV_LITE_H_INCLUDED +#define NONSTD_SV_LITE_H_INCLUDED + +#define string_view_lite_MAJOR 1 +#define string_view_lite_MINOR 1 +#define string_view_lite_PATCH 0 + +#define string_view_lite_VERSION nssv_STRINGIFY(string_view_lite_MAJOR) "." nssv_STRINGIFY(string_view_lite_MINOR) "." nssv_STRINGIFY(string_view_lite_PATCH) + +#define nssv_STRINGIFY( x ) nssv_STRINGIFY_( x ) +#define nssv_STRINGIFY_( x ) #x + +// string-view lite configuration: + +#define nssv_STRING_VIEW_DEFAULT 0 +#define nssv_STRING_VIEW_NONSTD 1 +#define nssv_STRING_VIEW_STD 2 + +#if !defined( nssv_CONFIG_SELECT_STRING_VIEW ) +# define nssv_CONFIG_SELECT_STRING_VIEW ( nssv_HAVE_STD_STRING_VIEW ? nssv_STRING_VIEW_STD : nssv_STRING_VIEW_NONSTD ) +#endif + +#if defined( nssv_CONFIG_SELECT_STD_STRING_VIEW ) || defined( nssv_CONFIG_SELECT_NONSTD_STRING_VIEW ) +# error nssv_CONFIG_SELECT_STD_STRING_VIEW and nssv_CONFIG_SELECT_NONSTD_STRING_VIEW are deprecated and removed, please use nssv_CONFIG_SELECT_STRING_VIEW=nssv_STRING_VIEW_... +#endif + +#ifndef nssv_CONFIG_STD_SV_OPERATOR +# define nssv_CONFIG_STD_SV_OPERATOR 0 +#endif + +#ifndef nssv_CONFIG_USR_SV_OPERATOR +# define nssv_CONFIG_USR_SV_OPERATOR 1 +#endif + +#ifdef nssv_CONFIG_CONVERSION_STD_STRING +# define nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS nssv_CONFIG_CONVERSION_STD_STRING +# define nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS nssv_CONFIG_CONVERSION_STD_STRING +#endif + +#ifndef nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS +# define nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS 1 +#endif + +#ifndef nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS +# define nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS 1 +#endif + +// Control presence of exception handling (try and auto discover): + +#ifndef nssv_CONFIG_NO_EXCEPTIONS +# if defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND) +# define nssv_CONFIG_NO_EXCEPTIONS 0 +# else +# define nssv_CONFIG_NO_EXCEPTIONS 1 +# endif +#endif + +// C++ language version detection (C++20 is speculative): +// Note: VC14.0/1900 (VS2015) lacks too much from C++14. + +#ifndef nssv_CPLUSPLUS +# if defined(_MSVC_LANG ) && !defined(__clang__) +# define nssv_CPLUSPLUS (_MSC_VER == 1900 ? 201103L : _MSVC_LANG ) +# else +# define nssv_CPLUSPLUS __cplusplus +# endif +#endif + +#define nssv_CPP98_OR_GREATER ( nssv_CPLUSPLUS >= 199711L ) +#define nssv_CPP11_OR_GREATER ( nssv_CPLUSPLUS >= 201103L ) +#define nssv_CPP11_OR_GREATER_ ( nssv_CPLUSPLUS >= 201103L ) +#define nssv_CPP14_OR_GREATER ( nssv_CPLUSPLUS >= 201402L ) +#define nssv_CPP17_OR_GREATER ( nssv_CPLUSPLUS >= 201703L ) +#define nssv_CPP20_OR_GREATER ( nssv_CPLUSPLUS >= 202000L ) + +// use C++17 std::string_view if available and requested: + +#if nssv_CPP17_OR_GREATER && defined(__has_include ) +# if __has_include( ) +# define nssv_HAVE_STD_STRING_VIEW 1 +# else +# define nssv_HAVE_STD_STRING_VIEW 0 +# endif +#else +# define nssv_HAVE_STD_STRING_VIEW 0 +#endif + +#define nssv_USES_STD_STRING_VIEW ( (nssv_CONFIG_SELECT_STRING_VIEW == nssv_STRING_VIEW_STD) || ((nssv_CONFIG_SELECT_STRING_VIEW == nssv_STRING_VIEW_DEFAULT) && nssv_HAVE_STD_STRING_VIEW) ) + +#define nssv_HAVE_STARTS_WITH ( nssv_CPP20_OR_GREATER || !nssv_USES_STD_STRING_VIEW ) +#define nssv_HAVE_ENDS_WITH nssv_HAVE_STARTS_WITH + +// +// Use C++17 std::string_view: +// + +#if nssv_USES_STD_STRING_VIEW + +#include + +// Extensions for std::string: + +#if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS + +namespace nonstd { + +template< class CharT, class Traits, class Allocator = std::allocator > +std::basic_string +to_string( std::basic_string_view v, Allocator const & a = Allocator() ) +{ + return std::basic_string( v.begin(), v.end(), a ); +} + +template< class CharT, class Traits, class Allocator > +std::basic_string_view +to_string_view( std::basic_string const & s ) +{ + return std::basic_string_view( s.data(), s.size() ); +} + +// Literal operators sv and _sv: + +#if nssv_CONFIG_STD_SV_OPERATOR + +using namespace std::literals::string_view_literals; + +#endif + +#if nssv_CONFIG_USR_SV_OPERATOR + +inline namespace literals { +inline namespace string_view_literals { + + +constexpr std::string_view operator "" _sv( const char* str, size_t len ) noexcept // (1) +{ + return std::string_view{ str, len }; +} + +constexpr std::u16string_view operator "" _sv( const char16_t* str, size_t len ) noexcept // (2) +{ + return std::u16string_view{ str, len }; +} + +constexpr std::u32string_view operator "" _sv( const char32_t* str, size_t len ) noexcept // (3) +{ + return std::u32string_view{ str, len }; +} + +constexpr std::wstring_view operator "" _sv( const wchar_t* str, size_t len ) noexcept // (4) +{ + return std::wstring_view{ str, len }; +} + +}} // namespace literals::string_view_literals + +#endif // nssv_CONFIG_USR_SV_OPERATOR + +} // namespace nonstd + +#endif // nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS + +namespace nonstd { + +using std::string_view; +using std::wstring_view; +using std::u16string_view; +using std::u32string_view; +using std::basic_string_view; + +// literal "sv" and "_sv", see above + +using std::operator==; +using std::operator!=; +using std::operator<; +using std::operator<=; +using std::operator>; +using std::operator>=; + +using std::operator<<; + +} // namespace nonstd + +#else // nssv_HAVE_STD_STRING_VIEW + +// +// Before C++17: use string_view lite: +// + +// Compiler versions: +// +// MSVC++ 6.0 _MSC_VER == 1200 (Visual Studio 6.0) +// MSVC++ 7.0 _MSC_VER == 1300 (Visual Studio .NET 2002) +// MSVC++ 7.1 _MSC_VER == 1310 (Visual Studio .NET 2003) +// MSVC++ 8.0 _MSC_VER == 1400 (Visual Studio 2005) +// MSVC++ 9.0 _MSC_VER == 1500 (Visual Studio 2008) +// MSVC++ 10.0 _MSC_VER == 1600 (Visual Studio 2010) +// MSVC++ 11.0 _MSC_VER == 1700 (Visual Studio 2012) +// MSVC++ 12.0 _MSC_VER == 1800 (Visual Studio 2013) +// MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015) +// MSVC++ 14.1 _MSC_VER >= 1910 (Visual Studio 2017) + +#if defined(_MSC_VER ) && !defined(__clang__) +# define nssv_COMPILER_MSVC_VER (_MSC_VER ) +# define nssv_COMPILER_MSVC_VERSION (_MSC_VER / 10 - 10 * ( 5 + (_MSC_VER < 1900 ) ) ) +#else +# define nssv_COMPILER_MSVC_VER 0 +# define nssv_COMPILER_MSVC_VERSION 0 +#endif + +#define nssv_COMPILER_VERSION( major, minor, patch ) (10 * ( 10 * major + minor) + patch) + +#if defined(__clang__) +# define nssv_COMPILER_CLANG_VERSION nssv_COMPILER_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__) +#else +# define nssv_COMPILER_CLANG_VERSION 0 +#endif + +#if defined(__GNUC__) && !defined(__clang__) +# define nssv_COMPILER_GNUC_VERSION nssv_COMPILER_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#else +# define nssv_COMPILER_GNUC_VERSION 0 +#endif + +// half-open range [lo..hi): +#define nssv_BETWEEN( v, lo, hi ) ( (lo) <= (v) && (v) < (hi) ) + +// Presence of language and library features: + +#ifdef _HAS_CPP0X +# define nssv_HAS_CPP0X _HAS_CPP0X +#else +# define nssv_HAS_CPP0X 0 +#endif + +// Unless defined otherwise below, consider VC14 as C++11 for variant-lite: + +#if nssv_COMPILER_MSVC_VER >= 1900 +# undef nssv_CPP11_OR_GREATER +# define nssv_CPP11_OR_GREATER 1 +#endif + +#define nssv_CPP11_90 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1500) +#define nssv_CPP11_100 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1600) +#define nssv_CPP11_110 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1700) +#define nssv_CPP11_120 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1800) +#define nssv_CPP11_140 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1900) +#define nssv_CPP11_141 (nssv_CPP11_OR_GREATER_ || nssv_COMPILER_MSVC_VER >= 1910) + +#define nssv_CPP14_000 (nssv_CPP14_OR_GREATER) +#define nssv_CPP17_000 (nssv_CPP17_OR_GREATER) + +// Presence of C++11 language features: + +#define nssv_HAVE_CONSTEXPR_11 nssv_CPP11_140 +#define nssv_HAVE_EXPLICIT_CONVERSION nssv_CPP11_140 +#define nssv_HAVE_INLINE_NAMESPACE nssv_CPP11_140 +#define nssv_HAVE_NOEXCEPT nssv_CPP11_140 +#define nssv_HAVE_NULLPTR nssv_CPP11_100 +#define nssv_HAVE_REF_QUALIFIER nssv_CPP11_140 +#define nssv_HAVE_UNICODE_LITERALS nssv_CPP11_140 +#define nssv_HAVE_USER_DEFINED_LITERALS nssv_CPP11_140 +#define nssv_HAVE_WCHAR16_T nssv_CPP11_100 +#define nssv_HAVE_WCHAR32_T nssv_CPP11_100 + +#if ! ( ( nssv_CPP11 && nssv_COMPILER_CLANG_VERSION ) || nssv_BETWEEN( nssv_COMPILER_CLANG_VERSION, 300, 400 ) ) +# define nssv_HAVE_STD_DEFINED_LITERALS nssv_CPP11_140 +#endif + +// Presence of C++14 language features: + +#define nssv_HAVE_CONSTEXPR_14 nssv_CPP14_000 + +// Presence of C++17 language features: + +#define nssv_HAVE_NODISCARD nssv_CPP17_000 + +// Presence of C++ library features: + +#define nssv_HAVE_STD_HASH nssv_CPP11_120 + +// C++ feature usage: + +#if nssv_HAVE_CONSTEXPR_11 +# define nssv_constexpr constexpr +#else +# define nssv_constexpr /*constexpr*/ +#endif + +#if nssv_HAVE_CONSTEXPR_14 +# define nssv_constexpr14 constexpr +#else +# define nssv_constexpr14 /*constexpr*/ +#endif + +#if nssv_HAVE_EXPLICIT_CONVERSION +# define nssv_explicit explicit +#else +# define nssv_explicit /*explicit*/ +#endif + +#if nssv_HAVE_INLINE_NAMESPACE +# define nssv_inline_ns inline +#else +# define nssv_inline_ns /*inline*/ +#endif + +#if nssv_HAVE_NOEXCEPT +# define nssv_noexcept noexcept +#else +# define nssv_noexcept /*noexcept*/ +#endif + +//#if nssv_HAVE_REF_QUALIFIER +//# define nssv_ref_qual & +//# define nssv_refref_qual && +//#else +//# define nssv_ref_qual /*&*/ +//# define nssv_refref_qual /*&&*/ +//#endif + +#if nssv_HAVE_NULLPTR +# define nssv_nullptr nullptr +#else +# define nssv_nullptr NULL +#endif + +#if nssv_HAVE_NODISCARD +# define nssv_nodiscard [[nodiscard]] +#else +# define nssv_nodiscard /*[[nodiscard]]*/ +#endif + +// Additional includes: + +#include +#include +#include +#include +#include +#include // std::char_traits<> + +#if ! nssv_CONFIG_NO_EXCEPTIONS +# include +#endif + +#if nssv_CPP11_OR_GREATER +# include +#endif + +// Clang, GNUC, MSVC warning suppression macros: + +#if defined(__clang__) +# pragma clang diagnostic ignored "-Wreserved-user-defined-literal" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wuser-defined-literals" +#elif defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wliteral-suffix" +#endif // __clang__ + +#if nssv_COMPILER_MSVC_VERSION >= 140 +# define nssv_SUPPRESS_MSGSL_WARNING(expr) [[gsl::suppress(expr)]] +# define nssv_SUPPRESS_MSVC_WARNING(code, descr) __pragma(warning(suppress: code) ) +# define nssv_DISABLE_MSVC_WARNINGS(codes) __pragma(warning(push)) __pragma(warning(disable: codes)) +#else +# define nssv_SUPPRESS_MSGSL_WARNING(expr) +# define nssv_SUPPRESS_MSVC_WARNING(code, descr) +# define nssv_DISABLE_MSVC_WARNINGS(codes) +#endif + +#if defined(__clang__) +# define nssv_RESTORE_WARNINGS() _Pragma("clang diagnostic pop") +#elif defined(__GNUC__) +# define nssv_RESTORE_WARNINGS() _Pragma("GCC diagnostic pop") +#elif nssv_COMPILER_MSVC_VERSION >= 140 +# define nssv_RESTORE_WARNINGS() __pragma(warning(pop )) +#else +# define nssv_RESTORE_WARNINGS() +#endif + +// Suppress the following MSVC (GSL) warnings: +// - C4455, non-gsl : 'operator ""sv': literal suffix identifiers that do not +// start with an underscore are reserved +// - C26472, gsl::t.1 : don't use a static_cast for arithmetic conversions; +// use brace initialization, gsl::narrow_cast or gsl::narow +// - C26481: gsl::b.1 : don't use pointer arithmetic. Use span instead + +nssv_DISABLE_MSVC_WARNINGS( 4455 26481 26472 ) +//nssv_DISABLE_CLANG_WARNINGS( "-Wuser-defined-literals" ) +//nssv_DISABLE_GNUC_WARNINGS( -Wliteral-suffix ) + +namespace nonstd { namespace sv_lite { + +template +< + class CharT, + class Traits = std::char_traits +> +class basic_string_view; + +// +// basic_string_view: +// + +template +< + class CharT, + class Traits /* = std::char_traits */ +> +class basic_string_view +{ +public: + // Member types: + + typedef Traits traits_type; + typedef CharT value_type; + + typedef CharT * pointer; + typedef CharT const * const_pointer; + typedef CharT & reference; + typedef CharT const & const_reference; + + typedef const_pointer iterator; + typedef const_pointer const_iterator; + typedef std::reverse_iterator< const_iterator > reverse_iterator; + typedef std::reverse_iterator< const_iterator > const_reverse_iterator; + + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + + // 24.4.2.1 Construction and assignment: + + nssv_constexpr basic_string_view() nssv_noexcept + : data_( nssv_nullptr ) + , size_( 0 ) + {} + +#if nssv_CPP11_OR_GREATER + nssv_constexpr basic_string_view( basic_string_view const & other ) nssv_noexcept = default; +#else + nssv_constexpr basic_string_view( basic_string_view const & other ) nssv_noexcept + : data_( other.data_) + , size_( other.size_) + {} +#endif + + nssv_constexpr basic_string_view( CharT const * s, size_type count ) + : data_( s ) + , size_( count ) + {} + + nssv_constexpr basic_string_view( CharT const * s) + : data_( s ) + , size_( Traits::length(s) ) + {} + + // Assignment: + +#if nssv_CPP11_OR_GREATER + nssv_constexpr14 basic_string_view & operator=( basic_string_view const & other ) nssv_noexcept = default; +#else + nssv_constexpr14 basic_string_view & operator=( basic_string_view const & other ) nssv_noexcept + { + data_ = other.data_; + size_ = other.size_; + return *this; + } +#endif + + // 24.4.2.2 Iterator support: + + nssv_constexpr const_iterator begin() const nssv_noexcept { return data_; } + nssv_constexpr const_iterator end() const nssv_noexcept { return data_ + size_; } + + nssv_constexpr const_iterator cbegin() const nssv_noexcept { return begin(); } + nssv_constexpr const_iterator cend() const nssv_noexcept { return end(); } + + nssv_constexpr const_reverse_iterator rbegin() const nssv_noexcept { return const_reverse_iterator( end() ); } + nssv_constexpr const_reverse_iterator rend() const nssv_noexcept { return const_reverse_iterator( begin() ); } + + nssv_constexpr const_reverse_iterator crbegin() const nssv_noexcept { return rbegin(); } + nssv_constexpr const_reverse_iterator crend() const nssv_noexcept { return rend(); } + + // 24.4.2.3 Capacity: + + nssv_constexpr size_type size() const nssv_noexcept { return size_; } + nssv_constexpr size_type length() const nssv_noexcept { return size_; } + nssv_constexpr size_type max_size() const nssv_noexcept { return (std::numeric_limits< size_type >::max)(); } + + // since C++20 + nssv_nodiscard nssv_constexpr bool empty() const nssv_noexcept + { + return 0 == size_; + } + + // 24.4.2.4 Element access: + + nssv_constexpr const_reference operator[]( size_type pos ) const + { + return data_at( pos ); + } + + nssv_constexpr14 const_reference at( size_type pos ) const + { +#if nssv_CONFIG_NO_EXCEPTIONS + assert( pos < size() ); +#else + if ( pos >= size() ) + { + throw std::out_of_range("nonst::string_view::at()"); + } +#endif + return data_at( pos ); + } + + nssv_constexpr const_reference front() const { return data_at( 0 ); } + nssv_constexpr const_reference back() const { return data_at( size() - 1 ); } + + nssv_constexpr const_pointer data() const nssv_noexcept { return data_; } + + // 24.4.2.5 Modifiers: + + nssv_constexpr14 void remove_prefix( size_type n ) + { + assert( n <= size() ); + data_ += n; + size_ -= n; + } + + nssv_constexpr14 void remove_suffix( size_type n ) + { + assert( n <= size() ); + size_ -= n; + } + + nssv_constexpr14 void swap( basic_string_view & other ) nssv_noexcept + { + using std::swap; + swap( data_, other.data_ ); + swap( size_, other.size_ ); + } + + // 24.4.2.6 String operations: + + size_type copy( CharT * dest, size_type n, size_type pos = 0 ) const + { +#if nssv_CONFIG_NO_EXCEPTIONS + assert( pos <= size() ); +#else + if ( pos > size() ) + { + throw std::out_of_range("nonst::string_view::copy()"); + } +#endif + const size_type rlen = (std::min)( n, size() - pos ); + + (void) Traits::copy( dest, data() + pos, rlen ); + + return rlen; + } + + nssv_constexpr14 basic_string_view substr( size_type pos = 0, size_type n = npos ) const + { +#if nssv_CONFIG_NO_EXCEPTIONS + assert( pos <= size() ); +#else + if ( pos > size() ) + { + throw std::out_of_range("nonst::string_view::substr()"); + } +#endif + return basic_string_view( data() + pos, (std::min)( n, size() - pos ) ); + } + + // compare(), 6x: + + nssv_constexpr14 int compare( basic_string_view other ) const nssv_noexcept // (1) + { + if ( const int result = Traits::compare( data(), other.data(), (std::min)( size(), other.size() ) ) ) + return result; + + return size() == other.size() ? 0 : size() < other.size() ? -1 : 1; + } + + nssv_constexpr int compare( size_type pos1, size_type n1, basic_string_view other ) const // (2) + { + return substr( pos1, n1 ).compare( other ); + } + + nssv_constexpr int compare( size_type pos1, size_type n1, basic_string_view other, size_type pos2, size_type n2 ) const // (3) + { + return substr( pos1, n1 ).compare( other.substr( pos2, n2 ) ); + } + + nssv_constexpr int compare( CharT const * s ) const // (4) + { + return compare( basic_string_view( s ) ); + } + + nssv_constexpr int compare( size_type pos1, size_type n1, CharT const * s ) const // (5) + { + return substr( pos1, n1 ).compare( basic_string_view( s ) ); + } + + nssv_constexpr int compare( size_type pos1, size_type n1, CharT const * s, size_type n2 ) const // (6) + { + return substr( pos1, n1 ).compare( basic_string_view( s, n2 ) ); + } + + // 24.4.2.7 Searching: + + // starts_with(), 3x, since C++20: + + nssv_constexpr bool starts_with( basic_string_view v ) const nssv_noexcept // (1) + { + return size() >= v.size() && compare( 0, v.size(), v ) == 0; + } + + nssv_constexpr bool starts_with( CharT c ) const nssv_noexcept // (2) + { + return starts_with( basic_string_view( &c, 1 ) ); + } + + nssv_constexpr bool starts_with( CharT const * s ) const // (3) + { + return starts_with( basic_string_view( s ) ); + } + + // ends_with(), 3x, since C++20: + + nssv_constexpr bool ends_with( basic_string_view v ) const nssv_noexcept // (1) + { + return size() >= v.size() && compare( size() - v.size(), npos, v ) == 0; + } + + nssv_constexpr bool ends_with( CharT c ) const nssv_noexcept // (2) + { + return ends_with( basic_string_view( &c, 1 ) ); + } + + nssv_constexpr bool ends_with( CharT const * s ) const // (3) + { + return ends_with( basic_string_view( s ) ); + } + + // find(), 4x: + + nssv_constexpr14 size_type find( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1) + { + return assert( v.size() == 0 || v.data() != nssv_nullptr ) + , pos >= size() + ? npos + : to_pos( std::search( cbegin() + pos, cend(), v.cbegin(), v.cend(), Traits::eq ) ); + } + + nssv_constexpr14 size_type find( CharT c, size_type pos = 0 ) const nssv_noexcept // (2) + { + return find( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr14 size_type find( CharT const * s, size_type pos, size_type n ) const // (3) + { + return find( basic_string_view( s, n ), pos ); + } + + nssv_constexpr14 size_type find( CharT const * s, size_type pos = 0 ) const // (4) + { + return find( basic_string_view( s ), pos ); + } + + // rfind(), 4x: + + nssv_constexpr14 size_type rfind( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1) + { + if ( size() < v.size() ) + return npos; + + if ( v.empty() ) + return (std::min)( size(), pos ); + + const_iterator last = cbegin() + (std::min)( size() - v.size(), pos ) + v.size(); + const_iterator result = std::find_end( cbegin(), last, v.cbegin(), v.cend(), Traits::eq ); + + return result != last ? size_type( result - cbegin() ) : npos; + } + + nssv_constexpr14 size_type rfind( CharT c, size_type pos = npos ) const nssv_noexcept // (2) + { + return rfind( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr14 size_type rfind( CharT const * s, size_type pos, size_type n ) const // (3) + { + return rfind( basic_string_view( s, n ), pos ); + } + + nssv_constexpr14 size_type rfind( CharT const * s, size_type pos = npos ) const // (4) + { + return rfind( basic_string_view( s ), pos ); + } + + // find_first_of(), 4x: + + nssv_constexpr size_type find_first_of( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1) + { + return pos >= size() + ? npos + : to_pos( std::find_first_of( cbegin() + pos, cend(), v.cbegin(), v.cend(), Traits::eq ) ); + } + + nssv_constexpr size_type find_first_of( CharT c, size_type pos = 0 ) const nssv_noexcept // (2) + { + return find_first_of( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find_first_of( CharT const * s, size_type pos, size_type n ) const // (3) + { + return find_first_of( basic_string_view( s, n ), pos ); + } + + nssv_constexpr size_type find_first_of( CharT const * s, size_type pos = 0 ) const // (4) + { + return find_first_of( basic_string_view( s ), pos ); + } + + // find_last_of(), 4x: + + nssv_constexpr size_type find_last_of( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1) + { + return empty() + ? npos + : pos >= size() + ? find_last_of( v, size() - 1 ) + : to_pos( std::find_first_of( const_reverse_iterator( cbegin() + pos + 1 ), crend(), v.cbegin(), v.cend(), Traits::eq ) ); + } + + nssv_constexpr size_type find_last_of( CharT c, size_type pos = npos ) const nssv_noexcept // (2) + { + return find_last_of( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find_last_of( CharT const * s, size_type pos, size_type count ) const // (3) + { + return find_last_of( basic_string_view( s, count ), pos ); + } + + nssv_constexpr size_type find_last_of( CharT const * s, size_type pos = npos ) const // (4) + { + return find_last_of( basic_string_view( s ), pos ); + } + + // find_first_not_of(), 4x: + + nssv_constexpr size_type find_first_not_of( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1) + { + return pos >= size() + ? npos + : to_pos( std::find_if( cbegin() + pos, cend(), not_in_view( v ) ) ); + } + + nssv_constexpr size_type find_first_not_of( CharT c, size_type pos = 0 ) const nssv_noexcept // (2) + { + return find_first_not_of( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find_first_not_of( CharT const * s, size_type pos, size_type count ) const // (3) + { + return find_first_not_of( basic_string_view( s, count ), pos ); + } + + nssv_constexpr size_type find_first_not_of( CharT const * s, size_type pos = 0 ) const // (4) + { + return find_first_not_of( basic_string_view( s ), pos ); + } + + // find_last_not_of(), 4x: + + nssv_constexpr size_type find_last_not_of( basic_string_view v, size_type pos = npos ) const nssv_noexcept // (1) + { + return empty() + ? npos + : pos >= size() + ? find_last_not_of( v, size() - 1 ) + : to_pos( std::find_if( const_reverse_iterator( cbegin() + pos + 1 ), crend(), not_in_view( v ) ) ); + } + + nssv_constexpr size_type find_last_not_of( CharT c, size_type pos = npos ) const nssv_noexcept // (2) + { + return find_last_not_of( basic_string_view( &c, 1 ), pos ); + } + + nssv_constexpr size_type find_last_not_of( CharT const * s, size_type pos, size_type count ) const // (3) + { + return find_last_not_of( basic_string_view( s, count ), pos ); + } + + nssv_constexpr size_type find_last_not_of( CharT const * s, size_type pos = npos ) const // (4) + { + return find_last_not_of( basic_string_view( s ), pos ); + } + + // Constants: + +#if nssv_CPP17_OR_GREATER + static nssv_constexpr size_type npos = size_type(-1); +#elif nssv_CPP11_OR_GREATER + enum : size_type { npos = size_type(-1) }; +#else + enum { npos = size_type(-1) }; +#endif + +private: + struct not_in_view + { + const basic_string_view v; + + nssv_constexpr not_in_view( basic_string_view v ) : v( v ) {} + + nssv_constexpr bool operator()( CharT c ) const + { + return npos == v.find_first_of( c ); + } + }; + + nssv_constexpr size_type to_pos( const_iterator it ) const + { + return it == cend() ? npos : size_type( it - cbegin() ); + } + + nssv_constexpr size_type to_pos( const_reverse_iterator it ) const + { + return it == crend() ? npos : size_type( crend() - it - 1 ); + } + + nssv_constexpr const_reference data_at( size_type pos ) const + { +#if nssv_BETWEEN( nssv_COMPILER_GNUC_VERSION, 1, 500 ) + return data_[pos]; +#else + return assert( pos < size() ), data_[pos]; +#endif + } + +private: + const_pointer data_; + size_type size_; + +public: +#if nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS + + template< class Allocator > + basic_string_view( std::basic_string const & s ) nssv_noexcept + : data_( s.data() ) + , size_( s.size() ) + {} + +#if nssv_HAVE_EXPLICIT_CONVERSION + + template< class Allocator > + explicit operator std::basic_string() const + { + return to_string( Allocator() ); + } + +#endif // nssv_HAVE_EXPLICIT_CONVERSION + +#if nssv_CPP11_OR_GREATER + + template< class Allocator = std::allocator > + std::basic_string + to_string( Allocator const & a = Allocator() ) const + { + return std::basic_string( begin(), end(), a ); + } + +#else + + std::basic_string + to_string() const + { + return std::basic_string( begin(), end() ); + } + + template< class Allocator > + std::basic_string + to_string( Allocator const & a ) const + { + return std::basic_string( begin(), end(), a ); + } + +#endif // nssv_CPP11_OR_GREATER + +#endif // nssv_CONFIG_CONVERSION_STD_STRING_CLASS_METHODS +}; + +// +// Non-member functions: +// + +// 24.4.3 Non-member comparison functions: +// lexicographically compare two string views (function template): + +template< class CharT, class Traits > +nssv_constexpr bool operator== ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) == 0 ; } + +template< class CharT, class Traits > +nssv_constexpr bool operator!= ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) != 0 ; } + +template< class CharT, class Traits > +nssv_constexpr bool operator< ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0 ; } + +template< class CharT, class Traits > +nssv_constexpr bool operator<= ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0 ; } + +template< class CharT, class Traits > +nssv_constexpr bool operator> ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0 ; } + +template< class CharT, class Traits > +nssv_constexpr bool operator>= ( + basic_string_view lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0 ; } + +// Let S be basic_string_view, and sv be an instance of S. +// Implementations shall provide sufficient additional overloads marked +// constexpr and noexcept so that an object t with an implicit conversion +// to S can be compared according to Table 67. + +#if nssv_CPP11_OR_GREATER && ! nssv_BETWEEN( nssv_COMPILER_MSVC_VERSION, 100, 141 ) + +#define nssv_BASIC_STRING_VIEW_I(T,U) typename std::decay< basic_string_view >::type + +#if nssv_BETWEEN( nssv_COMPILER_MSVC_VERSION, 140, 150 ) +# define nssv_MSVC_ORDER(x) , int=x +#else +# define nssv_MSVC_ORDER(x) /*, int=x*/ +#endif + +// == + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator==( + basic_string_view lhs, + nssv_BASIC_STRING_VIEW_I(CharT, Traits) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) == 0; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator==( + nssv_BASIC_STRING_VIEW_I(CharT, Traits) lhs, + basic_string_view rhs ) nssv_noexcept +{ return lhs.size() == rhs.size() && lhs.compare( rhs ) == 0; } + +// != + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator!= ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.size() != rhs.size() || lhs.compare( rhs ) != 0 ; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator!= ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) != 0 ; } + +// < + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator< ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0 ; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator< ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) < 0 ; } + +// <= + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator<= ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0 ; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator<= ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) <= 0 ; } + +// > + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator> ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0 ; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator> ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) > 0 ; } + +// >= + +template< class CharT, class Traits nssv_MSVC_ORDER(1) > +nssv_constexpr bool operator>= ( + basic_string_view < CharT, Traits > lhs, + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0 ; } + +template< class CharT, class Traits nssv_MSVC_ORDER(2) > +nssv_constexpr bool operator>= ( + nssv_BASIC_STRING_VIEW_I( CharT, Traits ) lhs, + basic_string_view < CharT, Traits > rhs ) nssv_noexcept +{ return lhs.compare( rhs ) >= 0 ; } + +#undef nssv_MSVC_ORDER +#undef nssv_BASIC_STRING_VIEW_I + +#endif // nssv_CPP11_OR_GREATER + +// 24.4.4 Inserters and extractors: + +namespace detail { + +template< class Stream > +void write_padding( Stream & os, std::streamsize n ) +{ + for ( std::streamsize i = 0; i < n; ++i ) + os.rdbuf()->sputc( os.fill() ); +} + +template< class Stream, class View > +Stream & write_to_stream( Stream & os, View const & sv ) +{ + typename Stream::sentry sentry( os ); + + if ( !os ) + return os; + + const std::streamsize length = static_cast( sv.length() ); + + // Whether, and how, to pad: + const bool pad = ( length < os.width() ); + const bool left_pad = pad && ( os.flags() & std::ios_base::adjustfield ) == std::ios_base::right; + + if ( left_pad ) + write_padding( os, os.width() - length ); + + // Write span characters: + os.rdbuf()->sputn( sv.begin(), length ); + + if ( pad && !left_pad ) + write_padding( os, os.width() - length ); + + // Reset output stream width: + os.width( 0 ); + + return os; +} + +} // namespace detail + +template< class CharT, class Traits > +std::basic_ostream & +operator<<( + std::basic_ostream& os, + basic_string_view sv ) +{ + return detail::write_to_stream( os, sv ); +} + +// Several typedefs for common character types are provided: + +typedef basic_string_view string_view; +typedef basic_string_view wstring_view; +#if nssv_HAVE_WCHAR16_T +typedef basic_string_view u16string_view; +typedef basic_string_view u32string_view; +#endif + +}} // namespace nonstd::sv_lite + +// +// 24.4.6 Suffix for basic_string_view literals: +// + +#if nssv_HAVE_USER_DEFINED_LITERALS + +namespace nonstd { +nssv_inline_ns namespace literals { +nssv_inline_ns namespace string_view_literals { + +#if nssv_CONFIG_STD_SV_OPERATOR && nssv_HAVE_STD_DEFINED_LITERALS + +nssv_constexpr nonstd::sv_lite::string_view operator "" sv( const char* str, size_t len ) nssv_noexcept // (1) +{ + return nonstd::sv_lite::string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::u16string_view operator "" sv( const char16_t* str, size_t len ) nssv_noexcept // (2) +{ + return nonstd::sv_lite::u16string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::u32string_view operator "" sv( const char32_t* str, size_t len ) nssv_noexcept // (3) +{ + return nonstd::sv_lite::u32string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::wstring_view operator "" sv( const wchar_t* str, size_t len ) nssv_noexcept // (4) +{ + return nonstd::sv_lite::wstring_view{ str, len }; +} + +#endif // nssv_CONFIG_STD_SV_OPERATOR && nssv_HAVE_STD_DEFINED_LITERALS + +#if nssv_CONFIG_USR_SV_OPERATOR + +nssv_constexpr nonstd::sv_lite::string_view operator "" _sv( const char* str, size_t len ) nssv_noexcept // (1) +{ + return nonstd::sv_lite::string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::u16string_view operator "" _sv( const char16_t* str, size_t len ) nssv_noexcept // (2) +{ + return nonstd::sv_lite::u16string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::u32string_view operator "" _sv( const char32_t* str, size_t len ) nssv_noexcept // (3) +{ + return nonstd::sv_lite::u32string_view{ str, len }; +} + +nssv_constexpr nonstd::sv_lite::wstring_view operator "" _sv( const wchar_t* str, size_t len ) nssv_noexcept // (4) +{ + return nonstd::sv_lite::wstring_view{ str, len }; +} + +#endif // nssv_CONFIG_USR_SV_OPERATOR + +}}} // namespace nonstd::literals::string_view_literals + +#endif + +// +// Extensions for std::string: +// + +#if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS + +namespace nonstd { +namespace sv_lite { + +// Exclude MSVC 14 (19.00): it yields ambiguous to_string(): + +#if nssv_CPP11_OR_GREATER && nssv_COMPILER_MSVC_VERSION != 140 + +template< class CharT, class Traits, class Allocator = std::allocator > +std::basic_string +to_string( basic_string_view v, Allocator const & a = Allocator() ) +{ + return std::basic_string( v.begin(), v.end(), a ); +} + +#else + +template< class CharT, class Traits > +std::basic_string +to_string( basic_string_view v ) +{ + return std::basic_string( v.begin(), v.end() ); +} + +template< class CharT, class Traits, class Allocator > +std::basic_string +to_string( basic_string_view v, Allocator const & a ) +{ + return std::basic_string( v.begin(), v.end(), a ); +} + +#endif // nssv_CPP11_OR_GREATER + +template< class CharT, class Traits, class Allocator > +basic_string_view +to_string_view( std::basic_string const & s ) +{ + return basic_string_view( s.data(), s.size() ); +} + +}} // namespace nonstd::sv_lite + +#endif // nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS + +// +// make types and algorithms available in namespace nonstd: +// + +namespace nonstd { + +using sv_lite::basic_string_view; +using sv_lite::string_view; +using sv_lite::wstring_view; + +#if nssv_HAVE_WCHAR16_T +using sv_lite::u16string_view; +#endif +#if nssv_HAVE_WCHAR32_T +using sv_lite::u32string_view; +#endif + +// literal "sv" + +using sv_lite::operator==; +using sv_lite::operator!=; +using sv_lite::operator<; +using sv_lite::operator<=; +using sv_lite::operator>; +using sv_lite::operator>=; + +using sv_lite::operator<<; + +#if nssv_CONFIG_CONVERSION_STD_STRING_FREE_FUNCTIONS +using sv_lite::to_string; +using sv_lite::to_string_view; +#endif + +} // namespace nonstd + +// 24.4.5 Hash support (C++11): + +// Note: The hash value of a string view object is equal to the hash value of +// the corresponding string object. + +#if nssv_HAVE_STD_HASH + +#include + +namespace std { + +template<> +struct hash< nonstd::string_view > +{ +public: + std::size_t operator()( nonstd::string_view v ) const nssv_noexcept + { + return std::hash()( std::string( v.data(), v.size() ) ); + } +}; + +template<> +struct hash< nonstd::wstring_view > +{ +public: + std::size_t operator()( nonstd::wstring_view v ) const nssv_noexcept + { + return std::hash()( std::wstring( v.data(), v.size() ) ); + } +}; + +template<> +struct hash< nonstd::u16string_view > +{ +public: + std::size_t operator()( nonstd::u16string_view v ) const nssv_noexcept + { + return std::hash()( std::u16string( v.data(), v.size() ) ); + } +}; + +template<> +struct hash< nonstd::u32string_view > +{ +public: + std::size_t operator()( nonstd::u32string_view v ) const nssv_noexcept + { + return std::hash()( std::u32string( v.data(), v.size() ) ); + } +}; + +} // namespace std + +#endif // nssv_HAVE_STD_HASH + +nssv_RESTORE_WARNINGS() + +#endif // nssv_HAVE_STD_STRING_VIEW +#endif // NONSTD_SV_LITE_H_INCLUDED + + + +namespace inja { + +enum class ElementNotation { + Dot, + Pointer +}; + +struct LexerConfig { + std::string statement_open {"{%"}; + std::string statement_close {"%}"}; + std::string line_statement {"##"}; + std::string expression_open {"{{"}; + std::string expression_close {"}}"}; + std::string comment_open {"{#"}; + std::string comment_close {"#}"}; + std::string open_chars {"#{"}; + + void update_open_chars() { + open_chars = ""; + if (open_chars.find(line_statement[0]) == std::string::npos) { + open_chars += line_statement[0]; + } + if (open_chars.find(statement_open[0]) == std::string::npos) { + open_chars += statement_open[0]; + } + if (open_chars.find(expression_open[0]) == std::string::npos) { + open_chars += expression_open[0]; + } + if (open_chars.find(comment_open[0]) == std::string::npos) { + open_chars += comment_open[0]; + } + } +}; + +struct ParserConfig { + ElementNotation notation {ElementNotation::Dot}; +}; + +} + +#endif // PANTOR_INJA_CONFIG_HPP + +// #include "function_storage.hpp" +#ifndef PANTOR_INJA_FUNCTION_STORAGE_HPP +#define PANTOR_INJA_FUNCTION_STORAGE_HPP + +// #include "bytecode.hpp" +#ifndef PANTOR_INJA_BYTECODE_HPP +#define PANTOR_INJA_BYTECODE_HPP + +#include + +#include + +// #include "string_view.hpp" + + + +namespace inja { + +using namespace nlohmann; + + +struct Bytecode { + enum class Op : uint8_t { + Nop, + // print StringRef (always immediate) + PrintText, + // print value + PrintValue, + // push value onto stack (always immediate) + Push, + + // builtin functions + // result is pushed to stack + // args specify number of arguments + // all functions can take their "last" argument either immediate + // or popped off stack (e.g. if immediate, it's like the immediate was + // just pushed to the stack) + Not, + And, + Or, + In, + Equal, + Greater, + GreaterEqual, + Less, + LessEqual, + Different, + DivisibleBy, + Even, + First, + Float, + Int, + Last, + Length, + Lower, + Max, + Min, + Odd, + Range, + Result, + Round, + Sort, + Upper, + Exists, + ExistsInObject, + IsBoolean, + IsNumber, + IsInteger, + IsFloat, + IsObject, + IsArray, + IsString, + Default, + + // include another template + // value is the template name + Include, + + // callback function + // str is the function name (this means it cannot be a lookup) + // args specify number of arguments + // as with builtin functions, "last" argument can be immediate + Callback, + + // unconditional jump + // args is the index of the bytecode to jump to. + Jump, + + // conditional jump + // value popped off stack is checked for truthyness + // if false, args is the index of the bytecode to jump to. + // if true, no action is taken (falls through) + ConditionalJump, + + // start loop + // value popped off stack is what is iterated over + // args is index of bytecode after end loop (jumped to if iterable is + // empty) + // immediate value is key name (for maps) + // str is value name + StartLoop, + + // end a loop + // args is index of the first bytecode in the loop body + EndLoop, + }; + + enum Flag { + // location of value for value-taking ops (mask) + ValueMask = 0x03, + // pop value off stack + ValuePop = 0x00, + // value is immediate rather than on stack + ValueImmediate = 0x01, + // lookup immediate str (dot notation) + ValueLookupDot = 0x02, + // lookup immediate str (json pointer notation) + ValueLookupPointer = 0x03, + }; + + Op op {Op::Nop}; + uint32_t args: 30; + uint32_t flags: 2; + + json value; + std::string str; + + Bytecode(): args(0), flags(0) {} + explicit Bytecode(Op op, unsigned int args = 0): op(op), args(args), flags(0) {} + explicit Bytecode(Op op, nonstd::string_view str, unsigned int flags): op(op), args(0), flags(flags), str(str) {} + explicit Bytecode(Op op, json&& value, unsigned int flags): op(op), args(0), flags(flags), value(std::move(value)) {} +}; + +} // namespace inja + +#endif // PANTOR_INJA_BYTECODE_HPP + +// #include "string_view.hpp" + + + +namespace inja { + +using namespace nlohmann; + +using Arguments = std::vector; +using CallbackFunction = std::function; + +class FunctionStorage { + public: + void add_builtin(nonstd::string_view name, unsigned int num_args, Bytecode::Op op) { + auto& data = get_or_new(name, num_args); + data.op = op; + } + + void add_callback(nonstd::string_view name, unsigned int num_args, const CallbackFunction& function) { + auto& data = get_or_new(name, num_args); + data.function = function; + } + + Bytecode::Op find_builtin(nonstd::string_view name, unsigned int num_args) const { + if (auto ptr = get(name, num_args)) { + return ptr->op; + } + return Bytecode::Op::Nop; + } + + CallbackFunction find_callback(nonstd::string_view name, unsigned int num_args) const { + if (auto ptr = get(name, num_args)) { + return ptr->function; + } + return nullptr; + } + + private: + struct FunctionData { + unsigned int num_args {0}; + Bytecode::Op op {Bytecode::Op::Nop}; // for builtins + CallbackFunction function; // for callbacks + }; + + FunctionData& get_or_new(nonstd::string_view name, unsigned int num_args) { + auto &vec = m_map[static_cast(name)]; + for (auto &i: vec) { + if (i.num_args == num_args) return i; + } + vec.emplace_back(); + vec.back().num_args = num_args; + return vec.back(); + } + + const FunctionData* get(nonstd::string_view name, unsigned int num_args) const { + auto it = m_map.find(static_cast(name)); + if (it == m_map.end()) return nullptr; + for (auto &&i: it->second) { + if (i.num_args == num_args) return &i; + } + return nullptr; + } + + std::map> m_map; +}; + +} + +#endif // PANTOR_INJA_FUNCTION_STORAGE_HPP + +// #include "parser.hpp" +#ifndef PANTOR_INJA_PARSER_HPP +#define PANTOR_INJA_PARSER_HPP + +#include + +// #include "bytecode.hpp" + +// #include "config.hpp" + +// #include "function_storage.hpp" + +// #include "lexer.hpp" +#ifndef PANTOR_INJA_LEXER_HPP +#define PANTOR_INJA_LEXER_HPP + +#include +#include + +// #include "config.hpp" + +// #include "token.hpp" +#ifndef PANTOR_INJA_TOKEN_HPP +#define PANTOR_INJA_TOKEN_HPP + +// #include "string_view.hpp" + + + +namespace inja { + +struct Token { + enum class Kind { + Text, + ExpressionOpen, // {{ + ExpressionClose, // }} + LineStatementOpen, // ## + LineStatementClose, // \n + StatementOpen, // {% + StatementClose, // %} + CommentOpen, // {# + CommentClose, // #} + Id, // this, this.foo + Number, // 1, 2, -1, 5.2, -5.3 + String, // "this" + Comma, // , + Colon, // : + LeftParen, // ( + RightParen, // ) + LeftBracket, // [ + RightBracket, // ] + LeftBrace, // { + RightBrace, // } + Equal, // == + GreaterThan, // > + GreaterEqual, // >= + LessThan, // < + LessEqual, // <= + NotEqual, // != + Unknown, + Eof + } kind {Kind::Unknown}; + + nonstd::string_view text; + + constexpr Token() = default; + constexpr Token(Kind kind, nonstd::string_view text): kind(kind), text(text) {} + + std::string describe() const { + switch (kind) { + case Kind::Text: + return ""; + case Kind::LineStatementClose: + return ""; + case Kind::Eof: + return ""; + default: + return static_cast(text); + } + } +}; + +} + +#endif // PANTOR_INJA_TOKEN_HPP + +// #include "utils.hpp" +#ifndef PANTOR_INJA_UTILS_HPP +#define PANTOR_INJA_UTILS_HPP + +#include + +// #include "string_view.hpp" + + + +namespace inja { + +inline void inja_throw(const std::string& type, const std::string& message) { + throw std::runtime_error("[inja.exception." + type + "] " + message); +} + +namespace string_view { + inline nonstd::string_view slice(nonstd::string_view view, size_t start, size_t end) { + start = std::min(start, view.size()); + end = std::min(std::max(start, end), view.size()); + return view.substr(start, end - start); // StringRef(Data + Start, End - Start); + } + + inline std::pair split(nonstd::string_view view, char Separator) { + size_t idx = view.find(Separator); + if (idx == nonstd::string_view::npos) { + return std::make_pair(view, nonstd::string_view()); + } + return std::make_pair(slice(view, 0, idx), slice(view, idx + 1, nonstd::string_view::npos)); + } + + inline bool starts_with(nonstd::string_view view, nonstd::string_view prefix) { + return (view.size() >= prefix.size() && view.compare(0, prefix.size(), prefix) == 0); + } +} // namespace string + +} // namespace inja + +#endif // PANTOR_INJA_UTILS_HPP + + + +namespace inja { + +class Lexer { + enum class State { + Text, + ExpressionStart, + ExpressionBody, + LineStart, + LineBody, + StatementStart, + StatementBody, + CommentStart, + CommentBody + } m_state; + + const LexerConfig& m_config; + nonstd::string_view m_in; + size_t m_tok_start; + size_t m_pos; + + public: + explicit Lexer(const LexerConfig& config) : m_config(config) {} + + void start(nonstd::string_view in) { + m_in = in; + m_tok_start = 0; + m_pos = 0; + m_state = State::Text; + } + + Token scan() { + m_tok_start = m_pos; + + again: + if (m_tok_start >= m_in.size()) return make_token(Token::Kind::Eof); + + switch (m_state) { + default: + case State::Text: { + // fast-scan to first open character + size_t open_start = m_in.substr(m_pos).find_first_of(m_config.open_chars); + if (open_start == nonstd::string_view::npos) { + // didn't find open, return remaining text as text token + m_pos = m_in.size(); + return make_token(Token::Kind::Text); + } + m_pos += open_start; + + // try to match one of the opening sequences, and get the close + nonstd::string_view open_str = m_in.substr(m_pos); + if (inja::string_view::starts_with(open_str, m_config.expression_open)) { + m_state = State::ExpressionStart; + } else if (inja::string_view::starts_with(open_str, m_config.statement_open)) { + m_state = State::StatementStart; + } else if (inja::string_view::starts_with(open_str, m_config.comment_open)) { + m_state = State::CommentStart; + } else if ((m_pos == 0 || m_in[m_pos - 1] == '\n') && + inja::string_view::starts_with(open_str, m_config.line_statement)) { + m_state = State::LineStart; + } else { + m_pos += 1; // wasn't actually an opening sequence + goto again; + } + if (m_pos == m_tok_start) goto again; // don't generate empty token + return make_token(Token::Kind::Text); + } + case State::ExpressionStart: { + m_state = State::ExpressionBody; + m_pos += m_config.expression_open.size(); + return make_token(Token::Kind::ExpressionOpen); + } + case State::LineStart: { + m_state = State::LineBody; + m_pos += m_config.line_statement.size(); + return make_token(Token::Kind::LineStatementOpen); + } + case State::StatementStart: { + m_state = State::StatementBody; + m_pos += m_config.statement_open.size(); + return make_token(Token::Kind::StatementOpen); + } + case State::CommentStart: { + m_state = State::CommentBody; + m_pos += m_config.comment_open.size(); + return make_token(Token::Kind::CommentOpen); + } + case State::ExpressionBody: + return scan_body(m_config.expression_close, Token::Kind::ExpressionClose); + case State::LineBody: + return scan_body("\n", Token::Kind::LineStatementClose); + case State::StatementBody: + return scan_body(m_config.statement_close, Token::Kind::StatementClose); + case State::CommentBody: { + // fast-scan to comment close + size_t end = m_in.substr(m_pos).find(m_config.comment_close); + if (end == nonstd::string_view::npos) { + m_pos = m_in.size(); + return make_token(Token::Kind::Eof); + } + // return the entire comment in the close token + m_state = State::Text; + m_pos += end + m_config.comment_close.size(); + return make_token(Token::Kind::CommentClose); + } + } + } + + const LexerConfig& get_config() const { return m_config; } + + private: + Token scan_body(nonstd::string_view close, Token::Kind closeKind) { + again: + // skip whitespace (except for \n as it might be a close) + if (m_tok_start >= m_in.size()) return make_token(Token::Kind::Eof); + char ch = m_in[m_tok_start]; + if (ch == ' ' || ch == '\t' || ch == '\r') { + m_tok_start += 1; + goto again; + } + + // check for close + if (inja::string_view::starts_with(m_in.substr(m_tok_start), close)) { + m_state = State::Text; + m_pos = m_tok_start + close.size(); + return make_token(closeKind); + } + + // skip \n + if (ch == '\n') { + m_tok_start += 1; + goto again; + } + + m_pos = m_tok_start + 1; + if (std::isalpha(ch)) return scan_id(); + switch (ch) { + case ',': + return make_token(Token::Kind::Comma); + case ':': + return make_token(Token::Kind::Colon); + case '(': + return make_token(Token::Kind::LeftParen); + case ')': + return make_token(Token::Kind::RightParen); + case '[': + return make_token(Token::Kind::LeftBracket); + case ']': + return make_token(Token::Kind::RightBracket); + case '{': + return make_token(Token::Kind::LeftBrace); + case '}': + return make_token(Token::Kind::RightBrace); + case '>': + if (m_pos < m_in.size() && m_in[m_pos] == '=') { + m_pos += 1; + return make_token(Token::Kind::GreaterEqual); + } + return make_token(Token::Kind::GreaterThan); + case '<': + if (m_pos < m_in.size() && m_in[m_pos] == '=') { + m_pos += 1; + return make_token(Token::Kind::LessEqual); + } + return make_token(Token::Kind::LessThan); + case '=': + if (m_pos < m_in.size() && m_in[m_pos] == '=') { + m_pos += 1; + return make_token(Token::Kind::Equal); + } + return make_token(Token::Kind::Unknown); + case '!': + if (m_pos < m_in.size() && m_in[m_pos] == '=') { + m_pos += 1; + return make_token(Token::Kind::NotEqual); + } + return make_token(Token::Kind::Unknown); + case '\"': + return scan_string(); + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + return scan_number(); + case '_': + return scan_id(); + default: + return make_token(Token::Kind::Unknown); + } + } + + Token scan_id() { + for (;;) { + if (m_pos >= m_in.size()) { + break; + } + char ch = m_in[m_pos]; + if (!std::isalnum(ch) && ch != '.' && ch != '/' && ch != '_' && ch != '-') { + break; + } + m_pos += 1; + } + return make_token(Token::Kind::Id); + } + + Token scan_number() { + for (;;) { + if (m_pos >= m_in.size()) { + break; + } + char ch = m_in[m_pos]; + // be very permissive in lexer (we'll catch errors when conversion happens) + if (!std::isdigit(ch) && ch != '.' && ch != 'e' && ch != 'E' && ch != '+' && ch != '-') { + break; + } + m_pos += 1; + } + return make_token(Token::Kind::Number); + } + + Token scan_string() { + bool escape {false}; + for (;;) { + if (m_pos >= m_in.size()) break; + char ch = m_in[m_pos++]; + if (ch == '\\') { + escape = true; + } else if (!escape && ch == m_in[m_tok_start]) { + break; + } else { + escape = false; + } + } + return make_token(Token::Kind::String); + } + + Token make_token(Token::Kind kind) const { + return Token(kind, string_view::slice(m_in, m_tok_start, m_pos)); + } +}; + +} + +#endif // PANTOR_INJA_LEXER_HPP + +// #include "template.hpp" +#ifndef PANTOR_INJA_TEMPLATE_HPP +#define PANTOR_INJA_TEMPLATE_HPP + +#include +#include + +// #include "bytecode.hpp" + + + +namespace inja { + +struct Template { + std::vector bytecodes; + std::string content; +}; + +using TemplateStorage = std::map; + +} + +#endif // PANTOR_INJA_TEMPLATE_HPP + +// #include "token.hpp" + +// #include "utils.hpp" + + +#include + + +namespace inja { + +class ParserStatic { + ParserStatic() { + functions.add_builtin("default", 2, Bytecode::Op::Default); + functions.add_builtin("divisibleBy", 2, Bytecode::Op::DivisibleBy); + functions.add_builtin("even", 1, Bytecode::Op::Even); + functions.add_builtin("first", 1, Bytecode::Op::First); + functions.add_builtin("float", 1, Bytecode::Op::Float); + functions.add_builtin("int", 1, Bytecode::Op::Int); + functions.add_builtin("last", 1, Bytecode::Op::Last); + functions.add_builtin("length", 1, Bytecode::Op::Length); + functions.add_builtin("lower", 1, Bytecode::Op::Lower); + functions.add_builtin("max", 1, Bytecode::Op::Max); + functions.add_builtin("min", 1, Bytecode::Op::Min); + functions.add_builtin("odd", 1, Bytecode::Op::Odd); + functions.add_builtin("range", 1, Bytecode::Op::Range); + functions.add_builtin("round", 2, Bytecode::Op::Round); + functions.add_builtin("sort", 1, Bytecode::Op::Sort); + functions.add_builtin("upper", 1, Bytecode::Op::Upper); + functions.add_builtin("exists", 1, Bytecode::Op::Exists); + functions.add_builtin("existsIn", 2, Bytecode::Op::ExistsInObject); + functions.add_builtin("isBoolean", 1, Bytecode::Op::IsBoolean); + functions.add_builtin("isNumber", 1, Bytecode::Op::IsNumber); + functions.add_builtin("isInteger", 1, Bytecode::Op::IsInteger); + functions.add_builtin("isFloat", 1, Bytecode::Op::IsFloat); + functions.add_builtin("isObject", 1, Bytecode::Op::IsObject); + functions.add_builtin("isArray", 1, Bytecode::Op::IsArray); + functions.add_builtin("isString", 1, Bytecode::Op::IsString); + } + + public: + ParserStatic(const ParserStatic&) = delete; + ParserStatic& operator=(const ParserStatic&) = delete; + + static const ParserStatic& get_instance() { + static ParserStatic inst; + return inst; + } + + FunctionStorage functions; +}; + +class Parser { + public: + explicit Parser(const ParserConfig& parser_config, const LexerConfig& lexer_config, TemplateStorage& included_templates): m_config(parser_config), m_lexer(lexer_config), m_included_templates(included_templates), m_static(ParserStatic::get_instance()) { } + + bool parse_expression(Template& tmpl) { + if (!parse_expression_and(tmpl)) return false; + if (m_tok.kind != Token::Kind::Id || m_tok.text != "or") return true; + get_next_token(); + if (!parse_expression_and(tmpl)) return false; + append_function(tmpl, Bytecode::Op::Or, 2); + return true; + } + + bool parse_expression_and(Template& tmpl) { + if (!parse_expression_not(tmpl)) return false; + if (m_tok.kind != Token::Kind::Id || m_tok.text != "and") return true; + get_next_token(); + if (!parse_expression_not(tmpl)) return false; + append_function(tmpl, Bytecode::Op::And, 2); + return true; + } + + bool parse_expression_not(Template& tmpl) { + if (m_tok.kind == Token::Kind::Id && m_tok.text == "not") { + get_next_token(); + if (!parse_expression_not(tmpl)) return false; + append_function(tmpl, Bytecode::Op::Not, 1); + return true; + } else { + return parse_expression_comparison(tmpl); + } + } + + bool parse_expression_comparison(Template& tmpl) { + if (!parse_expression_datum(tmpl)) return false; + Bytecode::Op op; + switch (m_tok.kind) { + case Token::Kind::Id: + if (m_tok.text == "in") + op = Bytecode::Op::In; + else + return true; + break; + case Token::Kind::Equal: + op = Bytecode::Op::Equal; + break; + case Token::Kind::GreaterThan: + op = Bytecode::Op::Greater; + break; + case Token::Kind::LessThan: + op = Bytecode::Op::Less; + break; + case Token::Kind::LessEqual: + op = Bytecode::Op::LessEqual; + break; + case Token::Kind::GreaterEqual: + op = Bytecode::Op::GreaterEqual; + break; + case Token::Kind::NotEqual: + op = Bytecode::Op::Different; + break; + default: + return true; + } + get_next_token(); + if (!parse_expression_datum(tmpl)) return false; + append_function(tmpl, op, 2); + return true; + } + + bool parse_expression_datum(Template& tmpl) { + nonstd::string_view json_first; + size_t bracket_level = 0; + size_t brace_level = 0; + + for (;;) { + switch (m_tok.kind) { + case Token::Kind::LeftParen: { + get_next_token(); + if (!parse_expression(tmpl)) return false; + if (m_tok.kind != Token::Kind::RightParen) { + inja_throw("parser_error", "unmatched '('"); + } + get_next_token(); + return true; + } + case Token::Kind::Id: + get_peek_token(); + if (m_peek_tok.kind == Token::Kind::LeftParen) { + // function call, parse arguments + Token func_token = m_tok; + get_next_token(); // id + get_next_token(); // leftParen + unsigned int num_args = 0; + if (m_tok.kind == Token::Kind::RightParen) { + // no args + get_next_token(); + } else { + for (;;) { + if (!parse_expression(tmpl)) { + inja_throw("parser_error", "expected expression, got '" + m_tok.describe() + "'"); + } + num_args += 1; + if (m_tok.kind == Token::Kind::RightParen) { + get_next_token(); + break; + } + if (m_tok.kind != Token::Kind::Comma) { + inja_throw("parser_error", "expected ')' or ',', got '" + m_tok.describe() + "'"); + } + get_next_token(); + } + } + + auto op = m_static.functions.find_builtin(func_token.text, num_args); + + if (op != Bytecode::Op::Nop) { + // swap arguments for default(); see comment in RenderTo() + if (op == Bytecode::Op::Default) + std::swap(tmpl.bytecodes.back(), *(tmpl.bytecodes.rbegin() + 1)); + append_function(tmpl, op, num_args); + return true; + } else { + append_callback(tmpl, func_token.text, num_args); + return true; + } + } else if (m_tok.text == "true" || m_tok.text == "false" || m_tok.text == "null") { + // true, false, null are json literals + if (brace_level == 0 && bracket_level == 0) { + json_first = m_tok.text; + goto returnJson; + } + break; + } else { + // normal literal (json read) + tmpl.bytecodes.emplace_back( + Bytecode::Op::Push, m_tok.text, + m_config.notation == ElementNotation::Pointer ? Bytecode::Flag::ValueLookupPointer : Bytecode::Flag::ValueLookupDot); + get_next_token(); + return true; + } + // json passthrough + case Token::Kind::Number: + case Token::Kind::String: + if (brace_level == 0 && bracket_level == 0) { + json_first = m_tok.text; + goto returnJson; + } + break; + case Token::Kind::Comma: + case Token::Kind::Colon: + if (brace_level == 0 && bracket_level == 0) { + inja_throw("parser_error", "unexpected token '" + m_tok.describe() + "'"); + } + break; + case Token::Kind::LeftBracket: + if (brace_level == 0 && bracket_level == 0) { + json_first = m_tok.text; + } + bracket_level += 1; + break; + case Token::Kind::LeftBrace: + if (brace_level == 0 && bracket_level == 0) { + json_first = m_tok.text; + } + brace_level += 1; + break; + case Token::Kind::RightBracket: + if (bracket_level == 0) { + inja_throw("parser_error", "unexpected ']'"); + } + --bracket_level; + if (brace_level == 0 && bracket_level == 0) goto returnJson; + break; + case Token::Kind::RightBrace: + if (brace_level == 0) { + inja_throw("parser_error", "unexpected '}'"); + } + --brace_level; + if (brace_level == 0 && bracket_level == 0) goto returnJson; + break; + default: + if (brace_level != 0) { + inja_throw("parser_error", "unmatched '{'"); + } + if (bracket_level != 0) { + inja_throw("parser_error", "unmatched '['"); + } + return false; + } + + get_next_token(); + } + + returnJson: + // bridge across all intermediate tokens + nonstd::string_view json_text(json_first.data(), m_tok.text.data() - json_first.data() + m_tok.text.size()); + tmpl.bytecodes.emplace_back(Bytecode::Op::Push, json::parse(json_text), Bytecode::Flag::ValueImmediate); + get_next_token(); + return true; + } + + bool parse_statement(Template& tmpl, nonstd::string_view path) { + if (m_tok.kind != Token::Kind::Id) return false; + + if (m_tok.text == "if") { + get_next_token(); + + // evaluate expression + if (!parse_expression(tmpl)) return false; + + // start a new if block on if stack + m_if_stack.emplace_back(tmpl.bytecodes.size()); + + // conditional jump; destination will be filled in by else or endif + tmpl.bytecodes.emplace_back(Bytecode::Op::ConditionalJump); + } else if (m_tok.text == "endif") { + if (m_if_stack.empty()) { + inja_throw("parser_error", "endif without matching if"); + } + auto& if_data = m_if_stack.back(); + get_next_token(); + + // previous conditional jump jumps here + if (if_data.prev_cond_jump != std::numeric_limits::max()) { + tmpl.bytecodes[if_data.prev_cond_jump].args = tmpl.bytecodes.size(); + } + + // update all previous unconditional jumps to here + for (unsigned int i: if_data.uncond_jumps) { + tmpl.bytecodes[i].args = tmpl.bytecodes.size(); + } + + // pop if stack + m_if_stack.pop_back(); + } else if (m_tok.text == "else") { + if (m_if_stack.empty()) + inja_throw("parser_error", "else without matching if"); + auto& if_data = m_if_stack.back(); + get_next_token(); + + // end previous block with unconditional jump to endif; destination will be + // filled in by endif + if_data.uncond_jumps.push_back(tmpl.bytecodes.size()); + tmpl.bytecodes.emplace_back(Bytecode::Op::Jump); + + // previous conditional jump jumps here + tmpl.bytecodes[if_data.prev_cond_jump].args = tmpl.bytecodes.size(); + if_data.prev_cond_jump = std::numeric_limits::max(); + + // chained else if + if (m_tok.kind == Token::Kind::Id && m_tok.text == "if") { + get_next_token(); + + // evaluate expression + if (!parse_expression(tmpl)) return false; + + // update "previous jump" + if_data.prev_cond_jump = tmpl.bytecodes.size(); + + // conditional jump; destination will be filled in by else or endif + tmpl.bytecodes.emplace_back(Bytecode::Op::ConditionalJump); + } + } else if (m_tok.text == "for") { + get_next_token(); + + // options: for a in arr; for a, b in obj + if (m_tok.kind != Token::Kind::Id) + inja_throw("parser_error", "expected id, got '" + m_tok.describe() + "'"); + Token value_token = m_tok; + get_next_token(); + + Token key_token; + if (m_tok.kind == Token::Kind::Comma) { + get_next_token(); + if (m_tok.kind != Token::Kind::Id) + inja_throw("parser_error", "expected id, got '" + m_tok.describe() + "'"); + key_token = std::move(value_token); + value_token = m_tok; + get_next_token(); + } + + if (m_tok.kind != Token::Kind::Id || m_tok.text != "in") + inja_throw("parser_error", + "expected 'in', got '" + m_tok.describe() + "'"); + get_next_token(); + + if (!parse_expression(tmpl)) return false; + + m_loop_stack.push_back(tmpl.bytecodes.size()); + + tmpl.bytecodes.emplace_back(Bytecode::Op::StartLoop); + if (!key_token.text.empty()) { + tmpl.bytecodes.back().value = key_token.text; + } + tmpl.bytecodes.back().str = static_cast(value_token.text); + } else if (m_tok.text == "endfor") { + get_next_token(); + if (m_loop_stack.empty()) { + inja_throw("parser_error", "endfor without matching for"); + } + + // update loop with EndLoop index (for empty case) + tmpl.bytecodes[m_loop_stack.back()].args = tmpl.bytecodes.size(); + + tmpl.bytecodes.emplace_back(Bytecode::Op::EndLoop); + tmpl.bytecodes.back().args = m_loop_stack.back() + 1; // loop body + m_loop_stack.pop_back(); + } else if (m_tok.text == "include") { + get_next_token(); + + if (m_tok.kind != Token::Kind::String) { + inja_throw("parser_error", "expected string, got '" + m_tok.describe() + "'"); + } + + // build the relative path + json json_name = json::parse(m_tok.text); + std::string pathname = static_cast(path); + pathname += json_name.get_ref(); + if (pathname.compare(0, 2, "./") == 0) { + pathname.erase(0, 2); + } + // sys::path::remove_dots(pathname, true, sys::path::Style::posix); + + Template include_template = parse_template(pathname); + m_included_templates.emplace(pathname, include_template); + + // generate a reference bytecode + tmpl.bytecodes.emplace_back(Bytecode::Op::Include, json(pathname), Bytecode::Flag::ValueImmediate); + + get_next_token(); + } else { + return false; + } + return true; + } + + void append_function(Template& tmpl, Bytecode::Op op, unsigned int num_args) { + // we can merge with back-to-back push + if (!tmpl.bytecodes.empty()) { + Bytecode& last = tmpl.bytecodes.back(); + if (last.op == Bytecode::Op::Push) { + last.op = op; + last.args = num_args; + return; + } + } + + // otherwise just add it to the end + tmpl.bytecodes.emplace_back(op, num_args); + } + + void append_callback(Template& tmpl, nonstd::string_view name, unsigned int num_args) { + // we can merge with back-to-back push value (not lookup) + if (!tmpl.bytecodes.empty()) { + Bytecode& last = tmpl.bytecodes.back(); + if (last.op == Bytecode::Op::Push && + (last.flags & Bytecode::Flag::ValueMask) == Bytecode::Flag::ValueImmediate) { + last.op = Bytecode::Op::Callback; + last.args = num_args; + last.str = static_cast(name); + return; + } + } + + // otherwise just add it to the end + tmpl.bytecodes.emplace_back(Bytecode::Op::Callback, num_args); + tmpl.bytecodes.back().str = static_cast(name); + } + + void parse_into(Template& tmpl, nonstd::string_view path) { + m_lexer.start(tmpl.content); + + for (;;) { + get_next_token(); + switch (m_tok.kind) { + case Token::Kind::Eof: + if (!m_if_stack.empty()) inja_throw("parser_error", "unmatched if"); + if (!m_loop_stack.empty()) inja_throw("parser_error", "unmatched for"); + return; + case Token::Kind::Text: + tmpl.bytecodes.emplace_back(Bytecode::Op::PrintText, m_tok.text, 0u); + break; + case Token::Kind::StatementOpen: + get_next_token(); + if (!parse_statement(tmpl, path)) { + inja_throw("parser_error", "expected statement, got '" + m_tok.describe() + "'"); + } + if (m_tok.kind != Token::Kind::StatementClose) { + inja_throw("parser_error", "expected statement close, got '" + m_tok.describe() + "'"); + } + break; + case Token::Kind::LineStatementOpen: + get_next_token(); + parse_statement(tmpl, path); + if (m_tok.kind != Token::Kind::LineStatementClose && + m_tok.kind != Token::Kind::Eof) { + inja_throw("parser_error", "expected line statement close, got '" + m_tok.describe() + "'"); + } + break; + case Token::Kind::ExpressionOpen: + get_next_token(); + if (!parse_expression(tmpl)) { + inja_throw("parser_error", "expected expression, got '" + m_tok.describe() + "'"); + } + append_function(tmpl, Bytecode::Op::PrintValue, 1); + if (m_tok.kind != Token::Kind::ExpressionClose) { + inja_throw("parser_error", "expected expression close, got '" + m_tok.describe() + "'"); + } + break; + case Token::Kind::CommentOpen: + get_next_token(); + if (m_tok.kind != Token::Kind::CommentClose) { + inja_throw("parser_error", "expected comment close, got '" + m_tok.describe() + "'"); + } + break; + default: + inja_throw("parser_error", "unexpected token '" + m_tok.describe() + "'"); + break; + } + } + } + + Template parse(nonstd::string_view input, nonstd::string_view path) { + Template result; + result.content = static_cast(input); + parse_into(result, path); + return result; + } + + Template parse(nonstd::string_view input) { + return parse(input, "./"); + } + + Template parse_template(nonstd::string_view filename) { + Template result; + result.content = load_file(filename); + + nonstd::string_view path = filename.substr(0, filename.find_last_of("/\\") + 1); + // StringRef path = sys::path::parent_path(filename); + Parser(m_config, m_lexer.get_config(), m_included_templates).parse_into(result, path); + return result; + } + + std::string load_file(nonstd::string_view filename) { + std::ifstream file(static_cast(filename)); + std::string text((std::istreambuf_iterator(file)), std::istreambuf_iterator()); + return text; + } + + private: + const ParserConfig& m_config; + Lexer m_lexer; + Token m_tok; + Token m_peek_tok; + bool m_have_peek_tok {false}; + TemplateStorage& m_included_templates; + const ParserStatic& m_static; + + struct IfData { + unsigned int prev_cond_jump; + std::vector uncond_jumps; + + explicit IfData(unsigned int condJump): prev_cond_jump(condJump) {} + }; + + std::vector m_if_stack; + std::vector m_loop_stack; + + void get_next_token() { + if (m_have_peek_tok) { + m_tok = m_peek_tok; + m_have_peek_tok = false; + } else { + m_tok = m_lexer.scan(); + } + } + + void get_peek_token() { + if (!m_have_peek_tok) { + m_peek_tok = m_lexer.scan(); + m_have_peek_tok = true; + } + } +}; + +} // namespace inja + +#endif // PANTOR_INJA_PARSER_HPP + +// #include "polyfill.hpp" +#ifndef PANTOR_INJA_POLYFILL_HPP +#define PANTOR_INJA_POLYFILL_HPP + + +#if __cplusplus < 201402L + +#include +#include +#include + + +namespace stdinja { + template struct _Unique_if { + typedef std::unique_ptr _Single_object; + }; + + template struct _Unique_if { + typedef std::unique_ptr _Unknown_bound; + }; + + template struct _Unique_if { + typedef void _Known_bound; + }; + + template + typename _Unique_if::_Single_object + make_unique(Args&&... args) { + return std::unique_ptr(new T(std::forward(args)...)); + } + + template + typename _Unique_if::_Unknown_bound + make_unique(size_t n) { + typedef typename std::remove_extent::type U; + return std::unique_ptr(new U[n]()); + } + + template + typename _Unique_if::_Known_bound + make_unique(Args&&...) = delete; +} + +#else + +namespace stdinja = std; + +#endif // memory */ + + +#endif // PANTOR_INJA_POLYFILL_HPP + +// #include "renderer.hpp" +#ifndef PANTOR_INJA_RENDERER_HPP +#define PANTOR_INJA_RENDERER_HPP + +#include +#include + +#include + +// #include "bytecode.hpp" + +// #include "template.hpp" + +// #include "utils.hpp" + + + +namespace inja { + +inline nonstd::string_view convert_dot_to_json_pointer(nonstd::string_view dot, std::string& out) { + out.clear(); + do { + nonstd::string_view part; + std::tie(part, dot) = string_view::split(dot, '.'); + out.push_back('/'); + out.append(part.begin(), part.end()); + } while (!dot.empty()); + return nonstd::string_view(out.data(), out.size()); +} + +class Renderer { + std::vector& get_args(const Bytecode& bc) { + m_tmp_args.clear(); + + bool has_imm = ((bc.flags & Bytecode::Flag::ValueMask) != Bytecode::Flag::ValuePop); + + // get args from stack + unsigned int pop_args = bc.args; + if (has_imm) { + pop_args -= 1; + } + + for (auto i = std::prev(m_stack.end(), pop_args); i != m_stack.end(); i++) { + m_tmp_args.push_back(&(*i)); + } + + // get immediate arg + if (has_imm) { + m_tmp_args.push_back(get_imm(bc)); + } + + return m_tmp_args; + } + + void pop_args(const Bytecode& bc) { + unsigned int popArgs = bc.args; + if ((bc.flags & Bytecode::Flag::ValueMask) != Bytecode::Flag::ValuePop) { + popArgs -= 1; + } + for (unsigned int i = 0; i < popArgs; ++i) { + m_stack.pop_back(); + } + } + + const json* get_imm(const Bytecode& bc) { + std::string ptr_buffer; + nonstd::string_view ptr; + switch (bc.flags & Bytecode::Flag::ValueMask) { + case Bytecode::Flag::ValuePop: + return nullptr; + case Bytecode::Flag::ValueImmediate: + return &bc.value; + case Bytecode::Flag::ValueLookupDot: + ptr = convert_dot_to_json_pointer(bc.str, ptr_buffer); + break; + case Bytecode::Flag::ValueLookupPointer: + ptr_buffer += '/'; + ptr_buffer += bc.str; + ptr = ptr_buffer; + break; + } + try { + return &m_data->at(json::json_pointer(ptr.data())); + } catch (std::exception&) { + // try to evaluate as a no-argument callback + if (auto callback = m_callbacks.find_callback(bc.str, 0)) { + std::vector arguments {}; + m_tmp_val = callback(arguments); + return &m_tmp_val; + } + inja_throw("render_error", "variable '" + static_cast(bc.str) + "' not found"); + return nullptr; + } + } + + bool truthy(const json& var) const { + if (var.empty()) { + return false; + } else if (var.is_number()) { + return (var != 0); + } else if (var.is_string()) { + return !var.empty(); + } + + try { + return var.get(); + } catch (json::type_error& e) { + inja_throw("json_error", e.what()); + throw; + } + } + + void update_loop_data() { + LoopLevel& level = m_loop_stack.back(); + + if (level.loop_type == LoopLevel::Type::Array) { + level.data[static_cast(level.value_name)] = level.values.at(level.index); // *level.it; + auto& loopData = level.data["loop"]; + loopData["index"] = level.index; + loopData["index1"] = level.index + 1; + loopData["is_first"] = (level.index == 0); + loopData["is_last"] = (level.index == level.size - 1); + } else { + level.data[static_cast(level.key_name)] = level.map_it->first; + level.data[static_cast(level.value_name)] = *level.map_it->second; + } + } + + const TemplateStorage& m_included_templates; + const FunctionStorage& m_callbacks; + + std::vector m_stack; + + + struct LoopLevel { + enum class Type { Map, Array }; + + Type loop_type; + nonstd::string_view key_name; // variable name for keys + nonstd::string_view value_name; // variable name for values + json data; // data with loop info added + + json values; // values to iterate over + + // loop over list + size_t index; // current list index + size_t size; // length of list + + // loop over map + using KeyValue = std::pair; + using MapValues = std::vector; + MapValues map_values; // values to iterate over + MapValues::iterator map_it; // iterator over values + + }; + + std::vector m_loop_stack; + const json* m_data; + + std::vector m_tmp_args; + json m_tmp_val; + + + public: + Renderer(const TemplateStorage& included_templates, const FunctionStorage& callbacks): m_included_templates(included_templates), m_callbacks(callbacks) { + m_stack.reserve(16); + m_tmp_args.reserve(4); + m_loop_stack.reserve(16); + } + + void render_to(std::ostream& os, const Template& tmpl, const json& data) { + m_data = &data; + + for (size_t i = 0; i < tmpl.bytecodes.size(); ++i) { + const auto& bc = tmpl.bytecodes[i]; + + switch (bc.op) { + case Bytecode::Op::Nop: { + break; + } + case Bytecode::Op::PrintText: { + os << bc.str; + break; + } + case Bytecode::Op::PrintValue: { + const json& val = *get_args(bc)[0]; + if (val.is_string()) + os << val.get_ref(); + else + os << val.dump(); + // val.dump(os); + pop_args(bc); + break; + } + case Bytecode::Op::Push: { + m_stack.emplace_back(*get_imm(bc)); + break; + } + case Bytecode::Op::Upper: { + auto result = get_args(bc)[0]->get(); + std::transform(result.begin(), result.end(), result.begin(), ::toupper); + pop_args(bc); + m_stack.emplace_back(std::move(result)); + break; + } + case Bytecode::Op::Lower: { + auto result = get_args(bc)[0]->get(); + std::transform(result.begin(), result.end(), result.begin(), ::tolower); + pop_args(bc); + m_stack.emplace_back(std::move(result)); + break; + } + case Bytecode::Op::Range: { + int number = get_args(bc)[0]->get(); + std::vector result(number); + std::iota(std::begin(result), std::end(result), 0); + pop_args(bc); + m_stack.emplace_back(std::move(result)); + break; + } + case Bytecode::Op::Length: { + auto result = get_args(bc)[0]->size(); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::Sort: { + auto result = get_args(bc)[0]->get>(); + std::sort(result.begin(), result.end()); + pop_args(bc); + m_stack.emplace_back(std::move(result)); + break; + } + case Bytecode::Op::First: { + auto result = get_args(bc)[0]->front(); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::Last: { + auto result = get_args(bc)[0]->back(); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::Round: { + auto args = get_args(bc); + double number = args[0]->get(); + int precision = args[1]->get(); + pop_args(bc); + m_stack.emplace_back(std::round(number * std::pow(10.0, precision)) / std::pow(10.0, precision)); + break; + } + case Bytecode::Op::DivisibleBy: { + auto args = get_args(bc); + int number = args[0]->get(); + int divisor = args[1]->get(); + pop_args(bc); + m_stack.emplace_back((divisor != 0) && (number % divisor == 0)); + break; + } + case Bytecode::Op::Odd: { + int number = get_args(bc)[0]->get(); + pop_args(bc); + m_stack.emplace_back(number % 2 != 0); + break; + } + case Bytecode::Op::Even: { + int number = get_args(bc)[0]->get(); + pop_args(bc); + m_stack.emplace_back(number % 2 == 0); + break; + } + case Bytecode::Op::Max: { + auto args = get_args(bc); + auto result = *std::max_element(args[0]->begin(), args[0]->end()); + pop_args(bc); + m_stack.emplace_back(std::move(result)); + break; + } + case Bytecode::Op::Min: { + auto args = get_args(bc); + auto result = *std::min_element(args[0]->begin(), args[0]->end()); + pop_args(bc); + m_stack.emplace_back(std::move(result)); + break; + } + case Bytecode::Op::Not: { + bool result = !truthy(*get_args(bc)[0]); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::And: { + auto args = get_args(bc); + bool result = truthy(*args[0]) && truthy(*args[1]); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::Or: { + auto args = get_args(bc); + bool result = truthy(*args[0]) || truthy(*args[1]); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::In: { + auto args = get_args(bc); + bool result = std::find(args[1]->begin(), args[1]->end(), *args[0]) != + args[1]->end(); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::Equal: { + auto args = get_args(bc); + bool result = (*args[0] == *args[1]); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::Greater: { + auto args = get_args(bc); + bool result = (*args[0] > *args[1]); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::Less: { + auto args = get_args(bc); + bool result = (*args[0] < *args[1]); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::GreaterEqual: { + auto args = get_args(bc); + bool result = (*args[0] >= *args[1]); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::LessEqual: { + auto args = get_args(bc); + bool result = (*args[0] <= *args[1]); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::Different: { + auto args = get_args(bc); + bool result = (*args[0] != *args[1]); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::Float: { + double result = + std::stod(get_args(bc)[0]->get_ref()); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::Int: { + int result = std::stoi(get_args(bc)[0]->get_ref()); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::Exists: { + auto&& name = get_args(bc)[0]->get_ref(); + bool result = (data.find(name) != data.end()); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::ExistsInObject: { + auto args = get_args(bc); + auto&& name = args[1]->get_ref(); + bool result = (args[0]->find(name) != args[0]->end()); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::IsBoolean: { + bool result = get_args(bc)[0]->is_boolean(); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::IsNumber: { + bool result = get_args(bc)[0]->is_number(); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::IsInteger: { + bool result = get_args(bc)[0]->is_number_integer(); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::IsFloat: { + bool result = get_args(bc)[0]->is_number_float(); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::IsObject: { + bool result = get_args(bc)[0]->is_object(); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::IsArray: { + bool result = get_args(bc)[0]->is_array(); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::IsString: { + bool result = get_args(bc)[0]->is_string(); + pop_args(bc); + m_stack.emplace_back(result); + break; + } + case Bytecode::Op::Default: { + // default needs to be a bit "magic"; we can't evaluate the first + // argument during the push operation, so we swap the arguments during + // the parse phase so the second argument is pushed on the stack and + // the first argument is in the immediate + try { + const json* imm = get_imm(bc); + // if no exception was raised, replace the stack value with it + m_stack.back() = *imm; + } catch (std::exception&) { + // couldn't read immediate, just leave the stack as is + } + break; + } + case Bytecode::Op::Include: + Renderer(m_included_templates, m_callbacks).render_to(os, m_included_templates.find(get_imm(bc)->get_ref())->second, data); + break; + case Bytecode::Op::Callback: { + auto callback = m_callbacks.find_callback(bc.str, bc.args); + if (!callback) { + inja_throw("render_error", "function '" + static_cast(bc.str) + "' (" + std::to_string(static_cast(bc.args)) + ") not found"); + } + json result = callback(get_args(bc)); + pop_args(bc); + m_stack.emplace_back(std::move(result)); + break; + } + case Bytecode::Op::Jump: { + i = bc.args - 1; // -1 due to ++i in loop + break; + } + case Bytecode::Op::ConditionalJump: { + if (!truthy(m_stack.back())) { + i = bc.args - 1; // -1 due to ++i in loop + } + m_stack.pop_back(); + break; + } + case Bytecode::Op::StartLoop: { + // jump past loop body if empty + if (m_stack.back().empty()) { + m_stack.pop_back(); + i = bc.args; // ++i in loop will take it past EndLoop + break; + } + + m_loop_stack.emplace_back(); + LoopLevel& level = m_loop_stack.back(); + level.value_name = bc.str; + level.values = std::move(m_stack.back()); + level.data = (*m_data); + m_stack.pop_back(); + + if (bc.value.is_string()) { + // map iterator + if (!level.values.is_object()) { + m_loop_stack.pop_back(); + inja_throw("render_error", "for key, value requires object"); + } + level.loop_type = LoopLevel::Type::Map; + level.key_name = bc.value.get_ref(); + + // sort by key + for (auto it = level.values.begin(), end = level.values.end(); it != end; ++it) { + level.map_values.emplace_back(it.key(), &it.value()); + } + std::sort(level.map_values.begin(), level.map_values.end(), [](const LoopLevel::KeyValue& a, const LoopLevel::KeyValue& b) { return a.first < b.first; }); + level.map_it = level.map_values.begin(); + } else { + if (!level.values.is_array()) { + m_loop_stack.pop_back(); + inja_throw("render_error", "type must be array"); + } + + // list iterator + level.loop_type = LoopLevel::Type::Array; + level.index = 0; + level.size = level.values.size(); + } + + // provide parent access in nested loop + auto parent_loop_it = level.data.find("loop"); + if (parent_loop_it != level.data.end()) { + json loop_copy = *parent_loop_it; + (*parent_loop_it)["parent"] = std::move(loop_copy); + } + + // set "current" data to loop data + m_data = &level.data; + update_loop_data(); + break; + } + case Bytecode::Op::EndLoop: { + if (m_loop_stack.empty()) { + inja_throw("render_error", "unexpected state in renderer"); + } + LoopLevel& level = m_loop_stack.back(); + + bool done; + if (level.loop_type == LoopLevel::Type::Array) { + level.index += 1; + done = (level.index == level.values.size()); + } else { + level.map_it += 1; + done = (level.map_it == level.map_values.end()); + } + + if (done) { + m_loop_stack.pop_back(); + // set "current" data to outer loop data or main data as appropriate + if (!m_loop_stack.empty()) { + m_data = &m_loop_stack.back().data; + } else { + m_data = &data; + } + break; + } + + update_loop_data(); + + // jump back to start of loop + i = bc.args - 1; // -1 due to ++i in loop + break; + } + default: { + inja_throw("render_error", "unknown op in renderer: " + std::to_string(static_cast(bc.op))); + } + } + } + } +}; + +} // namespace inja + +#endif // PANTOR_INJA_RENDERER_HPP + +// #include "string_view.hpp" + +// #include "template.hpp" + + + +namespace inja { + +using namespace nlohmann; + +class Environment { + class Impl { + public: + std::string input_path; + std::string output_path; + + LexerConfig lexer_config; + ParserConfig parser_config; + + FunctionStorage callbacks; + TemplateStorage included_templates; + }; + + std::unique_ptr m_impl; + + public: + Environment(): Environment("./") { } + + explicit Environment(const std::string& global_path): m_impl(stdinja::make_unique()) { + m_impl->input_path = global_path; + m_impl->output_path = global_path; + } + + explicit Environment(const std::string& input_path, const std::string& output_path): m_impl(stdinja::make_unique()) { + m_impl->input_path = input_path; + m_impl->output_path = output_path; + } + + /// Sets the opener and closer for template statements + void set_statement(const std::string& open, const std::string& close) { + m_impl->lexer_config.statement_open = open; + m_impl->lexer_config.statement_close = close; + m_impl->lexer_config.update_open_chars(); + } + + /// Sets the opener for template line statements + void set_line_statement(const std::string& open) { + m_impl->lexer_config.line_statement = open; + m_impl->lexer_config.update_open_chars(); + } + + /// Sets the opener and closer for template expressions + void set_expression(const std::string& open, const std::string& close) { + m_impl->lexer_config.expression_open = open; + m_impl->lexer_config.expression_close = close; + m_impl->lexer_config.update_open_chars(); + } + + /// Sets the opener and closer for template comments + void set_comment(const std::string& open, const std::string& close) { + m_impl->lexer_config.comment_open = open; + m_impl->lexer_config.comment_close = close; + m_impl->lexer_config.update_open_chars(); + } + + /// Sets the element notation syntax + void set_element_notation(ElementNotation notation) { + m_impl->parser_config.notation = notation; + } + + + Template parse(nonstd::string_view input) { + Parser parser(m_impl->parser_config, m_impl->lexer_config, m_impl->included_templates); + return parser.parse(input); + } + + Template parse_template(const std::string& filename) { + Parser parser(m_impl->parser_config, m_impl->lexer_config, m_impl->included_templates); + return parser.parse_template(m_impl->input_path + static_cast(filename)); + } + + std::string render(nonstd::string_view input, const json& data) { + return render(parse(input), data); + } + + std::string render(const Template& tmpl, const json& data) { + std::stringstream os; + render_to(os, tmpl, data); + return os.str(); + } + + std::string render_file(const std::string& filename, const json& data) { + return render(parse_template(filename), data); + } + + std::string render_file_with_json_file(const std::string& filename, const std::string& filename_data) { + const json data = load_json(filename_data); + return render_file(filename, data); + } + + void write(const std::string& filename, const json& data, const std::string& filename_out) { + std::ofstream file(m_impl->output_path + filename_out); + file << render_file(filename, data); + file.close(); + } + + void write(const Template& temp, const json& data, const std::string& filename_out) { + std::ofstream file(m_impl->output_path + filename_out); + file << render(temp, data); + file.close(); + } + + void write_with_json_file(const std::string& filename, const std::string& filename_data, const std::string& filename_out) { + const json data = load_json(filename_data); + write(filename, data, filename_out); + } + + void write_with_json_file(const Template& temp, const std::string& filename_data, const std::string& filename_out) { + const json data = load_json(filename_data); + write(temp, data, filename_out); + } + + std::ostream& render_to(std::ostream& os, const Template& tmpl, const json& data) { + Renderer(m_impl->included_templates, m_impl->callbacks).render_to(os, tmpl, data); + return os; + } + + std::string load_file(const std::string& filename) { + Parser parser(m_impl->parser_config, m_impl->lexer_config, m_impl->included_templates); + return parser.load_file(m_impl->input_path + filename); + } + + json load_json(const std::string& filename) { + std::ifstream file(m_impl->input_path + filename); + json j; + file >> j; + return j; + } + + void add_callback(const std::string& name, unsigned int numArgs, const CallbackFunction& callback) { + m_impl->callbacks.add_callback(name, numArgs, callback); + } + + /** Includes a template with a given name into the environment. + * Then, a template can be rendered in another template using the + * include "" syntax. + */ + void include_template(const std::string& name, const Template& tmpl) { + m_impl->included_templates[name] = tmpl; + } +}; + +/*! +@brief render with default settings to a string +*/ +inline std::string render(nonstd::string_view input, const json& data) { + return Environment().render(input, data); +} + +/*! +@brief render with default settings to the given output stream +*/ +inline void render_to(std::ostream& os, nonstd::string_view input, const json& data) { + Environment env; + env.render_to(os, env.parse(input), data); +} + +} + +#endif // PANTOR_INJA_ENVIRONMENT_HPP + +// #include "string_view.hpp" + +// #include "template.hpp" + +// #include "parser.hpp" + +// #include "renderer.hpp" + + + +#endif // PANTOR_INJA_HPP diff --git a/tools/jsonproc/jsonproc.cpp b/tools/jsonproc/jsonproc.cpp new file mode 100644 index 000000000..efe48f39f --- /dev/null +++ b/tools/jsonproc/jsonproc.cpp @@ -0,0 +1,91 @@ +// jsonproc.cpp + +#include "jsonproc.h" + +#include + +#include +using std::string; + +#include +using namespace inja; +using json = nlohmann::json; + +std::map customVars; + +void set_custom_var(string key, string value) +{ + customVars[key] = value; +} + +string get_custom_var(string key) +{ + return customVars[key]; +} + +int main(int argc, char *argv[]) +{ + if (argc != 4) + FATAL_ERROR("USAGE: jsonproc \n"); + + string jsonfilepath = argv[1]; + string templateFilepath = argv[2]; + string outputFilepath = argv[3]; + + Environment env; + + // Add custom command callbacks. + env.add_callback("doNotModifyHeader", 0, [jsonfilepath, templateFilepath](Arguments& args) { + return "//\n// DO NOT MODIFY THIS FILE! IT IS AUTO-GENERATED FROM " + jsonfilepath +" and Inja template " + templateFilepath + "\n//\n"; + }); + + env.add_callback("setVar", 2, [=](Arguments& args) { + string key = args.at(0)->get(); + string value = args.at(1)->get(); + set_custom_var(key, value); + return ""; + }); + + env.add_callback("getVar", 1, [=](Arguments& args) { + string key = args.at(0)->get(); + return get_custom_var(key); + }); + + env.add_callback("concat", 2, [](Arguments& args) { + string first = args.at(0)->get(); + string second = args.at(1)->get(); + return first + second; + }); + + env.add_callback("removePrefix", 2, [](Arguments& args) { + string rawValue = args.at(0)->get(); + string prefix = args.at(1)->get(); + string::size_type i = rawValue.find(prefix); + if (i != 0) + return rawValue; + + return rawValue.erase(0, prefix.length()); + }); + + // Add custom command callbacks. + env.add_callback("removeSuffix", 2, [](Arguments& args) { + string rawValue = args.at(0)->get(); + string suffix = args.at(1)->get(); + string::size_type i = rawValue.rfind(suffix); + if (i == string::npos) + return rawValue; + + return rawValue.substr(0, i); + }); + + try + { + env.write_with_json_file(templateFilepath, jsonfilepath, outputFilepath); + } + catch (const std::exception& e) + { + FATAL_ERROR("JSONPROC_ERROR: %s\n", e.what()); + } + + return 0; +} diff --git a/tools/jsonproc/jsonproc.h b/tools/jsonproc/jsonproc.h new file mode 100644 index 000000000..575fb3756 --- /dev/null +++ b/tools/jsonproc/jsonproc.h @@ -0,0 +1,32 @@ +// jsonproc.h + +#ifndef JSONPROC_H +#define JSONPROC_H + +#include +#include +using std::fprintf; using std::exit; + +#include + +#ifdef _MSC_VER + +#define FATAL_ERROR(format, ...) \ +do \ +{ \ + fprintf(stderr, format, __VA_ARGS__); \ + exit(1); \ +} while (0) + +#else + +#define FATAL_ERROR(format, ...) \ +do \ +{ \ + fprintf(stderr, format, ##__VA_ARGS__); \ + exit(1); \ +} while (0) + +#endif // _MSC_VER + +#endif // JSONPROC_H diff --git a/tools/jsonproc/nlohmann/json.hpp b/tools/jsonproc/nlohmann/json.hpp new file mode 100644 index 000000000..5003a4fa2 --- /dev/null +++ b/tools/jsonproc/nlohmann/json.hpp @@ -0,0 +1,20842 @@ +/* + __ _____ _____ _____ + __| | __| | | | JSON for Modern C++ +| | |__ | | | | | | version 3.6.1 +|_____|_____|_____|_|___| https://github.com/nlohmann/json + +Licensed under the MIT License . +SPDX-License-Identifier: MIT +Copyright (c) 2013-2019 Niels Lohmann . + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef INCLUDE_NLOHMANN_JSON_HPP_ +#define INCLUDE_NLOHMANN_JSON_HPP_ + +#define NLOHMANN_JSON_VERSION_MAJOR 3 +#define NLOHMANN_JSON_VERSION_MINOR 6 +#define NLOHMANN_JSON_VERSION_PATCH 1 + +#include // all_of, find, for_each +#include // assert +#include // and, not, or +#include // nullptr_t, ptrdiff_t, size_t +#include // hash, less +#include // initializer_list +#include // istream, ostream +#include // random_access_iterator_tag +#include // unique_ptr +#include // accumulate +#include // string, stoi, to_string +#include // declval, forward, move, pair, swap +#include // vector + +// #include + + +#include + +// #include + + +#include // transform +#include // array +#include // and, not +#include // forward_list +#include // inserter, front_inserter, end +#include // map +#include // string +#include // tuple, make_tuple +#include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible +#include // unordered_map +#include // pair, declval +#include // valarray + +// #include + + +#include // exception +#include // runtime_error +#include // to_string + +// #include + + +#include // size_t + +namespace nlohmann +{ +namespace detail +{ +/// struct to capture the start position of the current token +struct position_t +{ + /// the total number of characters read + std::size_t chars_read_total = 0; + /// the number of characters read in the current line + std::size_t chars_read_current_line = 0; + /// the number of lines read + std::size_t lines_read = 0; + + /// conversion to size_t to preserve SAX interface + constexpr operator size_t() const + { + return chars_read_total; + } +}; + +} // namespace detail +} // namespace nlohmann + + +namespace nlohmann +{ +namespace detail +{ +//////////////// +// exceptions // +//////////////// + +/*! +@brief general exception of the @ref basic_json class + +This class is an extension of `std::exception` objects with a member @a id for +exception ids. It is used as the base class for all exceptions thrown by the +@ref basic_json class. This class can hence be used as "wildcard" to catch +exceptions. + +Subclasses: +- @ref parse_error for exceptions indicating a parse error +- @ref invalid_iterator for exceptions indicating errors with iterators +- @ref type_error for exceptions indicating executing a member function with + a wrong type +- @ref out_of_range for exceptions indicating access out of the defined range +- @ref other_error for exceptions indicating other library errors + +@internal +@note To have nothrow-copy-constructible exceptions, we internally use + `std::runtime_error` which can cope with arbitrary-length error messages. + Intermediate strings are built with static functions and then passed to + the actual constructor. +@endinternal + +@liveexample{The following code shows how arbitrary library exceptions can be +caught.,exception} + +@since version 3.0.0 +*/ +class exception : public std::exception +{ + public: + /// returns the explanatory string + const char* what() const noexcept override + { + return m.what(); + } + + /// the id of the exception + const int id; + + protected: + exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} + + static std::string name(const std::string& ename, int id_) + { + return "[json.exception." + ename + "." + std::to_string(id_) + "] "; + } + + private: + /// an exception object as storage for error messages + std::runtime_error m; +}; + +/*! +@brief exception indicating a parse error + +This exception is thrown by the library when a parse error occurs. Parse errors +can occur during the deserialization of JSON text, CBOR, MessagePack, as well +as when using JSON Patch. + +Member @a byte holds the byte index of the last read character in the input +file. + +Exceptions have ids 1xx. + +name / id | example message | description +------------------------------ | --------------- | ------------------------- +json.exception.parse_error.101 | parse error at 2: unexpected end of input; expected string literal | This error indicates a syntax error while deserializing a JSON text. The error message describes that an unexpected token (character) was encountered, and the member @a byte indicates the error position. +json.exception.parse_error.102 | parse error at 14: missing or wrong low surrogate | JSON uses the `\uxxxx` format to describe Unicode characters. Code points above above 0xFFFF are split into two `\uxxxx` entries ("surrogate pairs"). This error indicates that the surrogate pair is incomplete or contains an invalid code point. +json.exception.parse_error.103 | parse error: code points above 0x10FFFF are invalid | Unicode supports code points up to 0x10FFFF. Code points above 0x10FFFF are invalid. +json.exception.parse_error.104 | parse error: JSON patch must be an array of objects | [RFC 6902](https://tools.ietf.org/html/rfc6902) requires a JSON Patch document to be a JSON document that represents an array of objects. +json.exception.parse_error.105 | parse error: operation must have string member 'op' | An operation of a JSON Patch document must contain exactly one "op" member, whose value indicates the operation to perform. Its value must be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors. +json.exception.parse_error.106 | parse error: array index '01' must not begin with '0' | An array index in a JSON Pointer ([RFC 6901](https://tools.ietf.org/html/rfc6901)) may be `0` or any number without a leading `0`. +json.exception.parse_error.107 | parse error: JSON pointer must be empty or begin with '/' - was: 'foo' | A JSON Pointer must be a Unicode string containing a sequence of zero or more reference tokens, each prefixed by a `/` character. +json.exception.parse_error.108 | parse error: escape character '~' must be followed with '0' or '1' | In a JSON Pointer, only `~0` and `~1` are valid escape sequences. +json.exception.parse_error.109 | parse error: array index 'one' is not a number | A JSON Pointer array index must be a number. +json.exception.parse_error.110 | parse error at 1: cannot read 2 bytes from vector | When parsing CBOR or MessagePack, the byte vector ends before the complete value has been read. +json.exception.parse_error.112 | parse error at 1: error reading CBOR; last byte: 0xF8 | Not all types of CBOR or MessagePack are supported. This exception occurs if an unsupported byte was read. +json.exception.parse_error.113 | parse error at 2: expected a CBOR string; last byte: 0x98 | While parsing a map key, a value that is not a string has been read. +json.exception.parse_error.114 | parse error: Unsupported BSON record type 0x0F | The parsing of the corresponding BSON record type is not implemented (yet). + +@note For an input with n bytes, 1 is the index of the first character and n+1 + is the index of the terminating null byte or the end of file. This also + holds true when reading a byte vector (CBOR or MessagePack). + +@liveexample{The following code shows how a `parse_error` exception can be +caught.,parse_error} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref out_of_range for exceptions indicating access out of the defined range +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class parse_error : public exception +{ + public: + /*! + @brief create a parse error exception + @param[in] id_ the id of the exception + @param[in] pos the position where the error occurred (or with + chars_read_total=0 if the position cannot be + determined) + @param[in] what_arg the explanatory string + @return parse_error object + */ + static parse_error create(int id_, const position_t& pos, const std::string& what_arg) + { + std::string w = exception::name("parse_error", id_) + "parse error" + + position_string(pos) + ": " + what_arg; + return parse_error(id_, pos.chars_read_total, w.c_str()); + } + + static parse_error create(int id_, std::size_t byte_, const std::string& what_arg) + { + std::string w = exception::name("parse_error", id_) + "parse error" + + (byte_ != 0 ? (" at byte " + std::to_string(byte_)) : "") + + ": " + what_arg; + return parse_error(id_, byte_, w.c_str()); + } + + /*! + @brief byte index of the parse error + + The byte index of the last read character in the input file. + + @note For an input with n bytes, 1 is the index of the first character and + n+1 is the index of the terminating null byte or the end of file. + This also holds true when reading a byte vector (CBOR or MessagePack). + */ + const std::size_t byte; + + private: + parse_error(int id_, std::size_t byte_, const char* what_arg) + : exception(id_, what_arg), byte(byte_) {} + + static std::string position_string(const position_t& pos) + { + return " at line " + std::to_string(pos.lines_read + 1) + + ", column " + std::to_string(pos.chars_read_current_line); + } +}; + +/*! +@brief exception indicating errors with iterators + +This exception is thrown if iterators passed to a library function do not match +the expected semantics. + +Exceptions have ids 2xx. + +name / id | example message | description +----------------------------------- | --------------- | ------------------------- +json.exception.invalid_iterator.201 | iterators are not compatible | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid. +json.exception.invalid_iterator.202 | iterator does not fit current value | In an erase or insert function, the passed iterator @a pos does not belong to the JSON value for which the function was called. It hence does not define a valid position for the deletion/insertion. +json.exception.invalid_iterator.203 | iterators do not fit current value | Either iterator passed to function @ref erase(IteratorType first, IteratorType last) does not belong to the JSON value from which values shall be erased. It hence does not define a valid range to delete values from. +json.exception.invalid_iterator.204 | iterators out of range | When an iterator range for a primitive type (number, boolean, or string) is passed to a constructor or an erase function, this range has to be exactly (@ref begin(), @ref end()), because this is the only way the single stored value is expressed. All other ranges are invalid. +json.exception.invalid_iterator.205 | iterator out of range | When an iterator for a primitive type (number, boolean, or string) is passed to an erase function, the iterator has to be the @ref begin() iterator, because it is the only way to address the stored value. All other iterators are invalid. +json.exception.invalid_iterator.206 | cannot construct with iterators from null | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) belong to a JSON null value and hence to not define a valid range. +json.exception.invalid_iterator.207 | cannot use key() for non-object iterators | The key() member function can only be used on iterators belonging to a JSON object, because other types do not have a concept of a key. +json.exception.invalid_iterator.208 | cannot use operator[] for object iterators | The operator[] to specify a concrete offset cannot be used on iterators belonging to a JSON object, because JSON objects are unordered. +json.exception.invalid_iterator.209 | cannot use offsets with object iterators | The offset operators (+, -, +=, -=) cannot be used on iterators belonging to a JSON object, because JSON objects are unordered. +json.exception.invalid_iterator.210 | iterators do not fit | The iterator range passed to the insert function are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid. +json.exception.invalid_iterator.211 | passed iterators may not belong to container | The iterator range passed to the insert function must not be a subrange of the container to insert to. +json.exception.invalid_iterator.212 | cannot compare iterators of different containers | When two iterators are compared, they must belong to the same container. +json.exception.invalid_iterator.213 | cannot compare order of object iterators | The order of object iterators cannot be compared, because JSON objects are unordered. +json.exception.invalid_iterator.214 | cannot get value | Cannot get value for iterator: Either the iterator belongs to a null value or it is an iterator to a primitive type (number, boolean, or string), but the iterator is different to @ref begin(). + +@liveexample{The following code shows how an `invalid_iterator` exception can be +caught.,invalid_iterator} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref out_of_range for exceptions indicating access out of the defined range +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class invalid_iterator : public exception +{ + public: + static invalid_iterator create(int id_, const std::string& what_arg) + { + std::string w = exception::name("invalid_iterator", id_) + what_arg; + return invalid_iterator(id_, w.c_str()); + } + + private: + invalid_iterator(int id_, const char* what_arg) + : exception(id_, what_arg) {} +}; + +/*! +@brief exception indicating executing a member function with a wrong type + +This exception is thrown in case of a type error; that is, a library function is +executed on a JSON value whose type does not match the expected semantics. + +Exceptions have ids 3xx. + +name / id | example message | description +----------------------------- | --------------- | ------------------------- +json.exception.type_error.301 | cannot create object from initializer list | To create an object from an initializer list, the initializer list must consist only of a list of pairs whose first element is a string. When this constraint is violated, an array is created instead. +json.exception.type_error.302 | type must be object, but is array | During implicit or explicit value conversion, the JSON type must be compatible to the target type. For instance, a JSON string can only be converted into string types, but not into numbers or boolean types. +json.exception.type_error.303 | incompatible ReferenceType for get_ref, actual type is object | To retrieve a reference to a value stored in a @ref basic_json object with @ref get_ref, the type of the reference must match the value type. For instance, for a JSON array, the @a ReferenceType must be @ref array_t &. +json.exception.type_error.304 | cannot use at() with string | The @ref at() member functions can only be executed for certain JSON types. +json.exception.type_error.305 | cannot use operator[] with string | The @ref operator[] member functions can only be executed for certain JSON types. +json.exception.type_error.306 | cannot use value() with string | The @ref value() member functions can only be executed for certain JSON types. +json.exception.type_error.307 | cannot use erase() with string | The @ref erase() member functions can only be executed for certain JSON types. +json.exception.type_error.308 | cannot use push_back() with string | The @ref push_back() and @ref operator+= member functions can only be executed for certain JSON types. +json.exception.type_error.309 | cannot use insert() with | The @ref insert() member functions can only be executed for certain JSON types. +json.exception.type_error.310 | cannot use swap() with number | The @ref swap() member functions can only be executed for certain JSON types. +json.exception.type_error.311 | cannot use emplace_back() with string | The @ref emplace_back() member function can only be executed for certain JSON types. +json.exception.type_error.312 | cannot use update() with string | The @ref update() member functions can only be executed for certain JSON types. +json.exception.type_error.313 | invalid value to unflatten | The @ref unflatten function converts an object whose keys are JSON Pointers back into an arbitrary nested JSON value. The JSON Pointers must not overlap, because then the resulting value would not be well defined. +json.exception.type_error.314 | only objects can be unflattened | The @ref unflatten function only works for an object whose keys are JSON Pointers. +json.exception.type_error.315 | values in object must be primitive | The @ref unflatten function only works for an object whose keys are JSON Pointers and whose values are primitive. +json.exception.type_error.316 | invalid UTF-8 byte at index 10: 0x7E | The @ref dump function only works with UTF-8 encoded strings; that is, if you assign a `std::string` to a JSON value, make sure it is UTF-8 encoded. | +json.exception.type_error.317 | JSON value cannot be serialized to requested format | The dynamic type of the object cannot be represented in the requested serialization format (e.g. a raw `true` or `null` JSON object cannot be serialized to BSON) | + +@liveexample{The following code shows how a `type_error` exception can be +caught.,type_error} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref out_of_range for exceptions indicating access out of the defined range +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class type_error : public exception +{ + public: + static type_error create(int id_, const std::string& what_arg) + { + std::string w = exception::name("type_error", id_) + what_arg; + return type_error(id_, w.c_str()); + } + + private: + type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; + +/*! +@brief exception indicating access out of the defined range + +This exception is thrown in case a library function is called on an input +parameter that exceeds the expected range, for instance in case of array +indices or nonexisting object keys. + +Exceptions have ids 4xx. + +name / id | example message | description +------------------------------- | --------------- | ------------------------- +json.exception.out_of_range.401 | array index 3 is out of range | The provided array index @a i is larger than @a size-1. +json.exception.out_of_range.402 | array index '-' (3) is out of range | The special array index `-` in a JSON Pointer never describes a valid element of the array, but the index past the end. That is, it can only be used to add elements at this position, but not to read it. +json.exception.out_of_range.403 | key 'foo' not found | The provided key was not found in the JSON object. +json.exception.out_of_range.404 | unresolved reference token 'foo' | A reference token in a JSON Pointer could not be resolved. +json.exception.out_of_range.405 | JSON pointer has no parent | The JSON Patch operations 'remove' and 'add' can not be applied to the root element of the JSON value. +json.exception.out_of_range.406 | number overflow parsing '10E1000' | A parsed number could not be stored as without changing it to NaN or INF. +json.exception.out_of_range.407 | number overflow serializing '9223372036854775808' | UBJSON and BSON only support integer numbers up to 9223372036854775807. | +json.exception.out_of_range.408 | excessive array size: 8658170730974374167 | The size (following `#`) of an UBJSON array or object exceeds the maximal capacity. | +json.exception.out_of_range.409 | BSON key cannot contain code point U+0000 (at byte 2) | Key identifiers to be serialized to BSON cannot contain code point U+0000, since the key is stored as zero-terminated c-string | + +@liveexample{The following code shows how an `out_of_range` exception can be +caught.,out_of_range} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class out_of_range : public exception +{ + public: + static out_of_range create(int id_, const std::string& what_arg) + { + std::string w = exception::name("out_of_range", id_) + what_arg; + return out_of_range(id_, w.c_str()); + } + + private: + out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; + +/*! +@brief exception indicating other library errors + +This exception is thrown in case of errors that cannot be classified with the +other exception types. + +Exceptions have ids 5xx. + +name / id | example message | description +------------------------------ | --------------- | ------------------------- +json.exception.other_error.501 | unsuccessful: {"op":"test","path":"/baz", "value":"bar"} | A JSON Patch operation 'test' failed. The unsuccessful operation is also printed. + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref out_of_range for exceptions indicating access out of the defined range + +@liveexample{The following code shows how an `other_error` exception can be +caught.,other_error} + +@since version 3.0.0 +*/ +class other_error : public exception +{ + public: + static other_error create(int id_, const std::string& what_arg) + { + std::string w = exception::name("other_error", id_) + what_arg; + return other_error(id_, w.c_str()); + } + + private: + other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // pair + +// This file contains all internal macro definitions +// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them + +// exclude unsupported compilers +#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) + #if defined(__clang__) + #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 + #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 + #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #endif +#endif + +// disable float-equal warnings on GCC/clang +#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + +// disable documentation warnings on clang +#if defined(__clang__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdocumentation" +#endif + +// allow for portable deprecation warnings +#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) + #define JSON_DEPRECATED __attribute__((deprecated)) +#elif defined(_MSC_VER) + #define JSON_DEPRECATED __declspec(deprecated) +#else + #define JSON_DEPRECATED +#endif + +// allow for portable nodiscard warnings +#if defined(__has_cpp_attribute) + #if __has_cpp_attribute(nodiscard) + #define JSON_NODISCARD [[nodiscard]] + #elif __has_cpp_attribute(gnu::warn_unused_result) + #define JSON_NODISCARD [[gnu::warn_unused_result]] + #else + #define JSON_NODISCARD + #endif +#else + #define JSON_NODISCARD +#endif + +// allow to disable exceptions +#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) + #define JSON_THROW(exception) throw exception + #define JSON_TRY try + #define JSON_CATCH(exception) catch(exception) + #define JSON_INTERNAL_CATCH(exception) catch(exception) +#else + #include + #define JSON_THROW(exception) std::abort() + #define JSON_TRY if(true) + #define JSON_CATCH(exception) if(false) + #define JSON_INTERNAL_CATCH(exception) if(false) +#endif + +// override exception macros +#if defined(JSON_THROW_USER) + #undef JSON_THROW + #define JSON_THROW JSON_THROW_USER +#endif +#if defined(JSON_TRY_USER) + #undef JSON_TRY + #define JSON_TRY JSON_TRY_USER +#endif +#if defined(JSON_CATCH_USER) + #undef JSON_CATCH + #define JSON_CATCH JSON_CATCH_USER + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_CATCH_USER +#endif +#if defined(JSON_INTERNAL_CATCH_USER) + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER +#endif + +// manual branch prediction +#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) + #define JSON_LIKELY(x) __builtin_expect(x, 1) + #define JSON_UNLIKELY(x) __builtin_expect(x, 0) +#else + #define JSON_LIKELY(x) x + #define JSON_UNLIKELY(x) x +#endif + +// C++ language standard detection +#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 +#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) + #define JSON_HAS_CPP_14 +#endif + +/*! +@brief macro to briefly define a mapping between an enum and JSON +@def NLOHMANN_JSON_SERIALIZE_ENUM +@since version 3.4.0 +*/ +#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ + template \ + inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [e](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.first == e; \ + }); \ + j = ((it != std::end(m)) ? it : std::begin(m))->second; \ + } \ + template \ + inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [j](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.second == j; \ + }); \ + e = ((it != std::end(m)) ? it : std::begin(m))->first; \ + } + +// Ugly macros to avoid uglier copy-paste when specializing basic_json. They +// may be removed in the future once the class is split. + +#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ + template class ObjectType, \ + template class ArrayType, \ + class StringType, class BooleanType, class NumberIntegerType, \ + class NumberUnsignedType, class NumberFloatType, \ + template class AllocatorType, \ + template class JSONSerializer> + +#define NLOHMANN_BASIC_JSON_TPL \ + basic_json + +// #include + + +#include // not +#include // size_t +#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type + +namespace nlohmann +{ +namespace detail +{ +// alias templates to reduce boilerplate +template +using enable_if_t = typename std::enable_if::type; + +template +using uncvref_t = typename std::remove_cv::type>::type; + +// implementation of C++14 index_sequence and affiliates +// source: https://stackoverflow.com/a/32223343 +template +struct index_sequence +{ + using type = index_sequence; + using value_type = std::size_t; + static constexpr std::size_t size() noexcept + { + return sizeof...(Ints); + } +}; + +template +struct merge_and_renumber; + +template +struct merge_and_renumber, index_sequence> + : index_sequence < I1..., (sizeof...(I1) + I2)... > {}; + +template +struct make_index_sequence + : merge_and_renumber < typename make_index_sequence < N / 2 >::type, + typename make_index_sequence < N - N / 2 >::type > {}; + +template<> struct make_index_sequence<0> : index_sequence<> {}; +template<> struct make_index_sequence<1> : index_sequence<0> {}; + +template +using index_sequence_for = make_index_sequence; + +// dispatch utility (taken from ranges-v3) +template struct priority_tag : priority_tag < N - 1 > {}; +template<> struct priority_tag<0> {}; + +// taken from ranges-v3 +template +struct static_const +{ + static constexpr T value{}; +}; + +template +constexpr T static_const::value; +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // not +#include // numeric_limits +#include // false_type, is_constructible, is_integral, is_same, true_type +#include // declval + +// #include + + +#include // random_access_iterator_tag + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template struct make_void +{ + using type = void; +}; +template using void_t = typename make_void::type; +} // namespace detail +} // namespace nlohmann + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template +struct iterator_types {}; + +template +struct iterator_types < + It, + void_t> +{ + using difference_type = typename It::difference_type; + using value_type = typename It::value_type; + using pointer = typename It::pointer; + using reference = typename It::reference; + using iterator_category = typename It::iterator_category; +}; + +// This is required as some compilers implement std::iterator_traits in a way that +// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. +template +struct iterator_traits +{ +}; + +template +struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> + : iterator_types +{ +}; + +template +struct iterator_traits::value>> +{ + using iterator_category = std::random_access_iterator_tag; + using value_type = T; + using difference_type = ptrdiff_t; + using pointer = T*; + using reference = T&; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + +// #include + + +#include + +// #include + + +// http://en.cppreference.com/w/cpp/experimental/is_detected +namespace nlohmann +{ +namespace detail +{ +struct nonesuch +{ + nonesuch() = delete; + ~nonesuch() = delete; + nonesuch(nonesuch const&) = delete; + nonesuch(nonesuch const&&) = delete; + void operator=(nonesuch const&) = delete; + void operator=(nonesuch&&) = delete; +}; + +template class Op, + class... Args> +struct detector +{ + using value_t = std::false_type; + using type = Default; +}; + +template class Op, class... Args> +struct detector>, Op, Args...> +{ + using value_t = std::true_type; + using type = Op; +}; + +template