mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-04-28 15:25:22 +00:00
woring Starfire damage calculations; projectiles have open-ended quality modifier
This commit is contained in:
parent
66eb3b5b95
commit
80c1a34fb0
7 changed files with 106 additions and 58 deletions
|
|
@ -2321,7 +2321,7 @@ object GlobalDefinitions {
|
|||
aphelion_starfire_projectile.Aggravated = AggravatedDamage(
|
||||
AggravatedInfo(DamageType.Direct, 0.25f, 250),
|
||||
Aura.None,
|
||||
0,
|
||||
2000,
|
||||
0f,
|
||||
true,
|
||||
List(TargetValidation(EffectTarget.Category.Aircraft, EffectTarget.Validation.Aircraft))
|
||||
|
|
@ -2454,7 +2454,7 @@ object GlobalDefinitions {
|
|||
comet_projectile.Aggravated = AggravatedDamage(
|
||||
AggravatedInfo(DamageType.Direct, 0.2f, 500),
|
||||
Aura.Comet,
|
||||
0,
|
||||
2000,
|
||||
10f,
|
||||
List(
|
||||
TargetValidation(EffectTarget.Category.Player, EffectTarget.Validation.Player),
|
||||
|
|
@ -3910,7 +3910,7 @@ object GlobalDefinitions {
|
|||
starfire_projectile.Aggravated = AggravatedDamage(
|
||||
AggravatedInfo(DamageType.Direct, 0.25f, 250),
|
||||
Aura.Comet,
|
||||
3000,
|
||||
2000,
|
||||
0f,
|
||||
true,
|
||||
List(TargetValidation(EffectTarget.Category.Aircraft, EffectTarget.Validation.Aircraft))
|
||||
|
|
@ -3923,7 +3923,6 @@ object GlobalDefinitions {
|
|||
starfire_projectile.Packet = projectileConverter
|
||||
ProjectileDefinition.CalculateDerivedFields(starfire_projectile)
|
||||
starfire_projectile.Modifiers = List(
|
||||
DamageModifiers.StarfireAggravated,
|
||||
DamageModifiers.StarfireAggravatedBurn,
|
||||
DamageModifiers.RadialDegrade
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package net.psforever.objects.ballistics
|
||||
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
import net.psforever.objects.PlanetSideGameObject
|
||||
import net.psforever.objects.definition.{ProjectileDefinition, ToolDefinition}
|
||||
import net.psforever.objects.entity.SimpleWorldEntity
|
||||
|
|
@ -25,6 +27,9 @@ import net.psforever.types.Vector3
|
|||
* if not, then it is a type of vehicle (and owner should have a positive `seated` field)
|
||||
* @param shot_origin where the projectile started
|
||||
* @param shot_angle in which direction the projectile was aimed when it was discharged
|
||||
* @param quality na
|
||||
* @param id an exclusive identifier for this projectile;
|
||||
* normally generated internally, but can be manually set
|
||||
* @param fire_time when the weapon discharged was recorded;
|
||||
* defaults to `System.nanoTime`
|
||||
*/
|
||||
|
|
@ -36,6 +41,8 @@ final case class Projectile(
|
|||
attribute_to: Int,
|
||||
shot_origin: Vector3,
|
||||
shot_angle: Vector3,
|
||||
quality: Float = 1f,
|
||||
id: Long = Projectile.idGenerator.getAndIncrement(),
|
||||
fire_time: Long = System.nanoTime
|
||||
) extends PlanetSideGameObject {
|
||||
Position = shot_origin
|
||||
|
|
@ -52,6 +59,28 @@ final case class Projectile(
|
|||
val current: SimpleWorldEntity = new SimpleWorldEntity()
|
||||
private var resolved: ProjectileResolution.Value = ProjectileResolution.Unresolved
|
||||
|
||||
/**
|
||||
* Create a copy of this projectile with all the same information
|
||||
* save for the quality.
|
||||
* Used mainly for aggravated damage.
|
||||
* It is important to note that the new projectile shares the (otherwise) exclusive id of the original.
|
||||
* @param value the new quality
|
||||
* @return a new `Projectile` entity
|
||||
*/
|
||||
def quality(value: Float): Projectile =
|
||||
Projectile(
|
||||
profile,
|
||||
tool_def,
|
||||
fire_mode,
|
||||
owner,
|
||||
attribute_to,
|
||||
shot_origin,
|
||||
shot_angle,
|
||||
value,
|
||||
id,
|
||||
fire_time
|
||||
)
|
||||
|
||||
/**
|
||||
* Mark the projectile as being "encountered" or "managed" at least once.
|
||||
*/
|
||||
|
|
@ -80,6 +109,8 @@ object Projectile {
|
|||
*/
|
||||
final val rangeUID: Int = 40150
|
||||
|
||||
private val idGenerator: AtomicLong = new AtomicLong
|
||||
|
||||
/**
|
||||
* Overloaded constructor for an `Unresolved` projectile.
|
||||
* @param profile an explanation of the damage that can be performed by this discharge
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ object DamageModifiers {
|
|||
case (Some(aggravation), v : VehicleSource) if GlobalDefinitions.isFlightVehicle(v.Definition) =>
|
||||
aggravation.info.find(_.damage_type == DamageType.Direct) match {
|
||||
case Some(infos) =>
|
||||
(damage * infos.degradation_percentage) toInt
|
||||
(math.floor(damage * infos.degradation_percentage) * data.projectile.quality) toInt
|
||||
case _ =>
|
||||
damage
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue