Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
andanteyk committed Feb 11, 2018
2 parents 53e2531 + 5574bd4 commit 45009f4
Show file tree
Hide file tree
Showing 29 changed files with 619 additions and 400 deletions.
Binary file modified ElectronicObserver/Assets.zip
Binary file not shown.
Binary file added ElectronicObserver/Assets/Item/ActionReport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion ElectronicObserver/Data/Battle/Detail/BattleDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ public override string ToString()

StringBuilder builder = new StringBuilder();

builder.AppendFormat("{0} → {1}\r\n", GetAttackerName(), GetDefenderName());
// 航空戦・支援攻撃時 AttackerIndex = BattleIndex.Invalid 、それで AttackerIndex.Side = BattleSides.FriendMain になる
// DefenderIndex.Side で判断すれば航空戦も正確に識別できるが表示が変になるので、最終的には AttackerIndex.Side で判断した
builder.AppendFormat(AttackerIndex.IsFriend ? "{0} → {1}\r\n" : "{1} ← {0}\r\n", GetAttackerName(), GetDefenderName());


if (AttackType >= 0)
Expand Down
114 changes: 106 additions & 8 deletions ElectronicObserver/Data/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,19 @@ public static string GetVoiceFlag(int value)
case 0:
return "-";
case 1:
return "時報";
case 2:
return "放置";
case 2:
return "時報";
case 3:
return "時報+放置";
return "放置+時報";
case 4:
return "特殊放置";
case 5:
return "時報+特殊放置";
case 6:
return "放置+特殊放置";
case 6:
return "時報+特殊放置";
case 7:
return "時報+放置+特殊放置";
return "放置+時報+特殊放置";
default:
return "不明";
}
Expand Down Expand Up @@ -280,6 +280,98 @@ public static string GetShipClassClassification(ShipTypes shiptype)
}
}


/// <summary>
/// 艦型を表す文字列を取得します。
/// </summary>
public static string GetShipClass(int id)
{
switch (id)
{
case 1: return "綾波型";
case 2: return "伊勢型";
case 3: return "加賀型";
case 4: return "球磨型";
case 5: return "暁型";
case 6: return "金剛型";
case 7: return "古鷹型";
case 8: return "高雄型";
case 9: return "最上型";
case 10: return "初春型";
case 11: return "祥鳳型";
case 12: return "吹雪型";
case 13: return "青葉型";
case 14: return "赤城型";
case 15: return "千歳型";
case 16: return "川内型";
case 17: return "蒼龍型";
case 18: return "朝潮型";
case 19: return "長門型";
case 20: return "長良型";
case 21: return "天龍型";
case 22: return "島風型";
case 23: return "白露型";
case 24: return "飛鷹型";
case 25: return "飛龍型";
case 26: return "扶桑型";
case 27: return "鳳翔型";
case 28: return "睦月型";
case 29: return "妙高型";
case 30: return "陽炎型";
case 31: return "利根型";
case 32: return "龍驤型";
case 33: return "翔鶴型";
case 34: return "夕張型";
case 35: return "海大VI型";
case 36: return "巡潜乙型改二";
case 37: return "大和型";
case 38: return "夕雲型";
case 39: return "巡潜乙型";
case 40: return "巡潜3型";
case 41: return "阿賀野型";
case 42: return "「霧」";
case 43: return "大鳳型";
case 44: return "潜特型(伊400型潜水艦)";
case 45: return "特種船丙型";
case 46: return "三式潜航輸送艇";
case 47: return "Bismarck級";
case 48: return "Z1型";
case 49: return "工作艦";
case 50: return "大鯨型";
case 51: return "龍鳳型";
case 52: return "大淀型";
case 53: return "雲龍型";
case 54: return "秋月型";
case 55: return "Admiral Hipper級";
case 56: return "香取型";
case 57: return "UボートIXC型/呂号潜水艦";
case 58: return "V.Veneto級";
case 59: return "秋津洲型";
case 60: return "改風早型";
case 61: return "Maestrale級";
case 62: return "瑞穂型";
case 63: return "Graf Zeppelin級";
case 64: return "Zara級";
case 65: return "Iowa級";
case 66: return "神風型";
case 67: return "Queen Elizabeth級";
case 68: return "Aquila級";
case 69: return "Lexington級";
case 70: return "C.Teste級";
case 71: return "巡潜甲型改二";
case 72: return "神威型";
case 73: return "Гангут級";
case 74: return "占守型";
case 75: return "春日丸級";
case 76: return "大鷹型";
case 77: return "択捉型";
case 78: return "Ark Royal級";
case 79: return "Richelieu級";
case 80: return "Guglielmo Marconi級";
default: return "不明";
}
}

#endregion


Expand Down Expand Up @@ -334,15 +426,15 @@ public static string GetMapEventKind(int value)
case 2:
return "夜戦";
case 3:
return "夜昼戦"; // 対通常?
return "夜昼戦"; // 対通常?
case 4:
return "航空戦";
case 5:
return "敵連合";
case 6:
return "空襲戦";
case 7:
return "夜昼戦"; // 対連合
return "夜昼戦"; // 対連合
default:
return "不明";
}
Expand Down Expand Up @@ -781,6 +873,12 @@ public static string GetAACutinKind(int id)
return "集中機銃(文月)";
case 23:
return "機銃(非集中)(UIT-25)";
case 24:
return "高角砲/機銃(非集中)(龍田)";
case 25:
return "噴進砲改二/電探/三式弾(伊勢)";
case 28:
return "噴進砲改二/電探(伊勢)";
default:
return "不明";
}
Expand Down
65 changes: 65 additions & 0 deletions ElectronicObserver/Data/Quest/ProgressMultiDiscard.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace ElectronicObserver.Data.Quest
{
[DataContract(Name = "ProgressMultiDiscard")]
public class ProgressMultiDiscard : ProgressData
{

[DataMember]
private ProgressDiscard[] ProgressList;

public ProgressMultiDiscard(QuestData quest, IEnumerable<ProgressDiscard> progressList)
: base(quest, 1)
{
ProgressList = progressList.ToArray();
ProgressMax = progressList.Sum(p => p.ProgressMax);
}


public void Increment(IEnumerable<int> equipments)
{
foreach (var p in ProgressList)
p.Increment(equipments);

Progress = ProgressList.Sum(p => p.Progress);
}


public override void Increment()
{
throw new NotSupportedException();
}

public override void Decrement()
{
throw new NotSupportedException();
}


public override void CheckProgress(QuestData q)
{
// do nothing
}


public override string ToString()
{
if (ProgressList.All(p => p.IsCleared))
return "達成!";
else
return string.Join(", ", ProgressList.Where(p => !p.IsCleared).Select(p => p.GetClearCondition() + ": " + p.ToString()));
}


public override string GetClearCondition()
{
return string.Join(", ", ProgressList.Select(p => p.GetClearCondition()));
}
}
}
28 changes: 28 additions & 0 deletions ElectronicObserver/Data/Quest/QuestProgressManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace ElectronicObserver.Data.Quest
[KnownType(typeof(ProgressDestruction))]
[KnownType(typeof(ProgressDevelopment))]
[KnownType(typeof(ProgressDiscard))]
[KnownType(typeof(ProgressMultiDiscard))]
[KnownType(typeof(ProgressDocking))]
[KnownType(typeof(ProgressExpedition))]
[KnownType(typeof(ProgressImprovement))]
Expand Down Expand Up @@ -367,6 +368,29 @@ void QuestUpdated(string apiname, dynamic data)
Progresses.Add(new ProgressDiscard(q, 3, true, new int[] { 21 }));
Progresses[q.QuestID].SharedCounterShift = 2;
break;
case 676: //|676|週|装備開発力の集中整備|(中口径主砲x3, 副砲x3, 簡易輸送部材x1)廃棄, 鋼材2400保有|進捗は n/7 で1つごとに進む
Progresses.Add(new ProgressMultiDiscard(q, new[] {
new ProgressDiscard(q, 3, true, new[]{ 2 }),
new ProgressDiscard(q, 3, true, new[]{ 4 }),
new ProgressDiscard(q, 1, true, new[]{ 30 }),
}));
break;
case 663: //|663|季|新型艤装の継続研究|大口径主砲x10廃棄, 鋼材18000保有
Progresses.Add(new ProgressDiscard(q, 10, true, new[] { 3 }));
break;
case 675: //|675|季|運用装備の統合整備|(艦上戦闘機x6, 機銃x4)廃棄, ボーキ800保有
Progresses.Add(new ProgressMultiDiscard(q, new[] {
new ProgressDiscard(q, 6, true, new[]{ 6 }),
new ProgressDiscard(q, 4, true, new[]{ 21 }),
}));
break;
case 677: //|677|週|継戦支援能力の整備|(大口径主砲x4, 水上偵察機x2, 魚雷x3)廃棄, 鋼材3600保有
Progresses.Add(new ProgressMultiDiscard(q, new[] {
new ProgressDiscard(q, 4, true, new[]{ 3 }),
new ProgressDiscard(q, 2, true, new[]{ 10 }),
new ProgressDiscard(q, 3, true, new[]{ 5 }),
}));
break;

case 702: //|702|艦の「近代化改修」を実施せよ!|改修成功2
Progresses.Add(new ProgressModernization(q, 2));
Expand Down Expand Up @@ -546,6 +570,10 @@ public void EquipmentDiscarded(string apiname, Dictionary<string, string> data)
{
p.Increment(ids);
}
foreach (var p in Progresses.Values.OfType<ProgressMultiDiscard>())
{
p.Increment(ids);
}

OnProgressChanged();
}
Expand Down
31 changes: 29 additions & 2 deletions ElectronicObserver/Data/ShipData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,25 @@ public int EvasionBase
get
{
int param = EvasionTotal;
bool hasNaganamiGun = false;

var eqs = AllSlotInstance.Where(eq => eq != null);
foreach (var eq in eqs)
{
param -= eq.MasterEquipment.Evasion;

if (eq.EquipmentID == 267) // 12.7cm連装砲D型改二
{
hasNaganamiGun = true;

if (ShipID == 543 || // 長波改二
MasterShip.ShipClass == 22 || // 島風型
MasterShip.ShipClass == 38 || // 夕雲型
MasterShip.ShipClass == 30) // 陽炎型
{
param -= 1;
}
}
}

// 北方迷彩(+北方装備) による特殊補正(重複しない)
Expand All @@ -362,11 +377,20 @@ public int EvasionBase
case 146: // 木曾改二
case 216: // 多摩改
case 217: // 木曾改
case 547: // 多摩改二
case 547: // 多摩改二
param -= 7;
break;
}
}

// 12.7cm連装砲D型改二 + 水上電探 による特殊補正
if (hasNaganamiGun &&
(ShipID == 229 || ShipID == 543) && // 島風改, 長波改二
eqs.Any(eq => eq.MasterEquipment.IsSurfaceRadar))
{
param -= 2;
}

return param;
}
}
Expand Down Expand Up @@ -1256,7 +1280,10 @@ private int CalculateNightBattlePower()
break;

case NightAttackKind.CutinTorpedoRadar:
basepower *= 1.3;
if (ShipID == 543 && AllSlotInstanceMaster.Any(eq => eq?.EquipmentID == 267)) // 長波改二 + 12.7cm連装砲D型改二
basepower *= 1.625;
else
basepower *= 1.3;
break;

case NightAttackKind.CutinTorpedoPicket:
Expand Down
10 changes: 10 additions & 0 deletions ElectronicObserver/Data/ShipDataMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public class ShipDataMaster : ResponseWrapper, IIdentifiable
/// </summary>
public ShipTypes ShipType => (ShipTypes)(int)RawData.api_stype;

/// <summary>
/// 艦型
/// </summary>
public int ShipClass => (int)RawData.api_ctype;


/// <summary>
/// 改装Lv.
Expand Down Expand Up @@ -93,6 +98,11 @@ public class ShipDataMaster : ResponseWrapper, IIdentifiable
/// </summary>
public int NeedCatapult { get; internal set; }

/// <summary>
/// 改装に戦闘詳報が必要かどうか
/// </summary>
public int NeedActionReport { get; internal set; }


#region Parameters

Expand Down
16 changes: 6 additions & 10 deletions ElectronicObserver/Data/ShipGroup/ExpressionData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,20 +255,16 @@ public Expression Compile(ParameterExpression paramex)
condex = Expression.Not(Expression.Call(memberex, typeof(string).GetMethod("Contains", new Type[] { typeof(string) }), constex));
break;
case ExpressionOperator.BeginWith:
condex = Expression.Equal(Expression.Call(memberex, typeof(string).GetMethod("IndexOf", new Type[] { typeof(string) }), constex), Expression.Constant(0, typeof(int)));
condex = Expression.Call(memberex, typeof(string).GetMethod("StartsWith", new Type[] { typeof(string) }), constex);
break;
case ExpressionOperator.NotBeginWith:
condex = Expression.NotEqual(Expression.Call(memberex, typeof(string).GetMethod("IndexOf", new Type[] { typeof(string) }), constex), Expression.Constant(0, typeof(int)));
condex = Expression.Not(Expression.Call(memberex, typeof(string).GetMethod("StartsWith", new Type[] { typeof(string) }), constex));
break;
case ExpressionOperator.EndWith: // returns memberex.LastIndexOf( constex ) == ( memberex.Length - constex.Length )
condex = Expression.Equal(
Expression.Call(memberex, typeof(string).GetMethod("LastIndexOf", new Type[] { typeof(string) }), constex),
Expression.Subtract(Expression.PropertyOrField(memberex, "Length"), Expression.PropertyOrField(constex, "Length")));
case ExpressionOperator.EndWith:
condex = Expression.Call(memberex, typeof(string).GetMethod("EndsWith", new Type[] { typeof(string) }), constex);
break;
case ExpressionOperator.NotEndWith: // returns memberex.LastIndexOf( constex ) != ( memberex.Length - constex.Length )
condex = Expression.NotEqual(
Expression.Call(memberex, typeof(string).GetMethod("LastIndexOf", new Type[] { typeof(string) }), constex),
Expression.Subtract(Expression.PropertyOrField(memberex, "Length"), Expression.PropertyOrField(constex, "Length")));
case ExpressionOperator.NotEndWith:
condex = Expression.Not(Expression.Call(memberex, typeof(string).GetMethod("EndsWith", new Type[] { typeof(string) }), constex));
break;
case ExpressionOperator.ArrayContains: // returns Enumerable.Contains<>( memberex )
condex = Expression.Call(typeof(Enumerable), "Contains", new Type[] { memberex.Type.GetElementType() ?? memberex.Type.GetGenericArguments().First() }, memberex, constex);
Expand Down
Loading

0 comments on commit 45009f4

Please sign in to comment.