Commit Graph

56 Commits

Author SHA1 Message Date
Briggs Baltzell 2340dc7bc0 Implement CookingMgr class (#113)
* Added CookingMgr fields and started on ctor

* Implemented CookItem::copy

* Implemented CookingMgr dtor

* Marked CookingMgr createInstance as matching

* Implemented CookingMgr::getCookItem

* Added CookingMgr::cook decl

* Added CookingMgr method decls

* Replaced part of CookingMgr with sead::FixedObjArray

* Added line separators in cookManager.h

* Defined structs Ingredient and BoostArg in CookingMgr

* Defined structs CookArg and CookIngredient

* Renamed some fields of CookingMgr

* Added struct CookingMgr::CookingEffectEntry

* Started implementing CookingMgr::init

* Set more entries in init

* Set field _548

* Set field default values in init

* Loaded string values from config

* Set mCookingEffectEntries in init

* Added conditional mConfig allocation

* Added FixedTreeMap class to sead

* Used FixedTreeMap in CookingMgr

* Set CookingMgr constructor to default and marked it as matching

* Removed field _31C from CookingMgr

* Updated sead

* Cleared _548 before filling

* Used name hash for _548 keys

* Fixed path setup

* Changed type of _548 to sead::FixedTreeMap<u32, u32, 13>

* Set mNMSSR to correct values

* Fixed field init order

* Rearranged variables

* Swapped entry_hash comparisons

* Changed CRC32 names and index values

* Cast i to u64

* Renamed static crc32 variables

* Renamed _548 to mCookingEffectNameIdMap

* Marked static vars as const and used decimal numbers

* Used sead::SafeArray for mNMMR and mNMSSR

* Rearranged mNMMR and mNMSSR conditions

* Removed size check from mNMMR and mNMSSR conditions

* Removed size check from CEI conditions

* Renamed mRes2 to mResHandle

* Renamed cook args

* Moved crc32 statics into Constants struct

* Marked CookingMgr::init as matching

* Renamed Constants to Crc32Constants

* Added cookFail and cookFailForMissingConfig

* Added NumIngredientsMax, NumEffects, and NumEffectSlots constants

* Renamed getCookItem to setCookItem

* Renamed x to getCookItem

* Implemented getCookItem

* Made setCookItem take a const ref

* Decompiled cookCalcItemPrice

* Marked cookCalcItemPrice as const

* Fixed both cookFail and cookFailForMissingConfig

* Added CookItem::reset

* Added CookingMgr::resetCookItem

* Moved ctor and dtor below static variables

* Changed cookFailForMissingConfig arg to sead::SafeString

* Started on cookCalcBoost

* Moved CookItem into cookManager.h

* Moved Cooking into Game

* Moved CookingMgr to uking namespace

* Inlined CookItem::reset

* Renamed CookItem members

* Fixed CookItem mangled names in uking_functions.csv

* Added enum class CookEffectId

* Moved CookingMgr ctor below disposer impl

* Updated sead

* Started on cookHandleBoostSuccessInner

* Made changes to cookCalcBoost and cookHandleBoostSuccessInner

* Extracted cookHandleBoostMonsterExtractInner

* Removed found_monster_extract in cookCalcBoost

* Marked cookCalcBoost as matching

* Got cookHandleBoostMonsterExtractInner matching

* Made changes to cookHandleBoostSuccessInner

* Renamed discriminator to bonus in cookHandleBoostSuccessInner

* Added CookingMgr::cookCalcSpiceBoost

* Made changes to CookingMgr::cookCalcSpiceBoost

* Added CookingMgr::cookCalcPotencyBoost

* Mostly matched CookingMgr::cookCalcPotencyBoost

* Added CookingMgr::getCookEffectId

* Used getCookEffectId in cookCalcPotencyBoost

* Set access modifiers in CookingMgr

* Made cookCalcPotencyBoost const-correct

* Marked global init as mismatching

* Renamed CookingMgr functions in uking_functions.csv

* Added CookingMgr::prepareCookArg

* Added IngredientArray type

* Added cookWithItems

* Added CookingMgr::prepareCookArg

* Fixed getCookEffectId

* Fixed cookCalcPotencyBoost

* Made changes to prepareCookArg

* Got cookWithItems matching

* Marked vars const

* Removed commented-out destructor and UnkItem

* Renamed CookIngredient._58 to count

* Started on CookingMgr::cook

* Extracted cookAdjustItem

* Fixed ingredient setup

* Extracted actor_info_data

* Fixed some control flow for single ingredients

* Fixed more control flow for single ingredients

* Handled no effect and empty actor name

* Renamed Ingredient::_10 to used_in_recipe

* Fixed recipe control flow

* Matched cookAdjustItem

* Fixed InfoData instance uses

* Removed BAD_RECIPE label

* Rearranged to remove goto

* Added cookCalcRecipeBoost

* Extracted getCookEffectId

* Extracted isCookFailure and isMedicine

* Extracted getCookEffectIdFromTreeMap

* Extracted findIngredientByName and findIngredientByTag

* Marked nonmatching functions

* Added resetArgCookData

* Matched resetArgCookData and prepareCookArg

* Added fields and handleMessage to CookPotRoot

* Started on CookPotRoot::init_

* Added hasMonsterExtract

* Added to CookPotRoot::handleMessage_

* Removed Ingredient::_4 field

* Renamed CookItem::_224 to is_crit

* Renamed CookingEffectEntry members

* Renamed CookingMgr fields

* Changed comparison in cook

* Renamed actor_tag_iter to hash_iter and added num checks

* Got cookCalcSpiceBoost closer to matching

* Removed int_val init from cookCalcSpiceBoost

* Inlined actor_data

* Added `using namespace ksys::act`

* Moved int_val outside loop

* Marked cookCalcSpiceBoost as matching

* Rearranged cookHandleBoostSuccessInner

* Renamed cookCalcPotencyBoost to cookCalcIngredientsBoost

* Renamed stamina_recover to vitality_boost

* Renamed CookItem args to cook_item

* Renamed cookFailForMissingConfig arg

* Used IngredientArray in findIngredient functions

* Renamed crit functions

* Renamed getCookEffectId arg

* Renamed getCookEffectId to getCookEffectIdByName

* Added SetCookItemInDemo::oneShot_

* Matched SetCookItemInDemo::oneShot_

* Added comment about CookArg constructor and formatted

* Removed TODO from CookingMgr

* Marked WIP functions as non-matching

* Fixed formatting

* Matched sead::SafeArray<uking::CookIngredient, 5>::SafeArray

* Added BoostArg default member initializers

* Used auto for cooking_mgr in CookPotRoot::handleMessage_

* Used designated initializers for boost_arg and added whitespace

* Used angle brackets for sead import

* Removed [[maybe_unused]] from declaration

* Used safeDelete

* Inverted condition in CookingMgr::cookCalcCritBoost

* Added getCookingEffectEntry getter and moved CookingEffectEntry up

* Cleaned up CookingMgr::cookCalcSpiceBoost

* Used loops to init ingredient num members

* Converted CookingMgr fields to s32

* Cleaned up CookingMgr::cookCalcItemPrice

* Renamed CookItem::item_price to sell_price

* Used min and max in CookingMgr::cookCalcItemPrice

* Inlined count vars in CookingMgr::cookCalcItemPrice

* Removed explicit casts in CookingMgr::cookCalcItemPrice

* Cleaned up and reformatted CookingMgr::cookCalcIngredientsBoost

* Added casts back into CookingMgr::cookCalcItemPrice to silence warnings
2023-01-27 18:30:24 +01:00
Léo Lam 2616802996 ksys/act: Clean up RootAiFlag/RootAiFlag2 definitions and usage 2022-12-22 14:35:08 +01:00
Léo Lam 7934e14ad6 ksys/phys: Use named bools in RigidBody to improve call site readability 2022-12-17 22:10:38 +01:00
notyourav 2f62d26424 Decompile some Action classes (#104)
* various action classes

* rename instanceset fns

* rename isFork -> isChangeable
2022-10-18 08:27:57 +02:00
theo3 3d1cb480c2 auto placement work 2022-03-16 17:54:50 -07:00
theo3 20f0a07ab0 AddAutoPlacementCreator action 2022-03-15 22:59:38 -07:00
Léo Lam df36d65665 Revert "Add #ifdef declarations for NON_MATCHING code"
This reverts commit 42807160cf.

It makes searching for NON_MATCHING comment descriptions much less
convenient in most text editors or IDEs, and we want the function
CSV to be the single source of truth for function statuses. Having
a function marked as matching but not built because of a stray #ifdef
would be bad.
2022-02-27 12:50:52 +01:00
Léo Lam 28515aceb5 ksys/act/AI: Take const ref for messages 2021-10-16 20:20:58 +02:00
Léo Lam 9b4af6eb00 ksys/act/AI: Rename AI handleMessage2_ and fix parameter type 2021-10-16 20:20:55 +02:00
AlexApps99 42807160cf Add #ifdef declarations for NON_MATCHING code 2021-07-26 23:05:19 +12:00
Léo Lam c808135ef1 query: Fix matching issue in CheckRupee 2021-07-06 00:04:02 +02:00
theo3 60dd80779a match some ai::Query 2021-07-01 21:05:10 -07:00
MonsterDruide1 cd6716c3ed uking/query: Add queryCheckCurseRRetryEverOnce 2021-06-21 17:50:44 +02:00
MonsterDruide1 adcad916b7 uking/action: Add actionCurseRRematchCount 2021-06-21 17:50:00 +02:00
Léo Lam 66ae62d4d1 lib: Update EventFlow 2021-05-24 20:42:50 +02:00
Léo Lam 9610122939 ai: Fix GameDataFlagSelector destructor 2021-04-07 21:27:14 +02:00
Léo Lam e3b3ebe165 ai: Implement GameDataFlagSelector 2021-04-07 21:25:38 +02:00
Léo Lam d0d5832c8d ai: Implement Fork*AI* 2021-04-07 20:58:23 +02:00
Léo Lam 3dc1988b02 ai: Implement ForkAI 2021-04-07 20:54:25 +02:00
Léo Lam 88f69b04ec action: Implement Fork 2021-04-07 19:25:02 +02:00
Léo Lam 1bd2f03de8 query: Implement CheckGiveReward 2021-03-26 19:11:12 +01:00
Léo Lam 9e37c75996 query: Implement CheckIsOpenItemCategory 2021-03-26 19:09:00 +01:00
Léo Lam 1bff3a20cf query: Implement CheckGetDemoTypeFromArg 2021-03-26 15:08:40 +01:00
Léo Lam 0e07294548 query: Implement CheckFame 2021-03-26 14:56:24 +01:00
Léo Lam d39e8400fc query: Implement CheckContainerItem 2021-03-26 14:53:24 +01:00
Léo Lam b72b160b43 query: Implement CheckFlag 2021-03-26 14:49:46 +01:00
Léo Lam 2cbe98381e query: Implement CheckDieCnt 2021-03-26 14:46:07 +01:00
Léo Lam 6888632132 query: Fix matching issues 2021-03-26 13:54:59 +01:00
Léo Lam bc8b8d5829 query: Implement CompareGameDataTime 2021-03-26 02:04:50 +01:00
Léo Lam ce3d29d2ec query: Implement CompareGameDataInt 2021-03-26 01:30:18 +01:00
Léo Lam c5d1bd69a2 query: Implement CompareGameDataFloat 2021-03-26 01:23:31 +01:00
Léo Lam a36463b339 query: Implement CheckGameDataInt 2021-03-26 00:48:51 +01:00
Léo Lam df910092a4 uking: Implement SendMessage action 2021-01-28 19:24:44 +01:00
Léo Lam b3fa7ae230 uking: Implement GameDataConvertIntToSring action 2021-01-01 19:21:17 +01:00
Léo Lam cb33d236a3 uking: Implement GameDataAddVec3 action 2021-01-01 19:00:46 +01:00
Léo Lam f621d136c0 uking: Implement GameDataAddInt action 2021-01-01 19:00:41 +01:00
Léo Lam 8301cb80a6 uking: Implement GameDataAddFloat action 2021-01-01 19:00:23 +01:00
Léo Lam e6d0305d57 Fix type issues in Action loadParams functions 2021-01-01 18:08:26 +01:00
Léo Lam 3869e440e7 Generate AIs 2020-12-31 14:16:09 +01:00
Léo Lam 6e5c8b382d Fix some minor matching issues 2020-12-29 01:11:50 +01:00
Léo Lam 56e1c0cfd2 Action: Fix incorrect handling of inherited virtual functions 2020-12-28 23:49:15 +01:00
Léo Lam 17c7e12a0b uking: Fix matching issues in actions 2020-12-28 17:47:14 +01:00
Léo Lam 76e5987423 uking: Fix matching issue in SiteBossFlyWaitTurnToTarget
Looks like a bug *shrug*
2020-12-28 12:07:41 +01:00
Léo Lam 02c583ca4d Generate actions 2020-12-28 01:26:51 +01:00
Léo Lam 2dd52d903b uking: Implement CheckGameDataFloat query 2020-12-23 17:16:38 +01:00
Léo Lam 20a1007897 uking: Implement RandomChoiceExceptOnFlag query 2020-12-23 16:59:37 +01:00
Léo Lam e46f921611 uking: Implement RandomChoice{2,3,4,8} queries 2020-12-23 15:47:25 +01:00
Léo Lam eba2713653 Generate query factories as well 2020-12-23 14:22:24 +01:00
Léo Lam ab06c2a5ca Split src CMakeLists 2020-12-23 12:35:59 +01:00
Léo Lam f98d3ee758 Generate stubs for queries 2020-12-22 01:50:49 +01:00