void cCreature::append(legacy::creature_data_type old){ active = old.active; attitude = old.attitude; number = old.number; cur_loc.x = old.m_loc.x; cur_loc.y = old.m_loc.y; cMonster::append(old.m_d); mobility = old.mobile; summon_time = old.summoned; if(summon_time >= 100) { party_summoned = false; summon_time -= 100; } else party_summoned = true; number = old.monst_start.number; start_attitude = old.monst_start.start_attitude; start_loc.x = old.monst_start.start_loc.x; start_loc.y = old.monst_start.start_loc.y; mobility = old.monst_start.mobile; switch(old.monst_start.time_flag) { case 0: time_flag = eMonstTime::ALWAYS; break; case 1: time_flag = eMonstTime::APPEAR_ON_DAY; break; case 2: time_flag = eMonstTime::DISAPPEAR_ON_DAY; break; case 4: time_flag = eMonstTime::SOMETIMES_A; break; case 5: time_flag = eMonstTime::SOMETIMES_B; break; case 6: time_flag = eMonstTime::SOMETIMES_C; break; case 7: time_flag = eMonstTime::APPEAR_WHEN_EVENT; break; case 8: time_flag = eMonstTime::DISAPPEAR_WHEN_EVENT; break; } spec1 = old.monst_start.spec1; spec2 = old.monst_start.spec2; spec_enc_code = old.monst_start.spec_enc_code; time_code = old.monst_start.time_code; monster_time = old.monst_start.monster_time; personality = old.monst_start.personality; special_on_kill = old.monst_start.special_on_kill; facial_pic = old.monst_start.facial_pic; health = old.m_d.health; mp = old.m_d.mp; max_mp = old.m_d.max_mp; ap = old.m_d.ap; morale = old.m_d.morale; m_morale = old.m_d.m_morale; for(int i = 0; i < 15; i++) status[(eStatus) i] = old.m_d.status[i]; direction = eDirection(old.m_d.direction); }
void cParty::import_legacy(legacy::party_record_type& old, cUniverse& univ){ scen_name = old.scen_name; age = old.age; gold = old.gold; food = old.food; for(short i = 0; i < 310; i++) for(short j = 0; j < 10; j++) stuff_done[i][j] = old.stuff_done[i][j]; light_level = old.light_level; if(stuff_done[305][0] > 0) status[ePartyStatus::STEALTH] = stuff_done[305][0]; if(stuff_done[305][1] > 0) status[ePartyStatus::FLIGHT] = stuff_done[305][1]; if(stuff_done[305][2] > 0) status[ePartyStatus::DETECT_LIFE] = stuff_done[305][2]; if(stuff_done[305][3] > 0) status[ePartyStatus::FIREWALK] = stuff_done[305][3]; outdoor_corner.x = old.outdoor_corner.x; outdoor_corner.y = old.outdoor_corner.y; i_w_c.x = old.i_w_c.x; i_w_c.y = old.i_w_c.y; out_loc.x = old.p_loc.x; out_loc.y = old.p_loc.y; loc_in_sec.x = old.loc_in_sec.x; loc_in_sec.y = old.loc_in_sec.y; if(stuff_done[304][0]) { left_at = loc(stuff_done[304][1], stuff_done[304][2]); left_in = -1; } party_event_timers.reserve(30); boats.resize(30); horses.resize(30); for(short i = 0; i < 30; i++){ boats[i].import_legacy(old.boats[i]); horses[i].import_legacy(old.horses[i]); cTimer t; t.time = old.party_event_timers[i]; t.node_type = old.global_or_town[i]; t.node = old.node_to_call[i]; party_event_timers.push_back(t); } for(short i = 0; i < 4; i++){ creature_save[i].import_legacy(old.creature_save[i]); imprisoned_monst[i] = old.imprisoned_monst[i]; } in_boat = old.in_boat; in_horse = old.in_horse; for(short i = 0; i < 10; i++){ out_c[i].import_legacy(old.out_c[i]); for(short j = 0; j < 5; j++) magic_store_items[j][i].import_legacy(old.magic_store_items[j][i]); } for(short i = 0; i < 256; i++) if(old.m_seen[i]) m_noted.insert(i); if(!scen_name.empty()) { special_notes.reserve(140); for(short i = 0; i < 140; i++){ if(old.special_notes_str[i][0] <= 0) continue; cEncNote n; n.import_legacy(old.special_notes_str[i], univ.scenario); special_notes.push_back(n); } talk_save.reserve(120); for(short i = 0; i < 120; i++){ cConvers t; t.import_legacy(old.talk_save[i], univ.scenario); talk_save.push_back(t); } } direction = eDirection(old.direction); at_which_save_slot = old.at_which_save_slot; for(short i = 0; i < 20 ; i++) alchemy[i] = old.alchemy[i]; for(short i = 0; i < univ.scenario.towns.size(); i++){ univ.scenario.towns[i]->can_find = old.can_find_town[i]; univ.scenario.towns[i]->m_killed = old.m_killed[i]; for(short j = 0; j < 64; j++) univ.scenario.towns[i]->item_taken[j] = old.item_taken[i][j / 8] & (1 << j % 8); } for(short i = 0; i < 100; i++) key_times[i] = old.key_times[i]; total_m_killed = old.total_m_killed; total_dam_done = old.total_dam_done; total_xp_gained = old.total_xp_gained; total_dam_taken = old.total_dam_taken; }
void cParty::append(legacy::party_record_type& old){ int i,j; age = old.age; gold = old.gold; food = old.food; for(i = 0; i < 310; i++) for(j = 0; j < 10; j++) stuff_done[i][j] = old.stuff_done[i][j]; for(i = 0; i < 200; i++) for(j = 0; j < 8; j++) item_taken[i][j] = old.item_taken[i][j]; light_level = old.light_level; if(stuff_done[305][0] > 0) status[ePartyStatus::STEALTH] = stuff_done[305][0]; if(stuff_done[305][1] > 0) status[ePartyStatus::FLIGHT] = stuff_done[305][1]; if(stuff_done[305][2] > 0) status[ePartyStatus::DETECT_LIFE] = stuff_done[305][2]; if(stuff_done[305][3] > 0) status[ePartyStatus::FIREWALK] = stuff_done[305][3]; outdoor_corner.x = old.outdoor_corner.x; outdoor_corner.y = old.outdoor_corner.y; i_w_c.x = old.i_w_c.x; i_w_c.y = old.i_w_c.y; p_loc.x = old.p_loc.x; p_loc.y = old.p_loc.y; loc_in_sec.x = old.loc_in_sec.x; loc_in_sec.y = old.loc_in_sec.y; if(stuff_done[304][0]) { left_at = loc(stuff_done[304][1], stuff_done[304][2]); left_in = -1; } party_event_timers.reserve(30); for(i = 0; i < 30; i++){ boats[i].append(old.boats[i]); horses[i].append(old.horses[i]); cTimer t; t.time = old.party_event_timers[i]; t.node_type = old.global_or_town[i]; t.node = old.node_to_call[i]; party_event_timers.push_back(t); } for(i = 0; i < 4; i++){ creature_save[i].append(old.creature_save[i]); imprisoned_monst[i] = old.imprisoned_monst[i]; } in_boat = old.in_boat; in_horse = old.in_horse; for(i = 0; i < 10; i++){ out_c[i].append(old.out_c[i]); for(j = 0; j < 5; j++) magic_store_items[j][i].append(old.magic_store_items[j][i]); } for(i = 0; i < 256; i++) if(old.m_seen[i]) m_noted.insert(i); journal.reserve(50); // The journal wasn't used before, so let's not bother converting it // for(i = 0; i < 50; i++){ // cJournal j; // j.day = old.journal_day[i]; // journal.push_back(j); // spec_items[i] = old.spec_items[i]; // } if(!scen_name.empty()) { special_notes.reserve(140); for(i = 0; i < 140; i++){ if(old.special_notes_str[i][0] <= 0) continue; cEncNote n; n.append(old.special_notes_str[i], univ.scenario); special_notes.push_back(n); } talk_save.reserve(120); for(i = 0; i < 120; i++){ cConvers t; t.append(old.talk_save[i], univ.scenario); talk_save.push_back(t); if(old.help_received[i]) help_received.insert(i); } } direction = eDirection(old.direction); at_which_save_slot = old.at_which_save_slot; for(i = 0; i < 20 ; i++) alchemy[i] = old.alchemy[i]; for(i = 0; i < 200; i++){ can_find_town[i] = old.can_find_town[i]; m_killed[i] = old.m_killed[i]; } for(i = 0; i < 100; i++) key_times[i] = old.key_times[i]; total_m_killed = old.total_m_killed; total_dam_done = old.total_dam_done; total_xp_gained = old.total_xp_gained; total_dam_taken = old.total_dam_taken; scen_name = old.scen_name; }