CWinEnemyEditor::CWinEnemyEditor(CData* data, CConfig* config, CFile* file) { // 以下はデフォルト値です。 // オブジェクト作成後に調整してください。 m_dpos.x = 0; m_dpos.y = 0; m_cur.y = 0; m_wpos.x = 1; m_wpos.y = 1; m_winx = 0; // 窓の表示開始位置(常に0) m_winy = 0; // 窓の表示開始位置(常に0) m_winw = COLS / 2; // 窓の幅(全角でカウント) m_winh = LINES; // 窓の高さ m_maxwidth = 0; // 文字列の最大幅 m_enemynum = 0; // 読み込んだ敵キャラの数 m_data = data; // データ格納 m_config = config; // コンフィグ格納 m_file = file; // ファイルハンドラ格納 // ここでシナリオを読み込め(不要) // 敵キャラ一括読み込みして、ついでにセレクトリスト用に保存する read_enemy_list(); // アイテム一括読み込みしてセレクトリスト用に保存する read_item_list(); // 属性リストをセレクトリスト用に保存する read_type_list(); // 攻撃方法リストをセレクトリスト用に保存する read_fight_list(); for (int i = 0; i < m_enemynum; i++) { push(std::string(m_data->m_enemy[i].name), i); } push("新規作成", m_enemynum); }
void boot_the_shops(FILE * shop_f, char *filename, int rec_count) { char *buf, buf2[150]; int temp, count, new_format = 0; struct shop_buy_data list[MAX_SHOP_OBJ + 1]; int done = 0; sprintf(buf2, "beginning of shop file %s", filename); while (!done) { buf = fread_string(shop_f, buf2); if (*buf == '#') { /* New shop */ sscanf(buf, "#%d\n", &temp); sprintf(buf2, "shop #%d in shop file %s", temp, filename); FREE(buf); /* Plug memory leak! */ if (!top_shop) CREATE(shop_index, struct shop_data, rec_count); SHOP_NUM(top_shop) = temp; temp = read_list(shop_f, list, new_format, MAX_PROD, LIST_PRODUCE); CREATE(shop_index[top_shop].producing, int, temp); for (count = 0; count < temp; count++) SHOP_PRODUCT(top_shop, count) = BUY_TYPE(list[count]); read_line(shop_f, "%f", &SHOP_BUYPROFIT(top_shop)); read_line(shop_f, "%f", &SHOP_SELLPROFIT(top_shop)); temp = read_type_list(shop_f, list, new_format, MAX_TRADE); CREATE(shop_index[top_shop].type, struct shop_buy_data, temp); for (count = 0; count < temp; count++) { SHOP_BUYTYPE(top_shop, count) = (byte) BUY_TYPE(list[count]); SHOP_BUYWORD(top_shop, count) = BUY_WORD(list[count]); } shop_index[top_shop].no_such_item1 = fread_string(shop_f, buf2); shop_index[top_shop].no_such_item2 = fread_string(shop_f, buf2); shop_index[top_shop].do_not_buy = fread_string(shop_f, buf2); shop_index[top_shop].missing_cash1 = fread_string(shop_f, buf2); shop_index[top_shop].missing_cash2 = fread_string(shop_f, buf2); shop_index[top_shop].message_buy = fread_string(shop_f, buf2); shop_index[top_shop].message_sell = fread_string(shop_f, buf2); read_line(shop_f, "%d", &SHOP_BROKE_TEMPER(top_shop)); read_line(shop_f, "%d", &SHOP_BITVECTOR(top_shop)); read_line(shop_f, "%d", &SHOP_KEEPER(top_shop)); SHOP_KEEPER(top_shop) = real_mobile(SHOP_KEEPER(top_shop)); read_line(shop_f, "%d", &SHOP_TRADE_WITH(top_shop)); temp = read_list(shop_f, list, new_format, 1, LIST_ROOM); CREATE(shop_index[top_shop].in_room, int, temp); for (count = 0; count < temp; count++) SHOP_ROOM(top_shop, count) = BUY_TYPE(list[count]); read_line(shop_f, "%d", &SHOP_OPEN1(top_shop)); read_line(shop_f, "%d", &SHOP_CLOSE1(top_shop)); read_line(shop_f, "%d", &SHOP_OPEN2(top_shop)); read_line(shop_f, "%d", &SHOP_CLOSE2(top_shop)); SHOP_BANK(top_shop) = 0; SHOP_SORT(top_shop) = 0; SHOP_FUNC(top_shop) = 0; top_shop++; } else { if (*buf == '$') /* EOF */