Degraded Lash Damage (#257)

* formulas to calculate consistent distance between origin and impact; lash damage degrades as a function of distance

* clamped the degrade value for lashing damage; clamped the distance value; implemented a rudimentary and unsophisticated shot origin to shot owner distance validation test; fixed a mounting bug

* lashing damage is primarily targeted at exo-suit armor; lashing calculates damage starting at the same distance at which it starts being detected

* clarifying the weapon fired in the warning message
This commit is contained in:
Fate-JH 2019-05-06 08:48:11 -04:00 committed by GitHub
parent 78eb7906c9
commit fca14e6b1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 18 deletions

View file

@ -4427,16 +4427,24 @@ class WorldSessionActor extends Actor with MDCContextAware {
}) {
log.trace(s"WeaponFireMessage: overwriting unresolved projectile ${projectile_guid.guid}")
}
val (angle, attribution) = obj match {
val (angle, attribution, acceptableDistanceToOwner) = obj match {
case p : Player =>
(p.Orientation, tool.Definition.ObjectId) //TODO upper body facing
(p.Orientation, tool.Definition.ObjectId, 10f) //TODO upper body facing
case v : Vehicle if v.Definition.CanFly =>
(tool.Orientation, obj.Definition.ObjectId, 1000f) //TODO this is too simplistic to find proper angle
case _ : Vehicle =>
(tool.Orientation, obj.Definition.ObjectId) //TODO this is too simplistic to find proper angle
(tool.Orientation, obj.Definition.ObjectId, 225f) //TODO this is too simplistic to find proper angle
case _ =>
(obj.Orientation, obj.Definition.ObjectId)
(obj.Orientation, obj.Definition.ObjectId, 300f)
}
val distanceToOwner = Vector3.DistanceSquared(shot_origin, player.Position)
if(distanceToOwner <= acceptableDistanceToOwner) {
projectiles(projectileIndex) =
Some(Projectile(tool.Projectile, tool.Definition, tool.FireMode, player, attribution, shot_origin, angle))
}
else {
log.warn(s"WeaponFireMessage: $player's ${tool.Definition.Name} projectile is too far from owner position at time of discharge ($distanceToOwner > $acceptableDistanceToOwner); suspect")
}
projectiles(projectileIndex) =
Some(Projectile(tool.Projectile, tool.Definition, tool.FireMode, player, attribution, shot_origin, angle))
}
case _ => ;
}