Destroy and repair (#346)
* bog-standard order_terminal amenities now take damage up to the point of destruction and can be repaired from destruction to functional to the point of being fully repaired; this is mostly proof fo concept
* restored proper destruction to FacilityTurrets; extended proper rrepairs to FacilityTurrets; co-opted terminal hacking into TerminalControl; started to expand on hacking protocol, but chose restraint
* changes made thus that a clear Definition hierarchy is established; all of this is in line with making future changes to repair/destroy variables, and making generic the repair code
* all meaningful facility amenities take damage and can be repaired; spawn tubes can be destroyed and the base will properly lose spawns (and show it on the map); some hack logic has been redistributed into the appropriate control objects, following in the wake of repair/damage logic
* deployables are repairable; the TRAP has been converted into a ComplexDeployable; changed the nature of the Repairable traits
* player bank repair and medapp heal has been moved out from WSA into PlayerControl
* overhaul of Progress callback system and the inclusion of player revival as a Progress activity
* begun relocating functionality for hacking outside of WSA; set up behavoir mixin for cargo operations, in order to move vehicle hack function, but did not yet integrate
* integration of the actor behavior mixin for vehicle cargo operations to support the integration of vehicle hacking finalization
* establishing inheritance/override potential of Damageable activity; Generator and SpawnTube map behavior behavior (currently inactive)
* ImplantTerminalMech objects now have a 'with-coordinates' constructor and a deprecated 'no-coordinates' constructor; implants mechs and interfaces are now damageable and repairable, and their damage state can also block mounting
* generators are destroyed and repaired properly, and even explode, killing a radius-worth of players
* destroy and repair pass on deployables, except for explosive types
* Damageable pass; client synchronization pass
* helpful comments
* some tests for damageable and repairable; refined output and repaired existing tests
* enabled friendly fire check and recovery
* handled friendly fire against allied mines; moved jammer code to common damageable behavior
* tweaks to damageability, infantry heal and repair, and sensor and explosive animations
* animations; framework for future vitals events; closing database connections
* adding some deployable tests; fixing a bunch of other tests; History is back
* testing for basic Damageable functions; removing a log message
* finicky animation stuff
* event messages to the Generator to represent health changes
* damage against BFR's is now only used against mythical creatures
* test fix
2020-04-14 15:17:32 -04:00
|
|
|
// Copyright (c) 2018 PSForever
|
2018-09-23 08:00:58 -04:00
|
|
|
package net.psforever.objects
|
|
|
|
|
|
2019-12-27 00:18:46 -05:00
|
|
|
import akka.actor.{Actor, ActorContext, Props}
|
2021-01-12 23:01:08 -05:00
|
|
|
import net.psforever.objects.ballistics.{PlayerSource, SourceEntry}
|
2019-12-27 00:18:46 -05:00
|
|
|
import net.psforever.objects.ce._
|
|
|
|
|
import net.psforever.objects.definition.{ComplexDeployableDefinition, SimpleDeployableDefinition}
|
|
|
|
|
import net.psforever.objects.definition.converter.SmallDeployableConverter
|
2019-12-21 09:08:06 -05:00
|
|
|
import net.psforever.objects.equipment.JammableUnit
|
2021-02-03 19:39:32 -05:00
|
|
|
import net.psforever.objects.geometry.Geometry3D
|
2021-01-27 14:33:43 -05:00
|
|
|
import net.psforever.objects.serverobject.affinity.FactionAffinity
|
2021-01-12 23:01:08 -05:00
|
|
|
import net.psforever.objects.serverobject.{CommonMessages, PlanetSideServerObject}
|
Damage Changes/Explosions (#644)
* created base damage interaction classes and replaced various projectile-based damage that utilized ResolvedProjectile; not refined, maintains redundancy and overloads, but should work
* continuing to reduce the exposure of ResolvedProjectile and replacing it with applications of DamageInteraction, DamageResult, and DamageReason
* removed ResolvedProjectile from the project; adjusted remaining code paths to work around it
* vitals.test became vital.base; no one liked this
* lots of inheritance, polymorphism, and other chicanery; moved around files, so it also looks like more files have changed when they have not (even if they did)
* codecov file correction
* master rebase; vital directory structure changed, so file imports have been modified in several other files; ResolutionSelection has been removed, requiring direct function literal assignment; tests repaired, where necessary; no actual functional change
* code comments
* DamageResult is its own case class now, wrapping around a before/after target and the interaction used in its calaculations; tests have been corrected
* adjusted Player.Die() to demonstrate a damage-based suicide approach
* resolved circular inheritance in projectile damage modifiers; better employed explosion reason, damages players around exploding vehicle as example
* expanded explosions to other object types; exploding is now a flag and the damage is an innate property of the object type; removed advanced references to properties on the damage source, since the damage source is easily accessible; wrote comments; fixed tests
* overhaul to painbox damage to align with normal player damage handling, thus assimilating it properly into the damage system
* future development; normal vector from euler angles; custom proximity test
* where 'innateDamage' should have not replaced 'explosion'
* moved the hitPos for the generator test; attempting to imrpove the reliability of the auto-repair integration tests (didn't ...)
* spelling and private val
2020-12-08 14:32:42 -05:00
|
|
|
import net.psforever.objects.serverobject.damage.{Damageable, DamageableEntity}
|
2020-08-18 13:32:43 -04:00
|
|
|
import net.psforever.objects.serverobject.damage.Damageable.Target
|
|
|
|
|
import net.psforever.objects.vital.resolution.ResolutionCalculations.Output
|
2021-01-27 14:33:43 -05:00
|
|
|
import net.psforever.objects.vital.{SimpleResolutions, Vitality}
|
2021-01-12 23:01:08 -05:00
|
|
|
import net.psforever.objects.vital.etc.TriggerUsedReason
|
|
|
|
|
import net.psforever.objects.vital.interaction.{DamageInteraction, DamageResult}
|
Damage Changes/Explosions (#644)
* created base damage interaction classes and replaced various projectile-based damage that utilized ResolvedProjectile; not refined, maintains redundancy and overloads, but should work
* continuing to reduce the exposure of ResolvedProjectile and replacing it with applications of DamageInteraction, DamageResult, and DamageReason
* removed ResolvedProjectile from the project; adjusted remaining code paths to work around it
* vitals.test became vital.base; no one liked this
* lots of inheritance, polymorphism, and other chicanery; moved around files, so it also looks like more files have changed when they have not (even if they did)
* codecov file correction
* master rebase; vital directory structure changed, so file imports have been modified in several other files; ResolutionSelection has been removed, requiring direct function literal assignment; tests repaired, where necessary; no actual functional change
* code comments
* DamageResult is its own case class now, wrapping around a before/after target and the interaction used in its calaculations; tests have been corrected
* adjusted Player.Die() to demonstrate a damage-based suicide approach
* resolved circular inheritance in projectile damage modifiers; better employed explosion reason, damages players around exploding vehicle as example
* expanded explosions to other object types; exploding is now a flag and the damage is an innate property of the object type; removed advanced references to properties on the damage source, since the damage source is easily accessible; wrote comments; fixed tests
* overhaul to painbox damage to align with normal player damage handling, thus assimilating it properly into the damage system
* future development; normal vector from euler angles; custom proximity test
* where 'innateDamage' should have not replaced 'explosion'
* moved the hitPos for the generator test; attempting to imrpove the reliability of the auto-repair integration tests (didn't ...)
* spelling and private val
2020-12-08 14:32:42 -05:00
|
|
|
import net.psforever.objects.vital.projectile.ProjectileReason
|
Destroy and repair (#346)
* bog-standard order_terminal amenities now take damage up to the point of destruction and can be repaired from destruction to functional to the point of being fully repaired; this is mostly proof fo concept
* restored proper destruction to FacilityTurrets; extended proper rrepairs to FacilityTurrets; co-opted terminal hacking into TerminalControl; started to expand on hacking protocol, but chose restraint
* changes made thus that a clear Definition hierarchy is established; all of this is in line with making future changes to repair/destroy variables, and making generic the repair code
* all meaningful facility amenities take damage and can be repaired; spawn tubes can be destroyed and the base will properly lose spawns (and show it on the map); some hack logic has been redistributed into the appropriate control objects, following in the wake of repair/damage logic
* deployables are repairable; the TRAP has been converted into a ComplexDeployable; changed the nature of the Repairable traits
* player bank repair and medapp heal has been moved out from WSA into PlayerControl
* overhaul of Progress callback system and the inclusion of player revival as a Progress activity
* begun relocating functionality for hacking outside of WSA; set up behavoir mixin for cargo operations, in order to move vehicle hack function, but did not yet integrate
* integration of the actor behavior mixin for vehicle cargo operations to support the integration of vehicle hacking finalization
* establishing inheritance/override potential of Damageable activity; Generator and SpawnTube map behavior behavior (currently inactive)
* ImplantTerminalMech objects now have a 'with-coordinates' constructor and a deprecated 'no-coordinates' constructor; implants mechs and interfaces are now damageable and repairable, and their damage state can also block mounting
* generators are destroyed and repaired properly, and even explode, killing a radius-worth of players
* destroy and repair pass on deployables, except for explosive types
* Damageable pass; client synchronization pass
* helpful comments
* some tests for damageable and repairable; refined output and repaired existing tests
* enabled friendly fire check and recovery
* handled friendly fire against allied mines; moved jammer code to common damageable behavior
* tweaks to damageability, infantry heal and repair, and sensor and explosive animations
* animations; framework for future vitals events; closing database connections
* adding some deployable tests; fixing a bunch of other tests; History is back
* testing for basic Damageable functions; removing a log message
* finicky animation stuff
* event messages to the Generator to represent health changes
* damage against BFR's is now only used against mythical creatures
* test fix
2020-04-14 15:17:32 -04:00
|
|
|
import net.psforever.objects.zones.Zone
|
Damage Changes/Explosions (#644)
* created base damage interaction classes and replaced various projectile-based damage that utilized ResolvedProjectile; not refined, maintains redundancy and overloads, but should work
* continuing to reduce the exposure of ResolvedProjectile and replacing it with applications of DamageInteraction, DamageResult, and DamageReason
* removed ResolvedProjectile from the project; adjusted remaining code paths to work around it
* vitals.test became vital.base; no one liked this
* lots of inheritance, polymorphism, and other chicanery; moved around files, so it also looks like more files have changed when they have not (even if they did)
* codecov file correction
* master rebase; vital directory structure changed, so file imports have been modified in several other files; ResolutionSelection has been removed, requiring direct function literal assignment; tests repaired, where necessary; no actual functional change
* code comments
* DamageResult is its own case class now, wrapping around a before/after target and the interaction used in its calaculations; tests have been corrected
* adjusted Player.Die() to demonstrate a damage-based suicide approach
* resolved circular inheritance in projectile damage modifiers; better employed explosion reason, damages players around exploding vehicle as example
* expanded explosions to other object types; exploding is now a flag and the damage is an innate property of the object type; removed advanced references to properties on the damage source, since the damage source is easily accessible; wrote comments; fixed tests
* overhaul to painbox damage to align with normal player damage handling, thus assimilating it properly into the damage system
* future development; normal vector from euler angles; custom proximity test
* where 'innateDamage' should have not replaced 'explosion'
* moved the hitPos for the generator test; attempting to imrpove the reliability of the auto-repair integration tests (didn't ...)
* spelling and private val
2020-12-08 14:32:42 -05:00
|
|
|
import net.psforever.types.Vector3
|
2020-08-23 03:26:06 +02:00
|
|
|
import net.psforever.services.Service
|
|
|
|
|
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
|
|
|
|
|
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
|
2018-09-23 08:00:58 -04:00
|
|
|
|
2019-12-27 00:18:46 -05:00
|
|
|
import scala.concurrent.duration._
|
|
|
|
|
|
2021-01-12 23:01:08 -05:00
|
|
|
class ExplosiveDeployable(cdef: ExplosiveDeployableDefinition)
|
|
|
|
|
extends ComplexDeployable(cdef)
|
|
|
|
|
with JammableUnit {
|
2019-12-27 00:18:46 -05:00
|
|
|
|
2020-07-14 05:54:05 +02:00
|
|
|
override def Definition: ExplosiveDeployableDefinition = cdef
|
2018-09-23 08:00:58 -04:00
|
|
|
}
|
2019-12-27 00:18:46 -05:00
|
|
|
|
2020-07-14 05:54:05 +02:00
|
|
|
class ExplosiveDeployableDefinition(private val objectId: Int) extends ComplexDeployableDefinition(objectId) {
|
2019-12-27 00:18:46 -05:00
|
|
|
Name = "explosive_deployable"
|
|
|
|
|
DeployCategory = DeployableCategory.Mines
|
Damage Changes/Explosions (#644)
* created base damage interaction classes and replaced various projectile-based damage that utilized ResolvedProjectile; not refined, maintains redundancy and overloads, but should work
* continuing to reduce the exposure of ResolvedProjectile and replacing it with applications of DamageInteraction, DamageResult, and DamageReason
* removed ResolvedProjectile from the project; adjusted remaining code paths to work around it
* vitals.test became vital.base; no one liked this
* lots of inheritance, polymorphism, and other chicanery; moved around files, so it also looks like more files have changed when they have not (even if they did)
* codecov file correction
* master rebase; vital directory structure changed, so file imports have been modified in several other files; ResolutionSelection has been removed, requiring direct function literal assignment; tests repaired, where necessary; no actual functional change
* code comments
* DamageResult is its own case class now, wrapping around a before/after target and the interaction used in its calaculations; tests have been corrected
* adjusted Player.Die() to demonstrate a damage-based suicide approach
* resolved circular inheritance in projectile damage modifiers; better employed explosion reason, damages players around exploding vehicle as example
* expanded explosions to other object types; exploding is now a flag and the damage is an innate property of the object type; removed advanced references to properties on the damage source, since the damage source is easily accessible; wrote comments; fixed tests
* overhaul to painbox damage to align with normal player damage handling, thus assimilating it properly into the damage system
* future development; normal vector from euler angles; custom proximity test
* where 'innateDamage' should have not replaced 'explosion'
* moved the hitPos for the generator test; attempting to imrpove the reliability of the auto-repair integration tests (didn't ...)
* spelling and private val
2020-12-08 14:32:42 -05:00
|
|
|
Model = SimpleResolutions.calculate
|
2019-12-27 00:18:46 -05:00
|
|
|
Packet = new SmallDeployableConverter
|
|
|
|
|
|
2020-07-14 05:54:05 +02:00
|
|
|
private var detonateOnJamming: Boolean = true
|
2019-12-27 00:18:46 -05:00
|
|
|
|
2020-07-14 05:54:05 +02:00
|
|
|
def DetonateOnJamming: Boolean = detonateOnJamming
|
2019-12-27 00:18:46 -05:00
|
|
|
|
2020-07-14 05:54:05 +02:00
|
|
|
def DetonateOnJamming_=(detonate: Boolean): Boolean = {
|
2019-12-27 00:18:46 -05:00
|
|
|
detonateOnJamming = detonate
|
|
|
|
|
DetonateOnJamming
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-14 05:54:05 +02:00
|
|
|
override def Initialize(obj: PlanetSideServerObject with Deployable, context: ActorContext) = {
|
|
|
|
|
obj.Actor =
|
|
|
|
|
context.actorOf(Props(classOf[ExplosiveDeployableControl], obj), PlanetSideServerObject.UniqueActorName(obj))
|
2019-12-27 00:18:46 -05:00
|
|
|
}
|
|
|
|
|
|
2020-07-14 05:54:05 +02:00
|
|
|
override def Uninitialize(obj: PlanetSideServerObject with Deployable, context: ActorContext) = {
|
2019-12-27 00:18:46 -05:00
|
|
|
SimpleDeployableDefinition.SimpleUninitialize(obj, context)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object ExplosiveDeployableDefinition {
|
2020-07-14 05:54:05 +02:00
|
|
|
def apply(dtype: DeployedItem.Value): ExplosiveDeployableDefinition = {
|
2019-12-27 00:18:46 -05:00
|
|
|
new ExplosiveDeployableDefinition(dtype.id)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-14 05:54:05 +02:00
|
|
|
class ExplosiveDeployableControl(mine: ExplosiveDeployable) extends Actor with Damageable {
|
Destroy and repair (#346)
* bog-standard order_terminal amenities now take damage up to the point of destruction and can be repaired from destruction to functional to the point of being fully repaired; this is mostly proof fo concept
* restored proper destruction to FacilityTurrets; extended proper rrepairs to FacilityTurrets; co-opted terminal hacking into TerminalControl; started to expand on hacking protocol, but chose restraint
* changes made thus that a clear Definition hierarchy is established; all of this is in line with making future changes to repair/destroy variables, and making generic the repair code
* all meaningful facility amenities take damage and can be repaired; spawn tubes can be destroyed and the base will properly lose spawns (and show it on the map); some hack logic has been redistributed into the appropriate control objects, following in the wake of repair/damage logic
* deployables are repairable; the TRAP has been converted into a ComplexDeployable; changed the nature of the Repairable traits
* player bank repair and medapp heal has been moved out from WSA into PlayerControl
* overhaul of Progress callback system and the inclusion of player revival as a Progress activity
* begun relocating functionality for hacking outside of WSA; set up behavoir mixin for cargo operations, in order to move vehicle hack function, but did not yet integrate
* integration of the actor behavior mixin for vehicle cargo operations to support the integration of vehicle hacking finalization
* establishing inheritance/override potential of Damageable activity; Generator and SpawnTube map behavior behavior (currently inactive)
* ImplantTerminalMech objects now have a 'with-coordinates' constructor and a deprecated 'no-coordinates' constructor; implants mechs and interfaces are now damageable and repairable, and their damage state can also block mounting
* generators are destroyed and repaired properly, and even explode, killing a radius-worth of players
* destroy and repair pass on deployables, except for explosive types
* Damageable pass; client synchronization pass
* helpful comments
* some tests for damageable and repairable; refined output and repaired existing tests
* enabled friendly fire check and recovery
* handled friendly fire against allied mines; moved jammer code to common damageable behavior
* tweaks to damageability, infantry heal and repair, and sensor and explosive animations
* animations; framework for future vitals events; closing database connections
* adding some deployable tests; fixing a bunch of other tests; History is back
* testing for basic Damageable functions; removing a log message
* finicky animation stuff
* event messages to the Generator to represent health changes
* damage against BFR's is now only used against mythical creatures
* test fix
2020-04-14 15:17:32 -04:00
|
|
|
def DamageableObject = mine
|
|
|
|
|
|
2020-07-14 05:54:05 +02:00
|
|
|
def receive: Receive =
|
|
|
|
|
takesDamage
|
|
|
|
|
.orElse {
|
2021-01-12 23:01:08 -05:00
|
|
|
case CommonMessages.Use(player, Some(trigger: BoomerTrigger)) if {
|
|
|
|
|
mine match {
|
|
|
|
|
case boomer: BoomerDeployable => boomer.Trigger.contains(trigger) && mine.Definition.Damageable
|
|
|
|
|
case _ => false
|
|
|
|
|
}
|
|
|
|
|
} =>
|
2021-01-20 22:56:29 -05:00
|
|
|
// the trigger damages the mine, which sets it off, which causes an explosion
|
2021-01-12 23:01:08 -05:00
|
|
|
// think of this as an initiator to the proper explosion
|
|
|
|
|
mine.Destroyed = true
|
|
|
|
|
ExplosiveDeployableControl.DamageResolution(
|
|
|
|
|
mine,
|
|
|
|
|
DamageInteraction(
|
|
|
|
|
SourceEntry(mine),
|
2021-02-08 00:20:17 -05:00
|
|
|
TriggerUsedReason(PlayerSource(player), trigger.GUID),
|
2021-01-12 23:01:08 -05:00
|
|
|
mine.Position
|
|
|
|
|
).calculate()(mine),
|
|
|
|
|
damage = 0
|
|
|
|
|
)
|
2020-07-14 05:54:05 +02:00
|
|
|
case _ => ;
|
|
|
|
|
}
|
2019-12-27 00:18:46 -05:00
|
|
|
|
2020-08-18 13:32:43 -04:00
|
|
|
override protected def PerformDamage(
|
|
|
|
|
target: Target,
|
|
|
|
|
applyDamageTo: Output
|
|
|
|
|
): Unit = {
|
|
|
|
|
if (mine.CanDamage) {
|
|
|
|
|
val originalHealth = mine.Health
|
|
|
|
|
val cause = applyDamageTo(mine)
|
|
|
|
|
val damage = originalHealth - mine.Health
|
2021-01-27 14:33:43 -05:00
|
|
|
if (CanDetonate(mine, damage, cause.interaction)) {
|
2020-08-18 13:32:43 -04:00
|
|
|
ExplosiveDeployableControl.DamageResolution(mine, cause, damage)
|
|
|
|
|
} else {
|
|
|
|
|
mine.Health = originalHealth
|
Destroy and repair (#346)
* bog-standard order_terminal amenities now take damage up to the point of destruction and can be repaired from destruction to functional to the point of being fully repaired; this is mostly proof fo concept
* restored proper destruction to FacilityTurrets; extended proper rrepairs to FacilityTurrets; co-opted terminal hacking into TerminalControl; started to expand on hacking protocol, but chose restraint
* changes made thus that a clear Definition hierarchy is established; all of this is in line with making future changes to repair/destroy variables, and making generic the repair code
* all meaningful facility amenities take damage and can be repaired; spawn tubes can be destroyed and the base will properly lose spawns (and show it on the map); some hack logic has been redistributed into the appropriate control objects, following in the wake of repair/damage logic
* deployables are repairable; the TRAP has been converted into a ComplexDeployable; changed the nature of the Repairable traits
* player bank repair and medapp heal has been moved out from WSA into PlayerControl
* overhaul of Progress callback system and the inclusion of player revival as a Progress activity
* begun relocating functionality for hacking outside of WSA; set up behavoir mixin for cargo operations, in order to move vehicle hack function, but did not yet integrate
* integration of the actor behavior mixin for vehicle cargo operations to support the integration of vehicle hacking finalization
* establishing inheritance/override potential of Damageable activity; Generator and SpawnTube map behavior behavior (currently inactive)
* ImplantTerminalMech objects now have a 'with-coordinates' constructor and a deprecated 'no-coordinates' constructor; implants mechs and interfaces are now damageable and repairable, and their damage state can also block mounting
* generators are destroyed and repaired properly, and even explode, killing a radius-worth of players
* destroy and repair pass on deployables, except for explosive types
* Damageable pass; client synchronization pass
* helpful comments
* some tests for damageable and repairable; refined output and repaired existing tests
* enabled friendly fire check and recovery
* handled friendly fire against allied mines; moved jammer code to common damageable behavior
* tweaks to damageability, infantry heal and repair, and sensor and explosive animations
* animations; framework for future vitals events; closing database connections
* adding some deployable tests; fixing a bunch of other tests; History is back
* testing for basic Damageable functions; removing a log message
* finicky animation stuff
* event messages to the Generator to represent health changes
* damage against BFR's is now only used against mythical creatures
* test fix
2020-04-14 15:17:32 -04:00
|
|
|
}
|
2020-08-18 13:32:43 -04:00
|
|
|
}
|
2019-12-27 00:18:46 -05:00
|
|
|
}
|
2021-01-27 14:33:43 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A supplement for checking target susceptibility
|
|
|
|
|
* to account for sympathetic explosives even if there is no damage.
|
|
|
|
|
* This does not supercede other underlying checks or undo prior damage checks.
|
|
|
|
|
* @see `Damageable.CanDamageOrJammer`
|
|
|
|
|
* @see `DamageProperties.SympatheticExplosives`
|
|
|
|
|
* @param obj the entity being damaged
|
|
|
|
|
* @param damage the amount of damage
|
|
|
|
|
* @param data historical information about the damage
|
|
|
|
|
* @return `true`, if the target can be affected;
|
|
|
|
|
* `false`, otherwise
|
|
|
|
|
*/
|
|
|
|
|
def CanDetonate(obj: Vitality with FactionAffinity, damage: Int, data: DamageInteraction): Boolean = {
|
2021-02-03 19:39:32 -05:00
|
|
|
!mine.Destroyed && (if (damage == 0 && data.cause.source.SympatheticExplosion) {
|
2021-01-27 14:33:43 -05:00
|
|
|
Damageable.CanDamageOrJammer(mine, damage = 1, data)
|
|
|
|
|
} else {
|
|
|
|
|
Damageable.CanDamageOrJammer(mine, damage, data)
|
2021-02-03 19:39:32 -05:00
|
|
|
})
|
2021-01-27 14:33:43 -05:00
|
|
|
}
|
2019-12-27 00:18:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object ExplosiveDeployableControl {
|
2021-01-12 23:01:08 -05:00
|
|
|
/**
|
|
|
|
|
* na
|
|
|
|
|
* @param target na
|
|
|
|
|
* @param cause na
|
|
|
|
|
* @param damage na
|
|
|
|
|
*/
|
Damage Changes/Explosions (#644)
* created base damage interaction classes and replaced various projectile-based damage that utilized ResolvedProjectile; not refined, maintains redundancy and overloads, but should work
* continuing to reduce the exposure of ResolvedProjectile and replacing it with applications of DamageInteraction, DamageResult, and DamageReason
* removed ResolvedProjectile from the project; adjusted remaining code paths to work around it
* vitals.test became vital.base; no one liked this
* lots of inheritance, polymorphism, and other chicanery; moved around files, so it also looks like more files have changed when they have not (even if they did)
* codecov file correction
* master rebase; vital directory structure changed, so file imports have been modified in several other files; ResolutionSelection has been removed, requiring direct function literal assignment; tests repaired, where necessary; no actual functional change
* code comments
* DamageResult is its own case class now, wrapping around a before/after target and the interaction used in its calaculations; tests have been corrected
* adjusted Player.Die() to demonstrate a damage-based suicide approach
* resolved circular inheritance in projectile damage modifiers; better employed explosion reason, damages players around exploding vehicle as example
* expanded explosions to other object types; exploding is now a flag and the damage is an innate property of the object type; removed advanced references to properties on the damage source, since the damage source is easily accessible; wrote comments; fixed tests
* overhaul to painbox damage to align with normal player damage handling, thus assimilating it properly into the damage system
* future development; normal vector from euler angles; custom proximity test
* where 'innateDamage' should have not replaced 'explosion'
* moved the hitPos for the generator test; attempting to imrpove the reliability of the auto-repair integration tests (didn't ...)
* spelling and private val
2020-12-08 14:32:42 -05:00
|
|
|
def DamageResolution(target: ExplosiveDeployable, cause: DamageResult, damage: Int): Unit = {
|
Destroy and repair (#346)
* bog-standard order_terminal amenities now take damage up to the point of destruction and can be repaired from destruction to functional to the point of being fully repaired; this is mostly proof fo concept
* restored proper destruction to FacilityTurrets; extended proper rrepairs to FacilityTurrets; co-opted terminal hacking into TerminalControl; started to expand on hacking protocol, but chose restraint
* changes made thus that a clear Definition hierarchy is established; all of this is in line with making future changes to repair/destroy variables, and making generic the repair code
* all meaningful facility amenities take damage and can be repaired; spawn tubes can be destroyed and the base will properly lose spawns (and show it on the map); some hack logic has been redistributed into the appropriate control objects, following in the wake of repair/damage logic
* deployables are repairable; the TRAP has been converted into a ComplexDeployable; changed the nature of the Repairable traits
* player bank repair and medapp heal has been moved out from WSA into PlayerControl
* overhaul of Progress callback system and the inclusion of player revival as a Progress activity
* begun relocating functionality for hacking outside of WSA; set up behavoir mixin for cargo operations, in order to move vehicle hack function, but did not yet integrate
* integration of the actor behavior mixin for vehicle cargo operations to support the integration of vehicle hacking finalization
* establishing inheritance/override potential of Damageable activity; Generator and SpawnTube map behavior behavior (currently inactive)
* ImplantTerminalMech objects now have a 'with-coordinates' constructor and a deprecated 'no-coordinates' constructor; implants mechs and interfaces are now damageable and repairable, and their damage state can also block mounting
* generators are destroyed and repaired properly, and even explode, killing a radius-worth of players
* destroy and repair pass on deployables, except for explosive types
* Damageable pass; client synchronization pass
* helpful comments
* some tests for damageable and repairable; refined output and repaired existing tests
* enabled friendly fire check and recovery
* handled friendly fire against allied mines; moved jammer code to common damageable behavior
* tweaks to damageability, infantry heal and repair, and sensor and explosive animations
* animations; framework for future vitals events; closing database connections
* adding some deployable tests; fixing a bunch of other tests; History is back
* testing for basic Damageable functions; removing a log message
* finicky animation stuff
* event messages to the Generator to represent health changes
* damage against BFR's is now only used against mythical creatures
* test fix
2020-04-14 15:17:32 -04:00
|
|
|
target.History(cause)
|
2021-01-12 23:01:08 -05:00
|
|
|
if (cause.interaction.cause.source.SympatheticExplosion) {
|
|
|
|
|
explodes(target, cause)
|
|
|
|
|
DestructionAwareness(target, cause)
|
|
|
|
|
} else if (target.Health == 0) {
|
Destroy and repair (#346)
* bog-standard order_terminal amenities now take damage up to the point of destruction and can be repaired from destruction to functional to the point of being fully repaired; this is mostly proof fo concept
* restored proper destruction to FacilityTurrets; extended proper rrepairs to FacilityTurrets; co-opted terminal hacking into TerminalControl; started to expand on hacking protocol, but chose restraint
* changes made thus that a clear Definition hierarchy is established; all of this is in line with making future changes to repair/destroy variables, and making generic the repair code
* all meaningful facility amenities take damage and can be repaired; spawn tubes can be destroyed and the base will properly lose spawns (and show it on the map); some hack logic has been redistributed into the appropriate control objects, following in the wake of repair/damage logic
* deployables are repairable; the TRAP has been converted into a ComplexDeployable; changed the nature of the Repairable traits
* player bank repair and medapp heal has been moved out from WSA into PlayerControl
* overhaul of Progress callback system and the inclusion of player revival as a Progress activity
* begun relocating functionality for hacking outside of WSA; set up behavoir mixin for cargo operations, in order to move vehicle hack function, but did not yet integrate
* integration of the actor behavior mixin for vehicle cargo operations to support the integration of vehicle hacking finalization
* establishing inheritance/override potential of Damageable activity; Generator and SpawnTube map behavior behavior (currently inactive)
* ImplantTerminalMech objects now have a 'with-coordinates' constructor and a deprecated 'no-coordinates' constructor; implants mechs and interfaces are now damageable and repairable, and their damage state can also block mounting
* generators are destroyed and repaired properly, and even explode, killing a radius-worth of players
* destroy and repair pass on deployables, except for explosive types
* Damageable pass; client synchronization pass
* helpful comments
* some tests for damageable and repairable; refined output and repaired existing tests
* enabled friendly fire check and recovery
* handled friendly fire against allied mines; moved jammer code to common damageable behavior
* tweaks to damageability, infantry heal and repair, and sensor and explosive animations
* animations; framework for future vitals events; closing database connections
* adding some deployable tests; fixing a bunch of other tests; History is back
* testing for basic Damageable functions; removing a log message
* finicky animation stuff
* event messages to the Generator to represent health changes
* damage against BFR's is now only used against mythical creatures
* test fix
2020-04-14 15:17:32 -04:00
|
|
|
DestructionAwareness(target, cause)
|
Damage Changes/Explosions (#644)
* created base damage interaction classes and replaced various projectile-based damage that utilized ResolvedProjectile; not refined, maintains redundancy and overloads, but should work
* continuing to reduce the exposure of ResolvedProjectile and replacing it with applications of DamageInteraction, DamageResult, and DamageReason
* removed ResolvedProjectile from the project; adjusted remaining code paths to work around it
* vitals.test became vital.base; no one liked this
* lots of inheritance, polymorphism, and other chicanery; moved around files, so it also looks like more files have changed when they have not (even if they did)
* codecov file correction
* master rebase; vital directory structure changed, so file imports have been modified in several other files; ResolutionSelection has been removed, requiring direct function literal assignment; tests repaired, where necessary; no actual functional change
* code comments
* DamageResult is its own case class now, wrapping around a before/after target and the interaction used in its calaculations; tests have been corrected
* adjusted Player.Die() to demonstrate a damage-based suicide approach
* resolved circular inheritance in projectile damage modifiers; better employed explosion reason, damages players around exploding vehicle as example
* expanded explosions to other object types; exploding is now a flag and the damage is an innate property of the object type; removed advanced references to properties on the damage source, since the damage source is easily accessible; wrote comments; fixed tests
* overhaul to painbox damage to align with normal player damage handling, thus assimilating it properly into the damage system
* future development; normal vector from euler angles; custom proximity test
* where 'innateDamage' should have not replaced 'explosion'
* moved the hitPos for the generator test; attempting to imrpove the reliability of the auto-repair integration tests (didn't ...)
* spelling and private val
2020-12-08 14:32:42 -05:00
|
|
|
} else if (!target.Jammed && Damageable.CanJammer(target, cause.interaction)) {
|
|
|
|
|
if ( {
|
|
|
|
|
target.Jammed = cause.interaction.cause match {
|
|
|
|
|
case o: ProjectileReason =>
|
|
|
|
|
val radius = o.projectile.profile.DamageRadius
|
|
|
|
|
Vector3.DistanceSquared(cause.interaction.hitPos, cause.interaction.target.Position) < radius * radius
|
|
|
|
|
case _ =>
|
|
|
|
|
true
|
2020-07-14 05:54:05 +02:00
|
|
|
}
|
Damage Changes/Explosions (#644)
* created base damage interaction classes and replaced various projectile-based damage that utilized ResolvedProjectile; not refined, maintains redundancy and overloads, but should work
* continuing to reduce the exposure of ResolvedProjectile and replacing it with applications of DamageInteraction, DamageResult, and DamageReason
* removed ResolvedProjectile from the project; adjusted remaining code paths to work around it
* vitals.test became vital.base; no one liked this
* lots of inheritance, polymorphism, and other chicanery; moved around files, so it also looks like more files have changed when they have not (even if they did)
* codecov file correction
* master rebase; vital directory structure changed, so file imports have been modified in several other files; ResolutionSelection has been removed, requiring direct function literal assignment; tests repaired, where necessary; no actual functional change
* code comments
* DamageResult is its own case class now, wrapping around a before/after target and the interaction used in its calaculations; tests have been corrected
* adjusted Player.Die() to demonstrate a damage-based suicide approach
* resolved circular inheritance in projectile damage modifiers; better employed explosion reason, damages players around exploding vehicle as example
* expanded explosions to other object types; exploding is now a flag and the damage is an innate property of the object type; removed advanced references to properties on the damage source, since the damage source is easily accessible; wrote comments; fixed tests
* overhaul to painbox damage to align with normal player damage handling, thus assimilating it properly into the damage system
* future development; normal vector from euler angles; custom proximity test
* where 'innateDamage' should have not replaced 'explosion'
* moved the hitPos for the generator test; attempting to imrpove the reliability of the auto-repair integration tests (didn't ...)
* spelling and private val
2020-12-08 14:32:42 -05:00
|
|
|
}
|
2020-07-14 05:54:05 +02:00
|
|
|
) {
|
2021-01-12 23:01:08 -05:00
|
|
|
if (target.Definition.DetonateOnJamming) {
|
|
|
|
|
explodes(target, cause)
|
2019-12-27 00:18:46 -05:00
|
|
|
}
|
Destroy and repair (#346)
* bog-standard order_terminal amenities now take damage up to the point of destruction and can be repaired from destruction to functional to the point of being fully repaired; this is mostly proof fo concept
* restored proper destruction to FacilityTurrets; extended proper rrepairs to FacilityTurrets; co-opted terminal hacking into TerminalControl; started to expand on hacking protocol, but chose restraint
* changes made thus that a clear Definition hierarchy is established; all of this is in line with making future changes to repair/destroy variables, and making generic the repair code
* all meaningful facility amenities take damage and can be repaired; spawn tubes can be destroyed and the base will properly lose spawns (and show it on the map); some hack logic has been redistributed into the appropriate control objects, following in the wake of repair/damage logic
* deployables are repairable; the TRAP has been converted into a ComplexDeployable; changed the nature of the Repairable traits
* player bank repair and medapp heal has been moved out from WSA into PlayerControl
* overhaul of Progress callback system and the inclusion of player revival as a Progress activity
* begun relocating functionality for hacking outside of WSA; set up behavoir mixin for cargo operations, in order to move vehicle hack function, but did not yet integrate
* integration of the actor behavior mixin for vehicle cargo operations to support the integration of vehicle hacking finalization
* establishing inheritance/override potential of Damageable activity; Generator and SpawnTube map behavior behavior (currently inactive)
* ImplantTerminalMech objects now have a 'with-coordinates' constructor and a deprecated 'no-coordinates' constructor; implants mechs and interfaces are now damageable and repairable, and their damage state can also block mounting
* generators are destroyed and repaired properly, and even explode, killing a radius-worth of players
* destroy and repair pass on deployables, except for explosive types
* Damageable pass; client synchronization pass
* helpful comments
* some tests for damageable and repairable; refined output and repaired existing tests
* enabled friendly fire check and recovery
* handled friendly fire against allied mines; moved jammer code to common damageable behavior
* tweaks to damageability, infantry heal and repair, and sensor and explosive animations
* animations; framework for future vitals events; closing database connections
* adding some deployable tests; fixing a bunch of other tests; History is back
* testing for basic Damageable functions; removing a log message
* finicky animation stuff
* event messages to the Generator to represent health changes
* damage against BFR's is now only used against mythical creatures
* test fix
2020-04-14 15:17:32 -04:00
|
|
|
DestructionAwareness(target, cause)
|
2019-12-27 00:18:46 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-12 23:01:08 -05:00
|
|
|
/**
|
|
|
|
|
* na
|
|
|
|
|
* @param target na
|
|
|
|
|
* @param cause na
|
|
|
|
|
*/
|
|
|
|
|
def explodes(target: Damageable.Target, cause: DamageResult): Unit = {
|
|
|
|
|
target.Health = 1 // short-circuit logic in DestructionAwareness
|
|
|
|
|
val zone = target.Zone
|
|
|
|
|
zone.Activity ! Zone.HotSpot.Activity(cause)
|
|
|
|
|
zone.LocalEvents ! LocalServiceMessage(zone.id, LocalAction.Detonate(target.GUID, target))
|
2021-05-05 10:13:57 -04:00
|
|
|
Zone.serverSideDamage(
|
|
|
|
|
zone,
|
|
|
|
|
target,
|
|
|
|
|
Zone.explosionDamage(Some(cause)),
|
|
|
|
|
ExplosiveDeployableControl.detectionForExplosiveSource(target)
|
|
|
|
|
)
|
2021-01-12 23:01:08 -05:00
|
|
|
}
|
|
|
|
|
|
2019-12-27 00:18:46 -05:00
|
|
|
/**
|
|
|
|
|
* na
|
|
|
|
|
* @param target na
|
Destroy and repair (#346)
* bog-standard order_terminal amenities now take damage up to the point of destruction and can be repaired from destruction to functional to the point of being fully repaired; this is mostly proof fo concept
* restored proper destruction to FacilityTurrets; extended proper rrepairs to FacilityTurrets; co-opted terminal hacking into TerminalControl; started to expand on hacking protocol, but chose restraint
* changes made thus that a clear Definition hierarchy is established; all of this is in line with making future changes to repair/destroy variables, and making generic the repair code
* all meaningful facility amenities take damage and can be repaired; spawn tubes can be destroyed and the base will properly lose spawns (and show it on the map); some hack logic has been redistributed into the appropriate control objects, following in the wake of repair/damage logic
* deployables are repairable; the TRAP has been converted into a ComplexDeployable; changed the nature of the Repairable traits
* player bank repair and medapp heal has been moved out from WSA into PlayerControl
* overhaul of Progress callback system and the inclusion of player revival as a Progress activity
* begun relocating functionality for hacking outside of WSA; set up behavoir mixin for cargo operations, in order to move vehicle hack function, but did not yet integrate
* integration of the actor behavior mixin for vehicle cargo operations to support the integration of vehicle hacking finalization
* establishing inheritance/override potential of Damageable activity; Generator and SpawnTube map behavior behavior (currently inactive)
* ImplantTerminalMech objects now have a 'with-coordinates' constructor and a deprecated 'no-coordinates' constructor; implants mechs and interfaces are now damageable and repairable, and their damage state can also block mounting
* generators are destroyed and repaired properly, and even explode, killing a radius-worth of players
* destroy and repair pass on deployables, except for explosive types
* Damageable pass; client synchronization pass
* helpful comments
* some tests for damageable and repairable; refined output and repaired existing tests
* enabled friendly fire check and recovery
* handled friendly fire against allied mines; moved jammer code to common damageable behavior
* tweaks to damageability, infantry heal and repair, and sensor and explosive animations
* animations; framework for future vitals events; closing database connections
* adding some deployable tests; fixing a bunch of other tests; History is back
* testing for basic Damageable functions; removing a log message
* finicky animation stuff
* event messages to the Generator to represent health changes
* damage against BFR's is now only used against mythical creatures
* test fix
2020-04-14 15:17:32 -04:00
|
|
|
* @param cause na
|
2019-12-27 00:18:46 -05:00
|
|
|
*/
|
Damage Changes/Explosions (#644)
* created base damage interaction classes and replaced various projectile-based damage that utilized ResolvedProjectile; not refined, maintains redundancy and overloads, but should work
* continuing to reduce the exposure of ResolvedProjectile and replacing it with applications of DamageInteraction, DamageResult, and DamageReason
* removed ResolvedProjectile from the project; adjusted remaining code paths to work around it
* vitals.test became vital.base; no one liked this
* lots of inheritance, polymorphism, and other chicanery; moved around files, so it also looks like more files have changed when they have not (even if they did)
* codecov file correction
* master rebase; vital directory structure changed, so file imports have been modified in several other files; ResolutionSelection has been removed, requiring direct function literal assignment; tests repaired, where necessary; no actual functional change
* code comments
* DamageResult is its own case class now, wrapping around a before/after target and the interaction used in its calaculations; tests have been corrected
* adjusted Player.Die() to demonstrate a damage-based suicide approach
* resolved circular inheritance in projectile damage modifiers; better employed explosion reason, damages players around exploding vehicle as example
* expanded explosions to other object types; exploding is now a flag and the damage is an innate property of the object type; removed advanced references to properties on the damage source, since the damage source is easily accessible; wrote comments; fixed tests
* overhaul to painbox damage to align with normal player damage handling, thus assimilating it properly into the damage system
* future development; normal vector from euler angles; custom proximity test
* where 'innateDamage' should have not replaced 'explosion'
* moved the hitPos for the generator test; attempting to imrpove the reliability of the auto-repair integration tests (didn't ...)
* spelling and private val
2020-12-08 14:32:42 -05:00
|
|
|
def DestructionAwareness(target: ExplosiveDeployable, cause: DamageResult): Unit = {
|
2019-12-27 00:18:46 -05:00
|
|
|
val zone = target.Zone
|
Damage Changes/Explosions (#644)
* created base damage interaction classes and replaced various projectile-based damage that utilized ResolvedProjectile; not refined, maintains redundancy and overloads, but should work
* continuing to reduce the exposure of ResolvedProjectile and replacing it with applications of DamageInteraction, DamageResult, and DamageReason
* removed ResolvedProjectile from the project; adjusted remaining code paths to work around it
* vitals.test became vital.base; no one liked this
* lots of inheritance, polymorphism, and other chicanery; moved around files, so it also looks like more files have changed when they have not (even if they did)
* codecov file correction
* master rebase; vital directory structure changed, so file imports have been modified in several other files; ResolutionSelection has been removed, requiring direct function literal assignment; tests repaired, where necessary; no actual functional change
* code comments
* DamageResult is its own case class now, wrapping around a before/after target and the interaction used in its calaculations; tests have been corrected
* adjusted Player.Die() to demonstrate a damage-based suicide approach
* resolved circular inheritance in projectile damage modifiers; better employed explosion reason, damages players around exploding vehicle as example
* expanded explosions to other object types; exploding is now a flag and the damage is an innate property of the object type; removed advanced references to properties on the damage source, since the damage source is easily accessible; wrote comments; fixed tests
* overhaul to painbox damage to align with normal player damage handling, thus assimilating it properly into the damage system
* future development; normal vector from euler angles; custom proximity test
* where 'innateDamage' should have not replaced 'explosion'
* moved the hitPos for the generator test; attempting to imrpove the reliability of the auto-repair integration tests (didn't ...)
* spelling and private val
2020-12-08 14:32:42 -05:00
|
|
|
val attribution = DamageableEntity.attributionTo(cause, target.Zone)
|
2021-01-12 23:01:08 -05:00
|
|
|
Deployables.AnnounceDestroyDeployable(
|
|
|
|
|
target,
|
|
|
|
|
Some(if (target.Jammed || target.Destroyed) 0 seconds else 500 milliseconds)
|
|
|
|
|
)
|
Destroy and repair (#346)
* bog-standard order_terminal amenities now take damage up to the point of destruction and can be repaired from destruction to functional to the point of being fully repaired; this is mostly proof fo concept
* restored proper destruction to FacilityTurrets; extended proper rrepairs to FacilityTurrets; co-opted terminal hacking into TerminalControl; started to expand on hacking protocol, but chose restraint
* changes made thus that a clear Definition hierarchy is established; all of this is in line with making future changes to repair/destroy variables, and making generic the repair code
* all meaningful facility amenities take damage and can be repaired; spawn tubes can be destroyed and the base will properly lose spawns (and show it on the map); some hack logic has been redistributed into the appropriate control objects, following in the wake of repair/damage logic
* deployables are repairable; the TRAP has been converted into a ComplexDeployable; changed the nature of the Repairable traits
* player bank repair and medapp heal has been moved out from WSA into PlayerControl
* overhaul of Progress callback system and the inclusion of player revival as a Progress activity
* begun relocating functionality for hacking outside of WSA; set up behavoir mixin for cargo operations, in order to move vehicle hack function, but did not yet integrate
* integration of the actor behavior mixin for vehicle cargo operations to support the integration of vehicle hacking finalization
* establishing inheritance/override potential of Damageable activity; Generator and SpawnTube map behavior behavior (currently inactive)
* ImplantTerminalMech objects now have a 'with-coordinates' constructor and a deprecated 'no-coordinates' constructor; implants mechs and interfaces are now damageable and repairable, and their damage state can also block mounting
* generators are destroyed and repaired properly, and even explode, killing a radius-worth of players
* destroy and repair pass on deployables, except for explosive types
* Damageable pass; client synchronization pass
* helpful comments
* some tests for damageable and repairable; refined output and repaired existing tests
* enabled friendly fire check and recovery
* handled friendly fire against allied mines; moved jammer code to common damageable behavior
* tweaks to damageability, infantry heal and repair, and sensor and explosive animations
* animations; framework for future vitals events; closing database connections
* adding some deployable tests; fixing a bunch of other tests; History is back
* testing for basic Damageable functions; removing a log message
* finicky animation stuff
* event messages to the Generator to represent health changes
* damage against BFR's is now only used against mythical creatures
* test fix
2020-04-14 15:17:32 -04:00
|
|
|
target.Destroyed = true
|
2020-07-14 05:54:05 +02:00
|
|
|
zone.AvatarEvents ! AvatarServiceMessage(
|
2020-08-01 12:25:03 +02:00
|
|
|
zone.id,
|
2020-07-14 05:54:05 +02:00
|
|
|
AvatarAction.Destroy(target.GUID, attribution, Service.defaultPlayerGUID, target.Position)
|
|
|
|
|
)
|
|
|
|
|
if (target.Health == 0) {
|
|
|
|
|
zone.LocalEvents ! LocalServiceMessage(
|
2020-08-01 12:25:03 +02:00
|
|
|
zone.id,
|
2020-07-14 05:54:05 +02:00
|
|
|
LocalAction.TriggerEffect(Service.defaultPlayerGUID, "detonate_damaged_mine", target.GUID)
|
|
|
|
|
)
|
Destroy and repair (#346)
* bog-standard order_terminal amenities now take damage up to the point of destruction and can be repaired from destruction to functional to the point of being fully repaired; this is mostly proof fo concept
* restored proper destruction to FacilityTurrets; extended proper rrepairs to FacilityTurrets; co-opted terminal hacking into TerminalControl; started to expand on hacking protocol, but chose restraint
* changes made thus that a clear Definition hierarchy is established; all of this is in line with making future changes to repair/destroy variables, and making generic the repair code
* all meaningful facility amenities take damage and can be repaired; spawn tubes can be destroyed and the base will properly lose spawns (and show it on the map); some hack logic has been redistributed into the appropriate control objects, following in the wake of repair/damage logic
* deployables are repairable; the TRAP has been converted into a ComplexDeployable; changed the nature of the Repairable traits
* player bank repair and medapp heal has been moved out from WSA into PlayerControl
* overhaul of Progress callback system and the inclusion of player revival as a Progress activity
* begun relocating functionality for hacking outside of WSA; set up behavoir mixin for cargo operations, in order to move vehicle hack function, but did not yet integrate
* integration of the actor behavior mixin for vehicle cargo operations to support the integration of vehicle hacking finalization
* establishing inheritance/override potential of Damageable activity; Generator and SpawnTube map behavior behavior (currently inactive)
* ImplantTerminalMech objects now have a 'with-coordinates' constructor and a deprecated 'no-coordinates' constructor; implants mechs and interfaces are now damageable and repairable, and their damage state can also block mounting
* generators are destroyed and repaired properly, and even explode, killing a radius-worth of players
* destroy and repair pass on deployables, except for explosive types
* Damageable pass; client synchronization pass
* helpful comments
* some tests for damageable and repairable; refined output and repaired existing tests
* enabled friendly fire check and recovery
* handled friendly fire against allied mines; moved jammer code to common damageable behavior
* tweaks to damageability, infantry heal and repair, and sensor and explosive animations
* animations; framework for future vitals events; closing database connections
* adding some deployable tests; fixing a bunch of other tests; History is back
* testing for basic Damageable functions; removing a log message
* finicky animation stuff
* event messages to the Generator to represent health changes
* damage against BFR's is now only used against mythical creatures
* test fix
2020-04-14 15:17:32 -04:00
|
|
|
}
|
2019-12-27 00:18:46 -05:00
|
|
|
}
|
2021-02-03 19:39:32 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Two game entities are considered "near" each other if they are within a certain distance of one another.
|
|
|
|
|
* For explosives, the source of the explosion is always typically constant.
|
|
|
|
|
* @see `detectsTarget`
|
|
|
|
|
* @see `ObjectDefinition.Geometry`
|
|
|
|
|
* @see `Vector3.relativeUp`
|
|
|
|
|
* @param obj a game entity that explodes
|
|
|
|
|
* @return a function that resolves a potential target as detected
|
|
|
|
|
*/
|
|
|
|
|
def detectionForExplosiveSource(obj: PlanetSideGameObject): (PlanetSideGameObject, PlanetSideGameObject, Float) => Boolean = {
|
|
|
|
|
val up = Vector3.relativeUp(obj.Orientation) //check relativeUp; rotate as little as necessary!
|
|
|
|
|
val g1 = obj.Definition.Geometry(obj)
|
|
|
|
|
detectTarget(g1, up)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Two game entities are considered "near" each other if they are within a certain distance of one another.
|
|
|
|
|
* For explosives, targets in the damage radius in the direction of the blast (above the explosive) are valid targets.
|
|
|
|
|
* Targets that are ~0.5916f units in the opposite direction of the blast (below the explosive) are also selected.
|
|
|
|
|
* @see `ObjectDefinition.Geometry`
|
|
|
|
|
* @see `PrimitiveGeometry.pointOnOutside`
|
|
|
|
|
* @see `Vector3.DistanceSquared`
|
|
|
|
|
* @see `Vector3.neg`
|
|
|
|
|
* @see `Vector3.relativeUp`
|
|
|
|
|
* @see `Vector3.ScalarProjection`
|
|
|
|
|
* @see `Vector3.Unit`
|
|
|
|
|
* @param g1 a cached geometric representation that should belong to `obj1`
|
|
|
|
|
* @param up a cached vector in the direction of "above `obj1`'s geometric representation"
|
|
|
|
|
* @param obj1 a game entity that explodes
|
|
|
|
|
* @param obj2 a game entity that suffers the explosion
|
|
|
|
|
* @param maxDistance the square of the maximum distance permissible between game entities
|
|
|
|
|
* before they are no longer considered "near"
|
|
|
|
|
* @return `true`, if the target entities are near enough to each other;
|
|
|
|
|
* `false`, otherwise
|
|
|
|
|
*/
|
|
|
|
|
def detectTarget(g1: Geometry3D, up: Vector3)(obj1: PlanetSideGameObject, obj2: PlanetSideGameObject, maxDistance: Float) : Boolean = {
|
|
|
|
|
val g2 = obj2.Definition.Geometry(obj2)
|
|
|
|
|
val dir = g2.center.asVector3 - g1.center.asVector3
|
Hart (#723)
* initial OrbitalShuttleTimeMsg packet and tests; new objects to support HART shuttle transport system
* master was stale
* grouped scheduling for timing orbital shuttle activity
* door lock controls for HART shuttle lifecycle, and specifically for the doors that lead into the shuttle boarding hallway
* separation of the door from the door unlocking logic, which now has to be provided if performed by an outside source; a door that is locked either by bolt, HART routine, or other reason, can now be shut immediately; message when HART is not docked with a corresponding entry hallway door
* better degree of door logic control; all shuttle-related messages have been moved to LocalService; careful managing of 'original state' for the shuttle's cycle
* modification of seat mounting and cargo mounting support entities to expand functionality
* absolutely very little to do with the feature of this branch and a lot to do with yak-shaving; long story short, class inheritance is greatly modified and mountable seats can now accept multiple players if initialized properly
* a lot has changed: distribution of MountableBehavior, mount point information is more complex, vehicles convert differently, the routine of the shuttle timer is initialized differently; you can now successfully utilize the HART shuttle to drop into a zone
* swap of shutle from pad to pad control; tests and comments
* eject players from HART gantry hallway as if passengers dismounting from seat when not boarding through the use of environmental geometry; HART system uses duration from config settings to set scheduler
* rebase to curious master; repairs to vector rotation calculations; regression of mountable changes involving seats with occupancy greater than 1; orbital shuttle as a unique vehicle and amenity; corrected dismount offsets and offset calculations; weird angle of nc hart a building has been properly accommodated; hart events have prerequisite animation states
* rebase with master; looks like rebase with merged_master, which is also a commit
* lots of tests (though not nearly enough); checking the permission group of a shuttle seat no longer creates that seat
* fixing explosions
* fixed the persistence monitor service potentially using non-printable unicode in actor names
* can not use a droppod to gain access to one's own sanctuary
* removed hart facility update that causing open bay doors and beeping
* PR review changes
* fix for aggravation issues
2021-03-23 09:44:10 -04:00
|
|
|
//val scalar = Vector3.ScalarProjection(dir, up)
|
2021-02-03 19:39:32 -05:00
|
|
|
val point1 = g1.pointOnOutside(dir).asVector3
|
|
|
|
|
val point2 = g2.pointOnOutside(Vector3.neg(dir)).asVector3
|
Hart (#723)
* initial OrbitalShuttleTimeMsg packet and tests; new objects to support HART shuttle transport system
* master was stale
* grouped scheduling for timing orbital shuttle activity
* door lock controls for HART shuttle lifecycle, and specifically for the doors that lead into the shuttle boarding hallway
* separation of the door from the door unlocking logic, which now has to be provided if performed by an outside source; a door that is locked either by bolt, HART routine, or other reason, can now be shut immediately; message when HART is not docked with a corresponding entry hallway door
* better degree of door logic control; all shuttle-related messages have been moved to LocalService; careful managing of 'original state' for the shuttle's cycle
* modification of seat mounting and cargo mounting support entities to expand functionality
* absolutely very little to do with the feature of this branch and a lot to do with yak-shaving; long story short, class inheritance is greatly modified and mountable seats can now accept multiple players if initialized properly
* a lot has changed: distribution of MountableBehavior, mount point information is more complex, vehicles convert differently, the routine of the shuttle timer is initialized differently; you can now successfully utilize the HART shuttle to drop into a zone
* swap of shutle from pad to pad control; tests and comments
* eject players from HART gantry hallway as if passengers dismounting from seat when not boarding through the use of environmental geometry; HART system uses duration from config settings to set scheduler
* rebase to curious master; repairs to vector rotation calculations; regression of mountable changes involving seats with occupancy greater than 1; orbital shuttle as a unique vehicle and amenity; corrected dismount offsets and offset calculations; weird angle of nc hart a building has been properly accommodated; hart events have prerequisite animation states
* rebase with master; looks like rebase with merged_master, which is also a commit
* lots of tests (though not nearly enough); checking the permission group of a shuttle seat no longer creates that seat
* fixing explosions
* fixed the persistence monitor service potentially using non-printable unicode in actor names
* can not use a droppod to gain access to one's own sanctuary
* removed hart facility update that causing open bay doors and beeping
* PR review changes
* fix for aggravation issues
2021-03-23 09:44:10 -04:00
|
|
|
val scalar = Vector3.ScalarProjection(point2 - point1, up)
|
2021-02-08 00:20:17 -05:00
|
|
|
(scalar >= 0 || Vector3.MagnitudeSquared(up * scalar) < 0.35f) &&
|
|
|
|
|
math.min(
|
|
|
|
|
Vector3.DistanceSquared(g1.center.asVector3, g2.center.asVector3),
|
|
|
|
|
Vector3.DistanceSquared(point1, point2)
|
|
|
|
|
) <= maxDistance
|
2021-02-03 19:39:32 -05:00
|
|
|
}
|
2019-12-27 00:18:46 -05:00
|
|
|
}
|