diff --git a/README.md b/README.md index abcb542..c31f6cc 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,20 @@ In general, there have been many wild encounter tweaks. View this document for d - The Kanto Safari Zone map from the prototype has been restored. - The prototype Lake of Rage village has been restored, complete with an Evolution Stone shop and Trader NPC! In general, it's themed around Pokemon evolution. - The Pokemon Communications Centre from JP GSC has been added and tweaked into a Regional Variant Trade hub, increasing with badge count. +- Breakable rocks now give useful items... + db 1, MAX_REVIVE + db 2, DOME_FOSSIL + db 2, HELIX_FOSSIL + db 2, WING_FOSSIL + db 2, OLD_AMBER + db 2, CLUB_FOSSIL + db 4, STAR_PIECE + db 10, BIG_PEARL + db 18, ETHER + db 24, HARD_STONE + db 24, SOFT_SAND + db 48, PEARL + db 64, BRICK_PIECE ## Item Changes - Many evolution stones have been added to accomodate the Pokemon featured here, including the Heart and Poison Stones from the SpaceWorld demo! diff --git a/constants/item_constants.asm b/constants/item_constants.asm index fa5bd7f..8d697cf 100644 --- a/constants/item_constants.asm +++ b/constants/item_constants.asm @@ -153,7 +153,7 @@ const BLK_AUGURITE ; 91 const LEFTOVERS ; 92 const PEAT_BLOCK ; 93 - const ITEM_94 ; 94 + const CLUB_FOSSIL ; 94, was ITEM_94 const ITEM_95 ; 95 const MYSTERYBERRY ; 96 const DRAGON_SCALE ; 97 diff --git a/data/items/attributes.asm b/data/items/attributes.asm index a1e96ed..6f81249 100644 --- a/data/items/attributes.asm +++ b/data/items/attributes.asm @@ -302,8 +302,8 @@ ItemAttributes: item_attribute 200, HELD_LEFTOVERS, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; PEAT_BLOCK item_attribute 2100, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE -; ITEM_94 - item_attribute $9999, HELD_NONE, 0, NO_LIMITS, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE +; CLUB_FOSSIL + item_attribute 0, HELD_NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; ITEM_95 item_attribute $9999, HELD_NONE, 0, NO_LIMITS, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; MYSTERYBERRY diff --git a/data/items/descriptions.asm b/data/items/descriptions.asm index 8c03685..5fdcfba 100644 --- a/data/items/descriptions.asm +++ b/data/items/descriptions.asm @@ -148,7 +148,7 @@ ItemDescriptions: dw BlkAuguriteDesc dw LeftoversDesc dw PeatBlockDesc - dw QuestionMarkDesc + dw ClubFossilDesc dw QuestionMarkDesc dw MysteryBerryDesc dw DragonScaleDesc @@ -967,3 +967,7 @@ BlkAuguriteDesc: PeatBlockDesc: db "Evolves certain" next "kinds of #MON.@" + +ClubFossilDesc: + db "The club of an" + next "ancient #MON.@" diff --git a/data/items/names.asm b/data/items/names.asm index a3914cf..3b32796 100644 --- a/data/items/names.asm +++ b/data/items/names.asm @@ -147,7 +147,7 @@ ItemNames:: li "BLK AUGURITE" li "LEFTOVERS" li "PEAT BLOCK" - li "TERU-SAMA" + li "CLUB FOSSIL" li "TERU-SAMA" li "MYSTERYBERRY" li "DRAGON SCALE" diff --git a/engine/events/checkforhiddenitems.asm b/engine/events/checkforhiddenitems.asm index 4eafef5..4b4ee4e 100644 --- a/engine/events/checkforhiddenitems.asm +++ b/engine/events/checkforhiddenitems.asm @@ -81,3 +81,39 @@ CheckForHiddenItems: call GetFarByte inc hl ret + +; from https://github.com/pret/pokecrystal/wiki/Smashing-rocks-has-a-chance-to-contain-items +RockItemEncounter: + ld hl, .RockItems + call Random +.loop + sub [hl] + jr c, .ok + inc hl + inc hl + jr .loop + +.ok + ld a, [hli] + inc a + jr z, .done + ld a, [hli] +.done + ld [wScriptVar], a + ret + +.RockItems: + db 1, MAX_REVIVE + db 2, DOME_FOSSIL + db 2, HELIX_FOSSIL + db 2, WING_FOSSIL + db 2, OLD_AMBER + db 2, CLUB_FOSSIL + db 4, STAR_PIECE + db 10, BIG_PEARL + db 18, ETHER + db 24, HARD_STONE + db 24, SOFT_SAND + db 48, PEARL + db 64, BRICK_PIECE + db -1 diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index 42bbe60..199e280 100644 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -1374,11 +1374,19 @@ RockSmashScript: callasm RockMonEncounter readmem wTempWildMonSpecies - iffalse .done + iffalse .no_battle randomwildmon startbattle reloadmapafterbattle -.done + end +; from https://github.com/pret/pokecrystal/wiki/Smashing-rocks-has-a-chance-to-contain-items +.no_battle + callasm RockItemEncounter + iffalse .no_item + opentext + verbosegiveitem ITEM_FROM_MEM + closetext +.no_item end MovementData_RockSmash: diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 1e5f35c..2d9d076 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -161,7 +161,7 @@ ItemEffects: dw EvoStoneEffect ; BLK_AUGURITE dw NoEffect ; LEFTOVERS dw EvoStoneEffect ; PEAT_BLOCK - dw NoEffect ; ITEM_94 + dw NoEffect ; CLUB_FOSSIL, was ITEM_94 dw NoEffect ; ITEM_95 dw RestorePPEffect ; MYSTERYBERRY dw NoEffect ; DRAGON_SCALE @@ -203,10 +203,10 @@ ItemEffects: dw NoEffect ; BLUESKY_MAIL dw NoEffect ; MUSIC_MAIL dw NoEffect ; MIRAGE_MAIL - dw NoEffect ; ITEM_BE - dw NoEffect ; ITEM_DC - dw NoEffect ; ITEM_C3 - dw NoEffect ; ITEM_FA + dw NoEffect ; OLD_AMBER + dw NoEffect ; DOME_FOSSIL + dw NoEffect ; HELIX_FOSSIL + dw NoEffect ; WING_FOSSIL assert_table_length NUM_ITEMS ; The items past ITEM_B3 do not have effect entries: ; They all have the ITEMMENU_NOUSE attribute so they can't be used anyway. diff --git a/maps/DebugRoom.asm b/maps/DebugRoom.asm index 600ed22..7813663 100644 --- a/maps/DebugRoom.asm +++ b/maps/DebugRoom.asm @@ -19,12 +19,12 @@ DebugPokemon1Script: DebugPokemon2Script: opentext - getmonname STRING_BUFFER_3, WALKING_WAKE + getmonname STRING_BUFFER_3, MACHAMP writetext ReceivedDebugPokemonText playsound SFX_CAUGHT_MON waitsfx promptbutton - givepoke QWILFISH, 31, THUNDERSTONE + givepoke MACHAMP, 31, TM_ROCK_SMASH closetext end