Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flat Merge Friday (Weekly merge) #2286

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
59f89bd
Misc cleanup
AsparagusEduardo Aug 18, 2022
3bc2cf9
Sync src/battle_controllers.c with pokefirered
AsparagusEduardo Aug 8, 2022
11b4958
Incorporate commented bug fixes in contest AI scripts
GriffinRichards Aug 19, 2022
76d2d92
Merge branch 'pretmaster' into pret_clean2
AsparagusEduardo Aug 20, 2022
261b0ff
Standardize judgement vs judgment spelling
GriffinRichards Aug 21, 2022
8aead3b
Merge pull request #1747 from GriffinRichards/contest-ai-bug
GriffinRichards Aug 27, 2022
481210b
Missing uses of MAX_SPRITES
AsparagusEduardo Aug 27, 2022
0a34d47
Merge remote-tracking branch 'pret/master' into pret_clean2
AsparagusEduardo Aug 27, 2022
6c457f4
Corrected uses of GetBattlerSide
AsparagusEduardo Aug 27, 2022
15d611b
Usage of BATTLE_PARTNER
AsparagusEduardo Aug 27, 2022
1f0a952
Usage of BATTLE_OPPOSITE
AsparagusEduardo Aug 27, 2022
866d916
SpriteTemplate formatting
AsparagusEduardo Aug 27, 2022
99fbad9
IS_BATTLER_OF_TYPE
AsparagusEduardo Aug 27, 2022
1c8d3a4
Removed unnecessary parenthesis
AsparagusEduardo Aug 27, 2022
0a2ac61
Merge pull request #1757 from AsparagusEduardo/pret_clean2
GriffinRichards Aug 27, 2022
e02b33e
Automatized the contents of some sideof in src/item.c
LOuroboros Sep 1, 2022
ea345f9
Picked the correct pointers for correctness' sake
LOuroboros Sep 1, 2022
b66de1f
Merge pull request #1759 from LOuroboros/pyramidSchemes
GriffinRichards Sep 1, 2022
5d346fd
Updated a couple more sizeofs
LOuroboros Sep 1, 2022
d211adb
Merge pull request #1760 from LOuroboros/bermuda
GriffinRichards Sep 1, 2022
a28fbbc
Merge pull request #1748 from GriffinRichards/fix-judgement
GriffinRichards Sep 1, 2022
c7fc2e1
Renamed TM flags to keep consistency with the rest of the repo
AsparagusEduardo Sep 2, 2022
ff53a55
Merge pull request #1761 from AsparagusEduardo/pret/tmFlagNames
GriffinRichards Sep 2, 2022
5403cd0
Merge remote-tracking branch 'pret/master' into RHH/pr/pretMerge_2022…
AsparagusEduardo Sep 3, 2022
03498d7
Applied remaining instances of BATTLE_OPPOSITE and BATTLE_PARTNER
AsparagusEduardo Sep 3, 2022
790bdd6
Using GET_BATTLER_SIDE and GET_BATTLER_SIDE2
AsparagusEduardo Sep 3, 2022
41bf6bd
Removed pointless macro
AsparagusEduardo Sep 3, 2022
797aa08
Merge pull request #1764 from AsparagusEduardo/pret/battlerMacros
GriffinRichards Sep 3, 2022
dbd56ef
Merge remote-tracking branch 'pret/master' into RHH/pr/pretMerge_2022…
AsparagusEduardo Sep 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions data/contest_ai_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,15 @@ AI_CGM_BetterWhenAudienceExcited:
AI_CGM_BetterWhenAudienceExcited_1stUp:
@ BUG: Should be if_appeal_num_eq 0
@ 1st up on 1st appeal excitement will always be 0
if_appeal_num_not_eq 0, AI_CGM_BetterWhenAudienceExcited_Not1stAppeal
.ifdef BUGFIX
if_appeal_num_eq 0, AI_CGM_BetterWhenAudienceExcited_1stAppeal
.else
if_appeal_num_not_eq 0, AI_CGM_BetterWhenAudienceExcited_1stAppeal
.endif
if_excitement_eq 4, AI_CGM_BetterWhenAudienceExcited_1AwayFromMax
if_excitement_eq 3, AI_CGM_BetterWhenAudienceExcited_2AwayFromMax
end
AI_CGM_BetterWhenAudienceExcited_Not1stAppeal:
AI_CGM_BetterWhenAudienceExcited_1stAppeal:
if_random_less_than 125, AI_CGM_End
score -15
end
Expand Down Expand Up @@ -542,7 +546,11 @@ AI_CGM_TargetMonWithJudgesAttention:
end
AI_CGM_TargetMonWithJudgesAttention_CheckMon1:
if_cannot_participate MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
.ifdef BUGFIX
if_not_used_combo_starter MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
.else
if_used_combo_starter MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
.endif
if_random_less_than 125, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
score +2
if_not_completed_combo MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
Expand All @@ -551,7 +559,11 @@ AI_CGM_TargetMonWithJudgesAttention_CheckMon1:
AI_CGM_TargetMonWithJudgesAttention_CheckMon2:
if_user_order_eq MON_2, AI_CGM_End
if_cannot_participate MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
.ifdef BUGFIX
if_not_used_combo_starter MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
.else
if_used_combo_starter MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
.endif
if_random_less_than 125, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
score +2
if_not_completed_combo MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
Expand All @@ -560,7 +572,11 @@ AI_CGM_TargetMonWithJudgesAttention_CheckMon2:
AI_CGM_TargetMonWithJudgesAttention_CheckMon3:
if_user_order_eq MON_3, AI_CGM_End
if_cannot_participate MON_3, AI_CGM_End
.ifdef BUGFIX
if_not_used_combo_starter MON_3, AI_CGM_End
.else
if_used_combo_starter MON_3, AI_CGM_End
.endif
if_random_less_than 125, AI_CGM_End
score +2
if_not_completed_combo MON_3, AI_CGM_End
Expand Down
2 changes: 1 addition & 1 deletion data/maps/AbandonedShip_HiddenFloorRooms/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "AbandonedShip_HiddenFloorRooms_EventScript_ItemTM18",
"flag": "FLAG_ITEM_ABANDONED_SHIP_HIDDEN_FLOOR_ROOM_1_TM_18"
"flag": "FLAG_ITEM_ABANDONED_SHIP_HIDDEN_FLOOR_ROOM_1_TM18"
},
{
"graphics_id": "OBJ_EVENT_GFX_ITEM_BALL",
Expand Down
2 changes: 1 addition & 1 deletion data/maps/AbandonedShip_Room_B1F/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "AbandonedShip_Room_B1F_EventScript_ItemTM13",
"flag": "FLAG_ITEM_ABANDONED_SHIP_ROOMS_B1F_TM_13"
"flag": "FLAG_ITEM_ABANDONED_SHIP_ROOMS_B1F_TM13"
}
],
"warp_events": [
Expand Down
2 changes: 1 addition & 1 deletion data/maps/MeteorFalls_1F_1R/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "MeteorFalls_1F_1R_EventScript_ItemTM23",
"flag": "FLAG_ITEM_METEOR_FALLS_1F_1R_TM_23"
"flag": "FLAG_ITEM_METEOR_FALLS_1F_1R_TM23"
},
{
"graphics_id": "OBJ_EVENT_GFX_ITEM_BALL",
Expand Down
2 changes: 1 addition & 1 deletion data/maps/MeteorFalls_B1F_2R/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "MeteorFalls_B1F_2R_EventScript_ItemTM02",
"flag": "FLAG_ITEM_METEOR_FALLS_B1F_2R_TM_02"
"flag": "FLAG_ITEM_METEOR_FALLS_B1F_2R_TM02"
}
],
"warp_events": [
Expand Down
2 changes: 1 addition & 1 deletion data/maps/MtPyre_6F/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "MtPyre_6F_EventScript_ItemTM30",
"flag": "FLAG_ITEM_MT_PYRE_6F_TM_30"
"flag": "FLAG_ITEM_MT_PYRE_6F_TM30"
},
{
"graphics_id": "OBJ_EVENT_GFX_PSYCHIC_M",
Expand Down
2 changes: 1 addition & 1 deletion data/maps/MtPyre_Exterior/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "MtPyre_Exterior_EventScript_ItemTM48",
"flag": "FLAG_ITEM_MT_PYRE_EXTERIOR_TM_48"
"flag": "FLAG_ITEM_MT_PYRE_EXTERIOR_TM48"
}
],
"warp_events": [
Expand Down
2 changes: 1 addition & 1 deletion data/maps/Route111/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "Route111_EventScript_ItemTM37",
"flag": "FLAG_ITEM_ROUTE_111_TM_37"
"flag": "FLAG_ITEM_ROUTE_111_TM37"
},
{
"graphics_id": "OBJ_EVENT_GFX_BERRY_TREE",
Expand Down
2 changes: 1 addition & 1 deletion data/maps/Route113/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
"y": 5,
"elevation": 3,
"item": "ITEM_TM32",
"flag": "FLAG_HIDDEN_ITEM_ROUTE_113_TM_32"
"flag": "FLAG_HIDDEN_ITEM_ROUTE_113_TM32"
},
{
"type": "hidden_item",
Expand Down
2 changes: 1 addition & 1 deletion data/maps/Route115/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "Route115_EventScript_ItemTM01",
"flag": "FLAG_ITEM_ROUTE_115_TM_01"
"flag": "FLAG_ITEM_ROUTE_115_TM01"
},
{
"graphics_id": "OBJ_EVENT_GFX_ITEM_BALL",
Expand Down
2 changes: 1 addition & 1 deletion data/maps/SafariZone_Northwest/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "SafariZone_Northwest_EventScript_ItemTM22",
"flag": "FLAG_ITEM_SAFARI_ZONE_NORTH_WEST_TM_22"
"flag": "FLAG_ITEM_SAFARI_ZONE_NORTH_WEST_TM22"
}
],
"warp_events": [],
Expand Down
2 changes: 1 addition & 1 deletion data/maps/ScorchedSlab/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "ScorchedSlab_EventScript_ItemTM11",
"flag": "FLAG_ITEM_SCORCHED_SLAB_TM_11"
"flag": "FLAG_ITEM_SCORCHED_SLAB_TM11"
}
],
"warp_events": [
Expand Down
2 changes: 1 addition & 1 deletion data/maps/SeafloorCavern_Room9/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "SeafloorCavern_Room9_EventScript_ItemTM26",
"flag": "FLAG_ITEM_SEAFLOOR_CAVERN_ROOM_9_TM_26"
"flag": "FLAG_ITEM_SEAFLOOR_CAVERN_ROOM_9_TM26"
},
{
"graphics_id": "OBJ_EVENT_GFX_KYOGRE_ASLEEP",
Expand Down
2 changes: 1 addition & 1 deletion data/maps/ShoalCave_LowTideIceRoom/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "ShoalCave_LowTideIceRoom_EventScript_ItemTM07",
"flag": "FLAG_ITEM_SHOAL_CAVE_ICE_ROOM_TM_07"
"flag": "FLAG_ITEM_SHOAL_CAVE_ICE_ROOM_TM07"
},
{
"graphics_id": "OBJ_EVENT_GFX_ITEM_BALL",
Expand Down
2 changes: 1 addition & 1 deletion data/maps/VictoryRoad_B1F/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "0",
"script": "VictoryRoad_B1F_EventScript_ItemTM29",
"flag": "FLAG_ITEM_VICTORY_ROAD_B1F_TM_29"
"flag": "FLAG_ITEM_VICTORY_ROAD_B1F_TM29"
},
{
"graphics_id": "OBJ_EVENT_GFX_ITEM_BALL",
Expand Down
2 changes: 1 addition & 1 deletion gflib/sprite.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ typedef void (*AffineAnimCmdFunc)(u8 matrixNum, struct Sprite *);
#define DUMMY_OAM_DATA \
{ \
.y = DISPLAY_HEIGHT, \
.affineMode = 0, \
.affineMode = ST_OAM_AFFINE_OFF, \
.objMode = 0, \
.mosaic = FALSE, \
.bpp = 0, \
Expand Down
7 changes: 3 additions & 4 deletions include/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
#include "pokeball.h"
#include "battle_debug.h"

#define GET_BATTLER_POSITION(battler) (gBattlerPositions[battler])
#define GET_BATTLER_SIDE(battler) (GetBattlerPosition(battler) & BIT_SIDE)
#define GET_BATTLER_SIDE2(battler) (GET_BATTLER_POSITION(battler) & BIT_SIDE)
#define GET_BATTLER_SIDE2(battler) (gBattlerPositions[battler] & BIT_SIDE)

// Used to exclude moves learned temporarily by Transform or Mimic
#define MOVE_IS_PERMANENT(battler, moveSlot) \
Expand Down Expand Up @@ -515,7 +514,7 @@ struct BattleStruct
u8 faintedActionsState;
u8 faintedActionsBattlerId;
u32 expValue;
u8 field_52;
u8 scriptPartyIdx; // for printing the nickname
u8 sentInPokes;
bool8 selectionScriptFinished[MAX_BATTLERS_COUNT];
u8 battlerPartyIndexes[MAX_BATTLERS_COUNT];
Expand Down Expand Up @@ -764,7 +763,7 @@ struct BattleHealthboxInfo
u8 specialAnimActive:1; // x40
u8 triedShinyMonAnim:1;
u8 finishedShinyMonAnim:1;
u8 field_1_x1E:4;
u8 opponentDrawPartyStatusSummaryDelay:4;
u8 bgmRestored:1;
u8 waitForCry:1;
u8 healthboxSlideInStarted:1;
Expand Down
2 changes: 1 addition & 1 deletion include/battle_ai_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define AI_IS_FASTER 0
#define AI_IS_SLOWER 1

#define FOE(battler) ((battler ^ BIT_SIDE) & BIT_SIDE)
#define FOE(battler) ((BATTLE_OPPOSITE(battler)) & BIT_SIDE)

bool32 AI_RandLessThan(u8 val);
void RecordLastUsedMoveByTarget(void);
Expand Down
14 changes: 0 additions & 14 deletions include/battle_controllers.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,20 +208,15 @@ void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data);

// emitters
void BtlController_EmitGetMonData(u8 bufferId, u8 requestId, u8 monToCheck);
void BtlController_EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes); // unused
void BtlController_EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 bytes, void *data);
void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data); // unused
void BtlController_EmitLoadMonSprite(u8 bufferId);
void BtlController_EmitSwitchInAnim(u8 bufferId, u8 partyId, bool8 dontClearSubstituteBit);
void BtlController_EmitReturnMonToBall(u8 bufferId, bool8 skipAnim);
void BtlController_EmitDrawTrainerPic(u8 bufferId);
void BtlController_EmitTrainerSlide(u8 bufferId);
void BtlController_EmitTrainerSlideBack(u8 bufferId);
void BtlController_EmitFaintAnimation(u8 bufferId);
void BtlController_EmitPaletteFade(u8 bufferId); // unused
void BtlController_EmitSuccessBallThrowAnim(u8 bufferId); // unused
void BtlController_EmitBallThrowAnim(u8 bufferId, u8 caseId);
void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data); // unused
void BtlController_EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct *disableStructPtr, u8 multihit);
void BtlController_EmitPrintString(u8 bufferId, u16 stringId);
void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringId);
Expand All @@ -230,24 +225,15 @@ void BtlController_EmitYesNoBox(u8 bufferId);
void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData);
void BtlController_EmitChooseItem(u8 bufferId, u8 *battlePartyOrder);
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u16 abilityId, u8 *data);
void BtlController_EmitCmd23(u8 bufferId); // unused
void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
void BtlController_EmitExpUpdate(u8 bufferId, u8 partyId, s32 expPoints);
void BtlController_EmitStatusIconUpdate(u8 bufferId, u32 status1, u32 status2);
void BtlController_EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status);
void BtlController_EmitStatusXor(u8 bufferId, u8 b); // unused
void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data);
void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data); // unused
void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data); // unused
void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data); // unused
void BtlController_EmitTwoReturnValues(u8 bufferId, u8 ret8, u32 ret32);
void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 partyId, u8 *battlePartyOrder);
void BtlController_EmitOneReturnValue(u8 bufferId, u16 ret);
void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret);
void BtlController_EmitClearUnkVar(u8 bufferId); // unused
void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused
void BtlController_EmitClearUnkFlag(u8 bufferId); // unused
void BtlController_EmitToggleUnkFlag(u8 bufferId); // unused
void BtlController_EmitHitAnimation(u8 bufferId);
void BtlController_EmitCantSwitch(u8 bufferId);
void BtlController_EmitPlaySE(u8 bufferId, u16 songId);
Expand Down
4 changes: 2 additions & 2 deletions include/battle_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ struct BattleMsgData
u16 lastItem;
u16 lastAbility;
u8 scrActive;
u8 unk1605E;
u8 bakScriptPartyIdx;
u8 hpScale;
u8 itemEffectBattler;
u8 moveType;
Expand Down Expand Up @@ -309,7 +309,7 @@ extern const u8 gText_OpponentMon1Name[];
extern const u8 gText_Mind[];
extern const u8 gText_Skill[];
extern const u8 gText_Body[];
extern const u8 gText_Judgement[];
extern const u8 gText_Judgment[];
extern const u8 gText_EmptyString3[];
extern const u8 gText_RecordBattleToPass[];
extern const u8 gText_BattleRecordedOnPass[];
Expand Down
8 changes: 4 additions & 4 deletions include/constants/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#define B_POSITION_OPPONENT_RIGHT 3

// These macros can be used with either battler ID or positions to get the partner or the opposite mon
#define BATTLE_OPPOSITE(id) ((id) ^ 1)
#define BATTLE_PARTNER(id) ((id) ^ 2)
#define BATTLE_OPPOSITE(id) ((id) ^ BIT_SIDE)
#define BATTLE_PARTNER(id) ((id) ^ BIT_FLANK)

#define B_SIDE_PLAYER 0
#define B_SIDE_OPPONENT 1
Expand Down Expand Up @@ -460,8 +460,8 @@
#define ARENA_WIN_MIND 18
#define ARENA_WIN_SKILL 19
#define ARENA_WIN_BODY 20
#define ARENA_WIN_JUDGEMENT_TITLE 21
#define ARENA_WIN_JUDGEMENT_TEXT 22
#define ARENA_WIN_JUDGMENT_TITLE 21
#define ARENA_WIN_JUDGMENT_TEXT 22

// Flag for BattlePutTextOnWindow. Never set
#define B_WIN_COPYTOVRAM (1 << 7)
Expand Down
Loading