Skip to content

Commit

Permalink
Implement additional stats support in the Ship model
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuubari committed Nov 9, 2015
1 parent 7c44474 commit c2429f0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/Grabacr07.KanColleWrapper/Models/Ship.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ public ShipSlot ExSlot
/// </summary>
public int ViewRange => this.RawData.api_sakuteki.Get(0) ?? 0;

public LimitedValue AntiSub { get; private set; }

public LimitedValue Evasion { get; private set; }

public LimitedValue LineOfSight { get; private set; }

/// <summary>
/// 火力・雷装・対空・装甲のすべてのステータス値が最大値に達しているかどうかを示す値を取得します。
/// </summary>
Expand Down Expand Up @@ -358,6 +364,10 @@ internal void Update(kcsapi_ship2 rawData)
}

this.UpdateSlots();

this.AntiSub = new LimitedValue(this.RawData.api_taisen[0], this.RawData.api_taisen[1], this.RawData.api_taisen[0] - this.EquippedItems.Sum(s => s.Item.Info.RawData.api_tais));
this.Evasion = new LimitedValue(this.RawData.api_kaihi[0], this.RawData.api_kaihi[1], this.RawData.api_kaihi[0] - this.EquippedItems.Sum(s => s.Item.Info.RawData.api_houk));
this.LineOfSight = new LimitedValue(this.RawData.api_sakuteki[0], this.RawData.api_sakuteki[1], this.RawData.api_sakuteki[0] - this.EquippedItems.Sum(s => s.Item.Info.RawData.api_saku));
}

public void UpdateSlots()
Expand Down

0 comments on commit c2429f0

Please sign in to comment.