mirror of
https://github.com/rh-hideout/pokeemerald-expansion.git
synced 2026-10-26 18:54:17 -05:00
Implement GSC berry/apricorn tree functionality. (#7777)
Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
This commit is contained in:
58
docs/tutorials/how_to_apricorn_tree.md
Normal file
58
docs/tutorials/how_to_apricorn_tree.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# How to interact with Apricorn Trees
|
||||
|
||||

|
||||
|
||||
### Adding a new apricorn tree
|
||||
|
||||
To add a new tree, first increase the tree count and expand the tree list in `include/constants/apricorn_tree.h`.
|
||||
|
||||
Note that each tree will take a bit in the savegame's `SaveBlock3` struct so increasing `APRICORN_TREE_COUNT` **breaks the savegame**.
|
||||
Due to this, pokeemerald-expansion doesn't have any trees set up by default to prevent breaking downstream savegames.
|
||||
The trees support random yields and properly use plural case on plural yields.
|
||||
|
||||
```diff
|
||||
#define APRICORN_TREE_NONE 0
|
||||
|
||||
-#define APRICORN_TREE_COUNT 0
|
||||
+#define APRICORN_TREE_ROUTE101_RED_TREE 1
|
||||
+
|
||||
+#define APRICORN_TREE_COUNT 32
|
||||
```
|
||||
|
||||
Then list its data in `src/data/apricorns.h`.
|
||||
|
||||
```diff
|
||||
const struct ApricornTree gApricornTrees[APRICORN_TREE_COUNT] =
|
||||
{
|
||||
[APRICORN_TREE_NONE] =
|
||||
{
|
||||
.minimum = 1,
|
||||
.maximum = 1,
|
||||
.apricornType = APRICORN_RED,
|
||||
},
|
||||
|
||||
+ [APRICORN_TREE_ROUTE101_RED_TREE] =
|
||||
+ {
|
||||
+ .minimum = 1,
|
||||
+ .maximum = 1,
|
||||
+ .apricornType = APRICORN_RED,
|
||||
+ },
|
||||
};
|
||||
```
|
||||
Finally, just place your new tree using Porymap.
|
||||
Similarly to berries, the Sight Radius / Berry Tree ID field is used for the tree's ID.
|
||||
|
||||

|
||||
|
||||
### Add a new apricorn type
|
||||
|
||||
After you created your new item, simply expand the `ApricornType` enum in `include/constants/apricorn_tree.h`.
|
||||
|
||||
```diff
|
||||
enum ApricornType
|
||||
{
|
||||
[...]
|
||||
APRICORN_BERRY_MARANGA = ITEM_MARANGA_BERRY,
|
||||
+ APRICORN_BROWN = ITEM_BROWN_APRICORN,
|
||||
};
|
||||
```
|
||||
BIN
docs/tutorials/img/apricorn_tree/apricorn-tree-porymap.png
Normal file
BIN
docs/tutorials/img/apricorn_tree/apricorn-tree-porymap.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 107 KiB |
BIN
docs/tutorials/img/apricorn_tree/apricorn-tree.gif
Normal file
BIN
docs/tutorials/img/apricorn_tree/apricorn-tree.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 87 KiB |
Reference in New Issue
Block a user