BOOL CVirusKillerDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here //宏定义函数指针类型 typedef int ( WINAPI *SKINH_ATTACHEX)(LPCTSTR strSkinFile,LPCTSTR strPassword); // 取得SKINH_ATTACHEX函数的地址 SKINH_ATTACHEX pFunc = (SKINH_ATTACHEX)::GetProcAddress(::LoadLibrary("SkinH.dll"), "SkinH_AttachEx"); if(pFunc) { pFunc(_T("skin\\dogmax.she"), NULL); } else { MessageBox(_T("皮肤库加载失败!"),_T("缺少SkinH.dll")); } InitItem(); return TRUE; // return TRUE unless you set the focus to a control }
void DataValueIterator::advance() { CurRepeatOffset++; if(CurRepeatOffset >= CurRepeatCount) { ValueOffset++; if(ValueOffset < Values.size()) InitItem(); } }
void FLGameBlock::InitBlock(int type) { CCAssert(type >= 0 && type < 7 , "type error!"); InitItem((const int*)BLOCK_TYPE_VALUE[type]); SetBlockXY(8,0); setVisible(true); }
void CreateObject(Map *map) { int i; InitEnemy(); InitItem(); InitBomb(); InitEffect(); for (i = 0; i < map->objectNum; i++) { float x = (float)map->object[i].x * BLOCK_WIDTH; float y = (float)map->object[i].y * BLOCK_HEIGHT; char type = map->object[i].type; int r; if (type == PLAYER) { InitPlayer(x, y); } r = CreateEnemy(type, x, y); if (r) { continue; } CreateItem(type, x, y); } MoveMap(map); }
DataValueIterator(ArrayRef<Expr*> Vals) : Values(Vals), ValueOffset(0) { InitItem(); }
BOOL CGambleSystem::DefaultItemToStore(playerCharacter_t* pPc, storeStruct_t* pMakestore) { if ( pMakestore == NULL) return FALSE; int ItemPos =0; for( int StorePageIdx = 0; StorePageIdx < MAX_NUMBER_OF_STORE_ITEM_PAGE; StorePageIdx ++ ) { int PageRegCount =0; for( int SlotIdx = 0; SlotIdx < MAX_NUMBER_OF_STORE_GENERATE_ITEM ; SlotIdx ++ ) { ItemPos = pMakestore->itemNumber; if ( ItemPos < 0 || ItemPos >= MAX_NUMBER_OF_STORE_ITEM) return FALSE; InitItem( &pMakestore->item[ItemPos].item ); int itemTableIdx = pMakestore->defaultItem[StorePageIdx].itemIndex[SlotIdx]; if ( itemTableIdx < 0 || itemTableIdx >= MAX_NUMBER_OF_ITEM_TABLE) continue; SpawnItem ( &pMakestore->item[ItemPos].item, itemTableIdx ); pMakestore->item[ItemPos].page = StorePageIdx; pMakestore->item[ItemPos].maxNumber = pMakestore->defaultItem[StorePageIdx].itemNumber[SlotIdx]; pMakestore->item[ItemPos].curNumber = pMakestore->defaultItem[StorePageIdx].itemNumber[SlotIdx]; int Selecteditemidx = SelectCollectedItem(&pMakestore->item[ItemPos]); float AddPrice = (rand() %( (int)g_logic.GamblePriceRate ) )* 0.01; int CalPrice = 0; if ( pMakestore->item[ItemPos].item.itemTableIdx == QUESTION_MARK_ITEM_TABLE_IDX) { pPc->RegGamblePrice[ItemPos] = g_itemTable[QUESTION_MARK_ITEM_TABLE_IDX].gambleCost; pMakestore->item[ItemPos].price = g_itemTable[QUESTION_MARK_ITEM_TABLE_IDX].gambleCost; } else { if ( GTH_Random() > 0.5 ) { CalPrice = g_itemTable[Selecteditemidx].gambleCost + (int)( ((float)(g_itemTable[Selecteditemidx].gambleCost) * AddPrice ) + 0.5f); } else { CalPrice = g_itemTable[Selecteditemidx].gambleCost - (int)( ((float)(g_itemTable[Selecteditemidx].gambleCost) * AddPrice ) + 0.5f); } if ( CalPrice < 0) CalPrice = 1; pPc->RegGamblePrice[ItemPos] = CalPrice; pMakestore->item[ItemPos].price = CalPrice; } PageRegCount++; pPc->RegGambleItems[ItemPos] = Selecteditemidx; pMakestore->itemNumber++; } } return TRUE; }