mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-19 18:14:44 +00:00
added a check called no double lash that should stop players from suffering double lash
This commit is contained in:
parent
e9a7eb3d78
commit
f41de41d5a
|
|
@ -6,9 +6,11 @@ import net.psforever.objects.ballistics.{PlayerSource, SourceEntry}
|
|||
import net.psforever.objects.ce.ComplexDeployable
|
||||
import net.psforever.objects.serverobject.affinity.FactionAffinity
|
||||
import net.psforever.objects.serverobject.damage.Damageable
|
||||
import net.psforever.objects.vital.Vitality
|
||||
import net.psforever.objects.vital.base.DamageResolution
|
||||
import net.psforever.objects.vital.{DamagingActivity, Vitality, VitalsHistory}
|
||||
import net.psforever.objects.vital.damage.DamageCalculations
|
||||
import net.psforever.objects.vital.interaction.{DamageInteraction, DamageResult}
|
||||
import net.psforever.objects.vital.projectile.ProjectileReason
|
||||
import net.psforever.objects.vital.resistance.ResistanceSelection
|
||||
import net.psforever.types.{ExoSuitType, ImplantType}
|
||||
|
||||
|
|
@ -153,7 +155,7 @@ object ResolutionCalculations {
|
|||
def InfantryApplication(damageValues: (Int, Int), data: DamageInteraction)(target: PlanetSideGameObject with FactionAffinity): DamageResult = {
|
||||
val targetBefore = SourceEntry(target)
|
||||
target match {
|
||||
case player: Player =>
|
||||
case player: Player if noDoubleLash(player, data) =>
|
||||
var (a, b) = damageValues
|
||||
if (player.isAlive && !(a == 0 && b == 0)) {
|
||||
val originalHealth = player.Health
|
||||
|
|
@ -323,4 +325,17 @@ object ResolutionCalculations {
|
|||
SimpleApplication(dam, data)(target)
|
||||
}
|
||||
}
|
||||
|
||||
private def noDoubleLash(target: PlanetSideGameObject with VitalsHistory, data: DamageInteraction): Boolean = {
|
||||
data.cause match {
|
||||
case reason: ProjectileReason if reason.resolution == DamageResolution.Lash =>
|
||||
val curr = System.currentTimeMillis()
|
||||
!target.History.exists {
|
||||
case dam: DamagingActivity => curr - dam.time < 1000 && reason.same(dam.data.interaction.cause)
|
||||
case _ => false
|
||||
}
|
||||
case _ =>
|
||||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue