|
@@ -31,8 +31,12 @@ namespace XmdsCommonSkill.Plugin.Skills
|
|
//记录所有附加毒的玩家信息
|
|
//记录所有附加毒的玩家信息
|
|
//private HashMap<String, PoisonPlayers> mPoisonPlayers = new HashMap<String, PoisonPlayers>();
|
|
//private HashMap<String, PoisonPlayers> mPoisonPlayers = new HashMap<String, PoisonPlayers>();
|
|
|
|
|
|
- //毒buff有效时间
|
|
|
|
- private int mPoisonValidTime;
|
|
|
|
|
|
+ /* 设置叠毒限制 - 非boss单位,N毫秒内叠毒上限M */
|
|
|
|
+ private int mPoisonValidTime; // 毒计算时间维度
|
|
|
|
+ private int mPosionTotals; // 单位时间维度内叠毒上限
|
|
|
|
+ //private short mRecordPosions;
|
|
|
|
+ private long mRecordPosionEndTime; // 单位时间内,累计叠毒截止时间,
|
|
|
|
+ private HashSet<uint> mRecordPosionExt = new HashSet<uint>();
|
|
|
|
|
|
//强化4-5内容
|
|
//强化4-5内容
|
|
public int mPoisonBreakDmgAdd; //毒爆伤害增加
|
|
public int mPoisonBreakDmgAdd; //毒爆伤害增加
|
|
@@ -42,9 +46,10 @@ namespace XmdsCommonSkill.Plugin.Skills
|
|
private long mPoisonRateVaildTime;
|
|
private long mPoisonRateVaildTime;
|
|
private int mPoisonAddRate;
|
|
private int mPoisonAddRate;
|
|
|
|
|
|
- public PlayerCache_Remedy(InstanceUnit unit, int poisonTime) : base(unit, null)
|
|
|
|
|
|
+ public PlayerCache_Remedy(InstanceUnit unit, int recordTime, int poisionTotal) : base(unit, null)
|
|
{
|
|
{
|
|
- this.mPoisonValidTime = Math.Max(1000, poisonTime);
|
|
|
|
|
|
+ this.mPoisonValidTime = recordTime;
|
|
|
|
+ this.mPosionTotals = poisionTotal;
|
|
}
|
|
}
|
|
|
|
|
|
//刷新概率信息
|
|
//刷新概率信息
|
|
@@ -92,13 +97,40 @@ namespace XmdsCommonSkill.Plugin.Skills
|
|
//{
|
|
//{
|
|
// mPoisonRate.Clear();
|
|
// mPoisonRate.Clear();
|
|
//}
|
|
//}
|
|
- this.mPoisonValidTime = 0;
|
|
|
|
this.mPoisonBreakDmgAdd = 0;
|
|
this.mPoisonBreakDmgAdd = 0;
|
|
this.mPoisonBreakFullDmgAdd = 0;
|
|
this.mPoisonBreakFullDmgAdd = 0;
|
|
this.mPoisonRateVaildTime = 0;
|
|
this.mPoisonRateVaildTime = 0;
|
|
this.mPoisonAddRate = 0;
|
|
this.mPoisonAddRate = 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* 是否可以叠毒 */
|
|
|
|
+ public bool IsCanAddPosion(XmdsVirtual hitted)
|
|
|
|
+ {
|
|
|
|
+ if (!hitted.IsBoss())
|
|
|
|
+ {
|
|
|
|
+ if (this.mRecordPosionEndTime > CommonLang.CUtils.localTimeMS)
|
|
|
|
+ {
|
|
|
|
+ //this.mRecordPosions++;
|
|
|
|
+ if (mRecordPosionExt.Count >= mPosionTotals)
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ mRecordPosionExt.Add(hitted.mUnit.ID);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ this.mRecordPosionEndTime = CommonLang.CUtils.localTimeMS + mPoisonValidTime;
|
|
|
|
+ mRecordPosionExt.Clear();
|
|
|
|
+ //this.mRecordPosions = 1;
|
|
|
|
+ mRecordPosionExt.Add(hitted.mUnit.ID);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
|
|
//记录叠毒玩家信息
|
|
//记录叠毒玩家信息
|
|
//public void RecordPoisonPlayer(XmdsVirtual hitter)
|
|
//public void RecordPoisonPlayer(XmdsVirtual hitter)
|
|
@@ -115,52 +147,53 @@ namespace XmdsCommonSkill.Plugin.Skills
|
|
//}
|
|
//}
|
|
|
|
|
|
//刷新配置
|
|
//刷新配置
|
|
- public void RefreshConfig(int poisonTime)
|
|
|
|
|
|
+ public void RefreshConfig(int recordTime, int poisionTotal)
|
|
{
|
|
{
|
|
- this.mPoisonValidTime = Math.Max(1000, poisonTime);
|
|
|
|
|
|
+ this.mPoisonValidTime = recordTime;
|
|
|
|
+ this.mPosionTotals = poisionTotal;
|
|
}
|
|
}
|
|
|
|
|
|
- //毒爆: checkRange内的玩家毒会爆炸
|
|
|
|
- //public void TriggerPoisonEffect(int damageBase, int damagePer, int checkRange = 9, int addLayer = 0, int breakAddBuffId = 0, int breakAddBufMaxLayer = 0)
|
|
|
|
- //{
|
|
|
|
- // XmdsVirtual owner = this.mOwner.Virtual as XmdsVirtual;
|
|
|
|
- // foreach (PoisonPlayers playerData in mPoisonPlayers.Values)
|
|
|
|
- // {
|
|
|
|
- // if (playerData.buffValidTime < CommonLang.CUtils.localTimeMS || !playerData.player.mUnit.IsActive)
|
|
|
|
- // {
|
|
|
|
- // continue;
|
|
|
|
- // }
|
|
|
|
- // else if(CMath.getDistance(mOwner.X, mOwner.Y, playerData.player.mUnit.X, playerData.player.mUnit.Y) > checkRange)
|
|
|
|
- // {
|
|
|
|
- // continue;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // BuffState buffState = playerData.player.mUnit.GetBuffByIDAndSender(Remedy_510601.Buff_POISON, this.mOwner.ID);
|
|
|
|
- // if(buffState == null)
|
|
|
|
- // {
|
|
|
|
- // continue;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // int finalLayer = 1 + buffState.OverlayLevel + addLayer;
|
|
|
|
- // damagePer += (this.mPoisonBreakDmgAdd + (finalLayer >= buffState.Data.MaxOverlay ? this.mPoisonBreakFullDmgAdd : 0));
|
|
|
|
-
|
|
|
|
- // int attackTemp = (int)(owner.MirrorProp.GetFinalAttack(playerData.player.mUnit.IsMonster) / XmdsDamageCalculator.PERER * damagePer);
|
|
|
|
- // int calcDmg = (damageBase + XmdsDamageCalculator.GetDamage(attackTemp, owner, playerData.player, null)) * finalLayer;
|
|
|
|
- // playerData.player.mUnit.AddHP(-calcDmg, this.mOwner);
|
|
|
|
- // playerData.player.mUnit.removeBuffBySender(Remedy_510601.Buff_POISON, this.mOwner.ID);
|
|
|
|
-
|
|
|
|
- // // 附加额外buff
|
|
|
|
- // if(breakAddBuffId > 0)
|
|
|
|
- // {
|
|
|
|
- // BuffState buff = playerData.player.mUnit.AddBuff(breakAddBuffId, this.mOwner, 0, false, false, false, 0, finalLayer);
|
|
|
|
- // buff.SetLayerLevel((byte)(Math.Min(breakAddBufMaxLayer, finalLayer)));
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // System.Console.WriteLine("毒爆: " + playerData.player.mUnit.Info.Name + ", 伤害:" + calcDmg + ", 结算层:" + (1 + buffState.OverlayLevel + addLayer));
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // this.mPoisonPlayers.Clear();
|
|
|
|
- //}
|
|
|
|
|
|
+ //毒爆: checkRange内的玩家毒会爆炸
|
|
|
|
+ //public void TriggerPoisonEffect(int damageBase, int damagePer, int checkRange = 9, int addLayer = 0, int breakAddBuffId = 0, int breakAddBufMaxLayer = 0)
|
|
|
|
+ //{
|
|
|
|
+ // XmdsVirtual owner = this.mOwner.Virtual as XmdsVirtual;
|
|
|
|
+ // foreach (PoisonPlayers playerData in mPoisonPlayers.Values)
|
|
|
|
+ // {
|
|
|
|
+ // if (playerData.buffValidTime < CommonLang.CUtils.localTimeMS || !playerData.player.mUnit.IsActive)
|
|
|
|
+ // {
|
|
|
|
+ // continue;
|
|
|
|
+ // }
|
|
|
|
+ // else if(CMath.getDistance(mOwner.X, mOwner.Y, playerData.player.mUnit.X, playerData.player.mUnit.Y) > checkRange)
|
|
|
|
+ // {
|
|
|
|
+ // continue;
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // BuffState buffState = playerData.player.mUnit.GetBuffByIDAndSender(Remedy_510601.Buff_POISON, this.mOwner.ID);
|
|
|
|
+ // if(buffState == null)
|
|
|
|
+ // {
|
|
|
|
+ // continue;
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // int finalLayer = 1 + buffState.OverlayLevel + addLayer;
|
|
|
|
+ // damagePer += (this.mPoisonBreakDmgAdd + (finalLayer >= buffState.Data.MaxOverlay ? this.mPoisonBreakFullDmgAdd : 0));
|
|
|
|
+
|
|
|
|
+ // int attackTemp = (int)(owner.MirrorProp.GetFinalAttack(playerData.player.mUnit.IsMonster) / XmdsDamageCalculator.PERER * damagePer);
|
|
|
|
+ // int calcDmg = (damageBase + XmdsDamageCalculator.GetDamage(attackTemp, owner, playerData.player, null)) * finalLayer;
|
|
|
|
+ // playerData.player.mUnit.AddHP(-calcDmg, this.mOwner);
|
|
|
|
+ // playerData.player.mUnit.removeBuffBySender(Remedy_510601.Buff_POISON, this.mOwner.ID);
|
|
|
|
+
|
|
|
|
+ // // 附加额外buff
|
|
|
|
+ // if(breakAddBuffId > 0)
|
|
|
|
+ // {
|
|
|
|
+ // BuffState buff = playerData.player.mUnit.AddBuff(breakAddBuffId, this.mOwner, 0, false, false, false, 0, finalLayer);
|
|
|
|
+ // buff.SetLayerLevel((byte)(Math.Min(breakAddBufMaxLayer, finalLayer)));
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // System.Console.WriteLine("毒爆: " + playerData.player.mUnit.Info.Name + ", 伤害:" + calcDmg + ", 结算层:" + (1 + buffState.OverlayLevel + addLayer));
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // this.mPoisonPlayers.Clear();
|
|
|
|
+ //}
|
|
|
|
|
|
- }
|
|
|
|
|
|
+}
|
|
}
|
|
}
|