initial item service implementation

This commit is contained in:
TakaRikka
2026-08-09 16:40:26 -07:00
parent 7434a0f834
commit 71b2eedc82
64 changed files with 1477 additions and 135 deletions
+7 -1
View File
@@ -2260,6 +2260,12 @@ int daAlink_c::procCoGetItemInit() {
s16 var_r22 = 0;
BOOL var_r31 = FALSE;
BOOL var_r30 = FALSE;
#if TARGET_PC
// Queued grants have no event partner, so create the demo item from the event's GtItm.
if (dusk::mods::item_give_queue_dispatching()) {
mDemo.setParam0(0x100);
}
#endif
if (mProcID == PROC_GET_ITEM || mProcID == PROC_INSECT_CATCH ||
(mProcID == PROC_PREACTION_UNEQUIP && !checkNoUpperAnime()))
{
@@ -2299,7 +2305,7 @@ int daAlink_c::procCoGetItemInit() {
}
fpc_ProcID item_partner_id = fopAcM_createItemForPresentDemo(&current.pos, item_no, 0, -1,
fopAcM_GetRoomNo(this), NULL, NULL);
fopAcM_GetRoomNo(this), NULL, NULL IF_DUSK_ARG(dusk::mods::item_give_queue_take_tag()));
if (item_partner_id != fpcM_ERROR_PROCESS_ID_e) {
dComIfGp_event_setItemPartnerId(item_partner_id);
}
+4
View File
@@ -4084,6 +4084,10 @@ void daB_DS_c::executeBattle2Dead() {
camera->mCamera.SetTrimSize(0);
dComIfGp_event_reset();
dComIfGs_onStageBossEnemy(0x13);
#if TARGET_PC
// This reward has no original grant at this point in the cutscene.
dusk::mods::item_check_enqueue("Arbiters Grounds Dungeon Reward", dItemNo_NONE_e);
#endif
/* dSv_event_flag_c::F_0265 - Arbiter's Grounds - Arbiter's Grounds clear */
dComIfGs_onEventBit(0x2010);
fopAcM_delete(this);
+1 -1
View File
@@ -170,7 +170,7 @@ void daDitem_c::actionEvent() {
if (chkDead()) {
if (!chkArgFlag(0x1)) {
execItemGet(m_itemNo);
execItemGet(m_itemNo IF_DUSK_ARG(mItemGiveTag) IF_DUSK_ARG(this));
}
if (m_itemNo == dItemNo_KAKERA_HEART_e) {
+12 -5
View File
@@ -726,11 +726,18 @@ void daE_HP_c::executeDead() {
fopAcM_onSwitch(this, bitSw);
}
dComIfGs_addPohSpiritNum();
#if TARGET_PC
mItemCheckOverridden =
dusk::mods::item_check_poe(bitSw, dItemNo_POU_SPIRIT_e, this) != dItemNo_POU_SPIRIT_e;
if (mItemCheckOverridden) {
dusk::mods::item_check_enqueue_poe(bitSw, dItemNo_POU_SPIRIT_e);
} else
#endif
dComIfGs_addPohSpiritNum();
field_0x784 = -1;
if (dComIfGs_getPohSpiritNum() == 20) {
if (dComIfGs_getPohSpiritNum() == 20 IF_DUSK(&&!mItemCheckOverridden)) {
dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[0x1c9]);
}
@@ -752,13 +759,13 @@ void daE_HP_c::executeDead() {
field_0x788 = 1;
}
}
} else if (field_0x788 != 0) {
} else if (field_0x788 != 0 IF_DUSK(|| mItemCheckOverridden)) {
fopAcM_createDisappear(this, &current.pos, 8, 3, 0xff);
fopAcM_delete(this);
} else {
if (field_0x784 == -1) {
field_0x784 = fopAcM_createItemForPresentDemo(&current.pos, dItemNo_POU_SPIRIT_e, 0, -1,
-1, 0, 0);
field_0x784 = fopAcM_createItemForPresentDemo(&current.pos, dItemNo_POU_SPIRIT_e, 0,
-1, -1, 0, 0 IF_DUSK_ARG(dusk::mods::item_give_tag_poe(bitSw)));
}
if (fopAcM_IsExecuting(field_0x784) != FALSE) {
+16 -1
View File
@@ -1132,12 +1132,20 @@ static void e_po_dead(e_po_class* i_this) {
camera_player->mCamera.Start();
camera_player->mCamera.SetTrimSize(0);
dComIfGp_event_reset();
dComIfGs_addPohSpiritNum();
#if TARGET_PC
if (dusk::mods::item_check_poe(i_this->BitSW, dItemNo_POU_SPIRIT_e, a_this) ==
dItemNo_POU_SPIRIT_e)
{
#endif
dComIfGs_addPohSpiritNum();
#if !PLATFORM_SHIELD
if (dComIfGs_getPohSpiritNum() == 0x14) {
/* dSv_event_flag_c::F_0457 - Castle Town - Revived cat */
dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[457]);
}
#endif
#if TARGET_PC
}
#endif
daPy_getPlayerActorClass()->cancelOriginalDemo();
} else if (mArg0Check(i_this, 0) != 0) {
@@ -1265,8 +1273,15 @@ static void e_po_dead(e_po_class* i_this) {
}
} else {
if (i_this->field_0x75C == -1) {
#if TARGET_PC
const u8 itemNo =
dusk::mods::item_check_poe(i_this->BitSW, dItemNo_POU_SPIRIT_e, a_this);
i_this->field_0x75C = fopAcM_createItemForPresentDemo(&a_this->current.pos, itemNo,
0, -1, -1, NULL, NULL, dusk::mods::item_give_tag_poe(i_this->BitSW));
#else
i_this->field_0x75C = fopAcM_createItemForPresentDemo(&a_this->current.pos, 0xE0, 0,
-1, -1, NULL, NULL);
#endif
}
if (fopAcM_IsExecuting(i_this->field_0x75C)) {
i_this->field_0x762 =
+3 -1
View File
@@ -1250,7 +1250,9 @@ static void demo_camera(e_rdb_class* i_this) {
}
if (iVar1 != 0) {
daPy_getPlayerActorClass()->changeDemoMode(11, 32, 0, 0);
daPy_getPlayerActorClass()->changeDemoMode(11,
DUSK_ITEM_CHECK_EXPR("Hyrule Castle King Bulblin Key", dItemNo_SMALL_KEY_e, &i_this->enemy), 0,
0);
i_this->mDemoMode = 12;
i_this->field_0x10aa = 0;
i_this->field_0xfe5 = 1;
+3 -1
View File
@@ -931,7 +931,9 @@ static void get_demo(e_th_ball_class* i_this) {
case 0:
break;
case 1:
demo_id = fopAcM_createItemForTrBoxDemo(&i_this->current.pos, dItemNo_IRONBALL_e, -1, fopAcM_GetRoomNo(i_this), NULL, NULL);
demo_id = fopAcM_createItemForTrBoxDemo(&i_this->current.pos,
DUSK_ITEM_CHECK_EXPR("Snowpeak Ruins Ball and Chain", dItemNo_IRONBALL_e, i_this), -1,
fopAcM_GetRoomNo(i_this), NULL, NULL DUSK_GIVE_TAG("Snowpeak Ruins Ball and Chain"));
JUT_ASSERT(1670, demo_id != fpcM_ERROR_PROCESS_ID_e);
i_this->mDemoMode = 2;
break;
+3 -1
View File
@@ -1744,7 +1744,9 @@ int daNpc_Aru_c::cutSpeakTo(int i_staffID) {
switch (eventId) {
case 1:
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, NULL, NULL);
DUSK_ITEM_CHECK("Herding Goats Reward", itemNo, this);
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, itemNo,
0, -1, -1, NULL, NULL DUSK_GIVE_TAG("Herding Goats Reward"));
}
if (fopAcM_IsExecuting(mItemPartnerId)) {
+3 -2
View File
@@ -1001,8 +1001,9 @@ BOOL daNpcAshB_c::EvCut_Appear(int i_staffID) {
case '0008':
local_30[0] = 0;
if (mFlow.getEventId(local_30) == 1) {
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, local_30[0], 0, -1, -1, 0, 0);
DUSK_ITEM_CHECK("Ashei Sketch", local_30[0], this);
mItemPartnerId = fopAcM_createItemForPresentDemo(
&current.pos, local_30[0], 0, -1, -1, 0, 0 DUSK_GIVE_TAG("Ashei Sketch"));
dComIfGp_event_setItemPartnerId(mItemPartnerId);
mItemPartnerId = -1;
}
+12 -1
View File
@@ -1804,8 +1804,19 @@ int daNpcChin_c::_Evt_GameSucceed_CutMain(const int& param_0) {
itemId1 = 0;
}
#if TARGET_PC
const char* itemCheckName = nullptr;
if (itemId1 == dItemNo_ARROW_LV2_e) {
itemCheckName = "STAR Prize 1";
} else if (itemId1 == dItemNo_ARROW_LV3_e) {
itemCheckName = "STAR Prize 2";
}
if (itemCheckName != nullptr) {
itemId1 = dusk::mods::item_check(itemCheckName, itemId1, this);
}
#endif
fpc_ProcID itemId2 = fopAcM_createItemForPresentDemo(&current.pos, itemId1, 0, -1, -1,
0, 0);
0, 0 IF_DUSK_ARG(dusk::mods::item_give_tag(itemCheckName)));
if (itemId2 != -1) {
dComIfGp_event_setItemPartnerId(itemId2);
}
+3 -1
View File
@@ -1333,7 +1333,9 @@ void daNpc_Fairy_c::PresentDemoCall() {
item_no = 0;
}
fpc_ProcID id = fopAcM_createItemForPresentDemo(&current.pos, item_no, 0, -1, -1, NULL, NULL);
DUSK_ITEM_CHECK("Cave of Ordeals Great Fairy Reward", item_no, this);
fpc_ProcID id = fopAcM_createItemForPresentDemo(&current.pos, item_no, 0, -1, -1, NULL,
NULL DUSK_GIVE_TAG("Cave of Ordeals Great Fairy Reward"));
if (id != fpcM_ERROR_PROCESS_ID_e) {
dComIfGp_event_setItemPartnerId(id);
}
+9 -2
View File
@@ -4018,8 +4018,15 @@ BOOL daNpc_grA_c::talk(void*) {
}
if (r26 && talkProc(NULL, TRUE, NULL)) {
if (mFlow.getEventId(&sp8) == 1) {
field_0x1480 =
fopAcM_createItemForPresentDemo(&current.pos, sp8, 0, -1, -1, NULL, NULL);
#if TARGET_PC
const char* itemCheckName = nullptr;
if (sp8 == dItemNo_BOMB_IN_BAG_e) {
itemCheckName = "Zoras Domain Underwater Goron";
sp8 = dusk::mods::item_check(itemCheckName, sp8, this);
}
#endif
field_0x1480 = fopAcM_createItemForPresentDemo(&current.pos, sp8, 0, -1, -1, NULL,
NULL IF_DUSK_ARG(dusk::mods::item_give_tag(itemCheckName)));
if (field_0x1480 != fpcM_ERROR_PROCESS_ID_e) {
s16 r25 = dComIfGp_getEventManager().getEventIdx(this, "DEFAULT_GETITEM", 0xff);
dComIfGp_getEvent()->reset(this);
+3 -1
View File
@@ -1681,7 +1681,9 @@ int daNpc_grO_c::talk(void* param_1) {
if (facePlayerFlag && talkProc(NULL, TRUE, NULL)) {
if (mType == TYPE_MINES) {
if (mFlow.getEventId(&itemId) == 1) {
mItemID = fopAcM_createItemForPresentDemo(&current.pos, itemId, 0, -1, -1, NULL, NULL);
DUSK_ITEM_CHECK("Goron Mines Gor Ebizo Key Shard", itemId, this);
mItemID = fopAcM_createItemForPresentDemo(&current.pos, itemId, 0, -1, -1,
NULL, NULL DUSK_GIVE_TAG("Goron Mines Gor Ebizo Key Shard"));
if (mItemID != fpcM_ERROR_PROCESS_ID_e) {
s16 eventIdx = dComIfGp_getEventManager().getEventIdx(this, "DEFAULT_GETITEM", 0xFF);
dComIfGp_getEvent()->reset(this);
+3 -1
View File
@@ -1338,7 +1338,9 @@ int daNpc_grR_c::talk(void* param_1) {
if (bVar1 && talkProc(NULL, TRUE, NULL)) {
if (mType == TYPE_0) {
if (mFlow.getEventId(&i_itemNo) == 1) {
mItemID = fopAcM_createItemForPresentDemo(&current.pos, i_itemNo, 0, -1, -1, NULL, NULL);
DUSK_ITEM_CHECK("Goron Mines Gor Liggs Key Shard", i_itemNo, this);
mItemID = fopAcM_createItemForPresentDemo(&current.pos, i_itemNo, 0, -1, -1,
NULL, NULL DUSK_GIVE_TAG("Goron Mines Gor Liggs Key Shard"));
if (mItemID != fpcM_ERROR_PROCESS_ID_e) {
s16 i_eventID = dComIfGp_getEventManager().getEventIdx(this, "DEFAULT_GETITEM", 0xFF);
+3 -2
View File
@@ -1190,8 +1190,9 @@ int daNpc_grS_c::talk(void* param_0) {
if (unkFlag1 && talkProc(NULL, 1, NULL)) {
if (mType == 0) {
if (mFlow.getEventId(&unkInt2) == 1) {
mPresentItemId =
fopAcM_createItemForPresentDemo(&current.pos, unkInt2, 0, -1, -1, 0, 0);
DUSK_ITEM_CHECK("Goron Mines Gor Amato Key Shard", unkInt2, this);
mPresentItemId = fopAcM_createItemForPresentDemo(&current.pos, unkInt2, 0, -1,
-1, 0, 0 DUSK_GIVE_TAG("Goron Mines Gor Amato Key Shard"));
if (mPresentItemId != fpcM_ERROR_PROCESS_ID_e) {
s16 eventIdx =
+6 -4
View File
@@ -971,8 +971,9 @@ BOOL daNpcImpal_c::EvCut_ImpalAppear1(int i_cut_index) {
if (talkProc(NULL, 1, NULL)) {
int evt_id = 0;
if (mFlow.getEventId(&evt_id) == 1) {
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, evt_id, 0, -1, -1, 0, 0);
DUSK_ITEM_CHECK("Ilia Charm", evt_id, this);
mItemPartnerId = fopAcM_createItemForPresentDemo(
&current.pos, evt_id, 0, -1, -1, 0, 0 DUSK_GIVE_TAG("Ilia Charm"));
if (mItemPartnerId != 0xffffffff) {
s16 evt_idx =
dComIfGp_getEventManager().getEventIdx(this, "DEFAULT_GETITEM", 0xff);
@@ -1060,8 +1061,9 @@ BOOL daNpcImpal_c::EvCut_CopyRod(int i_cut_index) {
case '0003':
int evt_id = 0;
if (mFlow.getEventId(&evt_id) == 1) {
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, evt_id, 0, -1, -1, 0, 0);
DUSK_ITEM_CHECK("Skybook From Impaz", evt_id, this);
mItemPartnerId = fopAcM_createItemForPresentDemo(
&current.pos, evt_id, 0, -1, -1, 0, 0 DUSK_GIVE_TAG("Skybook From Impaz"));
dComIfGp_event_setItemPartnerId(mItemPartnerId);
mItemPartnerId = -1;
}
+16 -1
View File
@@ -11,6 +11,10 @@
#include "d/d_msg_object.h"
#include <cstring>
#if TARGET_PC
static u8 s_givenInsectId = dItemNo_NONE_e;
#endif
enum Ins_RES_File_ID {
/* BCK */
/* 0x06 */ BCK_INS_F_HAPPY = 0x6,
@@ -1259,6 +1263,7 @@ int daNpcIns_c::waitPresent(void* param_1) {
daPy_py_c* player = daPy_getPlayerActorClass();
player->changeOriginalDemo();
player->changeDemoMode(0x25, 2, type, 0);
IF_DUSK(s_givenInsectId = type;)
} else {
mInsectMsgNo = 0x719;
}
@@ -1487,7 +1492,17 @@ int daNpcIns_c::talk(void* param_1) {
OS_REPORT("会話終了時 イベントID=%d アイテムNo=%d\n", eventID, itemNo);
if (eventID == 1) {
mItemID = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, NULL, NULL);
#if TARGET_PC
u32 itemGiveTag = 0;
if (s_givenInsectId != dItemNo_NONE_e) {
itemNo = dusk::mods::item_check_bug(
s_givenInsectId, itemNo & 0xFF, this);
itemGiveTag = dusk::mods::item_give_tag_bug(s_givenInsectId);
s_givenInsectId = dItemNo_NONE_e;
}
#endif
mItemID = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1,
-1, NULL, NULL IF_DUSK_ARG(itemGiveTag));
if (mItemID != fpcM_ERROR_PROCESS_ID_e) {
daPy_getPlayerActorClass()->cancelOriginalDemo();
+10 -1
View File
@@ -1181,7 +1181,16 @@ int daNpc_Kkri_c::talk(void*) {
switch (eventId) {
case 1:
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, item_no, 0, -1, -1, NULL, NULL);
#if TARGET_PC
const char* itemCheckName = nullptr;
if (item_no == dItemNo_OIL_BOTTLE3_e) {
itemCheckName = "Coro Bottle";
item_no = dusk::mods::item_check(itemCheckName, item_no, this);
}
#endif
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, item_no,
0, -1, -1, NULL,
NULL IF_DUSK_ARG(dusk::mods::item_give_tag(itemCheckName)));
}
if (fopAcM_IsExecuting(mItemPartnerId)) {
+2 -1
View File
@@ -1236,8 +1236,9 @@ int daNpc_Len_c::talk(void* param_0) {
switch (evt_id) {
case 1:
if (mItemPartnerId == -1) {
DUSK_ITEM_CHECK("Renados Letter", local_18, this);
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, local_18,
0, -1, -1, 0, 0);
0, -1, -1, 0, 0 DUSK_GIVE_TAG("Renados Letter"));
}
if (fopAcM_IsExecuting(mItemPartnerId)) {
mEvtNo = 1;
+4 -1
View File
@@ -2393,7 +2393,10 @@ int daNpc_Maro_c::cutArrowTutorial(int arg0) {
switch (evt_ret) {
case 1: {
if (mItemPartnerId == -1) {
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, evt_id, 0, -1, -1, NULL, NULL);
DUSK_ITEM_CHECK("Talo Sharpshooting", evt_id, this);
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, evt_id, 0, -1, -1,
NULL, NULL DUSK_GIVE_TAG("Talo Sharpshooting"));
}
if (fopAcM_IsExecuting(mItemPartnerId)) {
+9 -1
View File
@@ -1191,7 +1191,15 @@ int daNpc_myna2_c::ECut_gameGoalSuccess(int i_staffId) {
case 20: {
int itemNo = 0;
if (mFlow.getEventId(&itemNo) == 1) {
mItemPid = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, NULL, NULL);
#if TARGET_PC
const char* itemCheckName = nullptr;
if (itemNo == dItemNo_KAKERA_HEART_e) {
itemCheckName = "Plumm Fruit Balloon Minigame";
itemNo = dusk::mods::item_check(itemCheckName, itemNo, this);
}
#endif
mItemPid = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, NULL,
NULL IF_DUSK_ARG(dusk::mods::item_give_tag(itemCheckName)));
}
break;
}
+12 -1
View File
@@ -958,8 +958,19 @@ int daNpc_Pouya_c::cutHaveFavorToAsk(int param_0) {
switch (evt_id) {
case 1:
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
#if TARGET_PC
const char* itemCheckName = nullptr;
if (local_64 == dItemNo_DROP_BOTTLE_e) {
itemCheckName = "Jovani 20 Poe Soul Reward";
} else if (local_64 == dItemNo_SILVER_RUPEE_e) {
itemCheckName = "Jovani 60 Poe Soul Reward";
}
if (itemCheckName != nullptr) {
local_64 = dusk::mods::item_check(itemCheckName, local_64, this);
}
#endif
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, local_64, 0,
-1, -1, 0, 0);
-1, -1, 0, 0 IF_DUSK_ARG(dusk::mods::item_give_tag(itemCheckName)));
}
if (fopAcM_IsExecuting(mItemPartnerId)) {
field_0xfce = 1;
+2 -1
View File
@@ -720,7 +720,8 @@ fpc_ProcID daNpcPray_c::createHeart() {
mDoMtx_stack_c::ZXYrotS(rot);
mDoMtx_stack_c::multVec(&offset, &offset);
pos += offset;
return fopAcM_createItemForBoss(&pos, dItemNo_KAKERA_HEART_e, fopAcM_GetRoomNo(this), &rot, &size, 0.0f, 0.0f, 0);
return fopAcM_createItemForBoss(&pos, dItemNo_KAKERA_HEART_e, fopAcM_GetRoomNo(this), &rot,
&size, 0.0f, 0.0f, 0 IF_DUSK_ARG("Charlo Donation Blessing"));
}
BOOL daNpcPray_c::_Evt_GetHeart(int i_staffID) {
+6 -2
View File
@@ -1310,7 +1310,9 @@ bool daNpcRafrel_c::talk(void* param_0) {
OS_REPORT("会話終了時 イベントID=%d アイテムNo=%d\n", eventId, itemNo);
if (eventId == 1) {
field_0xe00 = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, NULL, NULL);
DUSK_ITEM_CHECK("Auru Gift To Fyer", itemNo, this);
field_0xe00 = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1,
NULL, NULL DUSK_GIVE_TAG("Auru Gift To Fyer"));
if (field_0xe00 != fpcM_ERROR_PROCESS_ID_e) {
s16 eventIdx = dComIfGp_getEventManager().getEventIdx(this, "DEFAULT_GETITEM", 0xFF);
dComIfGp_getEvent()->reset(this);
@@ -1562,7 +1564,9 @@ int daNpcRafrel_c::EvCut_Appear(int i_staffId) {
int itemNo = 0;
u16 eventId = mFlow.getEventId(&itemNo);
if (eventId == 1) {
field_0xe00 = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, NULL, NULL);
DUSK_ITEM_CHECK("Auru Gift To Fyer", itemNo, this);
field_0xe00 = fopAcM_createItemForPresentDemo(
&current.pos, itemNo, 0, -1, -1, NULL, NULL DUSK_GIVE_TAG("Auru Gift To Fyer"));
dComIfGp_event_setItemPartnerId(field_0xe00);
field_0xe00 = fpcM_ERROR_PROCESS_ID_e;
}
+2 -1
View File
@@ -823,8 +823,9 @@ BOOL daNpcThe_c::talk(void* param_0) {
}
int item_no = 0;
if (mFlow.getEventId(&item_no) == 1) {
DUSK_ITEM_CHECK("Telma Invoice", item_no, this);
mItemID = fopAcM_createItemForPresentDemo(&current.pos, item_no, 0, -1, -1,
NULL, NULL);
NULL, NULL DUSK_GIVE_TAG("Telma Invoice"));
if (mItemID != -1) {
s16 event_id = dComIfGp_getEventManager().getEventIdx(
this, "DEFAULT_GETITEM", 0xff);
+3 -2
View File
@@ -1165,8 +1165,9 @@ int daNpc_Uri_c::cutEndCarryTutorial(int param_1) {
(s32)mFlow.getEventId(&local_48) == 1)
{
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, local_48, 0, -1, -1, NULL, NULL);
DUSK_ITEM_CHECK("Uli Cradle Delivery", local_48, this);
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, local_48, 0, -1, -1,
NULL, NULL DUSK_GIVE_TAG("Uli Cradle Delivery"));
}
if (fopAcM_IsExecuting(mItemPartnerId)) {
/* T_0007 - Ordon Village - During Uli's pick-up tutorial */
+6 -4
View File
@@ -2213,8 +2213,9 @@ int daNpc_ykW_c::cutEndSnowboardRace(int param_0) {
switch (eventId) {
case 1:
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, itemId, 0,
-1, -1, 0, 0);
DUSK_ITEM_CHECK("Snowboard Racing Prize", itemId, this);
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, itemId, 0, -1,
-1, 0, 0 DUSK_GIVE_TAG("Snowboard Racing Prize"));
}
if (fopAcM_IsExecuting(mItemPartnerId)) {
@@ -2911,8 +2912,9 @@ int daNpc_ykW_c::talk(void* param_0) {
switch (eventId) {
case 1:
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, 0, 0);
DUSK_ITEM_CHECK("Snowpeak Ruins Mansion Map", itemNo, this);
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, itemNo,
0, -1, -1, 0, 0 DUSK_GIVE_TAG("Snowpeak Ruins Mansion Map"));
}
if (fopAcM_IsExecuting(mItemPartnerId)) {
+13 -2
View File
@@ -2609,8 +2609,19 @@ BOOL daNpc_zrA_c::ECut_thanksBlast(int i_staffID) {
case 31: {
int item_id = 0;
if (mFlow.getEventId(&item_id) == 1) {
mItemID = fopAcM_createItemForPresentDemo(&current.pos, item_id,
0, -1, -1, NULL, NULL);
#if TARGET_PC
const char* itemCheckName = nullptr;
if (item_id == dItemNo_BOMB_IN_BAG_e) {
itemCheckName = "Iza Helping Hand";
} else if (item_id == dItemNo_BOMB_BAG_LV2_e) {
itemCheckName = "Iza Raging Rapids Minigame";
}
if (itemCheckName != nullptr) {
item_id = dusk::mods::item_check(itemCheckName, item_id, this);
}
#endif
mItemID = fopAcM_createItemForPresentDemo(&current.pos, item_id, 0, -1, -1, NULL,
NULL IF_DUSK_ARG(dusk::mods::item_give_tag(itemCheckName)));
}
field_0x9eb = true;
break;
+3 -2
View File
@@ -1681,8 +1681,9 @@ BOOL daNpc_zrC_c::ECut_earringGet(int i_staffID) {
case 40: {
int item_no = 0;
if (mFlow.getEventId(&item_no) == 1) {
mItemID = fopAcM_createItemForPresentDemo(&current.pos, item_no,
0, -1, -1, NULL, NULL);
DUSK_ITEM_CHECK("Gift From Ralis", item_no, this);
mItemID = fopAcM_createItemForPresentDemo(
&current.pos, item_no, 0, -1, -1, NULL, NULL DUSK_GIVE_TAG("Gift From Ralis"));
}
break;
}
+3 -2
View File
@@ -1729,8 +1729,9 @@ BOOL daNpc_zrZ_c::ECut_clothesGet(int i_staffID) {
}
item_no = 0;
if (mFlow.getEventId(&item_no) == 1) {
mItemID = fopAcM_createItemForPresentDemo(&current.pos, item_no,
0, -1, -1, NULL, NULL);
DUSK_ITEM_CHECK("Rutelas Blessing", item_no, this);
mItemID = fopAcM_createItemForPresentDemo(
&current.pos, item_no, 0, -1, -1, NULL, NULL DUSK_GIVE_TAG("Rutelas Blessing"));
}
break;
+65 -14
View File
@@ -206,7 +206,7 @@ void daItem_c::CreateInit() {
initBaseMtx();
animPlay(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
if (m_itemNo == dItemNo_BOOMERANG_e) {
if (m_itemNo == dItemNo_BOOMERANG_e IF_DUSK(&&!mItemOverridden)) {
itemGetNextExecute();
} else if ((m_itemNo == dItemNo_ORANGE_RUPEE_e || m_itemNo == dItemNo_SILVER_RUPEE_e) &&
mSparkleEmtr.getEmitter() == NULL)
@@ -264,6 +264,17 @@ int daItem_c::_daItem_create() {
shape_angle.z = 0;
shape_angle.x = 0;
#if TARGET_PC
const u32 params = fopAcM_GetParam(this);
mOriginalItemNo = params & 0xFF;
const u8 resolvedItem = dusk::mods::item_check_freestanding(
daItem_prm::getItemBitNo(this), mOriginalItemNo, this);
mItemOverridden = resolvedItem != mOriginalItemNo;
mItemGiveTag = dusk::mods::item_give_tag_freestanding(daItem_prm::getItemBitNo(this));
if (mItemOverridden) {
fopAcM_SetParam(this, (params & 0xFFFFFF00) | resolvedItem);
}
#endif
field_0x95d = true;
}
@@ -507,9 +518,18 @@ void daItem_c::procInitGetDemoEvent() {
fopAcM_orderItemEvent(this, 0, 0);
eventInfo.onCondition(dEvtCnd_CANGETITEM_e);
m_item_id = fopAcM_createItemForTrBoxDemo(&current.pos, m_itemNo, -1, fopAcM_GetRoomNo(this),
NULL, NULL);
#if TARGET_PC
const u8 displayItemNo = m_itemNo;
if (mItemOverridden) {
m_itemNo = dusk::mods::item_check_tagged(mItemGiveTag, mOriginalItemNo, this);
}
#endif
m_item_id = fopAcM_createItemForTrBoxDemo(
&current.pos, m_itemNo, -1, fopAcM_GetRoomNo(this), NULL, NULL IF_DUSK_ARG(mItemGiveTag));
JUT_ASSERT(0, m_item_id != fpcM_ERROR_PROCESS_ID_e);
#if TARGET_PC
m_itemNo = displayItemNo;
#endif
setStatus(STATUS_WAIT_GET_DEMO_EVENT_e);
}
@@ -521,7 +541,7 @@ void daItem_c::procWaitGetDemoEvent() {
dComIfGp_event_setItemPartnerId(m_item_id);
}
} else {
if (m_itemNo == dItemNo_BOOMERANG_e) {
if (m_itemNo == dItemNo_BOOMERANG_e IF_DUSK(&&!mItemOverridden)) {
fopAcM_orderItemEvent(this, 0, 0);
eventInfo.onCondition(dEvtCnd_CANGETITEM_e);
return;
@@ -537,7 +557,9 @@ void daItem_c::procWaitGetDemoEvent() {
procInitSimpleGetDemo();
itemGet();
if (!haveItem) {
if (!haveItem IF_DUSK(&&(!mItemOverridden || (m_itemNo >= dItemNo_GREEN_RUPEE_e &&
m_itemNo <= dItemNo_SILVER_RUPEE_e))))
{
dComIfGs_offItemFirstBit(m_itemNo);
}
} else {
@@ -864,6 +886,12 @@ void daItem_c::itemGetNextExecute() {
procInitGetDemoEvent();
break;
default:
#if TARGET_PC
if (mItemOverridden) {
procInitGetDemoEvent();
break;
}
#endif
// "[daItem_c] Get process not defined[%d]\n"
OS_REPORT_ERROR("[daItem_c]ゲット処理が定義されていません[%d]\n", m_itemNo);
}
@@ -877,38 +905,48 @@ void daItem_c::itemGetNextExecute() {
}
void daItem_c::itemGet() {
#if TARGET_PC
const u8 displayItemNo = m_itemNo;
if (mItemOverridden) {
m_itemNo = dusk::mods::item_check_tagged(mItemGiveTag, mOriginalItemNo, this);
}
#endif
switch (m_itemNo) {
#if TARGET_PC
case dItemNo_UTAWA_HEART_e:
case dItemNo_KAKERA_HEART_e:
#endif
case dItemNo_HEART_e:
mDoAud_seStart(Z2SE_HEART_PIECE_GET, NULL, 0, 0);
execItemGet(m_itemNo);
execItemGet(m_itemNo IF_DUSK_ARG(mItemGiveTag) IF_DUSK_ARG(this));
break;
case dItemNo_GREEN_RUPEE_e:
mDoAud_seStart(Z2SE_GREEN_LUPY_GET, NULL, 0, 0);
execItemGet(m_itemNo);
execItemGet(m_itemNo IF_DUSK_ARG(mItemGiveTag) IF_DUSK_ARG(this));
break;
case dItemNo_BLUE_RUPEE_e:
mDoAud_seStart(Z2SE_BLUE_LUPY_GET, NULL, 0, 0);
execItemGet(m_itemNo);
execItemGet(m_itemNo IF_DUSK_ARG(mItemGiveTag) IF_DUSK_ARG(this));
break;
case dItemNo_YELLOW_RUPEE_e:
mDoAud_seStart(Z2SE_BLUE_LUPY_GET, NULL, 0, 0);
execItemGet(m_itemNo);
execItemGet(m_itemNo IF_DUSK_ARG(mItemGiveTag) IF_DUSK_ARG(this));
break;
case dItemNo_RED_RUPEE_e:
mDoAud_seStart(Z2SE_RED_LUPY_GET, NULL, 0, 0);
execItemGet(m_itemNo);
execItemGet(m_itemNo IF_DUSK_ARG(mItemGiveTag) IF_DUSK_ARG(this));
break;
case dItemNo_PURPLE_RUPEE_e:
mDoAud_seStart(Z2SE_RED_LUPY_GET, NULL, 0, 0);
execItemGet(m_itemNo);
execItemGet(m_itemNo IF_DUSK_ARG(mItemGiveTag) IF_DUSK_ARG(this));
break;
case dItemNo_ORANGE_RUPEE_e:
mDoAud_seStart(Z2SE_RED_LUPY_GET, NULL, 0, 0);
execItemGet(m_itemNo);
execItemGet(m_itemNo IF_DUSK_ARG(mItemGiveTag) IF_DUSK_ARG(this));
break;
case dItemNo_SILVER_RUPEE_e:
mDoAud_seStart(Z2SE_RED_LUPY_GET, NULL, 0, 0);
execItemGet(m_itemNo);
execItemGet(m_itemNo IF_DUSK_ARG(mItemGiveTag) IF_DUSK_ARG(this));
break;
case dItemNo_BOOMERANG_e:
break;
@@ -918,12 +956,25 @@ void daItem_c::itemGet() {
case dItemNo_ARROW_1_e:
case dItemNo_PACHINKO_SHOT_e:
mDoAud_seStart(Z2SE_CONSUMP_ITEM_GET, NULL, 0, 0);
execItemGet(m_itemNo);
execItemGet(m_itemNo IF_DUSK_ARG(mItemGiveTag) IF_DUSK_ARG(this));
#if TARGET_PC
break;
#endif
default:
#if TARGET_PC
if (mItemOverridden) {
mDoAud_seStart(Z2SE_CONSUMP_ITEM_GET, NULL, 0, 0);
execItemGet(m_itemNo, mItemGiveTag, this);
break;
}
#endif
// "[daItem_c] Get process not defined[%d]\n"
OS_REPORT_ERROR("[daItem_c]ゲット処理が定義されていません[%d]\n", m_itemNo);
break;
}
#if TARGET_PC
m_itemNo = displayItemNo;
#endif
}
BOOL daItem_c::checkCountTimer() {
+39 -2
View File
@@ -97,6 +97,12 @@ int daObjLife_c::Create() {
field_0x94c = 0.7f;
mRotateSpeed = 7000;
#if TARGET_PC
if (mOverrideHover) {
fopAcM_SetGravity(this, 0.0f);
mRotateSpeed = 550;
}
#endif
setEffect();
mSound.init(&current.pos, 1);
return 1;
@@ -140,6 +146,27 @@ int daObjLife_c::create() {
home.angle.x = home.angle.z = 0;
current.angle.x = current.angle.z = 0;
shape_angle.x = shape_angle.z = 0;
#if TARGET_PC
const u32 params = fopAcM_GetParam(this);
const u8 parameterItemNo = params & 0xFF;
if (mItemGiveOriginalNo == dItemNo_NONE_e) {
mOriginalItemNo = parameterItemNo;
const u8 resolvedItem =
dusk::mods::item_check_freestanding(getSaveBitNo(), mOriginalItemNo, this);
mItemGiveTag = dusk::mods::item_give_tag_freestanding(getSaveBitNo());
mItemOverridden = resolvedItem != mOriginalItemNo;
if (mItemOverridden) {
fopAcM_SetParam(this, (params & 0xFFFFFF00) | resolvedItem);
}
} else {
mOriginalItemNo = mItemGiveOriginalNo;
mItemOverridden = parameterItemNo != mItemGiveOriginalNo;
}
mOverrideHover =
mItemOverridden &&
(mOriginalItemNo == dItemNo_UTAWA_HEART_e ||
(mOriginalItemNo >= dItemNo_M_BEETLE_e && mOriginalItemNo <= dItemNo_F_MAYFLY_e));
#endif
mIsPrmsInit = true;
}
@@ -153,7 +180,7 @@ int daObjLife_c::create() {
return cPhs_ERROR_e;
}
if (m_itemNo == dItemNo_UTAWA_HEART_e && dComIfGs_isStageLife()) {
if (m_itemNo == dItemNo_UTAWA_HEART_e && dComIfGs_isStageLife() IF_DUSK(&&!mItemOverridden)) {
return cPhs_ERROR_e;
}
@@ -296,8 +323,18 @@ int daObjLife_c::initActionOrderGetDemo() {
fopAcM_orderItemEvent(this, 0, 0);
eventInfo.onCondition(dEvtCnd_CANGETITEM_e);
mItemId = fopAcM_createItemForTrBoxDemo(&current.pos, m_itemNo, -1, fopAcM_GetRoomNo(this), NULL, NULL);
#if TARGET_PC
const u8 displayItemNo = m_itemNo;
if (mItemOverridden) {
m_itemNo = dusk::mods::item_check_tagged(mItemGiveTag, mOriginalItemNo, this);
}
#endif
mItemId = fopAcM_createItemForTrBoxDemo(
&current.pos, m_itemNo, -1, fopAcM_GetRoomNo(this), NULL, NULL IF_DUSK_ARG(mItemGiveTag));
JUT_ASSERT(699, mItemId != fpcM_ERROR_PROCESS_ID_e);
#if TARGET_PC
m_itemNo = displayItemNo;
#endif
setStatus(STATUS_ORDER_GET_DEMO_e);
return 1;
+4 -2
View File
@@ -109,6 +109,7 @@ int daItemShield_c::__CreateHeap() {
int daItemShield_c::create() {
fopAcM_ct(this, daItemShield_c);
m_itemNo = dItemNo_WOOD_SHIELD_e;
DUSK_ITEM_CHECK("Ordon Shield", m_itemNo, this);
if (fopAcM_isSwitch(this, getSwBit2())) {
OS_REPORT("木の盾:もう取ったので出ません\n");
return cPhs_ERROR_e;
@@ -240,8 +241,9 @@ int daItemShield_c::initActionOrderGetDemo() {
daItemBase_c::hide();
fopAcM_orderItemEvent(this, 0, 0);
eventInfo.onCondition(dEvtCnd_CANGETITEM_e);
mItemId =
fopAcM_createItemForTrBoxDemo(&current.pos, m_itemNo, -1, fopAcM_GetRoomNo(this), 0, 0);
mItemId = fopAcM_createItemForTrBoxDemo(&current.pos,
DUSK_ITEM_CHECK_EXPR("Ordon Shield", dItemNo_WOOD_SHIELD_e, this), -1,
fopAcM_GetRoomNo(this), 0, 0 DUSK_GIVE_TAG("Ordon Shield"));
JUT_ASSERT(682, mItemId != fpcM_ERROR_PROCESS_ID_e)
setStatus(STATUS_ORDERGETDEMO);
return 1;
+4 -2
View File
@@ -37,6 +37,7 @@ int daObjSword_c::Create() {
cPhs_Step daObjSword_c::create() {
fopAcM_ct(this, daObjSword_c);
m_itemNo = 0x28;
DUSK_ITEM_CHECK("Ordon Sword", m_itemNo, this);
if (fopAcM_isItem(this, getItemBit())) {
return cPhs_ERROR_e;
}
@@ -71,8 +72,9 @@ int daObjSword_c::initActionOrderGetDemo() {
hide();
fopAcM_orderItemEvent(this, 0, 0);
eventInfo.onCondition(8);
mProcID = fopAcM_createItemForTrBoxDemo(&current.pos, m_itemNo, -1, fopAcM_GetRoomNo(this),
NULL, NULL);
mProcID =
fopAcM_createItemForTrBoxDemo(&current.pos, DUSK_ITEM_CHECK_EXPR("Ordon Sword", 0x28, this),
-1, fopAcM_GetRoomNo(this), NULL, NULL DUSK_GIVE_TAG("Ordon Sword"));
setStatus(1);
return 1;
}
+3 -2
View File
@@ -255,8 +255,9 @@ int daObjWStatue_c::initActionOrderGetDemo() {
s16 eventIdx = dComIfGp_getEventManager().getEventIdx(this, "DEFAULT_GETITEM", 0xff);
dComIfGp_getEvent()->reset(this);
fopAcM_orderChangeEventId(this, eventIdx, 1, 0xffff);
mItemId = fopAcM_createItemForTrBoxDemo(&current.pos, m_itemNo, 0xffffffff,
fopAcM_GetRoomNo(this), 0, 0);
mItemId = fopAcM_createItemForTrBoxDemo(&current.pos,
DUSK_ITEM_CHECK_EXPR("Wooden Statue", m_itemNo, this), 0xffffffff, fopAcM_GetRoomNo(this),
0, 0 DUSK_GIVE_TAG("Wooden Statue"));
JUT_ASSERT(544, mItemId != fpcM_ERROR_PROCESS_ID_e);
setStatus(STATUS_ORDER_GET_DEMO);
return 1;
+1
View File
@@ -32,6 +32,7 @@ int daObjZCloth_c::Create() {
int daObjZCloth_c::create() {
fopAcM_ct(this, daObjZCloth_c);
m_itemNo = 0x31;
DUSK_ITEM_CHECK("Rutelas Blessing", m_itemNo, this);
int phase = dComIfG_resLoad(&mPhase, dItem_data::getFieldArc(m_itemNo));
if (phase == cPhs_COMPLEATE_e) {
if (!fopAcM_entrySolidHeap(this, (heapCallbackFunc)CheckFieldItemCreateHeap, 0x2fb0)) {
+59 -16
View File
@@ -11,6 +11,20 @@
#include "m_Do/m_Do_lib.h"
#include <cstring>
#if TARGET_PC
#include "d/d_item_data.h"
const ResourceData& daShopItem_c::getResourceData() const {
if (mItemOverridden) {
return mOverrideData;
}
return mData[mShopItemID];
}
#define SHOP_RESOURCE_DATA getResourceData()
#else
#define SHOP_RESOURCE_DATA mData[mShopItemID]
#endif
const char* daShopItem_c::getShopArcname() {
switch (m_itemNo) {
case dItemNo_NONE_e:
@@ -88,7 +102,29 @@ const char* daShopItem_c::getShopArcname() {
return NULL;
}
return mData[mShopItemID].get_arcName();
#if TARGET_PC
if (m_itemNo != dItemNo_NONE_e && mItemGiveOriginalNo == dItemNo_NONE_e) {
mItemGiveOriginalNo = m_itemNo;
const u8 resolvedItem = dusk::mods::item_check_shop(mItemGiveOriginalNo, this);
mItemOverridden = resolvedItem != mItemGiveOriginalNo;
if (mItemOverridden) {
mOverrideData = mData[mShopItemID];
mOverrideData.mArcName = dItem_data::getArcName(resolvedItem);
mOverrideData.mBmdName = dItem_data::getBmdName(resolvedItem);
mOverrideData.mBtkName = dItem_data::getBtkName(resolvedItem);
mOverrideData.mBckName = dItem_data::getBckName(resolvedItem);
mOverrideData.mBrkName = dItem_data::getBrkName(resolvedItem);
mOverrideData.mBtpName = dItem_data::getBtpName(resolvedItem);
mOverrideData.mTevFrm = dItem_data::getTevFrm(resolvedItem);
mOverrideData.mBtpFrm = -1;
mOverrideData.mFlag = static_cast<u32>(-1);
mOverrideData.mOffsetY = mShopItemID == SHOP_ITEMNO_ARMOR ? 60.0f : 15.0f;
mOverrideData.mScale = 1.0f;
}
}
#endif
return SHOP_RESOURCE_DATA.get_arcName();
}
DUSK_GAME_DATA const f32 daShopItem_c::m_cullfar_max = 5000.0f;
@@ -104,6 +140,11 @@ u16 daShopItem_c::getHeapSize() {
OS_REPORT("ShopItemID [%u]\n", a_ShopItemID);
ASSERT(a_ShopItemID < SHOP_ITEMNO_MAX);
#if TARGET_PC
if (mItemOverridden) {
return 0x8000;
}
#endif
return HeapSizeTbl[a_ShopItemID];
}
@@ -119,11 +160,11 @@ void daShopItem_c::CreateInit() {
if (strcmp("R_SP109", dComIfGp_getStartStageName()) == 0 && dComIfGp_getStartStageRoomNo() == 1)
{
scale.set(mData[mShopItemID].get_scale() * 0.8f, mData[mShopItemID].get_scale() * 0.8f,
mData[mShopItemID].get_scale() * 0.8f);
scale.set(SHOP_RESOURCE_DATA.get_scale() * 0.8f, SHOP_RESOURCE_DATA.get_scale() * 0.8f,
SHOP_RESOURCE_DATA.get_scale() * 0.8f);
} else {
scale.set(mData[mShopItemID].get_scale(), mData[mShopItemID].get_scale(),
mData[mShopItemID].get_scale());
scale.set(SHOP_RESOURCE_DATA.get_scale(), SHOP_RESOURCE_DATA.get_scale(),
SHOP_RESOURCE_DATA.get_scale());
}
home.pos = current.pos;
@@ -137,8 +178,8 @@ void daShopItem_c::set_mtx() {
if (daShopItem_prm::getGroup(this) == 15) {
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
} else {
mDoMtx_stack_c::transS(current.pos.x, current.pos.y + mData[mShopItemID].get_offsetY(),
current.pos.z);
mDoMtx_stack_c::transS(
current.pos.x, current.pos.y + SHOP_RESOURCE_DATA.get_offsetY(), current.pos.z);
}
MTXCopy(mDoMtx_stack_c::get(), mMtx);
@@ -147,8 +188,8 @@ void daShopItem_c::set_mtx() {
if (daShopItem_prm::getGroup(this) == 15) {
mDoMtx_stack_c::ZXYrotM(-11300, 32700, 7300);
} else {
mDoMtx_stack_c::ZXYrotM(mAngleX + mData[mShopItemID].get_angleX(),
mData[mShopItemID].get_angleY(), mData[mShopItemID].get_angleZ());
mDoMtx_stack_c::ZXYrotM(mAngleX + SHOP_RESOURCE_DATA.get_angleX(),
SHOP_RESOURCE_DATA.get_angleY(), SHOP_RESOURCE_DATA.get_angleZ());
}
mDoMtx_stack_c::ZXYrotM(current.angle.x, current.angle.y, current.angle.z);
@@ -156,7 +197,7 @@ void daShopItem_c::set_mtx() {
if (daShopItem_prm::getGroup(this) == 15) {
mDoMtx_stack_c::XrotM(0);
} else {
mDoMtx_stack_c::XrotM(mData[mShopItemID].get_angleOffsetX());
mDoMtx_stack_c::XrotM(SHOP_RESOURCE_DATA.get_angleOffsetX());
}
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
@@ -190,29 +231,31 @@ void daShopItem_c::setShadow() {
}
BOOL daShopItem_c::chkFlag(int i_flag) {
return mData[mShopItemID].get_flag() & i_flag;
return SHOP_RESOURCE_DATA.get_flag() & i_flag;
}
s8 daShopItem_c::getTevFrm() {
return mData[mShopItemID].get_tevfrm();
return SHOP_RESOURCE_DATA.get_tevfrm();
}
s8 daShopItem_c::getBtpFrm() {
return mData[mShopItemID].get_btpfrm();
return SHOP_RESOURCE_DATA.get_btpfrm();
}
u8 daShopItem_c::getShadowSize() {
return mData[mShopItemID].get_shadowSize();
return SHOP_RESOURCE_DATA.get_shadowSize();
}
u8 daShopItem_c::getCollisionH() {
return mData[mShopItemID].get_collisionH();
return SHOP_RESOURCE_DATA.get_collisionH();
}
u8 daShopItem_c::getCollisionR() {
return mData[mShopItemID].get_collisionR();
return SHOP_RESOURCE_DATA.get_collisionR();
}
#undef SHOP_RESOURCE_DATA
int daShopItem_c::_create() {
fopAcM_ct(this, daShopItem_c);
+5 -3
View File
@@ -362,9 +362,11 @@ int daTagStatue_c::demoProc() {
item = dItemNo_AIR_LETTER_e;
}
mItemId =
fopAcM_createItemForTrBoxDemo(&current.pos, item, -1,
fopAcM_GetRoomNo(this), 0, 0);
#if TARGET_PC
item = dusk::mods::item_check_sky_character(item & 0xFF, this);
#endif
mItemId = fopAcM_createItemForTrBoxDemo(&current.pos, item, -1,
fopAcM_GetRoomNo(this), 0, 0 IF_DUSK_ARG(dusk::mods::item_give_tag_sky_character()));
JUT_ASSERT(580, mItemId != fpcM_ERROR_PROCESS_ID_e);
+13 -2
View File
@@ -1390,6 +1390,10 @@ u8 daTbox_c::getBombItemNoMain(u8 i_itemNo) {
int daTbox_c::setGetDemoItem() {
u8 item_no = getItemNo();
#if TARGET_PC
const u32 giveTag = dusk::mods::item_give_tag_chest(getTboxNo());
item_no = dusk::mods::item_check_tagged(giveTag, mOriginalItemNo, this);
#endif
if (item_no == dItemNo_BOMB_5_e || item_no == dItemNo_BOMB_10_e || item_no == dItemNo_BOMB_20_e || item_no == dItemNo_BOMB_30_e ||
item_no == dItemNo_WATER_BOMB_5_e || item_no == dItemNo_WATER_BOMB_10_e || item_no == dItemNo_WATER_BOMB_20_e || item_no == dItemNo_WATER_BOMB_30_e ||
item_no == dItemNo_BOMB_INSECT_5_e || item_no == dItemNo_BOMB_INSECT_10_e || item_no == dItemNo_BOMB_INSECT_20_e || item_no == dItemNo_BOMB_INSECT_30_e)
@@ -1399,9 +1403,11 @@ int daTbox_c::setGetDemoItem() {
fpc_ProcID item_id;
if (field_0x718) {
item_id = fopAcM_createItemForPresentDemo(&current.pos, item_no, 1, -1, -1, NULL, NULL);
item_id = fopAcM_createItemForPresentDemo(
&current.pos, item_no, 1, -1, -1, NULL, NULL IF_DUSK_ARG(giveTag));
} else {
item_id = fopAcM_createItemForTrBoxDemo(&current.pos, item_no, -1, -1, NULL, NULL);
item_id = fopAcM_createItemForTrBoxDemo(
&current.pos, item_no, -1, -1, NULL, NULL IF_DUSK_ARG(giveTag));
}
if (item_id != fpcM_ERROR_PROCESS_ID_e) {
@@ -1785,6 +1791,11 @@ void daTbox_c::mode_exec() {
cPhs_Step daTbox_c::create1st() {
if (!mParamsInit) {
field_0x980 = home.angle.x;
#if TARGET_PC
mOriginalItemNo = (home.angle.z >> 8) & 0xFF;
const u8 resolvedItem = dusk::mods::item_check_chest(getTboxNo(), mOriginalItemNo, this);
home.angle.z = static_cast<s16>((home.angle.z & ~0xFF00) | (resolvedItem << 8));
#endif
field_0x982 = home.angle.z;
home.angle.z = 0;
home.angle.x = 0;
+7
View File
@@ -45,6 +45,12 @@ int CheckShopItemCreateHeap(fopAc_ac_c* i_this) {
daShopItem_c* a_this1 = static_cast<daShopItem_c*>(i_this);
daShopItem_c* a_this2 = static_cast<daShopItem_c*>(i_this);
#if TARGET_PC
const ResourceData& data = a_this2->getResourceData();
return a_this1->CreateItemHeap(data.get_arcName(), data.get_bmdName(), data.get_btk1Name(),
data.get_bpk1Name(), data.get_bck1Name(), data.get_bxa1Name(), data.get_brk1Name(),
data.get_btp1Name());
#else
u8 a_ShopItemID = a_this2->getShopItemID();
return a_this1->CreateItemHeap(daShopItem_c::mData[a_ShopItemID].get_arcName(),
daShopItem_c::mData[a_ShopItemID].get_bmdName(),
@@ -54,4 +60,5 @@ int CheckShopItemCreateHeap(fopAc_ac_c* i_this) {
daShopItem_c::mData[a_ShopItemID].get_bxa1Name(),
daShopItem_c::mData[a_ShopItemID].get_brk1Name(),
daShopItem_c::mData[a_ShopItemID].get_btp1Name());
#endif
}
+8
View File
@@ -335,6 +335,14 @@ bool dEvent_manager_c::setObjectArchive(DUSK_CONST char* arcname) {
if (arcname != NULL) {
rt = dComIfG_getObjectRes(arcname, DataFileName);
#if TARGET_PC
if (rt != nullptr && strcmp(arcname, "Prayer") == 0) {
// pointer to Prayer event `011get_item` prm0 in it's event_list.dat
u8* itemNo = static_cast<u8*>(rt) + 0x927;
*itemNo =
dusk::mods::item_check("Charlo Donation Blessing", dItemNo_KAKERA_HEART_e, NULL);
}
#endif
int base_status = mEventList[BASE_ACTOR].init((char*)rt, -1);
#if DEBUG
+2 -1
View File
@@ -274,8 +274,9 @@ inline void getItemFunc(u8 i_itemNo) {
item_func_ptr[i_itemNo]();
}
void execItemGet(u8 i_itemNo) {
void execItemGet(u8 i_itemNo IF_DUSK_ARG(u32 i_itemGiveTag) IF_DUSK_ARG(fopAc_ac_c* i_giver)) {
getItemFunc(i_itemNo);
IF_DUSK(dusk::mods::item_granted(i_itemNo, i_itemGiveTag, i_giver);)
}
static int (*item_getcheck_func_ptr[256])() = {
+16 -4
View File
@@ -905,8 +905,16 @@ int dShopSystem_c::seq_start(fopAc_ac_c* actor, dMsgFlow_c* i_flow) {
int itemNo;
if (mFlow.getEventId(&itemNo) == 1) {
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
mItemPartnerId = fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1,
-1, NULL, NULL);
#if TARGET_PC
const char* itemCheckName = nullptr;
if (itemNo == dItemNo_HALF_MILK_BOTTLE_e) {
itemCheckName = "Ordon Cat Rescue";
itemNo = dusk::mods::item_check(itemCheckName, itemNo, actor);
}
#endif
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, NULL,
NULL IF_DUSK_ARG(dusk::mods::item_give_tag(itemCheckName)));
}
if (fpcEx_IsExist(mItemPartnerId)) {
@@ -1195,8 +1203,12 @@ int dShopSystem_c::seq_decide_yes(fopAc_ac_c* actor, dMsgFlow_c* i_flow) {
if (mFlow.getEventId(&itemNo) == 1) {
if (i_flow->doFlow(actor, NULL, 0)) {
if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) {
mItemPartnerId =
fopAcM_createItemForPresentDemo(&current.pos, itemNo, 0, -1, -1, NULL, NULL);
#if TARGET_PC
const u32 itemGiveTag = dusk::mods::item_give_tag_shop(itemNo & 0xFF);
itemNo = dusk::mods::item_check_shop(itemNo & 0xFF, actor);
#endif
mItemPartnerId = fopAcM_createItemForPresentDemo(
&current.pos, itemNo, 0, -1, -1, NULL, NULL IF_DUSK_ARG(itemGiveTag));
}
if (fpcEx_IsExist(mItemPartnerId)) {