mirror of
https://github.com/pret/pmd-sky.git
synced 2026-03-21 17:25:15 -05:00
Decomped IsBagFull and GetCurrentBagCapacity
This commit is contained in:
parent
5657f448f0
commit
33662d75e4
|
|
@ -1,36 +1,2 @@
|
|||
#pragma once
|
||||
.public AreItemsEquivalent
|
||||
.public BAG_ITEMS_PTR_MIRROR
|
||||
.public BulkItemToItem
|
||||
.public EXCLUSIVE_ITEM_ATTACK_BOOSTS
|
||||
.public EXCLUSIVE_ITEM_DEFENSE_BOOSTS
|
||||
.public EXCLUSIVE_ITEM_SPECIAL_ATTACK_BOOSTS
|
||||
.public EXCLUSIVE_ITEM_SPECIAL_DEFENSE_BOOSTS
|
||||
.public EXCLUSIVE_ITEM_STAT_BOOST_DATA_INDEXES
|
||||
.public GetBagCapacity
|
||||
.public GetBagCapacitySpecialEpisode
|
||||
.public GetExecuteSpecialEpisodeType
|
||||
.public GetItemCategory
|
||||
.public GetItemCategoryVeneer
|
||||
.public GetItemIdFromList
|
||||
.public GetPerformanceFlagWithChecks
|
||||
.public GetRankStorageSize
|
||||
.public GetScenarioBalance
|
||||
.public InitBulkItem
|
||||
.public IsItemInTimeDarkness
|
||||
.public IsItemValidVeneer
|
||||
.public IsStorableItem
|
||||
.public IsThrownItem
|
||||
.public IsTreasureBox
|
||||
.public ItemZInit
|
||||
.public KECLEON_SHOP_ITEM_TABLE_LISTS_1
|
||||
.public KECLEON_SHOP_ITEM_TABLE_LISTS_2
|
||||
.public MemAlloc
|
||||
.public MemFree
|
||||
.public RandIntSafe
|
||||
.public RemoveEmptyItems
|
||||
.public SetItemAcquired
|
||||
.public SortItemList
|
||||
.public sub_0200D1F0
|
||||
.public sub_0200D8AC
|
||||
.public sub_020582E0
|
||||
|
|
|
|||
33
asm/include/main_0200EDFC.inc
Normal file
33
asm/include/main_0200EDFC.inc
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
.public AddMoneyCarried
|
||||
.public AreItemsEquivalent
|
||||
.public BAG_ITEMS_PTR_MIRROR
|
||||
.public BulkItemToItem
|
||||
.public EXCLUSIVE_ITEM_ATTACK_BOOSTS
|
||||
.public EXCLUSIVE_ITEM_DEFENSE_BOOSTS
|
||||
.public EXCLUSIVE_ITEM_SPECIAL_ATTACK_BOOSTS
|
||||
.public EXCLUSIVE_ITEM_SPECIAL_DEFENSE_BOOSTS
|
||||
.public EXCLUSIVE_ITEM_STAT_BOOST_DATA_INDEXES
|
||||
.public GetCurrentBagCapacity
|
||||
.public GetItemCategory
|
||||
.public GetItemCategoryVeneer
|
||||
.public GetItemIdFromList
|
||||
.public GetRankStorageSize
|
||||
.public InitBulkItem
|
||||
.public IsItemInTimeDarkness
|
||||
.public IsItemValidVeneer
|
||||
.public IsStorableItem
|
||||
.public IsThrownItem
|
||||
.public IsTreasureBox
|
||||
.public ItemZInit
|
||||
.public KECLEON_SHOP_ITEM_TABLE_LISTS_1
|
||||
.public KECLEON_SHOP_ITEM_TABLE_LISTS_2
|
||||
.public MemAlloc
|
||||
.public MemFree
|
||||
.public RandIntSafe
|
||||
.public RemoveEmptyItems
|
||||
.public SetItemAcquired
|
||||
.public SortItemList
|
||||
.public sub_0200D1F0
|
||||
.public sub_0200D8AC
|
||||
.public sub_020582E0
|
||||
2818
asm/main_0200ED1C.s
2818
asm/main_0200ED1C.s
File diff suppressed because it is too large
Load Diff
2782
asm/main_0200EDFC.s
Normal file
2782
asm/main_0200EDFC.s
Normal file
File diff suppressed because it is too large
Load Diff
10
include/main_0200EDC0.h
Normal file
10
include/main_0200EDC0.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef PMDSKY_MAIN_0200EDC0_H
|
||||
#define PMDSKY_MAIN_0200EDC0_H
|
||||
|
||||
#include "util.h"
|
||||
|
||||
s32 GetCurrentBagCapacity();
|
||||
// Implements SPECIAL_PROC_IS_BAG_FULL (see ScriptSpecialProcessCall).
|
||||
bool8 IsBagFull();
|
||||
|
||||
#endif //PMDSKY_MAIN_0200EDC0_H
|
||||
2
main.lsf
2
main.lsf
|
|
@ -45,6 +45,8 @@ Static main
|
|||
Object asm/main_0200EB30.o
|
||||
Object src/main_0200ECFC.o
|
||||
Object asm/main_0200ED1C.o
|
||||
Object src/main_0200EDC0.o
|
||||
Object asm/main_0200EDFC.o
|
||||
Object src/exclusive_item.o
|
||||
Object asm/main_02010FC4.o
|
||||
Object src/moves_1.o
|
||||
|
|
|
|||
31
src/main_0200EDC0.c
Normal file
31
src/main_0200EDC0.c
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#include "main_0200EDC0.h"
|
||||
#include "item.h"
|
||||
|
||||
extern struct bag_items *BAG_ITEMS_PTR_MIRROR;
|
||||
|
||||
extern u32 GetBagCapacity(s32 scenario_balance);
|
||||
extern s32 GetBagCapacitySpecialEpisode(s32 se_type);
|
||||
extern s32 GetExecuteSpecialEpisodeType();
|
||||
extern bool8 GetPerformanceFlagWithChecks(s32 flag_id);
|
||||
extern s32 GetScenarioBalance();
|
||||
|
||||
s32 GetCurrentBagCapacity()
|
||||
{
|
||||
s32 special_episode_type = GetExecuteSpecialEpisodeType();
|
||||
if (special_episode_type == -1)
|
||||
{
|
||||
if (GetPerformanceFlagWithChecks(2) == 0)
|
||||
return 1;
|
||||
|
||||
return GetBagCapacity(GetScenarioBalance());
|
||||
}
|
||||
return GetBagCapacitySpecialEpisode(special_episode_type);
|
||||
}
|
||||
|
||||
bool8 IsBagFull()
|
||||
{
|
||||
s32 last_item_index = GetCurrentBagCapacity() - 1;
|
||||
if (BAG_ITEMS_PTR_MIRROR->bag_items->bag_items[last_item_index].flags & ITEM_FLAG_EXISTS)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user