Skip to content

Commit

Permalink
CharaSim update, support CMST 5th job.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagamia committed Dec 26, 2016
1 parent 820eb99 commit 6ca51e9
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 21 deletions.
4 changes: 2 additions & 2 deletions WzComparerR2.Common/CharaSim/Addition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public string GetPropString()
string val;
if (this.Props.TryGetValue("prob", out val))
{
sb.AppendFormat("爆击概率提高{0}%\r\n", val);
sb.AppendFormat("爆击率{0}%\r\n", val);
}
if (this.Props.TryGetValue("damage", out val))
{
sb.AppendFormat("爆击最小伤害增加{0}%\r\n", val);
sb.AppendFormat("爆击伤害增加{0}%\r\n", val);
}
if (sb.Length > 2)
{
Expand Down
25 changes: 25 additions & 0 deletions WzComparerR2.Common/CharaSim/Gear.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Text;
using System.Text.RegularExpressions;
using System.Drawing;
using System.Linq;
using WzComparerR2.WzLib;

namespace WzComparerR2.CharaSim
Expand Down Expand Up @@ -64,6 +65,14 @@ public bool GetBooleanValue(GearPropType type)
return this.Props.TryGetValue(type, out value) && value != 0;
}

public IEnumerable<KeyValuePair<GearPropType, int>> PropsV5
{
get
{
return this.Props.Where(kv => IsV5SupportPropType(kv.Key));
}
}

public int GetMaxStar()
{
if (!this.HasTuc)
Expand Down Expand Up @@ -226,6 +235,22 @@ public static bool IsEpicPropType(GearPropType type)
}
}

public static bool IsV5SupportPropType(GearPropType type)
{
switch (type)
{
case GearPropType.incMDD:
case GearPropType.incMDDr:
case GearPropType.incACC:
case GearPropType.incACCr:
case GearPropType.incEVA:
case GearPropType.incEVAr:
return false;
default:
return true;
}
}

/// <summary>
/// 获取装备类型。
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion WzComparerR2.Common/CharaSim/GearPropType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public enum GearPropType
incMaxDamage,
incPADlv,
incMADlv,

incCriticaldamage,

Option,
OptionToMob,
Expand Down
6 changes: 6 additions & 0 deletions WzComparerR2.Common/CharaSim/SetItemEffect.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

namespace WzComparerR2.CharaSim
{
Expand All @@ -19,6 +20,11 @@ public SetItemEffect()
get { return props; }
}

public IEnumerable<KeyValuePair<GearPropType, object>> PropsV5
{
get { return props.Where(kv => Gear.IsV5SupportPropType(kv.Key)); }
}

public bool Enabled
{
get { return enabled; }
Expand Down
20 changes: 10 additions & 10 deletions WzComparerR2/CharaSimControl/GearTooltipRender2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ private Bitmap RenderBase(out int picH)

//一般属性
List<GearPropType> props = new List<GearPropType>();
foreach (KeyValuePair<GearPropType, int> p in Gear.Props)
foreach (KeyValuePair<GearPropType, int> p in Gear.PropsV5) //5转过滤
{
if ((int)p.Key < 100 && p.Value != 0)
props.Add(p.Key);
Expand Down Expand Up @@ -1025,28 +1025,28 @@ private void DrawPropDiffEx(Graphics g, int x, int y)
int value;
string numValue;
//防御
g.DrawImage(Resource.UIToolTip_img_Item_Equip_Summary_icon_pdd, x, y);
x += 62;
g.DrawImage(Resource.UIToolTip_img_Item_Equip_Summary_icon_pdd, x, y);
DrawReqNum(g, "0", NumberType.LookAhead, x - 5, y + 6, StringAlignment.Far);

//魔防
g.DrawImage(Resource.UIToolTip_img_Item_Equip_Summary_icon_mdd, x, y);
x += 62;
DrawReqNum(g, "0", NumberType.LookAhead, x - 5, y + 6, StringAlignment.Far);
////魔防
//g.DrawImage(Resource.UIToolTip_img_Item_Equip_Summary_icon_mdd, x, y);
//x += 62;
//DrawReqNum(g, "0", NumberType.LookAhead, x - 5, y + 6, StringAlignment.Far);

//boss伤
g.DrawImage(Resource.UIToolTip_img_Item_Equip_Summary_icon_bdr, x, y);
x += 62;
g.DrawImage(Resource.UIToolTip_img_Item_Equip_Summary_icon_bdr, x, y);
this.Gear.Props.TryGetValue(GearPropType.bdR, out value);
numValue = (value > 0 ? "+ " : null) + value + " % ";
DrawReqNum(g, numValue, NumberType.LookAhead, x - 5, y + 6, StringAlignment.Far);
DrawReqNum(g, numValue, NumberType.LookAhead, x - 5 + 3, y + 6, StringAlignment.Far);

//无视防御
g.DrawImage(Resource.UIToolTip_img_Item_Equip_Summary_icon_igpddr, x, y);
x += 62;
g.DrawImage(Resource.UIToolTip_img_Item_Equip_Summary_icon_igpddr, x, y);
this.Gear.Props.TryGetValue(GearPropType.imdR, out value);
numValue = (value > 0 ? "+ " : null) + value + " % ";
DrawReqNum(g, numValue, NumberType.LookAhead, x - 5 - 4, y + 6, StringAlignment.Far);
DrawReqNum(g, numValue, NumberType.LookAhead, x - 5 - 1, y + 6, StringAlignment.Far);
}

private void DrawJobReq(Graphics g, ref int picH)
Expand Down
22 changes: 14 additions & 8 deletions WzComparerR2/CharaSimControl/SetItemTooltipRender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private Bitmap RenderSetItem(out int picHeight)
Brush brush = effect.Value.Enabled ? Brushes.White : GearGraphics.GrayBrush2;

//T116 合并套装
var props = IsCombineProperties ? CombineProperties(effect.Value.Props) : effect.Value.Props;
var props = IsCombineProperties ? CombineProperties(effect.Value.PropsV5) : effect.Value.PropsV5;
foreach (KeyValuePair<GearPropType, object> prop in props)
{
if (prop.Key == GearPropType.Option)
Expand Down Expand Up @@ -179,11 +179,17 @@ private Bitmap RenderSetItem(out int picHeight)
return setBitmap;
}

private SortedDictionary<GearPropType, object> CombineProperties(SortedDictionary<GearPropType, object> props)
private IEnumerable<KeyValuePair<GearPropType, object>> CombineProperties(IEnumerable<KeyValuePair<GearPropType, object>> props)
{
var combinedProps = new SortedDictionary<GearPropType, object>();
var propCache = new SortedDictionary<GearPropType, object>();
foreach(var kv in props)
{
propCache.Add(kv.Key, kv.Value);
}

object obj;
foreach (var prop in props)
foreach (var prop in propCache)
{
switch (prop.Key)
{
Expand All @@ -193,7 +199,7 @@ private Bitmap RenderSetItem(out int picHeight)
{
break;
}
else if (props.TryGetValue(prop.Key == GearPropType.incMHP? GearPropType.incMMP : GearPropType.incMHP, out obj)
else if (propCache.TryGetValue(prop.Key == GearPropType.incMHP? GearPropType.incMMP : GearPropType.incMHP, out obj)
&& object.Equals(prop.Value, obj))
{
combinedProps.Add(GearPropType.incMHP_incMMP, prop.Value);
Expand All @@ -207,7 +213,7 @@ private Bitmap RenderSetItem(out int picHeight)
{
break;
}
else if (props.TryGetValue(prop.Key == GearPropType.incMHPr ? GearPropType.incMMPr : GearPropType.incMHPr, out obj)
else if (propCache.TryGetValue(prop.Key == GearPropType.incMHPr ? GearPropType.incMMPr : GearPropType.incMHPr, out obj)
&& object.Equals(prop.Value, obj))
{
combinedProps.Add(GearPropType.incMHPr_incMMPr, prop.Value);
Expand All @@ -221,7 +227,7 @@ private Bitmap RenderSetItem(out int picHeight)
{
break;
}
else if (props.TryGetValue(prop.Key == GearPropType.incPAD ? GearPropType.incMAD : GearPropType.incPAD, out obj)
else if (propCache.TryGetValue(prop.Key == GearPropType.incPAD ? GearPropType.incMAD : GearPropType.incPAD, out obj)
&& object.Equals(prop.Value, obj))
{
combinedProps.Add(GearPropType.incPAD_incMAD, prop.Value);
Expand All @@ -235,7 +241,7 @@ private Bitmap RenderSetItem(out int picHeight)
{
break;
}
else if (props.TryGetValue(prop.Key == GearPropType.incPDD ? GearPropType.incMDD : GearPropType.incPDD, out obj)
else if (propCache.TryGetValue(prop.Key == GearPropType.incPDD ? GearPropType.incMDD : GearPropType.incPDD, out obj)
&& object.Equals(prop.Value, obj))
{
combinedProps.Add(GearPropType.incPDD_incMDD, prop.Value);
Expand All @@ -249,7 +255,7 @@ private Bitmap RenderSetItem(out int picHeight)
{
break;
}
else if (props.TryGetValue(prop.Key == GearPropType.incACC ? GearPropType.incEVA : GearPropType.incACC, out obj)
else if (propCache.TryGetValue(prop.Key == GearPropType.incACC ? GearPropType.incEVA : GearPropType.incACC, out obj)
&& object.Equals(prop.Value, obj))
{
combinedProps.Add(GearPropType.incACC_incEVA, prop.Value);
Expand Down

0 comments on commit 6ca51e9

Please sign in to comment.