4 Star 1 Fork 4

懒得想名字/pokeemerald-expansion

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Migration Scripts

What are migration scripts?

pokeemerald-expansion rewrites existing systems in pokeemerald to improve their efficiency and make them easier to use and implement for developers. If developers were previously using a system that has been deprecated, it can be difficult to manually migrate between systems.

These scripts exist to help developers make the transition between refactored systems.

Requirements

All migration scripts require python3 to be installed. Migration scripts are executed by running the following commands from the root directory of a developer's project.

chmod +x migration_scripts/*.py ; #give permission to make the script executable
python3 migration_scripts/*.py ; #run the migration script

* will need to be replaced with the name of the appropriate script.

1.10.x to 1.11.x+

Contest Opponents

Moves the contest opponent filters in src/data/contest_opponents.h from gPostgameContestOpponentFilter to gContestOpponents

src/data/contest_opponents.h

const struct ContestPokemon gContestOpponents[] =
{
    [CONTEST_OPPONENT_JIMMY] = {
+       .filter = CONTEST_FILTER_NONE,
...
- const u8 gPostgameContestOpponentFilter[] =
- {
-     [CONTEST_OPPONENT_JIMMY] = CONTEST_FILTER_NONE,

Battle Frontier Trainers

Moves the Battle Frontier trainer parties from battle_frontier_trainer_mons.h to battle_frontier_trainers.h

src/data/battle_frontier/battle_frontier_trainer_mons.h

- const u16 gBattleFrontierTrainerMons_Brady[] =
- {
-    FRONTIER_MONS_YOUNGSTER_LASS_1
- };

src/data/battle_frontier/battle_frontier_trainers.h

-    .monSet = gBattleFrontierTrainerMons_Brady
+    .monSet = (const u16[]){FRONTIER_MONS_YOUNGSTER_LASS_1}

1.8.x to 1.9.x+

Battle Anim Moves

Refactors all battle animation move scripts, removing the list from data/battle_anim_scripts.s and linking them to the moves in gMovesInfo for easier maintaining. Only necessary if new moves have been added.

data/battle_anim_scripts.h

-    .4byte Move_POUND

include/battle_anim_scripts.h

+    extern const u8 Move_POUND[];

src/data/moves_info.h

    [MOVE_POUND] =
    {
        .name = COMPOUND_STRING("Pound"),
        .description = COMPOUND_STRING(
            "Pounds the foe with\n"
            "forelegs or tail."),
        .effect = EFFECT_HIT,
        .power = 40,
        .type = TYPE_NORMAL,
        .accuracy = 100,
        .pp = 35,
        .target = MOVE_TARGET_SELECTED,
        .priority = 0,
        .category = DAMAGE_CATEGORY_PHYSICAL,
        .makesContact = TRUE,
        .ignoresKingsRock = B_UPDATED_MOVE_FLAGS == GEN_4,
        .contestEffect = CONTEST_EFFECT_HIGHLY_APPEALING,
        .contestCategory = CONTEST_CATEGORY_TOUGH,
        .contestComboStarterId = COMBO_STARTER_POUND,
-        .contestComboMoves = {0}
+        .contestComboMoves = {0},
+        .battleAnimScript = Move_POUND,
    },

Item Icons

Moves all information from gItemIconTable to gItemsInfo.

src/data/item_icon_table.h

-    [ITEM_POKE_BALL] = {gItemIcon_PokeBall, gItemIconPalette_PokeBall},

src/data/items.h

    [ITEM_POKE_BALL] =
    {
        .name = _("Poké Ball"),
        .price = 200,
        .description = COMPOUND_STRING(
            "A tool used for\n"
            "catching wild\n"
            "Pokémon."),
        .pocket = POCKET_POKE_BALLS,
        .type = ITEM_USE_BAG_MENU,
        .battleUsage = EFFECT_ITEM_THROW_BALL,
        .secondaryId = BALL_POKE,
+        .iconSprite = gItemIcon_PokeBall,
+        .iconPalette = gItemIconPalette_PokeBall,
    },

Partner & Trainer Parties

Converts trainer data (for convert_trainer_parties.py) and partner data (for convert_partner_data.py) to the new .party format. Not necessary if COMPETITIVE_PARTY_SYNTAX is turned off.

src/data/trainer_parties.h

-static const struct TrainerMon sParty_Sawyer1[] = {
-    {
-    .lvl = 21,
-    .species = SPECIES_GEODUDE,
-    }
-};

src/data/trainers.party

+=== TRAINER_SAWYER_1 ===
+Name: SAWYER
+Class: Hiker
+Pic: Hiker
+Gender: Male
+Music: Hiker
+Double Battle: No
+AI: Check Bad Move / Try To Faint / Check Viability
+
+Geodude
+Level: 21
+IVs: 0 HP / 0 Atk / 0 Def / 0 SpA / 0 SpD / 0 Spe

src/data/partner_parties.h

-static const struct TrainerMon sParty_StevenPartner[] = {
-    {
-        .species = SPECIES_METANG,
-        .lvl = 42,
-        .nature = NATURE_BRAVE,
-        .iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
-        .ev = TRAINER_PARTY_EVS(0, 252, 252, 0, 6, 0),
-        .moves = {MOVE_LIGHT_SCREEN, MOVE_PSYCHIC, MOVE_REFLECT, MOVE_METAL_CLAW},
-    },
-    {
-        .species = SPECIES_SKARMORY,
-        .lvl = 43,
-        .nature = NATURE_IMPISH,
-        .iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
-        .ev = TRAINER_PARTY_EVS(252, 0, 0, 0, 6, 252),
-        .moves = {MOVE_TOXIC, MOVE_AERIAL_ACE, MOVE_PROTECT, MOVE_STEEL_WING},
-    },
-    {
-        .species = SPECIES_AGGRON,
-        .lvl = 44,
-        .nature = NATURE_ADAMANT,
-        .iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
-        .ev = TRAINER_PARTY_EVS(0, 252, 0, 0, 252, 6),
-        .moves = {MOVE_THUNDER, MOVE_PROTECT, MOVE_SOLAR_BEAM, MOVE_DRAGON_CLAW},
-    }
-};

src/data/battle_partners.party

+=== PARTNER_STEVEN ===
+Name: STEVEN
+Class: Rival
+Pic: Steven
+Gender: Male
+Music: Male
+
+Metang
+Brave Nature
+Level: 42
+IVs: 31 HP / 31 Atk / 31 Def / 31 SpA / 31 SpD / 31 Spe
+EVs: 252 Atk / 252 Def / 6 SpA
+- Light Screen
+- Psychic
+- Reflect
+- Metal Claw
+
+Skarmory
+Impish Nature
+Level: 43
+IVs: 31 HP / 31 Atk / 31 Def / 31 SpA / 31 SpD / 31 Spe
+EVs: 252 HP / 6 SpA / 252 SpD
+- Toxic
+- Aerial Ace
+- Protect
+- Steel Wing
+
+Aggron
+Adamant Nature
+Level: 44
+IVs: 31 HP / 31 Atk / 31 Def / 31 SpA / 31 SpD / 31 Spe
+EVs: 252 Atk / 252 SpA / 6 SpD
+- Thunder
+- Protect
+- Solar Beam
+- Dragon Claw

Egg Move Refactor

Updates egg moves to the refactored format. Only necessary if new species have been added or if egg moves of an existing species was altered.

src/data/pokemon/egg_moves.h

-    egg_moves(BULBASAUR,
-        MOVE_SKULL_BASH,
-        MOVE_CHARM,
-        MOVE_PETAL_DANCE,
-        MOVE_MAGICAL_LEAF,
-        MOVE_GRASS_WHISTLE,
-        MOVE_CURSE,
-        MOVE_INGRAIN,
-        MOVE_NATURE_POWER,
-        MOVE_AMNESIA,
-        MOVE_LEAF_STORM,
-        MOVE_POWER_WHIP,
-        MOVE_SLUDGE,
-        MOVE_ENDURE,
-        MOVE_GIGA_DRAIN,
-        MOVE_GRASSY_TERRAIN),
+static const u16 sBulbasaurEggMoveLearnset[] = {
+    MOVE_SKULL_BASH,
+    MOVE_CHARM,
+    MOVE_PETAL_DANCE,
+    MOVE_MAGICAL_LEAF,
+    MOVE_GRASS_WHISTLE,
+    MOVE_CURSE,
+    MOVE_INGRAIN,
+    MOVE_NATURE_POWER,
+    MOVE_AMNESIA,
+    MOVE_LEAF_STORM,
+    MOVE_POWER_WHIP,
+    MOVE_SLUDGE,
+    MOVE_ENDURE,
+    MOVE_GIGA_DRAIN,
+    MOVE_GRASSY_TERRAIN,
+    MOVE_UNAVAILABLE,
};

src/data/pokemon/species_info/gen_1_families.h

    [SPECIES_BULBASAUR] =
    {
        .baseHP        = 45,
        .baseAttack    = 49,
        .baseDefense   = 49,
        .baseSpeed     = 45,
        .baseSpAttack  = 65,
        .baseSpDefense = 65,
        .types = MON_TYPES(TYPE_GRASS, TYPE_POISON),
        .catchRate = 45,
        .expYield = 64,
        .evYield_SpAttack = 1,
        .genderRatio = PERCENT_FEMALE(12.5),
        .eggCycles = 20,
        .friendship = STANDARD_FRIENDSHIP,
        .growthRate = GROWTH_MEDIUM_SLOW,
        .eggGroups = MON_EGG_GROUPS(EGG_GROUP_MONSTER, EGG_GROUP_GRASS),
        .abilities = { ABILITY_OVERGROW, ABILITY_NONE, ABILITY_CHLOROPHYLL },
        .bodyColor = BODY_COLOR_GREEN,
        .speciesName = _("Bulbasaur"),
        .cryId = CRY_BULBASAUR,
        .natDexNum = NATIONAL_DEX_BULBASAUR,
        .categoryName = _("Seed"),
        .height = 7,
        .weight = 69,
        .description = COMPOUND_STRING(
            "Bulbasaur can be seen napping in bright\n"
            "sunlight. There is a seed on its back.\n"
            "By soaking up the sun's rays, the seed\n"
            "grows progressively larger."),
        .pokemonScale = 356,
        .pokemonOffset = 17,
        .trainerScale = 256,
        .trainerOffset = 0,
        .frontPic = gMonFrontPic_Bulbasaur,
        .frontPicSize = MON_COORDS_SIZE(40, 40),
        .frontPicYOffset = 13,
        .frontAnimFrames = sAnims_Bulbasaur,
        .frontAnimId = ANIM_V_JUMPS_H_JUMPS,
        .backPic = gMonBackPic_Bulbasaur,
        .backPicSize = MON_COORDS_SIZE(56, 40),
        .backPicYOffset = 13,
        .backAnimId = BACK_ANIM_DIP_RIGHT_SIDE,
        .palette = gMonPalette_Bulbasaur,
        .shinyPalette = gMonShinyPalette_Bulbasaur,
        .iconSprite = gMonIcon_Bulbasaur,
        .iconPalIndex = 4,
        FOOTPRINT(Bulbasaur)
        .levelUpLearnset = sBulbasaurLevelUpLearnset,
        .teachableLearnset = sBulbasaurTeachableLearnset,
+       .eggMoveLearnset = sBulbasaurEggMoveLearnset,
        .evolutions = EVOLUTION({EVO_LEVEL, 16, SPECIES_IVYSAUR}),
    },

1.7.x to 1.8.x+

Item Balls

Modifies all item ball scripts defined using to original Game Freak method to the new refactored method.

data/scripts/item_ball_scripts.inc

- Route102_EventScript_ItemPotion::
-	finditem ITEM_POTION
+ Common_EventScript_FindItem::
+   callnative GetObjectEventTrainerRangeFromTemplate
+   finditem VAR_RESULT
	end

data/maps/Route102/map.json

    {
      "graphics_id": "OBJ_EVENT_GFX_ITEM_BALL",
      "x": 50,
      "y": 5,
      "elevation": 3,
      "movement_type": "MOVEMENT_TYPE_LOOK_AROUND",
      "movement_range_x": 1,
      "movement_range_y": 1,
      "trainer_type": "TRAINER_TYPE_NONE",
-      "trainer_sight_or_berry_tree_id": "0",
-      "script": "Route102_EventScript_ItemPotion",
+      "trainer_sight_or_berry_tree_id": "ITEM_POTION",
+      "script": "Common_EventScript_FindItem",
      "flag": "FLAG_ITEM_ROUTE_102_POTION"
    },

Facility Mons

Replaces itemTableId with heldItem and evSpread with ev.

src/data/battle_frontier/battle_frontier_mons.h

    [FRONTIER_MON_SUNKERN] = {
        .species = SPECIES_SUNKERN,
        .moves = {MOVE_MEGA_DRAIN, MOVE_HELPING_HAND, MOVE_SUNNY_DAY, MOVE_LIGHT_SCREEN},
-        .itemTableId = BATTLE_FRONTIER_ITEM_LAX_INCENSE,
+       .heldItem = ITEM_LAX_INCENSE,
-        .evSpread = F_EV_SPREAD_SP_ATTACK | F_EV_SPREAD_HP,
+       .ev = TRAINER_PARTY_EVS(252, 0, 0, 0, 252, 0),
        .nature = NATURE_RELAXED
    },
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/maplefall/pokeemerald-expansion.git
git@gitee.com:maplefall/pokeemerald-expansion.git
maplefall
pokeemerald-expansion
pokeemerald-expansion
master

搜索帮助