KC3Kai / kancolle-replay

Sortie Replay and Simulation by @fourinone41
MIT License
52 stars 34 forks source link

[battleText] fix issue when escort fleet and main fleet have different number of ships #56

Closed lackofdream closed 6 years ago

lackofdream commented 6 years ago

Tested with the data below, current version cannot handle it correctly.

count":11,"max_count":18,"stars":0,"ace":7,"state":1,"morale":1},{"squad":3,"mst_id":250,"count":14,"max_count":18,"stars":0,"ace":7,"state":1,"morale":1},{"squad":4,"mst_id":251,"count":13,"max_count":18,"stars":0,"ace":7,"state":1,"morale":1}]},{"rid":3,"range":2,"action":2,"planes":[{"squad":1,"mst_id":185,"count":12,"max_count":18,"stars":0,"ace":7,"state":1,"morale":1},{"squad":2,"mst_id":175,"count":12,"max_count":18,"stars":0,"ace":7,"state":1,"morale":1},{"squad":3,"mst_id":175,"count":11,"max_count":18,"stars":0,"ace":7,"state":1,"morale":1},{"squad":4,"mst_id":263,"count":12,"max_count":18,"stars":0,"ace":7,"state":1,"morale":1}]}],"battles":[{"sortie_id":65,"node":16,"enemyId":0,"data":{"api_deck_id":1,"api_formation":[14,2,1],"api_f_nowhps":[93,61,53,63,73,62],"api_f_maxhps":[93,61,62,63,90,62],"api_f_nowhps_combined":[15,41,37,23,22],"api_f_maxhps_combined":[15,45,43,43,39],"api_fParam":[[98,0,46,95],[56,0,87,74],[87,48,90,88],[75,84,60,82],[88,0,32,83],[55,0,86,75]],"api_fParam_combined":[[20,58,29,18],[56,94,78,68],[63,139,49,63],[63,139,49,63],[66,68,69,56]],"api_ship_ke":[1529,1529,1529,1592,1578,1578],"api_ship_lv":[1,1,1,1,1,1],"api_e_nowhps":[98,98,98,66,40,40],"api_e_maxhps":[98,98,98,66,40,40],"api_eSlot":[[509,509,525,528,-1],[509,509,525,528,-1],[509,509,525,528,-1],[550,550,545,525,-1],[502,515,542,-1,-1],[502,515,542,-1,-1]],"api_eParam":[[90,0,80,99],[90,0,80,99],[90,0,80,99],[64,92,96,68],[48,84,38,33],[48,84,38,33]],"api_midnight_flag":0,"api_search":[1,1],"api_stage_flag":[1,0,0],"api_kouku":{"api_plane_from":[[6],null],"api_stage1":{"api_f_count":15,"api_f_lostcount":0,"api_e_count":0,"api_e_lostcount":0,"api_disp_seiku":1,"api_touch_plane":[239,-1]},"api_stage2":null,"api_stage3":null,"api_stage3_combined":null},"api_support_flag":0,"api_support_info":null,"api_opening_taisen_flag":0,"api_opening_taisen":null,"api_opening_flag":1,"api_opening_atack":{"api_frai":[-1,-1,-1,-1,-1,-1,-1,4,2,2,-1,-1],"api_fcl":[0,0,0,0,0,0,0,1,1,1,0,0],"api_fdam":[0,0,0,0,0,0,0,0,0,0,0,0],"api_fydam":[0,0,0,0,0,0,0,69,65,35,0,0],"api_erai":[-1,-1,-1,-1,-1,-1,-1],"api_ecl":[0,0,0,0,0,0,0],"api_edam":[0,0,100,0,69,0,0],"api_eydam":[0,0,0,0,0,0,0]},"api_hourai_flag":[1,1,0,0],"api_hougeki1":{"api_at_eflag":[0,1,0,1,0,0],"api_at_list":[0,0,2,1,4,3],"api_at_type":[2,0,2,0,0,2],"api_df_list":[[3,3],[2],[5,5],[0],[1],[1,1]],"api_si_list":[["276","300"],[509],["50","50"],[509],[103],["50","50"]],"api_cl_list":[[2,2],[0],[2,1],[0],[0],[1,1]],"api_damage":[[273,248],[0],[248,0],[0],[0],[10,87]]},"api_hougeki2":{"api_at_eflag":[0,0],"api_at_list":[0,2],"api_at_type":[2,2],"api_df_list":[[0,0],[1,1]],"api_si_list":[["276","300"],["50","50"]],"api_cl_list":[[1,1],[2,1]],"api_damage":[[161,131],[163,70]]},"api_name":"fc_battle_water"},"yasen":{},"rating":"SS","drop":0,"time":1537728660,"baseEXP":250,"hqEXP":0,"shizunde":[[],[]],"mvp":[1,2],"fleetStates":[{"fuel":[88,56,46,51,83,56],"ammo":[175,55,80,75,110,55],"slots":[[1,1,2,2,0],[15,12,12,8,0],[6,3,3,3,0],[3,3,3,3,0],[4,4,4,4,0],[15,12,12,8,0]]},{"fuel":[14,23,23,23,14,0],"ammo":[20,35,75,75,35,0],"slots":[[0,0,0,0,0],[1,1,1,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]]}]}]}