Add pool rules for Mega Stones and Z-Crystals (#7720)
Co-authored-by: Hedara <hedara90@gmail.com>
This commit is contained in:
parent
b8d5951dfb
commit
3c94074750
@ -364,5 +364,7 @@
|
||||
#define B_POOL_RULE_EXCLUDE_FORMS FALSE // Exclude different forms from the Species Clause
|
||||
#define B_POOL_RULE_ITEM_CLAUSE FALSE // Only allow each item to be picked once
|
||||
#define B_POOL_RULES_USE_ITEM_EXCLUSIONS FALSE // Exclude items listed in poolItemClauseExclusions
|
||||
#define B_POOL_RULE_MEGA_STONE_CLAUSE FALSE // Pick only 1 mon with mega stone
|
||||
#define B_POOL_RULE_Z_CRYSTAL_CLAUSE FALSE // Pick only 1 mon with Z-crystal
|
||||
|
||||
#endif // GUARD_CONFIG_BATTLE_H
|
||||
|
||||
@ -56,10 +56,12 @@ enum PoolTags {
|
||||
|
||||
struct PoolRules
|
||||
{
|
||||
bool8 speciesClause;
|
||||
bool8 excludeForms;
|
||||
bool8 itemClause;
|
||||
bool8 itemClauseExclusions;
|
||||
u8 speciesClause:1;
|
||||
u8 excludeForms:1;
|
||||
u8 itemClause:1;
|
||||
u8 itemClauseExclusions:1;
|
||||
u8 megaStoneClause:1;
|
||||
u8 zCrystalClause:1;
|
||||
u8 tagMaxMembers[POOL_NUM_TAGS];
|
||||
bool8 tagRequired[POOL_NUM_TAGS];
|
||||
};
|
||||
|
||||
@ -12,6 +12,8 @@ const struct PoolRules defaultPoolRules =
|
||||
.excludeForms = B_POOL_RULE_EXCLUDE_FORMS,
|
||||
.itemClause = B_POOL_RULE_ITEM_CLAUSE,
|
||||
.itemClauseExclusions = B_POOL_RULES_USE_ITEM_EXCLUSIONS,
|
||||
.megaStoneClause = B_POOL_RULE_MEGA_STONE_CLAUSE,
|
||||
.zCrystalClause = B_POOL_RULE_Z_CRYSTAL_CLAUSE,
|
||||
};
|
||||
|
||||
const struct PoolRules gPoolRulesetsList[] = {
|
||||
@ -20,6 +22,8 @@ const struct PoolRules gPoolRulesetsList[] = {
|
||||
.excludeForms = B_POOL_RULE_EXCLUDE_FORMS,
|
||||
.itemClause = B_POOL_RULE_ITEM_CLAUSE,
|
||||
.itemClauseExclusions = B_POOL_RULES_USE_ITEM_EXCLUSIONS,
|
||||
.megaStoneClause = B_POOL_RULE_MEGA_STONE_CLAUSE,
|
||||
.zCrystalClause = B_POOL_RULE_Z_CRYSTAL_CLAUSE,
|
||||
.tagMaxMembers[POOL_TAG_LEAD] = 1,
|
||||
.tagMaxMembers[POOL_TAG_ACE] = 1,
|
||||
},
|
||||
@ -28,6 +32,8 @@ const struct PoolRules gPoolRulesetsList[] = {
|
||||
.excludeForms = B_POOL_RULE_EXCLUDE_FORMS,
|
||||
.itemClause = B_POOL_RULE_ITEM_CLAUSE,
|
||||
.itemClauseExclusions = B_POOL_RULES_USE_ITEM_EXCLUSIONS,
|
||||
.megaStoneClause = B_POOL_RULE_MEGA_STONE_CLAUSE,
|
||||
.zCrystalClause = B_POOL_RULE_Z_CRYSTAL_CLAUSE,
|
||||
.tagMaxMembers[POOL_TAG_LEAD] = 2,
|
||||
.tagMaxMembers[POOL_TAG_ACE] = 2,
|
||||
},
|
||||
@ -36,6 +42,8 @@ const struct PoolRules gPoolRulesetsList[] = {
|
||||
.excludeForms = B_POOL_RULE_EXCLUDE_FORMS,
|
||||
.itemClause = B_POOL_RULE_ITEM_CLAUSE,
|
||||
.itemClauseExclusions = B_POOL_RULES_USE_ITEM_EXCLUSIONS,
|
||||
.megaStoneClause = B_POOL_RULE_MEGA_STONE_CLAUSE,
|
||||
.zCrystalClause = B_POOL_RULE_Z_CRYSTAL_CLAUSE,
|
||||
.tagMaxMembers[POOL_TAG_LEAD] = 1,
|
||||
.tagMaxMembers[POOL_TAG_ACE] = 1,
|
||||
.tagMaxMembers[POOL_TAG_WEATHER_SETTER] = 1,
|
||||
@ -48,6 +56,8 @@ const struct PoolRules gPoolRulesetsList[] = {
|
||||
.excludeForms = B_POOL_RULE_EXCLUDE_FORMS,
|
||||
.itemClause = B_POOL_RULE_ITEM_CLAUSE,
|
||||
.itemClauseExclusions = B_POOL_RULES_USE_ITEM_EXCLUSIONS,
|
||||
.megaStoneClause = B_POOL_RULE_MEGA_STONE_CLAUSE,
|
||||
.zCrystalClause = B_POOL_RULE_Z_CRYSTAL_CLAUSE,
|
||||
.tagMaxMembers[POOL_TAG_LEAD] = 2,
|
||||
.tagMaxMembers[POOL_TAG_ACE] = 2,
|
||||
.tagMaxMembers[POOL_TAG_WEATHER_SETTER] = 1,
|
||||
@ -60,6 +70,8 @@ const struct PoolRules gPoolRulesetsList[] = {
|
||||
.excludeForms = B_POOL_RULE_EXCLUDE_FORMS,
|
||||
.itemClause = B_POOL_RULE_ITEM_CLAUSE,
|
||||
.itemClauseExclusions = B_POOL_RULES_USE_ITEM_EXCLUSIONS,
|
||||
.megaStoneClause = B_POOL_RULE_MEGA_STONE_CLAUSE,
|
||||
.zCrystalClause = B_POOL_RULE_Z_CRYSTAL_CLAUSE,
|
||||
.tagMaxMembers[POOL_TAG_LEAD] = 2,
|
||||
.tagMaxMembers[POOL_TAG_ACE] = 2,
|
||||
.tagMaxMembers[POOL_TAG_SUPPORT] = 1,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "data.h"
|
||||
#include "item.h"
|
||||
#include "malloc.h"
|
||||
#include "pokemon.h"
|
||||
#include "random.h"
|
||||
@ -227,6 +228,10 @@ static u32 PickMonFromPool(const struct Trainer *trainer, u8 *poolIndexArray, u3
|
||||
poolIndexArray[currIndex] = POOL_SLOT_DISABLED;
|
||||
}
|
||||
}
|
||||
if (rules->megaStoneClause && gItemsInfo[currentItem].sortType == ITEM_TYPE_MEGA_STONE && gItemsInfo[chosenItem].sortType == ITEM_TYPE_MEGA_STONE)
|
||||
poolIndexArray[currIndex] = POOL_SLOT_DISABLED;
|
||||
if (rules->zCrystalClause && gItemsInfo[currentItem].sortType == ITEM_TYPE_Z_CRYSTAL && gItemsInfo[chosenItem].sortType == ITEM_TYPE_Z_CRYSTAL)
|
||||
poolIndexArray[currIndex] = POOL_SLOT_DISABLED;
|
||||
}
|
||||
}
|
||||
return monIndex;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user