public static void KillBuff(Buff buffData, EntityParent caster, EntityParent target, int fromSkillLevel, bool isCommunicateMix) { LocalBattleBuffPropHandler.KillBuff(buffData, caster, target, fromSkillLevel); if (target == null) { return; } if (LocalAgent.GetSpiritIsDead(target, isCommunicateMix)) { return; } if (!LocalAgent.CheckBuffTypeContainOther(buffData, target.ID)) { LocalBattleProtocolSimulator.SendEndWeak(target.ID); } }
public static bool GetEntityUsable(EntityParent entity, bool isCommunicateMix) { return(entity != null && entity.IsFighting && !LocalAgent.GetSpiritIsDead(entity, isCommunicateMix)); }
public static bool GetEntityCalculatable(EntityParent entity, bool isCommunicateMix) { return((LocalAgent.LocalBattleDataLiaison == null || LocalAgent.LocalBattleDataLiaison.IsEnableCalculate) && entity != null && entity.IsFighting && !LocalAgent.GetSpiritIsDead(entity, isCommunicateMix) && entity.BattleBaseAttrs != null); }
protected bool CheckBuff(Buff buffData, EntityParent caster, EntityParent target, int fromSkillID, int elementType, bool isCommunicateMix = false) { if (buffData == null) { return(false); } if (caster == null) { return(false); } if (target == null) { return(false); } if (LocalAgent.GetSpiritIsDead(target, isCommunicateMix)) { return(false); } if (!target.IsFighting) { return(false); } if (!BattleCalculator.CalculateAddBuff(caster.BattleBaseAttrs, target.BattleBaseAttrs, (double)buffData.buffProp, elementType)) { return(false); } XDict <int, BuffState> buffListByEntityID = this.GetBuffListByEntityID(target.ID); if (buffListByEntityID == null) { return(false); } for (int i = 0; i < buffListByEntityID.Count; i++) { if (LocalAgent.GetBuffDataByID(buffListByEntityID.ElementKeyAt(i)).resist.Contains(buffData.type)) { return(false); } } for (int j = 0; j < buffListByEntityID.Count; j++) { if (LocalAgent.GetBuffDataByID(buffListByEntityID.ElementKeyAt(j)).resistId.Contains(buffData.id)) { return(false); } } List <int> list = new List <int>(); for (int k = 0; k < buffListByEntityID.Count; k++) { if (LocalAgent.GetBuffDataByID(buffListByEntityID.ElementKeyAt(k)).cover.Contains(buffData.type)) { list.Add(buffListByEntityID.ElementKeyAt(k)); } } for (int l = 0; l < buffListByEntityID.Count; l++) { if (LocalAgent.GetBuffDataByID(buffListByEntityID.ElementKeyAt(l)).coverId.Contains(buffData.id)) { list.Add(buffListByEntityID.ElementKeyAt(l)); } } for (int m = 0; m < list.get_Count(); m++) { this.AppRemoveBuff(list.get_Item(m), target.ID); } list.Clear(); for (int n = 0; n < buffListByEntityID.Count; n++) { if (buffData.delete.Contains(LocalAgent.GetBuffDataByID(buffListByEntityID.ElementKeyAt(n)).type)) { list.Add(buffListByEntityID.ElementKeyAt(n)); } } for (int num = 0; num < list.get_Count(); num++) { this.AppRemoveBuff(list.get_Item(num), target.ID); } if (LocalAgent.CheckBuffByTargetIDAndBuffID(target.ID, buffData.id)) { int overlayModeId = buffData.overlayModeId; if (overlayModeId != 1 && overlayModeId != 2) { this.AppRemoveBuff(buffData.id, target.ID); } } return(true); }