Skip to content

Commit

Permalink
Merge branch 'upcoming' into berryexpansion
Browse files Browse the repository at this point in the history
  • Loading branch information
Bassoonian authored Dec 29, 2023
2 parents a4b819a + 6bc0bf9 commit 1662dc3
Show file tree
Hide file tree
Showing 109 changed files with 4,724 additions and 2,326 deletions.
2 changes: 1 addition & 1 deletion asm/macros/battle_script.inc
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@
.byte 0xbb
.endm

.macro maxattackhalvehp failInstr:req
.macro halvehp failInstr:req
.byte 0xbc
.4byte \failInstr
.endm
Expand Down
30 changes: 30 additions & 0 deletions asm/macros/event.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2025,3 +2025,33 @@
callnative CreateTrainerPartyForPlayer
trainerbattle_no_intro \trainer2, NULL
.endm

@ Sets VAR_RESULT to TRUE if stat can be hyper trained, or to
@ FALSE otherwise.
.macro canhypertrain stat:req, slot:req
callnative CanHyperTrain
.byte \stat
.2byte \slot
.endm

@ Hyper Trains a stat.
.macro hypertrain stat:req, slot:req
callnative HyperTrain
.byte \stat
.2byte \slot
.endm

@ Sets VAR_RESULT to TRUE if the Pokemon has the Gigantamax Factor,
@ or to FALSE otherwise.
.macro hasgigantamaxfactor slot:req
callnative HasGigantamaxFactor
.2byte \slot
.endm

@ Toggles the Gigantamax Factor for a Pokemon.
@ Fails for Melmetal (vanilla behavior).
@ Sets VAR_RESULT to TRUE if it succeeds, and FALSE otherwise.
.macro togglegigantamaxfactor slot:req
callnative ToggleGigantamaxFactor
.2byte \slot
.endm
45 changes: 30 additions & 15 deletions data/battle_anim_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -860,21 +860,21 @@ gBattleAnims_Moves::
.4byte Move_MATCHA_GOTCHA
.4byte Move_SYRUP_BOMB
.4byte Move_IVY_CUDGEL
.4byte Move_833
.4byte Move_834
.4byte Move_835
.4byte Move_836
.4byte Move_837
.4byte Move_838
.4byte Move_839
.4byte Move_840
.4byte Move_841
.4byte Move_842
.4byte Move_843
.4byte Move_844
.4byte Move_845
.4byte Move_846
.4byte Move_847
.4byte Move_ELECTRO_SHOT
.4byte Move_TERA_STARSTORM
.4byte Move_FICKLE_BEAM
.4byte Move_BURNING_BULWARK
.4byte Move_THUNDERCLAP
.4byte Move_MIGHTY_CLEAVE
.4byte Move_TACHYON_CUTTER
.4byte Move_HARD_PRESS
.4byte Move_DRAGON_CHEER
.4byte Move_ALLURING_VOICE
.4byte Move_TEMPER_FLARE
.4byte Move_SUPERCELL_SLAM
.4byte Move_PSYCHIC_NOISE
.4byte Move_UPPER_HAND
.4byte Move_MALIGNANT_CHAIN
@@@@ Z MOVES
.4byte Move_BREAKNECK_BLITZ
.4byte Move_ALL_OUT_PUMMELING
Expand Down Expand Up @@ -16977,6 +16977,21 @@ Move_HYDRO_STEAM::
Move_BLOOD_MOON::
Move_MATCHA_GOTCHA::
Move_IVY_CUDGEL::
Move_ELECTRO_SHOT::
Move_TERA_STARSTORM::
Move_FICKLE_BEAM::
Move_BURNING_BULWARK::
Move_THUNDERCLAP::
Move_MIGHTY_CLEAVE::
Move_TACHYON_CUTTER::
Move_HARD_PRESS::
Move_DRAGON_CHEER::
Move_ALLURING_VOICE::
Move_TEMPER_FLARE::
Move_SUPERCELL_SLAM::
Move_PSYCHIC_NOISE::
Move_UPPER_HAND::
Move_MALIGNANT_CHAIN::
end @to do

@@@@@@@@@@@@@@@@@@@@@@@ GEN 1-3 @@@@@@@@@@@@@@@@@@@@@@@
Expand Down
41 changes: 40 additions & 1 deletion data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,41 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectBrickBreak @ EFFECT_RAGING_BULL
.4byte BattleScript_EffectHit @ EFFECT_RAGE_FIST
.4byte BattleScript_EffectDoodle @ EFFECT_DOODLE
.4byte BattleScript_EffectFilletAway @ EFFECT_FILLET_AWAY

BattleScript_EffectFilletAway:
attackcanceler
attackstring
ppreduce
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_FilletAwayTryAttack
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPATK, MAX_STAT_STAGE, BattleScript_FilletAwayTryAttack
jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPEED, MAX_STAT_STAGE, BattleScript_ButItFailed
BattleScript_FilletAwayTryAttack::
halvehp BattleScript_ButItFailed
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
attackanimation
waitanimation
setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPATK | BIT_SPEED, STAT_CHANGE_BY_TWO
setstatchanger STAT_ATK, 2, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_FilletAwayTrySpAtk
printfromtable gStatUpStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_FilletAwayTrySpAtk::
setstatchanger STAT_SPATK, 2, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_FilletAwayTrySpeed
printfromtable gStatUpStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_FilletAwayTrySpeed::
setstatchanger STAT_SPEED, 2, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_FilletAwayEnd
printfromtable gStatUpStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_FilletAwayEnd::
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
goto BattleScript_MoveEnd

BattleScript_EffectDoodle:
attackcanceler
Expand Down Expand Up @@ -5343,12 +5378,16 @@ BattleScript_EffectBellyDrum::
attackcanceler
attackstring
ppreduce
maxattackhalvehp BattleScript_ButItFailed
jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_ATK, MAX_STAT_STAGE, BattleScript_ButItFailed
halvehp BattleScript_ButItFailed
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
attackanimation
waitanimation
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
playstatchangeanimation BS_ATTACKER, BIT_ATK, STAT_CHANGE_BY_TWO
setstatchanger STAT_ATK, MAX_STAT_STAGE, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_MoveEnd
printstring STRINGID_PKMNCUTHPMAXEDATTACK
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
Expand Down
8 changes: 8 additions & 0 deletions data/scripts/pc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,11 @@ EventScript_AccessHallOfFame::
waitstate
goto EventScript_AccessPC
end

EventScript_AccessPokemonBoxLink::
playse SE_PC_LOGIN
msgbox gText_StorageSystemOpened, MSGBOX_DEFAULT
special ShowPokemonStorageSystemPC
waitstate
goto EventScript_TurnOffPC
end
18 changes: 18 additions & 0 deletions graphics/items/icon_palettes/metal_alloy.pal
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
JASC-PAL
0100
15
0 0 0
249 253 255
224 232 243
169 163 177
136 130 156
178 194 220
123 146 180
162 164 202
153 208 247
85 96 152
136 150 213
186 212 247
90 118 181
154 195 255
49 49 49
Binary file added graphics/items/icons/metal_alloy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions include/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct ResourceFlags
struct DisableStruct
{
u32 transformedMonPersonality;
u32 transformedMonOtId;
bool8 transformedMonShininess;
u16 disabledMove;
u16 encoredMove;
u8 protectUses:4;
Expand Down Expand Up @@ -1066,7 +1066,7 @@ extern u8 gBattlerStatusSummaryTaskId[MAX_BATTLERS_COUNT];
extern u8 gBattlerInMenuId;
extern bool8 gDoingBattleAnim;
extern u32 gTransformedPersonalities[MAX_BATTLERS_COUNT];
extern u32 gTransformedOtIds[MAX_BATTLERS_COUNT];
extern bool8 gTransformedShininess[MAX_BATTLERS_COUNT];
extern u8 gPlayerDpadHoldFrames;
extern struct BattleSpriteData *gBattleSpritesDataPtr;
extern struct MonSpritesGfx *gMonSpritesGfxPtr;
Expand Down
2 changes: 1 addition & 1 deletion include/battle_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union Aff
bool8 RunAffineAnimFromTaskData(struct Task *task);
void AnimThrowProjectile(struct Sprite *sprite);
void GetBgDataForTransform(struct BattleAnimBgData *dest, u8 battlerId);
u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId);
u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, bool8 isShiny, u32 battlerId);
void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite);
void Trade_MoveSelectedMonToTarget(struct Sprite *sprite);
void DestroyAnimVisualTaskAndDisableBlend(u8 taskId);
Expand Down
2 changes: 0 additions & 2 deletions include/battle_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ extern const struct OamData gOamData_BattleSpriteOpponentSide;
extern const struct OamData gOamData_BattleSpritePlayerSide;
extern const u8 gTypeNames[NUMBER_OF_MON_TYPES][TYPE_NAME_LENGTH + 1];
extern const struct TrainerMoney gTrainerMoneyTable[];
extern const u8 gAbilityNames[][ABILITY_NAME_LENGTH + 1];
extern const u8 *const gAbilityDescriptionPointers[];

extern const u8 gStatusConditionString_PoisonJpn[8];
extern const u8 gStatusConditionString_SleepJpn[8];
Expand Down
1 change: 1 addition & 0 deletions include/config/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
#define B_QUICK_GUARD GEN_LATEST // In Gen5 only, Wide Guard has a chance to fail if used consecutively.
#define B_IMPRISON GEN_LATEST // In Gen5+, Imprison doesn't fail if opposing pokemon don't have any moves the user knows.
#define B_ALLY_SWITCH_FAIL_CHANCE GEN_LATEST // In Gen9, using Ally Switch consecutively decreases the chance of success for each consecutive use.
#define B_SKETCH_BANS GEN_LATEST // In Gen9+, Sketch is unable to copy more moves than in previous generations.

// Ability settings
#define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters.
Expand Down
2 changes: 2 additions & 0 deletions include/config/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#define I_USE_EVO_HELD_ITEMS_FROM_BAG FALSE // If TRUE, items such as Razor Claw or Electirizer will be usable from the bag to evolve a Pokémon just like in LA.
#define I_TYPE_BOOST_POWER GEN_LATEST // In Gen4+, all regular type boosting held items had their power increased from 10% to 20%. eg. Charcoal
#define I_SELL_VALUE_FRACTION GEN_LATEST // In Gen9+, items sell for 1/4 of their value instead of 1/2.
#define I_PRICE GEN_LATEST // Some items have varied in value across generations.
#define I_BERRY_PRICE GEN_7 // Since Berries have become unplantable (Gen8+), their price has gone up.

// TM config
#define I_REUSABLE_TMS FALSE // In Gen5-8, TMs are reusable. Setting this to TRUE will make all vanilla TMs reusable, though they can also be cherry-picked by setting their importance to 1.
Expand Down
1 change: 1 addition & 0 deletions include/config/overworld.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// PC settings
#define OW_PC_PRESS_B GEN_LATEST // In Gen4, pressing B when holding a Pokémon is equivalent to placing it. In Gen3, it gives the "You're holding a Pokémon!" error.
#define OW_PC_JAPAN_WALDA_ICONS TRUE // In the US release of Emerald, the Cross, Bolt, and Plusle icons for Walda's wallpapers were left blank from the Japan release. Setting this to TRUE will restore them.
#define OW_PC_HEAL GEN_LATEST // In Gen8+, Pokémon are not healed when deposited in the PC.

// Berry settings
// These generational defines only make a distinction for Berries!
Expand Down
1 change: 1 addition & 0 deletions include/config/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#define P_LEGENDARY_PERFECT_IVS GEN_LATEST // Since Gen 6, Legendaries, Mythicals and Ultra Beasts found in the wild or given through gifts have at least 3 perfect IVs.
#define P_EV_CAP GEN_LATEST // Since Gen 6, the max EVs per stat is 252 instead of 255.
#define P_CATCH_CURVE GEN_LATEST // Since Gen 6, the capture rate curve was changed to make pokeballs more effective on lower level pokemon
#define P_SHOW_TERA_TYPE GEN_LATEST // Since Gen 9, the Tera Type is shown on the summary screen.

// Flag settings
// To use the following features in scripting, replace the 0s with the flag ID you're assigning it to.
Expand Down
8 changes: 4 additions & 4 deletions include/constants/abilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,10 @@
#define ABILITY_EMBODY_ASPECT_CORNERSTONE 304
#define ABILITY_TOXIC_CHAIN 305
#define ABILITY_SUPERSWEET_SYRUP 306
#define ABILITY_307 307
#define ABILITY_308 308
#define ABILITY_309 309
#define ABILITY_310 310
#define ABILITY_TERA_SHIFT 307
#define ABILITY_TERA_SHELL 308
#define ABILITY_TERAFORM_ZERO 309
#define ABILITY_POISON_PUPPETEER 310

#define ABILITIES_COUNT_GEN9 311

Expand Down
5 changes: 4 additions & 1 deletion include/constants/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@
#define B_OUTCOME_LINK_BATTLE_RAN (1 << 7) // 128

// Non-volatile status conditions
// These persist remain outside of battle and after switching out
// These remain outside of battle and after switching out.
// If a new STATUS1 is added here, it should also be added to
// sCompressedStatuses in src/pokemon.c or else it will be lost outside
// of battle.
#define STATUS1_NONE 0
#define STATUS1_SLEEP (1 << 0 | 1 << 1 | 1 << 2) // First 3 bits (Number of turns to sleep)
#define STATUS1_SLEEP_TURN(num) ((num) << 0) // Just for readability (or if rearranging statuses)
Expand Down
3 changes: 2 additions & 1 deletion include/constants/battle_move_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@
#define EFFECT_RAGING_BULL 411
#define EFFECT_RAGE_FIST 412
#define EFFECT_DOODLE 413
#define EFFECT_FILLET_AWAY 414

#define NUM_BATTLE_MOVE_EFFECTS 414
#define NUM_BATTLE_MOVE_EFFECTS 415

#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
2 changes: 2 additions & 0 deletions include/constants/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#define VERSION_PLATINUM 12
#define VERSION_GAMECUBE 15

#define NUM_VERSIONS 15

#define LANGUAGE_JAPANESE 1
#define LANGUAGE_ENGLISH 2
#define LANGUAGE_FRENCH 3
Expand Down
4 changes: 2 additions & 2 deletions include/constants/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -986,8 +986,8 @@
#define ITEM_SWIFT_MOCHI 811
#define ITEM_FRESH_START_MOCHI 812
#define ITEM_GLIMMERING_CHARM 813
#define ITEM_814 814 // TWV0YWwgQWxsb3k=
#define ITEM_815 815 // U3RlbGxhciBUZXJhIFNoYXJk
#define ITEM_METAL_ALLOY 814
#define ITEM_STELLAR_TERA_SHARD 815

#define ITEMS_COUNT 816
#define ITEM_FIELD_ARROW ITEMS_COUNT
Expand Down
34 changes: 19 additions & 15 deletions include/constants/moves.h
Original file line number Diff line number Diff line change
Expand Up @@ -886,25 +886,27 @@
#define MOVE_MAGICAL_TORQUE 826
#define MOVE_PSYBLADE 827
#define MOVE_HYDRO_STEAM 828
// The Teal Mask Moves
#define MOVE_BLOOD_MOON 829
#define MOVE_MATCHA_GOTCHA 830
#define MOVE_SYRUP_BOMB 831
#define MOVE_IVY_CUDGEL 832
#define MOVE_833 833
#define MOVE_834 834
#define MOVE_835 835
#define MOVE_836 836
#define MOVE_837 837
#define MOVE_838 838
#define MOVE_839 839
#define MOVE_840 840
#define MOVE_841 841
#define MOVE_842 842
#define MOVE_843 843
#define MOVE_844 844
#define MOVE_845 845
#define MOVE_846 846
#define MOVE_847 847
// The Indigo Disk Moves
#define MOVE_ELECTRO_SHOT 833
#define MOVE_TERA_STARSTORM 834
#define MOVE_FICKLE_BEAM 835
#define MOVE_BURNING_BULWARK 836
#define MOVE_THUNDERCLAP 837
#define MOVE_MIGHTY_CLEAVE 838
#define MOVE_TACHYON_CUTTER 839
#define MOVE_HARD_PRESS 840
#define MOVE_DRAGON_CHEER 841
#define MOVE_ALLURING_VOICE 842
#define MOVE_TEMPER_FLARE 843
#define MOVE_SUPERCELL_SLAM 844
#define MOVE_PSYCHIC_NOISE 845
#define MOVE_UPPER_HAND 846
#define MOVE_MALIGNANT_CHAIN 847

#define MOVES_COUNT_GEN9 848

Expand Down Expand Up @@ -1014,6 +1016,8 @@

#define MOVES_COUNT_DYNAMAX (LAST_MAX_MOVE + 1)

#define MOVES_COUNT_ALL MOVES_COUNT_DYNAMAX

// Used for checks for moves affected by Disable, Mimic, etc.
#define MOVE_UNAVAILABLE 0xFFFF

Expand Down
2 changes: 2 additions & 0 deletions include/constants/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@
#define MIN_LEVEL 1
#define MAX_LEVEL 100

#define MAX_DYNAMAX_LEVEL 10

#define OT_ID_PLAYER_ID 0
#define OT_ID_PRESET 1
#define OT_ID_RANDOM_NO_SHINY 2
Expand Down
6 changes: 5 additions & 1 deletion include/contest.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ struct ContestPokemon
u8 sheen;
u8 highestRank;
bool8 gameCleared;
u8 unused[10];
u8 isShiny:1;
u8 unused1:7;
u8 unused2[9];
u32 personality;
u32 otId;
};
Expand All @@ -125,6 +127,8 @@ struct ContestMoveAnimData
u16 species;
u16 targetSpecies;
bool8 hasTargetAnim:1;
u8 isShiny:1;
u8 targetIsShiny:1;
u8 contestant;
u32 personality;
u32 otId;
Expand Down
Loading

0 comments on commit 1662dc3

Please sign in to comment.