mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Rename eventLegal to fatefulEncounter
This commit is contained in:
parent
c32fbf594a
commit
6da5e0a280
@ -1576,15 +1576,15 @@
|
|||||||
.4byte \value
|
.4byte \value
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
@ Sets the eventLegal bit for the Pokemon in the specified slot of the player's party.
|
@ Sets the fatefulEncounter bit for the Pokemon in the specified slot of the player's party.
|
||||||
.macro setmoneventlegal slot:req
|
.macro setfatefulencounter slot:req
|
||||||
.byte 0xcd
|
.byte 0xcd
|
||||||
.2byte \slot
|
.2byte \slot
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
@ Checks if the eventLegal bit is set for the Pokemon in the specified slot of the player's party. If it isn't set,
|
@ Checks if the fatefulEncounter bit is set for the Pokemon in the specified slot of the player's party. If it isn't set,
|
||||||
@ VAR_RESULT is TRUE. If the bit is set (or if the specified slot is empty or invalid), VAR_RESULT is FALSE.
|
@ VAR_RESULT is TRUE. If the bit is set (or if the specified slot is empty or invalid), VAR_RESULT is FALSE.
|
||||||
.macro checkmoneventlegal slot:req
|
.macro checkfatefulencounter slot:req
|
||||||
.byte 0xce
|
.byte 0xce
|
||||||
.2byte \slot
|
.2byte \slot
|
||||||
.endm
|
.endm
|
||||||
@ -1932,10 +1932,10 @@
|
|||||||
closebraillemessage
|
closebraillemessage
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
@ Creates an "event legal" Pokémon for an encounter
|
@ Creates a Pokémon with the fatefulEncounter bit set for an encounter
|
||||||
.macro seteventmon species:req, level:req, item=ITEM_NONE
|
.macro setfatefulencountermon species:req, level:req, item=ITEM_NONE
|
||||||
setvar VAR_0x8004, \species
|
setvar VAR_0x8004, \species
|
||||||
setvar VAR_0x8005, \level
|
setvar VAR_0x8005, \level
|
||||||
setvar VAR_0x8006, \item
|
setvar VAR_0x8006, \item
|
||||||
special CreateEventLegalEnemyMon
|
special CreateFatefulEncounterEnemyMon
|
||||||
.endm
|
.endm
|
||||||
|
@ -85,7 +85,7 @@ BirthIsland_Exterior_EventScript_Deoxys::
|
|||||||
delay 40
|
delay 40
|
||||||
waitmoncry
|
waitmoncry
|
||||||
setvar VAR_LAST_TALKED, LOCALID_DEOXYS
|
setvar VAR_LAST_TALKED, LOCALID_DEOXYS
|
||||||
seteventmon SPECIES_DEOXYS, 30
|
setfatefulencountermon SPECIES_DEOXYS, 30
|
||||||
setflag FLAG_SYS_CTRL_OBJ_DELETE
|
setflag FLAG_SYS_CTRL_OBJ_DELETE
|
||||||
special BattleSetup_StartLegendaryBattle
|
special BattleSetup_StartLegendaryBattle
|
||||||
waitstate
|
waitstate
|
||||||
|
@ -129,7 +129,7 @@ FarawayIsland_Interior_EventScript_Mew::
|
|||||||
special DestroyMewEmergingGrassSprite
|
special DestroyMewEmergingGrassSprite
|
||||||
delay 40
|
delay 40
|
||||||
waitmoncry
|
waitmoncry
|
||||||
seteventmon SPECIES_MEW, 30
|
setfatefulencountermon SPECIES_MEW, 30
|
||||||
setflag FLAG_SYS_CTRL_OBJ_DELETE
|
setflag FLAG_SYS_CTRL_OBJ_DELETE
|
||||||
special BattleSetup_StartLegendaryBattle
|
special BattleSetup_StartLegendaryBattle
|
||||||
waitstate
|
waitstate
|
||||||
|
@ -53,7 +53,7 @@ NavelRock_Bottom_EventScript_Lugia::
|
|||||||
playmoncry SPECIES_LUGIA, CRY_MODE_ENCOUNTER
|
playmoncry SPECIES_LUGIA, CRY_MODE_ENCOUNTER
|
||||||
waitmoncry
|
waitmoncry
|
||||||
delay 20
|
delay 20
|
||||||
seteventmon SPECIES_LUGIA, 70
|
setfatefulencountermon SPECIES_LUGIA, 70
|
||||||
setflag FLAG_SYS_CTRL_OBJ_DELETE
|
setflag FLAG_SYS_CTRL_OBJ_DELETE
|
||||||
special BattleSetup_StartLegendaryBattle
|
special BattleSetup_StartLegendaryBattle
|
||||||
waitstate
|
waitstate
|
||||||
|
@ -57,7 +57,7 @@ NavelRock_Top_EventScript_HoOh::
|
|||||||
applymovement LOCALID_HO_OH, NavelRock_Top_Movement_HoOhApproach
|
applymovement LOCALID_HO_OH, NavelRock_Top_Movement_HoOhApproach
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
special RemoveCameraObject
|
special RemoveCameraObject
|
||||||
seteventmon SPECIES_HO_OH, 70
|
setfatefulencountermon SPECIES_HO_OH, 70
|
||||||
setflag FLAG_SYS_CTRL_OBJ_DELETE
|
setflag FLAG_SYS_CTRL_OBJ_DELETE
|
||||||
special BattleSetup_StartLegendaryBattle
|
special BattleSetup_StartLegendaryBattle
|
||||||
waitstate
|
waitstate
|
||||||
|
@ -105,11 +105,11 @@ SouthernIsland_Interior_EventScript_Sign::
|
|||||||
end
|
end
|
||||||
|
|
||||||
SouthernIsland_Interior_EventScript_SetLatiosBattleVars::
|
SouthernIsland_Interior_EventScript_SetLatiosBattleVars::
|
||||||
seteventmon SPECIES_LATIOS, 50, ITEM_SOUL_DEW
|
setfatefulencountermon SPECIES_LATIOS, 50, ITEM_SOUL_DEW
|
||||||
return
|
return
|
||||||
|
|
||||||
SouthernIsland_Interior_EventScript_SetLatiasBattleVars::
|
SouthernIsland_Interior_EventScript_SetLatiasBattleVars::
|
||||||
seteventmon SPECIES_LATIAS, 50, ITEM_SOUL_DEW
|
setfatefulencountermon SPECIES_LATIAS, 50, ITEM_SOUL_DEW
|
||||||
return
|
return
|
||||||
|
|
||||||
SouthernIsland_Interior_Movement_CameraPanUp:
|
SouthernIsland_Interior_Movement_CameraPanUp:
|
||||||
|
@ -205,8 +205,8 @@ gScriptCmdTable::
|
|||||||
.4byte ScrCmd_nop1 @ 0xca
|
.4byte ScrCmd_nop1 @ 0xca
|
||||||
.4byte ScrCmd_nop1 @ 0xcb
|
.4byte ScrCmd_nop1 @ 0xcb
|
||||||
.4byte ScrCmd_nop1 @ 0xcc
|
.4byte ScrCmd_nop1 @ 0xcc
|
||||||
.4byte ScrCmd_setmoneventlegal @ 0xcd
|
.4byte ScrCmd_setmonfatefulencounter @ 0xcd
|
||||||
.4byte ScrCmd_checkmoneventlegal @ 0xce
|
.4byte ScrCmd_checkmonfatefulencounter @ 0xce
|
||||||
.4byte ScrCmd_trywondercardscript @ 0xcf
|
.4byte ScrCmd_trywondercardscript @ 0xcf
|
||||||
.4byte ScrCmd_nop1 @ 0xd0
|
.4byte ScrCmd_nop1 @ 0xd0
|
||||||
.4byte ScrCmd_warpspinenter @ 0xd1
|
.4byte ScrCmd_warpspinenter @ 0xd1
|
||||||
|
@ -29,7 +29,7 @@ SurfPichu_FullParty:
|
|||||||
|
|
||||||
SurfPichu_GiveEgg:
|
SurfPichu_GiveEgg:
|
||||||
giveegg SPECIES_PICHU
|
giveegg SPECIES_PICHU
|
||||||
setmoneventlegal VAR_GIFT_PICHU_SLOT
|
setfatefulencounter VAR_GIFT_PICHU_SLOT
|
||||||
setmonmetlocation VAR_GIFT_PICHU_SLOT, METLOC_FATEFUL_ENCOUNTER
|
setmonmetlocation VAR_GIFT_PICHU_SLOT, METLOC_FATEFUL_ENCOUNTER
|
||||||
vgoto_if_eq VAR_GIFT_PICHU_SLOT, 1, SurfPichu_Slot1
|
vgoto_if_eq VAR_GIFT_PICHU_SLOT, 1, SurfPichu_Slot1
|
||||||
vgoto_if_eq VAR_GIFT_PICHU_SLOT, 2, SurfPichu_Slot2
|
vgoto_if_eq VAR_GIFT_PICHU_SLOT, 2, SurfPichu_Slot2
|
||||||
|
@ -490,7 +490,7 @@ gSpecials::
|
|||||||
def_special ScrollableMultichoice_ClosePersistentMenu
|
def_special ScrollableMultichoice_ClosePersistentMenu
|
||||||
def_special DoDeoxysRockInteraction
|
def_special DoDeoxysRockInteraction
|
||||||
def_special SetDeoxysRockPalette
|
def_special SetDeoxysRockPalette
|
||||||
def_special CreateEventLegalEnemyMon
|
def_special CreateFatefulEncounterEnemyMon
|
||||||
def_special StartMirageTowerDisintegration
|
def_special StartMirageTowerDisintegration
|
||||||
def_special StartMirageTowerShake
|
def_special StartMirageTowerShake
|
||||||
def_special StartMirageTowerFossilFallAndSink
|
def_special StartMirageTowerFossilFallAndSink
|
||||||
|
@ -85,7 +85,7 @@ enum {
|
|||||||
MON_DATA_EARTH_RIBBON,
|
MON_DATA_EARTH_RIBBON,
|
||||||
MON_DATA_WORLD_RIBBON,
|
MON_DATA_WORLD_RIBBON,
|
||||||
MON_DATA_UNUSED_RIBBONS,
|
MON_DATA_UNUSED_RIBBONS,
|
||||||
MON_DATA_EVENT_LEGAL,
|
MON_DATA_FATEFUL_ENCOUNTER,
|
||||||
MON_DATA_KNOWN_MOVES,
|
MON_DATA_KNOWN_MOVES,
|
||||||
MON_DATA_RIBBON_COUNT,
|
MON_DATA_RIBBON_COUNT,
|
||||||
MON_DATA_RIBBONS,
|
MON_DATA_RIBBONS,
|
||||||
@ -165,7 +165,7 @@ struct PokemonSubstruct3
|
|||||||
/* 0x0B */ u32 earthRibbon:1;
|
/* 0x0B */ u32 earthRibbon:1;
|
||||||
/* 0x0B */ u32 worldRibbon:1; // distributed during Pokémon Festa '04 and '05 to tournament winners
|
/* 0x0B */ u32 worldRibbon:1; // distributed during Pokémon Festa '04 and '05 to tournament winners
|
||||||
/* 0x0B */ u32 unusedRibbons:4; // discarded in Gen 4
|
/* 0x0B */ u32 unusedRibbons:4; // discarded in Gen 4
|
||||||
/* 0x0B */ u32 eventLegal:1; // controls Mew & Deoxys obedience; if set, Pokémon is a fateful encounter in Gen 4+; set for in-game event island legendaries, some distributed events, and Pokémon from XD: Gale of Darkness.
|
/* 0x0B */ u32 fatefulEncounter:1; // controls Mew & Deoxys obedience; set for in-game event island legendaries, some distributed events, and Pokémon from XD: Gale of Darkness.
|
||||||
};
|
};
|
||||||
|
|
||||||
// Number of bytes in the largest Pokémon substruct.
|
// Number of bytes in the largest Pokémon substruct.
|
||||||
@ -401,12 +401,12 @@ void CreateBattleTowerMon_HandleLevel(struct Pokemon *mon, struct BattleTowerPok
|
|||||||
void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 monId);
|
void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 monId);
|
||||||
void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level, u8 nature, u8 fixedIV, u8 evSpread, u32 otId);
|
void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level, u8 nature, u8 fixedIV, u8 evSpread, u32 otId);
|
||||||
void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerPokemon *dest);
|
void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerPokemon *dest);
|
||||||
void CreateEventLegalMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId);
|
void CreateFatefulEncounterMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId);
|
||||||
bool8 ShouldIgnoreDeoxysForm(u8 caseId, u8 battlerId);
|
bool8 ShouldIgnoreDeoxysForm(u8 caseId, u8 battlerId);
|
||||||
void SetDeoxysStats(void);
|
void SetDeoxysStats(void);
|
||||||
u16 GetUnionRoomTrainerPic(void);
|
u16 GetUnionRoomTrainerPic(void);
|
||||||
u16 GetUnionRoomTrainerClass(void);
|
u16 GetUnionRoomTrainerClass(void);
|
||||||
void CreateEventLegalEnemyMon(void);
|
void CreateFatefulEncounterEnemyMon(void);
|
||||||
void CalculateMonStats(struct Pokemon *mon);
|
void CalculateMonStats(struct Pokemon *mon);
|
||||||
void BoxMonToMon(const struct BoxPokemon *src, struct Pokemon *dest);
|
void BoxMonToMon(const struct BoxPokemon *src, struct Pokemon *dest);
|
||||||
u8 GetLevelFromMonExp(struct Pokemon *mon);
|
u8 GetLevelFromMonExp(struct Pokemon *mon);
|
||||||
|
@ -12,8 +12,8 @@ extern const struct WindowTemplate gTradeEvolutionSceneYesNoWindowTemplate;
|
|||||||
s32 GetGameProgressForLinkTrade(void);
|
s32 GetGameProgressForLinkTrade(void);
|
||||||
void CB2_StartCreateTradeMenu(void);
|
void CB2_StartCreateTradeMenu(void);
|
||||||
void CB2_LinkTrade(void);
|
void CB2_LinkTrade(void);
|
||||||
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isEventLegal);
|
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isFatefulEncounter);
|
||||||
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isEventLegal);
|
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isFatefulEncounter);
|
||||||
int CanSpinTradeMon(struct Pokemon *, u16);
|
int CanSpinTradeMon(struct Pokemon *, u16);
|
||||||
void InitTradeSequenceBgGpuRegs(void);
|
void InitTradeSequenceBgGpuRegs(void);
|
||||||
void LinkTradeDrawWindow(void);
|
void LinkTradeDrawWindow(void);
|
||||||
|
@ -3885,14 +3885,14 @@ u8 GetMoveTarget(u16 move, u8 setTarget)
|
|||||||
return targetBattler;
|
return targetBattler;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool32 IsMonEventLegal(u8 battlerId)
|
static bool32 IsBattlerFatefulEncounter(u8 battlerId)
|
||||||
{
|
{
|
||||||
if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT)
|
if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS
|
if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS
|
||||||
&& GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_MEW)
|
&& GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_MEW)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_EVENT_LEGAL, NULL);
|
return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_FATEFUL_ENCOUNTER, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 IsMonDisobedient(void)
|
u8 IsMonDisobedient(void)
|
||||||
@ -3906,7 +3906,7 @@ u8 IsMonDisobedient(void)
|
|||||||
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT)
|
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (IsMonEventLegal(gBattlerAttacker)) // only false if illegal Mew or Deoxys
|
if (IsBattlerFatefulEncounter(gBattlerAttacker)) // only false if illegal Mew or Deoxys
|
||||||
{
|
{
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBattlerPosition(gBattlerAttacker) == 2)
|
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBattlerPosition(gBattlerAttacker) == 2)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -313,7 +313,7 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
|
|||||||
{
|
{
|
||||||
u16 species;
|
u16 species;
|
||||||
u32 personality, pokerus;
|
u32 personality, pokerus;
|
||||||
u8 i, friendship, language, gameMet, markings, isEventLegal;
|
u8 i, friendship, language, gameMet, markings, isFatefulEncounter;
|
||||||
u16 moves[MAX_MON_MOVES];
|
u16 moves[MAX_MON_MOVES];
|
||||||
u32 ivs[NUM_STATS];
|
u32 ivs[NUM_STATS];
|
||||||
|
|
||||||
@ -332,7 +332,7 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
|
|||||||
gameMet = GetMonData(egg, MON_DATA_MET_GAME);
|
gameMet = GetMonData(egg, MON_DATA_MET_GAME);
|
||||||
markings = GetMonData(egg, MON_DATA_MARKINGS);
|
markings = GetMonData(egg, MON_DATA_MARKINGS);
|
||||||
pokerus = GetMonData(egg, MON_DATA_POKERUS);
|
pokerus = GetMonData(egg, MON_DATA_POKERUS);
|
||||||
isEventLegal = GetMonData(egg, MON_DATA_EVENT_LEGAL);
|
isFatefulEncounter = GetMonData(egg, MON_DATA_FATEFUL_ENCOUNTER);
|
||||||
|
|
||||||
CreateMon(temp, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0);
|
CreateMon(temp, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0);
|
||||||
|
|
||||||
@ -350,7 +350,7 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
|
|||||||
friendship = 120;
|
friendship = 120;
|
||||||
SetMonData(temp, MON_DATA_FRIENDSHIP, &friendship);
|
SetMonData(temp, MON_DATA_FRIENDSHIP, &friendship);
|
||||||
SetMonData(temp, MON_DATA_POKERUS, &pokerus);
|
SetMonData(temp, MON_DATA_POKERUS, &pokerus);
|
||||||
SetMonData(temp, MON_DATA_EVENT_LEGAL, &isEventLegal);
|
SetMonData(temp, MON_DATA_FATEFUL_ENCOUNTER, &isFatefulEncounter);
|
||||||
|
|
||||||
*egg = *temp;
|
*egg = *temp;
|
||||||
}
|
}
|
||||||
|
@ -3591,9 +3591,9 @@ static void CursorCb_Register(u8 taskId)
|
|||||||
{
|
{
|
||||||
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
|
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
|
||||||
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
|
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
|
||||||
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
|
u8 isFatefulEncounter = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_FATEFUL_ENCOUNTER);
|
||||||
|
|
||||||
switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), species2, species, isEventLegal))
|
switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), species2, species, isFatefulEncounter))
|
||||||
{
|
{
|
||||||
case CANT_REGISTER_MON:
|
case CANT_REGISTER_MON:
|
||||||
StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTradedNow);
|
StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTradedNow);
|
||||||
@ -3618,8 +3618,8 @@ static void CursorCb_Trade1(u8 taskId)
|
|||||||
{
|
{
|
||||||
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
|
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
|
||||||
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
|
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
|
||||||
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
|
u8 isFatefulEncounter = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_FATEFUL_ENCOUNTER);
|
||||||
u32 stringId = GetUnionRoomTradeMessageId(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), gRfuPartnerCompatibilityData, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isEventLegal);
|
u32 stringId = GetUnionRoomTradeMessageId(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), gRfuPartnerCompatibilityData, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isFatefulEncounter);
|
||||||
|
|
||||||
if (stringId != UR_TRADE_MSG_NONE)
|
if (stringId != UR_TRADE_MSG_NONE)
|
||||||
{
|
{
|
||||||
|
@ -2623,12 +2623,12 @@ void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerP
|
|||||||
GetMonData(mon, MON_DATA_NICKNAME, dest->nickname);
|
GetMonData(mon, MON_DATA_NICKNAME, dest->nickname);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateEventLegalMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId)
|
void CreateFatefulEncounterMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId)
|
||||||
{
|
{
|
||||||
bool32 isEventLegal = TRUE;
|
bool32 isFatefulEncounter = TRUE;
|
||||||
|
|
||||||
CreateMon(mon, species, level, fixedIV, hasFixedPersonality, fixedPersonality, otIdType, fixedOtId);
|
CreateMon(mon, species, level, fixedIV, hasFixedPersonality, fixedPersonality, otIdType, fixedOtId);
|
||||||
SetMonData(mon, MON_DATA_EVENT_LEGAL, &isEventLegal);
|
SetMonData(mon, MON_DATA_FATEFUL_ENCOUNTER, &isFatefulEncounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If FALSE, should load this game's Deoxys form. If TRUE, should load normal Deoxys form
|
// If FALSE, should load this game's Deoxys form. If TRUE, should load normal Deoxys form
|
||||||
@ -2763,14 +2763,14 @@ u16 GetUnionRoomTrainerClass(void)
|
|||||||
return gFacilityClassToTrainerClass[gUnionRoomFacilityClasses[arrId]];
|
return gFacilityClassToTrainerClass[gUnionRoomFacilityClasses[arrId]];
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateEventLegalEnemyMon(void)
|
void CreateFatefulEncounterEnemyMon(void)
|
||||||
{
|
{
|
||||||
s32 species = gSpecialVar_0x8004;
|
s32 species = gSpecialVar_0x8004;
|
||||||
s32 level = gSpecialVar_0x8005;
|
s32 level = gSpecialVar_0x8005;
|
||||||
s32 itemId = gSpecialVar_0x8006;
|
s32 itemId = gSpecialVar_0x8006;
|
||||||
|
|
||||||
ZeroEnemyPartyMons();
|
ZeroEnemyPartyMons();
|
||||||
CreateEventLegalMon(&gEnemyParty[0], species, level, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
|
CreateFatefulEncounterMon(&gEnemyParty[0], species, level, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
|
||||||
if (itemId)
|
if (itemId)
|
||||||
{
|
{
|
||||||
u8 heldItem[2];
|
u8 heldItem[2];
|
||||||
@ -3957,8 +3957,8 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data)
|
|||||||
case MON_DATA_UNUSED_RIBBONS:
|
case MON_DATA_UNUSED_RIBBONS:
|
||||||
retVal = substruct3->unusedRibbons;
|
retVal = substruct3->unusedRibbons;
|
||||||
break;
|
break;
|
||||||
case MON_DATA_EVENT_LEGAL:
|
case MON_DATA_FATEFUL_ENCOUNTER:
|
||||||
retVal = substruct3->eventLegal;
|
retVal = substruct3->fatefulEncounter;
|
||||||
break;
|
break;
|
||||||
case MON_DATA_SPECIES2:
|
case MON_DATA_SPECIES2:
|
||||||
retVal = substruct0->species;
|
retVal = substruct0->species;
|
||||||
@ -4341,8 +4341,8 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
|
|||||||
case MON_DATA_UNUSED_RIBBONS:
|
case MON_DATA_UNUSED_RIBBONS:
|
||||||
SET8(substruct3->unusedRibbons);
|
SET8(substruct3->unusedRibbons);
|
||||||
break;
|
break;
|
||||||
case MON_DATA_EVENT_LEGAL:
|
case MON_DATA_FATEFUL_ENCOUNTER:
|
||||||
SET8(substruct3->eventLegal);
|
SET8(substruct3->fatefulEncounter);
|
||||||
break;
|
break;
|
||||||
case MON_DATA_IVS:
|
case MON_DATA_IVS:
|
||||||
{
|
{
|
||||||
|
12
src/scrcmd.c
12
src/scrcmd.c
@ -2206,21 +2206,21 @@ bool8 ScrCmd_lockfortrainer(struct ScriptContext *ctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This command will set a Pokémon's eventLegal bit; there is no similar command to clear it.
|
// This command will set a Pokémon's fatefulEncounter bit; there is no similar command to clear it.
|
||||||
bool8 ScrCmd_setmoneventlegal(struct ScriptContext *ctx)
|
bool8 ScrCmd_setmonfatefulencounter(struct ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
bool8 isEventLegal = TRUE;
|
bool8 isFatefulEncounter = TRUE;
|
||||||
u16 partyIndex = VarGet(ScriptReadHalfword(ctx));
|
u16 partyIndex = VarGet(ScriptReadHalfword(ctx));
|
||||||
|
|
||||||
SetMonData(&gPlayerParty[partyIndex], MON_DATA_EVENT_LEGAL, &isEventLegal);
|
SetMonData(&gPlayerParty[partyIndex], MON_DATA_FATEFUL_ENCOUNTER, &isFatefulEncounter);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 ScrCmd_checkmoneventlegal(struct ScriptContext *ctx)
|
bool8 ScrCmd_checkmonfatefulencounter(struct ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
u16 partyIndex = VarGet(ScriptReadHalfword(ctx));
|
u16 partyIndex = VarGet(ScriptReadHalfword(ctx));
|
||||||
|
|
||||||
gSpecialVar_Result = GetMonData(&gPlayerParty[partyIndex], MON_DATA_EVENT_LEGAL, NULL);
|
gSpecialVar_Result = GetMonData(&gPlayerParty[partyIndex], MON_DATA_FATEFUL_ENCOUNTER, NULL);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
src/trade.c
16
src/trade.c
@ -1577,7 +1577,7 @@ static u8 CheckValidityOfTradeMons(u8 *aliveMons, u8 playerPartyCount, u8 player
|
|||||||
// Partner cant trade illegitimate Deoxys or Mew
|
// Partner cant trade illegitimate Deoxys or Mew
|
||||||
if (partnerSpecies == SPECIES_DEOXYS || partnerSpecies == SPECIES_MEW)
|
if (partnerSpecies == SPECIES_DEOXYS || partnerSpecies == SPECIES_MEW)
|
||||||
{
|
{
|
||||||
if (!GetMonData(&gEnemyParty[partnerMonIdx], MON_DATA_EVENT_LEGAL))
|
if (!GetMonData(&gEnemyParty[partnerMonIdx], MON_DATA_FATEFUL_ENCOUNTER))
|
||||||
return PARTNER_MON_INVALID;
|
return PARTNER_MON_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2426,7 +2426,7 @@ static u32 CanTradeSelectedMon(struct Pokemon *playerParty, int partyCount, int
|
|||||||
|
|
||||||
if (species[monIdx] == SPECIES_DEOXYS || species[monIdx] == SPECIES_MEW)
|
if (species[monIdx] == SPECIES_DEOXYS || species[monIdx] == SPECIES_MEW)
|
||||||
{
|
{
|
||||||
if (!GetMonData(&playerParty[monIdx], MON_DATA_EVENT_LEGAL))
|
if (!GetMonData(&playerParty[monIdx], MON_DATA_FATEFUL_ENCOUNTER))
|
||||||
return CANT_TRADE_INVALID_MON;
|
return CANT_TRADE_INVALID_MON;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2491,17 +2491,17 @@ s32 GetGameProgressForLinkTrade(void)
|
|||||||
return TRADE_BOTH_PLAYERS_READY;
|
return TRADE_BOTH_PLAYERS_READY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isEventLegal)
|
static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isFatefulEncounter)
|
||||||
{
|
{
|
||||||
if (species == SPECIES_DEOXYS || species == SPECIES_MEW)
|
if (species == SPECIES_DEOXYS || species == SPECIES_MEW)
|
||||||
{
|
{
|
||||||
if (!isEventLegal)
|
if (!isFatefulEncounter)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isEventLegal)
|
int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isFatefulEncounter)
|
||||||
{
|
{
|
||||||
bool8 playerHasNationalDex = player.hasNationalDex;
|
bool8 playerHasNationalDex = player.hasNationalDex;
|
||||||
bool8 playerCanLinkNationally = player.canLinkNationally;
|
bool8 playerCanLinkNationally = player.canLinkNationally;
|
||||||
@ -2520,7 +2520,7 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cannot trade illegitimate Deoxys/Mew
|
// Cannot trade illegitimate Deoxys/Mew
|
||||||
if (IsDeoxysOrMewUntradable(playerSpecies, isEventLegal))
|
if (IsDeoxysOrMewUntradable(playerSpecies, isFatefulEncounter))
|
||||||
return UR_TRADE_MSG_MON_CANT_BE_TRADED_2;
|
return UR_TRADE_MSG_MON_CANT_BE_TRADED_2;
|
||||||
|
|
||||||
if (partnerSpecies == SPECIES_EGG)
|
if (partnerSpecies == SPECIES_EGG)
|
||||||
@ -2563,11 +2563,11 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf
|
|||||||
return UR_TRADE_MSG_NONE;
|
return UR_TRADE_MSG_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isEventLegal)
|
int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isFatefulEncounter)
|
||||||
{
|
{
|
||||||
bool8 hasNationalDex = player.hasNationalDex;
|
bool8 hasNationalDex = player.hasNationalDex;
|
||||||
|
|
||||||
if (IsDeoxysOrMewUntradable(species, isEventLegal))
|
if (IsDeoxysOrMewUntradable(species, isFatefulEncounter))
|
||||||
return CANT_REGISTER_MON;
|
return CANT_REGISTER_MON;
|
||||||
|
|
||||||
if (hasNationalDex)
|
if (hasNationalDex)
|
||||||
|
Loading…
Reference in New Issue
Block a user