Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 12 additions & 2 deletions asm/macros/event.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1206,10 +1206,20 @@

@ Opens the Pokemart system, offering the specified products for sale.
@ Products should be a list of .2byte item values preceded by an .align 2
.macro pokemart products:req, useVariablePrices=FALSE
.macro pokemart products:req, shopType=SHOP_TYPE_NORMAL
.byte SCR_OP_POKEMART
.4byte \products
.2byte \useVariablePrices
.2byte \shopType
.endm

@ Pokemart using coins for currency
.macro coinmart products:req
pokemart \products, SHOP_TYPE_COIN
.endm

@ Pokemart using battle points for currency
.macro battlepointmart products:req
pokemart \products, SHOP_TYPE_POINTS
.endm

@ Used as the endpoint for a Pokemart item list
Expand Down
Binary file added graphics/new_shop/menu_bp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/new_shop/menu_coin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/new_shop/sellers/jennie/menu_bp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/new_shop/sellers/jennie/menu_coin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/new_shop/sellers/jerry/menu_bp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/new_shop/sellers/jerry/menu_coin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions include/coins.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ u16 GetCoins(void);
void SetCoins(u16 coinAmount);
bool8 AddCoins(u16 toAdd);
bool8 RemoveCoins(u16 toSub);
bool8 IsEnoughCoins(u16 cost);

#endif // GUARD_COINS_H
7 changes: 7 additions & 0 deletions include/config/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,11 @@
// Config to toggle using the new shop menu.
#define MUDSKIP_SHOP_UI

// Some defines for specific type of shop used

#define SHOP_TYPE_NORMAL 0
#define SHOP_TYPE_VARIABLE 1
#define SHOP_TYPE_COINS 2
#define SHOP_TYPE_POINTS 3

#endif // GUARD_CONFIG_GENERAL_H
4 changes: 4 additions & 0 deletions include/frontier_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@ u8 GetFrontierBrainMonNature(u8 monId);
u8 GetFrontierBrainMonEvs(u8 monId, u8 evStatId);
s32 GetFronterBrainSymbol(void);
void ClearEnemyPartyAfterChallenge(void);
u16 GetBattlePoints(void);
bool8 IsEnoughBattlePoints(u16 cost);
void SetBattlePoints(u16 pointAmount);
bool8 RemoveBattlePoints(u16 toSub);

#endif // GUARD_FRONTIER_UTIL_H
4 changes: 4 additions & 0 deletions include/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ struct Item
u8 type;
u8 battleUsage;
u8 flingPower;
u16 coinPrice;
u16 bpPrice;
const u32 *iconPic;
const u32 *iconPalette;
};
Expand Down Expand Up @@ -84,6 +86,8 @@ u32 ItemId_GetSecondaryId(u32 itemId);
u32 ItemId_GetFlingPower(u32 itemId);
u32 GetItemStatus1Mask(u16 itemId);
u32 GetItemStatus2Mask(u16 itemId);
u32 ItemId_GetCoinPrice(u16 itemId);
u32 ItemId_GetBpPrice(u16 itemId);

/* Expands to:
* enum
Expand Down
2 changes: 2 additions & 0 deletions include/new_shop.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ void NewShop_CreateOutfitShopMenu(const u16 *);
#endif // MUDSKIP_OUTFIT_SYSTEM

void NewShop_CreateVariablePokemartMenu(const u16 *);
void NewShop_CreateCoinPokemartMenu(const u16 *);
void NewShop_CreatePointsPokemartMenu(const u16 *);

#endif // MUDSKIP_SHOP_UI

Expand Down
8 changes: 8 additions & 0 deletions src/coins.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,11 @@ bool8 RemoveCoins(u16 toSub)
}
return FALSE;
}

bool8 IsEnoughCoins(u16 cost)
{
if (GetCoins() >= cost)
return TRUE;
else
return FALSE;
}
29 changes: 29 additions & 0 deletions src/frontier_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2649,3 +2649,32 @@ void ClearEnemyPartyAfterChallenge()
ZeroEnemyPartyMons();
}
}

u16 GetBattlePoints(void)
{
return gSaveBlock2Ptr->frontier.battlePoints;
}

bool8 IsEnoughBattlePoints(u16 cost)
{
if (GetBattlePoints() >= cost)
return TRUE;
else
return FALSE;
}

void SetBattlePoints(u16 pointAmount)
{
gSaveBlock2Ptr->frontier.battlePoints = pointAmount;
}

bool8 RemoveBattlePoints(u16 toSub)
{
u16 ownedBp = GetBattlePoints();
if (ownedBp >= toSub)
{
SetBattlePoints(ownedBp - toSub);
return TRUE;
}
return FALSE;
}
10 changes: 10 additions & 0 deletions src/item.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,3 +1013,13 @@ u32 GetItemStatus2Mask(u16 itemId)
else
return 0;
}

u32 ItemId_GetCoinPrice(u16 itemId)
{
return gItemsInfo[SanitizeItemId(itemId)].coinPrice;
}

u32 ItemId_GetBpPrice(u16 itemId)
{
return gItemsInfo[SanitizeItemId(itemId)].bpPrice;
}
Loading