mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-04 12:40:20 +00:00
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:
parent
78eb7906c9
commit
fca14e6b1b
5 changed files with 36 additions and 18 deletions
|
|
@ -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 _ => ;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue