void APlayerCharacter::CheckIfCanCraft(FCraftingStruct Item) { TSubclassOf<AInventoryItem> AItem; TSubclassOf<AInventoryItem> BItem; GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("checking..."))); uint8 NumbInventoryItems = ItemInventoryStructure.Num(); //Gets number of items within data table. for (uint8 i = 0; i < NumbInventoryItems; i++) { if (ItemInventoryStructure[i].ItemClass == Item.CraftA) { CraftAFound = true; AItem = ItemInventoryStructure[i].ItemClass; } if (ItemInventoryStructure[i].ItemClass == Item.CraftB) { CraftBFound = true; BItem = ItemInventoryStructure[i].ItemClass; } if(CraftAFound && CraftBFound) { GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Item is craftable"))); ItemInventoryStructure.RemoveAt(i); UpdateInventory(); }else { } CraftAFound = false; CraftBFound = false; } }
short CObjUSER::Add_ITEM (tagITEM &sITEM) { short nRet = CUserDATA::Add_ITEM( sITEM ); m_ItemSlot.AddItem( sITEM ); UpdateInventory(); return nRet; }
short CObjUSER::Add_CatchITEM (short nListRealNO, tagITEM &sITEM) { short nRet = CUserDATA::Add_CatchITEM( nListRealNO, sITEM ); if( sITEM.GetTYPE() != ITEM_TYPE_MONEY ) { m_ItemSlot.AddItem( nListRealNO, sITEM ); UpdateInventory(); } ///When the item is entered in the inventory g_pSoundLIST->IDX_PlaySound( SID_GETTING_ITEM ); return nRet; }
void CObjUSER::SubActiveBulletQuantity( ) { tagITEM sItem; sItem.m_cType = ITEM_TYPE_WEAPON; sItem.m_nItemNo = Get_R_WEAPON(); int iBulletNo = 0; int iShotType = sItem.GetShotTYPE(); if( iShotType >= MAX_SHOT_TYPE ) return; CItem* pItem = m_ItemSlot.GetItem( INVENTORY_SHOT_ITEM0 + iShotType ); if( pItem == NULL ) { assert( pItem && "Not Found Bullet @CObjUSER::SubActiveBulletQuantity() " ); return; } #ifdef _DEBUG g_itMGR.AppendChatMsg( "Bullet consumption", IT_MGR::CHAT_TYPE_ALL ); #endif pItem->SubQuantity( 1 ); m_ItemSlot.ChangeItemStatus( INVENTORY_SHOT_ITEM0 + iShotType ); ///Deleted from inventory ///gsv_SET_BULLET If you set the value to 0 (if known has used up); if( CObjAVT::m_ShotData[ iShotType ].m_nItemNo == 0 ) { //semi-automatic bullet. short nFindSLOT = m_Inventory.FindITEM( pItem->GetItem() ); if ( nFindSLOT >= 0 ) { ClearITEM( INVENTORY_SHOT_ITEM0 + iShotType ); g_pNet->Send_cli_SET_BULLET( iShotType, nFindSLOT ); } else { ClearITEM( INVENTORY_SHOT_ITEM0 + iShotType ); UpdateAbility(); g_itMGR.AppendChatMsg( STR_WARN_BULLET_USEUP, IT_MGR::CHAT_TYPE_SYSTEM ); D3DVECTOR PosSCR; g_pAVATAR->GetScreenPOS( PosSCR ); g_pNet->Send_cli_STOP( PosSCR ); } } UpdateInventory(); }
void CObjUSER::UpdateAbility() { //PY don't need these at all Cal_BattleAbility(); Calc_AruaAddAbility(); // changing the position of UpdateInventory () and Update_SPEED (). UpdateInventory();///The maximum amount of possession may have been changed. //PY: I just sent in the move speed from the server. Why would i want it to be calculated again so that the damn values are different? //just NO. Commenting this out //Update_SPEED(); }
void CObjUSER::Set_ITEM_UseSeparate(short nListRealNO, tagITEM& sITEM) { tagITEM* pItem = &(CUserDATA::m_Inventory.m_ItemLIST[ nListRealNO ] ); ///The items on the existing slots and redundant ... possible, and increase only if the same item is Count. if( !pItem->IsEmpty() && !sITEM.IsEmpty() && sITEM.IsEnableDupCNT() && pItem->IsEqual ( sITEM.GetTYPE(), sITEM.GetItemNO() ) ) { CUserDATA::m_Inventory.m_ItemLIST[ nListRealNO ].m_uiQuantity += sITEM.m_uiQuantity; GetItemSlot()->ChangeItemStatus( nListRealNO ); } else { CUserDATA::Set_ITEM( nListRealNO, sITEM ); if( !sITEM.IsEmpty() ) { if( (nListRealNO > 0 && nListRealNO < INVENTORY_ITEM_INDEX_0) || (nListRealNO >= INVENTORY_SHOT_ITEM0 && nListRealNO < INVENTORY_SHOT_ITEM0 + MAX_SHOT_TYPE ) )///장착시 g_pSoundLIST->IDX_PlaySound( ITEM_EQUIP_SOUND( sITEM.GetTYPE(), sITEM.GetItemNO() ) ); } } ///m_ItemSlot의 Add,Sub,DelItem은 CUserDATA::Set_ITEM에서 호출된다. //m_ItemSlot.SetItem( nListRealNO, sITEM ); if( nListRealNO >= INVENTORY_RIDE_ITEM0 && nListRealNO < INVENTORY_RIDE_ITEM0 + MAX_RIDING_PART ) { if( !sITEM.IsEmpty() ) { int iItemIDX = sITEM.GetItemNO(); if( nListRealNO == INVENTORY_RIDE_ITEM0 ) g_pAVATAR->SetPetType( PAT_ITEM_PART_TYPE( iItemIDX ) ); g_pAVATAR->SetPetParts( nListRealNO - INVENTORY_RIDE_ITEM0, iItemIDX ); } else { g_pAVATAR->SetPetParts( nListRealNO - INVENTORY_RIDE_ITEM0, 0 ); } } UpdateInventory(); }
void CObjUSER::ClearITEM(WORD wListRealNO) { CUserDATA::ClearITEM( wListRealNO ); m_ItemSlot.DelItem( wListRealNO ); UpdateInventory(); }
void CObjUSER::Sub_ITEM(short nListRealNO, tagITEM &sITEM) { CUserDATA::Sub_ITEM( nListRealNO, sITEM ); m_ItemSlot.SubItem( nListRealNO, sITEM ); UpdateInventory(); }