Skip to content

Commit

Permalink
4.2.2 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
myangelkamikaze committed Sep 18, 2019
2 parents c1206b4 + 0ed6bef commit fcac5b7
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 55 deletions.
5 changes: 5 additions & 0 deletions ElectronicObserver/Data/CompassData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ public int AirReconnaissanceResult
public int MapHPMax => RawData.api_eventmap() ? (int)RawData.api_eventmap.api_max_maphp : 0;


/// <summary>
/// 緊急泊地修理が可能か
/// </summary>
public bool CanEmergencyAnchorageRepair => RawData.api_anchorage_flag() && (int)RawData.api_anchorage_flag != 0;


/// <summary>
/// 対応する海域情報
Expand Down
2 changes: 2 additions & 0 deletions ElectronicObserver/Data/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ public static string GetMapEventID(int value)
return ConstantsRes.LargeResourceNode;
case 9:
return ConstantsRes.LandNode;
case 10:
return "Anchorage"; // todo add to res
default:
return ConstantsRes.Unknown;
}
Expand Down
4 changes: 2 additions & 2 deletions ElectronicObserver/Data/Quest/ProgressSpecialBattle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ public override void Increment(string rank, int areaID, bool isBoss)
}) >= 4;
break;

// |893|季|泊地周辺海域の安全確保を徹底せよ!|1-5・7-1・7-2(第一&第二)ボスS勝利各3|3エリア達成時点で80%
case 893:
case 872: //|872|季|戦果拡張任務!「Z作戦」後段作戦|5-5・6-2・6-5・7-2(第二)ボスS勝利各1|要第一艦隊?
case 893: //|893|季|泊地周辺海域の安全確保を徹底せよ!|1-5・7-1・7-2(第一&第二)ボスS勝利各3|3エリア達成時点で80%
if (GaugeIndex == 1)
isAccepted = bm.Compass.Destination == 7;
else if (GaugeIndex == 2)
Expand Down
86 changes: 47 additions & 39 deletions ElectronicObserver/Data/Quest/QuestProgressManager.cs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ElectronicObserver/ElectronicObserver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@
<Compile Include="Observer\kcsapi\api_req_kaisou\slot_deprive.cs" />
<Compile Include="Observer\kcsapi\api_req_kaisou\slot_exchange_index.cs" />
<Compile Include="Observer\kcsapi\api_req_kousyou\remodel_slotlist.cs" />
<Compile Include="Observer\kcsapi\api_req_map\anchorage_repair.cs" />
<Compile Include="Observer\kcsapi\api_req_map\select_eventmap_rank.cs" />
<Compile Include="Observer\kcsapi\api_req_member\itemuse.cs" />
<Compile Include="Observer\kcsapi\api_req_member\updatecomment.cs" />
Expand Down
1 change: 1 addition & 0 deletions ElectronicObserver/Observer/APIObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private APIObserver()
new kcsapi.api_req_member.itemuse(),
new kcsapi.api_req_sortie.ld_shooting(),
new kcsapi.api_req_combined_battle.ld_shooting(),
new kcsapi.api_req_map.anchorage_repair(),

new kcsapi.api_req_quest.clearitemget(),
new kcsapi.api_req_nyukyo.start(),
Expand Down
37 changes: 37 additions & 0 deletions ElectronicObserver/Observer/kcsapi/api_req_map/anchorage_repair.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using ElectronicObserver.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ElectronicObserver.Observer.kcsapi.api_req_map
{
public class anchorage_repair : APIBase
{
public override void OnResponseReceived(dynamic data)
{

var db = KCDatabase.Instance;

foreach (var elem in data.api_ship_data)
{
int id = (int)elem.api_id;

var ship = db.Ships[id];
if (ship != null)
ship.LoadFromResponse(APIName, elem);
else
{
ship = new ShipData();
ship.LoadFromResponse(APIName, elem);
db.Ships.Add(ship);
}
}

base.OnResponseReceived((object)data);
}

public override string APIName => "api_req_map/anchorage_repair";
}
}
15 changes: 11 additions & 4 deletions ElectronicObserver/Other/Information/apilist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,7 @@ api_req_map/start :出撃 同じメンバはnextのほうが情報が新し
9=航空偵察
10=長距離空襲戦
13=レーダー射撃
14=泊地
api_passed :1=通行済み 初期地点は常に0
api_rashin_flg :
api_rashin_id :
Expand Down Expand Up @@ -1547,7 +1548,7 @@ api_req_map/next :進撃
7=航空戦or航空偵察
8=船団護衛成功
9=揚陸地点
10=長距離空襲戦
10=泊地
api_event_kind :イベント種別 
0=非戦闘セル, 1=通常戦闘, 2=夜戦, 3=夜昼戦, 4=航空戦, 5=敵連合艦隊戦, 6=長距離空襲戦, 7=夜昼戦(対連合艦隊), 8=レーダー射撃
api_event_id=1|6(気のせいだった)時は 
Expand Down Expand Up @@ -1646,8 +1647,8 @@ api_req_map/next :進撃
3=「空襲により基地航空隊に地上撃破の損害が発生しました!」
4=「空襲による基地の損害はありません。」
api_m1 :('16秋イベ) 1=スタート地点解放ギミック発動 それ以外の場合は存在しない
api_m1 :('17夏イベ) 1=ルート解放など 通常は存在しない

api_m1 :イベント海域ギミック開放フラグ 1=ルート解放など 進捗によって 2 の場合もある 通常は存在しない
api_anchorage_flag :泊地セルでのみ存在 0=修理不可 1=修理可能


Request.api_req_sortie/battle :通常艦隊 昼戦
Expand Down Expand Up @@ -2238,7 +2239,8 @@ api_req_sortie/battleresult :通常艦隊 戦闘結果
api_escape :退避艦 api_escape_flag=0の時 null
api_escape_idx :退避艦のインデックス [対象艦数] 1基点 実際は[0]が対象となる
api_next_map_ids :次に出撃可能になった海域ID[] 海域解放時のみ存在 通常海域は数値、イベント海域は文字列なので注意
api_m1 :('16秋イベ)ギミック解除フラグ? 1=解除 それ以外の場合存在しない
api_m1 :('16秋イベ)ギミック解除フラグ 1=解除(段階によって 1 以外の場合もある) それ以外の場合存在しない
api_m2 :('19夏イベ)ギミック解除フラグ 1=解除(〃) それ以外の場合存在しない


api_req_sortie/goback_port :単艦退避受諾
Expand Down Expand Up @@ -3383,6 +3385,11 @@ Request.api_req_member/set_friendly_request :友軍艦隊要請
(情報なし)


api_req_map/anchorage_repair :緊急泊地修理
api_used_ship :発動させた艦娘のID (固有IDではない; 450=秋津洲改 など)
api_ship_data :艦船データ [出撃艦隊の艦船数] api_port/port.api_ship に準じる 



◇APIが呼ばれる順番

Expand Down
1 change: 1 addition & 0 deletions ElectronicObserver/Other/Information/kcmemo.md
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,7 @@ Bismarck dreiに対する魚雷装備・試製51cm連装砲といったものの
|854|季|戦果拡張任務!「Z作戦」前段作戦|2-4・6-1・6-3ボスA勝利各1/6-4ボスS勝利1
|861|季|強行輸送艦隊、抜錨!|1-6終点到達2|要(航空戦艦or補給艦)2
|862|季|前線の航空偵察を実施せよ!|6-3ボスA勝利2|要水母1軽巡2
|872|季|戦果拡張任務!「Z作戦」後段作戦|5-5・6-2・6-5・7-2(第二)ボスS勝利各1|要第一艦隊?
|873|季|北方海域警備を実施せよ!|3-1・3-2・3-3ボスA勝利各1|要軽巡1, 1エリア達成で50%,2エリアで80%
|875|季|精鋭「三一駆」、鉄底海域に突入せよ!|5-4ボスS勝利2|要長波改二/(高波改or沖波改or朝霜改)
|888|季|新編成「三川艦隊」、鉄底海峡に突入せよ!|5-1・5-3・5-4ボスS勝利各1|要(鳥海or青葉or衣笠or加古or古鷹or天龍or夕張)4
Expand Down
6 changes: 3 additions & 3 deletions ElectronicObserver/Utility/SoftwareInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ public static class SoftwareInformation
/// <summary>
/// バージョン(日本語, ソフトウェア名を含みます)
/// </summary>
public static string VersionJapanese => SoftwareNameJapanese + "四二型改";
public static string VersionJapanese => SoftwareNameJapanese + "四二型改二";


/// <summary>
/// バージョン(英語)
/// </summary>
public static string VersionEnglish => "4.2.1.1";
public static string VersionEnglish => "4.2.2";



/// <summary>
/// 更新日時
/// </summary>
public static DateTime UpdateTime => DateTimeHelper.CSVStringToTime("2019/09/04 14:00:00");
public static DateTime UpdateTime => DateTimeHelper.CSVStringToTime("2019/09/18 12:00:00");



Expand Down
4 changes: 4 additions & 0 deletions ElectronicObserver/Window/FormCompass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,10 @@ Color getColorFromEventKind(int kind)
TextEventDetail.Text = "";
break;

case 10: // 泊地
TextEventDetail.Text = compass.CanEmergencyAnchorageRepair ? "修理可能" : "";
break;

default:
TextEventDetail.Text = "";
break;
Expand Down
13 changes: 8 additions & 5 deletions ElectronicObserver/Window/FormFleet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,13 @@ public void Update(int shipMasterID)
{

bool isEscaped = KCDatabase.Instance.Fleet[Parent.FleetID].EscapedShipList.Contains(shipMasterID);

var equipments = ship.AllSlotInstance.Where(eq => eq != null);

Name.Text = ship.MasterShip.NameWithClass;
Name.Tag = ship.ShipID;
ToolTipInfo.SetToolTip(Name,
string.Format(
"{0} {1}\r\nFP: {2}/{3}\r\nTorp: {4}/{5}\r\nAA: {6}/{7}\r\nArmor: {8}/{9}\r\nASW: {10}/{11}\r\nEvasion: {12}/{13}\r\nLOS: {14}/{15}\r\nLuck: {16}\r\nRange: {17} / Speed: {18}\r\n(right click to open encyclopedia)\n",
"{0} {1}\r\nFP: {2}/{3}\r\nTorp: {4}/{5}\r\nAA: {6}/{7}\r\nArmor: {8}/{9}\r\nASW: {10}/{11}\r\nEvasion: {12}/{13}\r\nLOS: {14}/{15}\r\nLuck: {16}\r\nAccuracy: {17:+#;-#;+0}\r\nBombing: {18:+#;-#;+0}\r\nRange: {19} / Speed: {20}\r\n(right click to open encyclopedia)\n",
ship.MasterShip.ShipTypeName, ship.NameWithLevel,
ship.FirepowerBase, ship.FirepowerTotal,
ship.TorpedoBase, ship.TorpedoTotal,
Expand All @@ -472,7 +472,9 @@ public void Update(int shipMasterID)
ship.EvasionBase, ship.EvasionTotal,
ship.LOSBase, ship.LOSTotal,
ship.LuckTotal,
Constants.GetRange(ship.Range),
equipments.Any() ? equipments.Sum(eq => eq.MasterEquipment.Accuracy): 0,
equipments.Any() ? equipments.Sum(eq => eq.MasterEquipment.Bomber) : 0,
Constants.GetRange(ship.Range),
Constants.GetSpeed(ship.Speed)
));
{
Expand Down Expand Up @@ -909,8 +911,9 @@ private void FormFleet_Load(object sender, EventArgs e)
o["api_req_kaisou/remodeling"].RequestReceived += Updated;
o["api_req_map/start"].RequestReceived += Updated;
o["api_req_hensei/combined"].RequestReceived += Updated;
o["api_req_kaisou/open_exslot"].RequestReceived += Updated;

o["api_port/port"].ResponseReceived += Updated;
o["api_port/port"].ResponseReceived += Updated;
o["api_get_member/ship2"].ResponseReceived += Updated;
o["api_get_member/ndock"].ResponseReceived += Updated;
o["api_req_kousyou/getship"].ResponseReceived += Updated;
Expand All @@ -928,7 +931,7 @@ private void FormFleet_Load(object sender, EventArgs e)
o["api_get_member/require_info"].ResponseReceived += Updated;
o["api_req_kaisou/slot_deprive"].ResponseReceived += Updated;
o["api_req_kaisou/marriage"].ResponseReceived += Updated;

o["api_req_map/anchorage_repair"].ResponseReceived += Updated;

//追加するときは FormFleetOverview にも同様に追加してください

Expand Down
4 changes: 3 additions & 1 deletion ElectronicObserver/Window/FormFleetOverview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,9 @@ private void FormFleetOverview_Load(object sender, EventArgs e)
o["api_req_member/updatedeckname"].RequestReceived += Updated;
o["api_req_map/start"].RequestReceived += Updated;
o["api_req_hensei/combined"].RequestReceived += Updated;
o["api_req_kaisou/open_exslot"].RequestReceived += Updated;

o["api_port/port"].ResponseReceived += Updated;
o["api_port/port"].ResponseReceived += Updated;
o["api_get_member/ship2"].ResponseReceived += Updated;
o["api_get_member/ndock"].ResponseReceived += Updated;
o["api_req_kousyou/getship"].ResponseReceived += Updated;
Expand All @@ -209,6 +210,7 @@ private void FormFleetOverview_Load(object sender, EventArgs e)
o["api_get_member/require_info"].ResponseReceived += Updated;
o["api_req_kaisou/slot_deprive"].ResponseReceived += Updated;
o["api_req_kaisou/marriage"].ResponseReceived += Updated;
o["api_req_map/anchorage_repair"].ResponseReceived += Updated;

Utility.Configuration.Instance.ConfigurationChanged += ConfigurationChanged;
}
Expand Down
3 changes: 2 additions & 1 deletion ElectronicObserver/Window/FormInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,10 @@ private string GetBattleResult(dynamic data)
return sb.ToString();
}


private string CheckGimmickUpdated(dynamic data)
{
if (data.api_m1() && data.api_m1 != 0)
if (data.api_m1() && data.api_m1 != 0 || (data.api_m2() && data.api_m2 != 0))
{
Utility.Logger.Add(2, "Changes in event map detected!");
return "\r\n* Gimmick released *\r\n";
Expand Down

0 comments on commit fcac5b7

Please sign in to comment.