PSF-BotServer/src/test/scala/objects/DamageModelTests.scala

949 lines
28 KiB
Scala
Raw Normal View History

2018-07-30 09:28:45 -04:00
// Copyright (c) 2017 PSForever
package objects
import net.psforever.objects._
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.damage.{DamageProfile, _}
import net.psforever.objects.vital.projectile._
2018-07-30 09:28:45 -04:00
import DamageCalculations._
import net.psforever.objects.vital.resistance.ResistanceCalculations
import ResistanceCalculations._
import net.psforever.objects.vital.resolution.ResolutionCalculations
import ResolutionCalculations._
import net.psforever.objects.ballistics._
import net.psforever.objects.definition.{ProjectileDefinition, VehicleDefinition}
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.Vitality
import net.psforever.packet.game.objectcreate.ObjectClass
2018-07-30 09:28:45 -04:00
import net.psforever.types._
import org.specs2.mutable.Specification
import net.psforever.objects.avatar.Avatar
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.base._
import net.psforever.objects.vital.interaction.DamageInteraction
2018-07-30 09:28:45 -04:00
class DamageCalculationsTests extends Specification {
"DamageCalculations" should {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val wep = GlobalDefinitions.galaxy_gunship_cannon
val wep_fmode = Tool(wep).FireMode
val wep_prof = wep_fmode.Add
val proj = DamageModelTests.projectile
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val proj_prof = proj.asInstanceOf[DamageProfile]
val player = Player(Avatar(0, "TestCharacter", PlanetSideEmpire.TR, CharacterSex.Male, 0, CharacterVoice.Mute))
2018-07-30 09:28:45 -04:00
val projectile = Projectile(proj, wep, wep_fmode, player, Vector3(2, 2, 0), Vector3.Zero)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val target = Vehicle(GlobalDefinitions.fury)
2018-07-30 09:28:45 -04:00
target.Position = Vector3(10, 0, 0)
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target.DamageModel
),
Vector3(15, 0, 0)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
)
2018-07-30 09:28:45 -04:00
"extract no damage numbers" in {
AgainstNothing(proj_prof) mustEqual 0
2018-07-30 09:28:45 -04:00
}
"extract damage against exosuit target" in {
AgainstExoSuit(proj_prof) == proj_prof.Damage0 mustEqual true
2018-07-30 09:28:45 -04:00
}
"extract damage against MAX target" in {
AgainstMaxSuit(proj_prof) == proj_prof.Damage3 mustEqual true
2018-07-30 09:28:45 -04:00
}
"extract damage against vehicle target" in {
AgainstVehicle(proj_prof) == proj_prof.Damage1 mustEqual true
2018-07-30 09:28:45 -04:00
}
"extract damage against aircraft target" in {
AgainstAircraft(proj_prof) == proj_prof.Damage2 mustEqual true
2018-07-30 09:28:45 -04:00
}
"extract damage against battleframe robotics" in {
AgainstBFR(proj_prof) == proj_prof.Damage4 mustEqual true
2018-07-30 09:28:45 -04:00
}
"no degrade damage modifier" in {
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
SameHit.calculate(100, resprojectile) mustEqual 100
2018-07-30 09:28:45 -04:00
}
"degrade over distance damage modifier (no degrade)" in {
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
DistanceDegrade.calculate(100, resprojectile) == 100 mustEqual true
2018-07-30 09:28:45 -04:00
}
2020-09-21 23:18:11 -04:00
"cut off damage at max distance (no cutoff)" in {
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
MaxDistanceCutoff.calculate(100, resprojectile) == 100 mustEqual true
2020-09-21 23:18:11 -04:00
}
"cut off damage at max distance (cutoff)" in {
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 cutoffprojectile = DamageInteraction(
2020-09-21 23:18:11 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target.DamageModel
),
2020-09-21 23:18:11 -04:00
Vector3(1500, 0, 0)
)
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 damage = MaxDistanceCutoff.calculate(100, cutoffprojectile)
damage == 0 mustEqual true
2020-09-21 23:18:11 -04:00
}
"cut off damage at custom distance (no cutoff)" in {
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
CustomDistanceCutoff(10).calculate(100, resprojectile) == 0 mustEqual true
2020-09-21 23:18:11 -04:00
}
"cut off damage at custom distance (cutoff)" in {
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 coffprojectile = DamageInteraction(
2020-09-21 23:18:11 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Splash,
projectile,
target.DamageModel
),
2020-09-21 23:18:11 -04:00
Vector3(10, 0, 0)
)
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
CustomDistanceCutoff(2).calculate(100, coffprojectile) == 0 mustEqual true
2020-09-21 23:18:11 -04:00
}
"degrade over distance damage modifier (some degrade)" in {
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 resprojectile2 = DamageInteraction(
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Splash,
projectile,
target.DamageModel
),
Vector3(100, 0, 0)
)
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 damage = DistanceDegrade.calculate(100, resprojectile2)
damage < 100 && damage > 0 mustEqual true
2018-07-30 09:28:45 -04:00
}
"degrade over distance damage modifier (zero'd)" in {
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 resprojectile2 = DamageInteraction(
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Splash,
projectile,
target.DamageModel
),
Vector3(1000, 0, 0)
)
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
DistanceDegrade.calculate(100, resprojectile2) == 0 mustEqual true
2018-07-30 09:28:45 -04:00
}
"degrade at radial distance damage modifier (no degrade)" in {
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 resprojectile2 = DamageInteraction(
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Splash,
projectile,
target.DamageModel
),
Vector3(10, 0, 0)
)
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
RadialDegrade.calculate(100, resprojectile2) == 100 mustEqual true
2018-07-30 09:28:45 -04:00
}
"degrade at radial distance damage modifier (some degrade)" in {
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 resprojectile2 = DamageInteraction(
2020-08-25 15:24:26 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Splash,
projectile,
target.DamageModel
),
2020-08-25 15:24:26 -04:00
Vector3(12, 0, 0)
)
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 damage = RadialDegrade.calculate(100, resprojectile2)
damage < 100 && damage > 0 mustEqual true
2018-07-30 09:28:45 -04:00
}
"degrade at radial distance damage modifier (zero'd)" in {
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 resprojectile2 = DamageInteraction(
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Splash,
projectile,
target.DamageModel
),
2020-08-25 15:24:26 -04:00
Vector3(100, 0, 0)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
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
RadialDegrade.calculate(100, resprojectile2) == 0 mustEqual true
2018-07-30 09:28:45 -04:00
}
"lash degrade (no lash; too close)" in {
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 resprojectile2 = DamageInteraction(
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Lash,
projectile,
target.DamageModel
),
Vector3(5, 0, 0) //compared to Vector3(2, 2, 0)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
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
Lash.calculate(100, resprojectile2) == 0 mustEqual true
2018-07-30 09:28:45 -04:00
}
"lash degrade (lash)" in {
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 resprojectile2 = DamageInteraction(
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Lash,
projectile,
target.DamageModel
),
Vector3(20, 0, 0)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
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
val damage = Lash.calculate(100, resprojectile2)
damage < 100 && damage > 0 mustEqual true
2018-07-30 09:28:45 -04:00
}
"lash degrade (no lash; too far)" in {
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 resprojectile2 = DamageInteraction(
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Lash,
projectile,
target.DamageModel
),
Vector3(1000, 0, 0)
)
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
Lash.calculate(100, resprojectile2) == 0 mustEqual true
2018-07-30 09:28:45 -04:00
}
2020-09-21 23:18:11 -04:00
"fireball aggravated damage (aggravated splash burn" in {
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 burnWeapon = Tool(GlobalDefinitions.flamethrower)
// val burnProjectile = Projectile(
// burnWeapon.Projectile,
// burnWeapon.Definition,
// burnWeapon.FireMode,
// player,
// Vector3(2, 2, 0),
// Vector3.Zero
// )
val burnRes = DamageInteraction(
2020-09-21 23:18:11 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.AggravatedSplashBurn,
projectile,
target.DamageModel
),
2020-09-21 23:18:11 -04:00
Vector3(15, 0, 0)
)
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 resistance = target.DamageModel.ResistUsing(burnRes)(burnRes)
FireballAggravatedBurn.calculate(100, burnRes) == (1 + resistance) mustEqual true
2020-09-21 23:18:11 -04:00
}
"fireball aggravated damage (noral splash, no modification)" in {
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 burnWeapon = Tool(GlobalDefinitions.flamethrower)
// val burnProjectile = Projectile(
// burnWeapon.Projectile,
// burnWeapon.Definition,
// burnWeapon.FireMode,
// player,
// Vector3(2, 2, 0),
// Vector3.Zero
// )
val burnRes = DamageInteraction(
2020-09-21 23:18:11 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Splash,
projectile,
target.DamageModel
),
2020-09-21 23:18:11 -04:00
Vector3(15, 0, 0)
)
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
FireballAggravatedBurn.calculate(100, burnRes) == 100 mustEqual true
2020-09-21 23:18:11 -04:00
}
val charge_weapon = Tool(GlobalDefinitions.spiker)
val charge_projectile = Projectile(
charge_weapon.Projectile,
charge_weapon.Definition,
charge_weapon.FireMode,
player,
Vector3(2, 2, 0),
Vector3.Zero
)
val minDamageBase = charge_weapon.Projectile.Charging.get.min.Damage0
val chargeBaseDamage = charge_weapon.Projectile.Damage0
"charge (none)" in {
val cprojectile = charge_projectile.quality(ProjectileQuality.Modified(0))
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 rescprojectile = DamageInteraction(
2020-09-21 23:18:11 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
cprojectile,
target.DamageModel
),
2020-09-21 23:18:11 -04:00
Vector3(15, 0, 0)
)
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 damage = SpikerChargeDamage.calculate(chargeBaseDamage, rescprojectile)
val calcDam = minDamageBase + math.floor(
chargeBaseDamage * rescprojectile.cause.asInstanceOf[ProjectileReason].projectile.quality.mod
)
2020-09-21 23:18:11 -04:00
damage mustEqual calcDam
}
"charge (half)" in {
val cprojectile = charge_projectile.quality(ProjectileQuality.Modified(0.5f))
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 rescprojectile = DamageInteraction(
2020-09-21 23:18:11 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
cprojectile,
target.DamageModel
),
2020-09-21 23:18:11 -04:00
Vector3(15, 0, 0)
)
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 damage = SpikerChargeDamage.calculate(chargeBaseDamage, rescprojectile)
val calcDam = minDamageBase + math.floor(
chargeBaseDamage * rescprojectile.cause.asInstanceOf[ProjectileReason].projectile.quality.mod
)
2020-09-21 23:18:11 -04:00
damage mustEqual calcDam
}
"charge (full)" in {
val cprojectile = charge_projectile.quality(ProjectileQuality.Modified(1))
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 rescprojectile = DamageInteraction(
2020-09-21 23:18:11 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
cprojectile,
target.DamageModel
),
2020-09-21 23:18:11 -04:00
Vector3(15, 0, 0)
)
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 damage = SpikerChargeDamage.calculate(chargeBaseDamage, rescprojectile)
2020-09-21 23:18:11 -04:00
val calcDam = minDamageBase + chargeBaseDamage
damage mustEqual calcDam
}
val flak_weapon = Tool(GlobalDefinitions.trhev_burster)
val flak_projectile = Projectile(
flak_weapon.Projectile,
flak_weapon.Definition,
flak_weapon.FireMode,
player,
Vector3(2, 2, 0),
Vector3.Zero
)
"flak hit (resolution is splash, no degrade)" in {
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 resfprojectile = DamageInteraction(
2020-09-21 23:18:11 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Splash,
flak_projectile,
target.DamageModel
),
2020-09-21 23:18:11 -04:00
Vector3(10, 0, 0)
)
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 damage = FlakHit.calculate(100, resfprojectile)
2020-09-21 23:18:11 -04:00
damage == 100 mustEqual true
}
"flak hit (resolution is hit, no degrade)" in {
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 resfprojectile = DamageInteraction(
2020-09-21 23:18:11 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
flak_projectile,
target.DamageModel
),
2020-09-21 23:18:11 -04:00
Vector3(10, 0, 0)
)
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 damage = FlakHit.calculate(100, resfprojectile)
2020-09-21 23:18:11 -04:00
damage == 100 mustEqual true
}
"flak burst (resolution is hit)" in {
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 resfprojectile = DamageInteraction(
2020-09-21 23:18:11 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
flak_projectile,
target.DamageModel
),
2020-09-21 23:18:11 -04:00
Vector3(15, 0, 0)
)
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 damage = FlakBurst.calculate(100, resfprojectile)
2020-09-21 23:18:11 -04:00
damage == 100 mustEqual true
}
"flak burst (resolution is splash, no degrade)" in {
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 resfprojectile = DamageInteraction(
2020-09-21 23:18:11 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Splash,
flak_projectile,
target.DamageModel
),
2020-09-21 23:18:11 -04:00
Vector3(10, 0, 0)
)
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 damage = FlakBurst.calculate(100, resfprojectile)
2020-09-21 23:18:11 -04:00
damage == 100 mustEqual true
}
"flak burst (resolution is splash, some degrade)" in {
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 resfprojectile = DamageInteraction(
2020-09-21 23:18:11 -04:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Splash,
flak_projectile,
target.DamageModel
),
2020-09-21 23:18:11 -04:00
Vector3(5, 0, 0)
)
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 damage = FlakBurst.calculate(100, resfprojectile)
2020-09-21 23:18:11 -04:00
damage < 100 mustEqual true
}
"galaxy gunship reduction (target is galaxy_gunship, no shields)" in {
val vehicle = Vehicle(GlobalDefinitions.galaxy_gunship)
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 resfprojectile = DamageInteraction(
SourceEntry(vehicle),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
vehicle.DamageModel
),
Vector3(5, 0, 0)
)
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 damage = GalaxyGunshipReduction(0.63f).calculate(100, resfprojectile)
damage == 63 mustEqual true
}
"galaxy gunship reduction (target is galaxy_gunship)" in {
val vehicle = Vehicle(GlobalDefinitions.galaxy_gunship)
vehicle.Shields = 1
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 resfprojectile = DamageInteraction(
SourceEntry(vehicle),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
vehicle.DamageModel
),
Vector3(5, 0, 0)
)
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 damage = GalaxyGunshipReduction(0.63f).calculate(100, resfprojectile)
damage == 100 mustEqual true
}
"galaxy gunship reduction (target is vehicle, but not a galaxy_gunship)" in {
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 resfprojectile = DamageInteraction(
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target.DamageModel
),
Vector3(5, 0, 0)
)
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 damage = GalaxyGunshipReduction(0.63f).calculate(100, resfprojectile)
damage == 100 mustEqual true
}
"galaxy gunship reduction (target is not a vehicle)" in {
val tplayer =
Player(Avatar(0, "TestCharacter2", PlanetSideEmpire.TR, CharacterSex.Male, 0, CharacterVoice.Mute))
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 resfprojectile = DamageInteraction(
SourceEntry(tplayer),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
tplayer.DamageModel
),
Vector3(5, 0, 0)
)
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 damage = GalaxyGunshipReduction(0.63f).calculate(100, resfprojectile)
damage == 100 mustEqual true
}
"extract a complete damage profile" in {
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 result1 = RadialDegrade.calculate(
AgainstVehicle(proj_prof) + AgainstVehicle(wep_prof),
resprojectile
)
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 result2 = DamageCalculations.WithModifiers(AgainstVehicle, resprojectile)
result1 mustEqual result2
2018-07-30 09:28:45 -04:00
}
}
}
class ResistanceCalculationsTests extends Specification {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val wep = GlobalDefinitions.galaxy_gunship_cannon
val wep_fmode = Tool(wep).FireMode
val proj = DamageModelTests.projectile
val player = Player(Avatar(0, "TestCharacter", PlanetSideEmpire.TR, CharacterSex.Male, 0, CharacterVoice.Mute))
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val projectile = Projectile(proj, wep, wep_fmode, player, Vector3(2, 2, 0), Vector3.Zero)
2018-07-30 09:28:45 -04:00
"ResistanceCalculations" should {
"ignore all targets" in {
val target = Vehicle(GlobalDefinitions.fury)
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
2018-07-30 09:28:45 -04:00
InvalidTarget(resprojectile).isFailure mustEqual true
}
"discern standard infantry targets" in {
val target = player
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
2018-07-30 09:28:45 -04:00
ValidInfantryTarget(resprojectile).isSuccess mustEqual true
ValidMaxTarget(resprojectile).isSuccess mustEqual false
ValidVehicleTarget(resprojectile).isSuccess mustEqual false
ValidAircraftTarget(resprojectile).isSuccess mustEqual false
}
"discern mechanized infantry targets" in {
val target = Player(Avatar(0, "TestCharacter", PlanetSideEmpire.TR, CharacterSex.Male, 0, CharacterVoice.Mute))
2018-07-30 09:28:45 -04:00
target.ExoSuit = ExoSuitType.MAX
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
2018-07-30 09:28:45 -04:00
ValidInfantryTarget(resprojectile).isSuccess mustEqual false
ValidMaxTarget(resprojectile).isSuccess mustEqual true
ValidVehicleTarget(resprojectile).isSuccess mustEqual false
ValidAircraftTarget(resprojectile).isSuccess mustEqual false
}
"discern ground vehicle targets" in {
val target = Vehicle(GlobalDefinitions.fury)
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
2018-07-30 09:28:45 -04:00
ValidInfantryTarget(resprojectile).isSuccess mustEqual false
ValidMaxTarget(resprojectile).isSuccess mustEqual false
ValidVehicleTarget(resprojectile).isSuccess mustEqual true
ValidAircraftTarget(resprojectile).isSuccess mustEqual false
}
"discern flying vehicle targets" in {
val target = Vehicle(GlobalDefinitions.mosquito)
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
2018-07-30 09:28:45 -04:00
ValidInfantryTarget(resprojectile).isSuccess mustEqual false
ValidMaxTarget(resprojectile).isSuccess mustEqual false
ValidVehicleTarget(resprojectile).isSuccess mustEqual false
ValidAircraftTarget(resprojectile).isSuccess mustEqual true
}
"extract no resistance values" in {
NoResistExtractor(SourceEntry(player)) mustEqual 0
}
"extract resistance values from exo-suit" in {
val pSource = PlayerSource(player)
ExoSuitDirectExtractor(pSource) mustEqual 4
ExoSuitSplashExtractor(pSource) mustEqual 15
ExoSuitAggravatedExtractor(pSource) mustEqual 8
ExoSuitRadiationExtractor(pSource) mustEqual 0
}
"extract resistance values from vehicle" in {
val vSource = VehicleSource(Vehicle(GlobalDefinitions.fury))
VehicleDirectExtractor(vSource) mustEqual 0
VehicleSplashExtractor(vSource) mustEqual 0
VehicleAggravatedExtractor(vSource) mustEqual 0
VehicleRadiationExtractor(vSource) mustEqual 0
}
}
}
class ResolutionCalculationsTests extends Specification {
val wep = GlobalDefinitions.galaxy_gunship_cannon
2018-07-30 09:28:45 -04:00
val wep_fmode = Tool(wep).FireMode
val proj = DamageModelTests.projectile
val player = Player(Avatar(0, "TestCharacter", PlanetSideEmpire.TR, CharacterSex.Male, 0, CharacterVoice.Mute))
player.Spawn()
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val projectile = Projectile(proj, wep, wep_fmode, player, Vector3(2, 2, 0), Vector3.Zero)
2018-07-30 09:28:45 -04:00
"ResolutionCalculations" should {
"calculate no damage" in {
val target = player
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
ResolutionCalculations.NoDamage(resprojectile)(50, 50) mustEqual 0
2018-07-30 09:28:45 -04:00
}
"calculate no infantry damage for vehicles" in {
val target1 = Vehicle(GlobalDefinitions.fury) //!
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 resprojectile1 = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target1),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target1.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
InfantryDamage(resprojectile1)(50, 10) mustEqual (0, 0)
2018-07-30 09:28:45 -04:00
val target2 = player
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 resprojectile2 = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target2),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target2.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
InfantryDamage(resprojectile2)(50, 10) mustEqual (40, 10)
2018-07-30 09:28:45 -04:00
}
"calculate health and armor damage for infantry target" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
InfantryDamageAfterResist(100, 100)(50, 10) mustEqual (40, 10)
2018-07-30 09:28:45 -04:00
}
"calculate health and armor damage, with bleed through damage, for infantry target" in {
2018-07-30 09:28:45 -04:00
//health = 100, armor = 5 -> resist 10 but only have 5, so rollover extra -> damages (40+5, 5)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
InfantryDamageAfterResist(100, 5)(50, 10) mustEqual (45, 5)
2018-07-30 09:28:45 -04:00
}
"calculate health damage for infantry target" in {
//health = 100, armor = 0
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
InfantryDamageAfterResist(100, 0)(50, 10) mustEqual (50, 0)
2018-07-30 09:28:45 -04:00
}
"calculate armor damage for infantry target" in {
//resistance > damage
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
InfantryDamageAfterResist(100, 100)(50, 60) mustEqual (0, 50)
2018-07-30 09:28:45 -04:00
}
val player2 = Player(Avatar(0, "TestCharacter2", PlanetSideEmpire.TR, CharacterSex.Male, 0, CharacterVoice.Mute))
2018-07-30 09:28:45 -04:00
player2.ExoSuit = ExoSuitType.MAX
player2.Spawn()
2018-07-30 09:28:45 -04:00
"calculate no max damage for vehicles" in {
val target1 = Vehicle(GlobalDefinitions.fury) //!
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 resprojectile1 = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target1),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target1.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
MaxDamage(resprojectile1)(50, 10) mustEqual (0, 0)
2018-07-30 09:28:45 -04:00
val target2 = player2
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 resprojectile2 = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target2),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target2.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
MaxDamage(resprojectile2)(50, 10) mustEqual (0, 40)
2018-07-30 09:28:45 -04:00
}
"calculate health and armor damage for max target" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
MaxDamageAfterResist(100, 5)(50, 10) mustEqual (35, 5)
2018-07-30 09:28:45 -04:00
}
"calculate health damage for max target" in {
//health = 100, armor = 0
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
MaxDamageAfterResist(100, 0)(50, 10) mustEqual (40, 0)
2018-07-30 09:28:45 -04:00
}
"calculate armor damage for max target" in {
//resistance > damage
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
MaxDamageAfterResist(100, 100)(50, 10) mustEqual (0, 40)
2018-07-30 09:28:45 -04:00
}
"do not care if target is infantry for vehicle calculations" in {
val target1 = player
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 resprojectile1 = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target1),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target1.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
2018-07-30 09:28:45 -04:00
VehicleDamageAfterResist(resprojectile1)(50, 10) mustEqual 40
val target2 = Vehicle(GlobalDefinitions.fury) //!
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 resprojectile2 = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(target2),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
target2.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
2018-07-30 09:28:45 -04:00
VehicleDamageAfterResist(resprojectile2)(50, 10) mustEqual 40
}
"calculate resisted damage for vehicle target" in {
VehicleDamageAfterResist(50, 10) mustEqual 40
}
2018-07-30 09:28:45 -04:00
"calculate un-resisted damage for vehicle target" in {
VehicleDamageAfterResist(50, 0) mustEqual 50
}
2018-07-30 09:28:45 -04:00
}
}
class DamageModelTests extends Specification {
val wep = GlobalDefinitions.galaxy_gunship_cannon
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val wep_tool = Tool(wep)
2018-07-30 09:28:45 -04:00
val wep_fmode = wep_tool.FireMode
val proj = DamageModelTests.projectile
val player = Player(Avatar(0, "TestCharacter", PlanetSideEmpire.TR, CharacterSex.Male, 0, CharacterVoice.Mute))
player.Spawn()
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val projectile = Projectile(proj, wep, wep_fmode, player, Vector3(2, 2, 0), Vector3.Zero)
2018-07-30 09:28:45 -04:00
"DamageModel" should {
"be a part of vitality" in {
player.isInstanceOf[Vitality] mustEqual true
try {
player.getClass.getDeclaredMethod("DamageModel").hashCode()
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
} catch {
case _: Exception =>
2018-07-30 09:28:45 -04:00
ko //the method doesn't exist
}
wep_tool.isInstanceOf[Vitality] mustEqual false
try {
wep_tool.getClass.getDeclaredMethod("DamageModel").hashCode()
ko
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
} catch {
case _: Exception =>
2018-07-30 09:28:45 -04:00
ok //the method doesn't exist
}
ok
}
"resolve infantry targets" in {
val tplayer =
Player(Avatar(0, "TestCharacter2", PlanetSideEmpire.TR, CharacterSex.Male, 0, CharacterVoice.Mute))
tplayer.Spawn()
2018-07-30 09:28:45 -04:00
tplayer.Health mustEqual 100
tplayer.Armor mustEqual 50
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(tplayer),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
tplayer.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
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 func = resprojectile.calculate()
2018-07-30 09:28:45 -04:00
func(tplayer)
tplayer.Health mustEqual 65
tplayer.Armor mustEqual 35
2018-07-30 09:28:45 -04:00
}
"resolve infantry targets in a specific way" in {
val tplayer =
Player(Avatar(0, "TestCharacter2", PlanetSideEmpire.TR, CharacterSex.Male, 0, CharacterVoice.Mute))
tplayer.Spawn()
2018-07-30 09:28:45 -04:00
tplayer.Health mustEqual 100
tplayer.Armor mustEqual 50
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(tplayer),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
tplayer.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
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 func = resprojectile.calculate(DamageType.Splash)
2018-07-30 09:28:45 -04:00
func(tplayer)
tplayer.Health mustEqual 65
2018-07-30 09:28:45 -04:00
tplayer.Armor mustEqual 35
}
"resolve infantry targets, with damage overflow" in {
val tplayer =
Player(Avatar(0, "TestCharacter2", PlanetSideEmpire.TR, CharacterSex.Male, 0, CharacterVoice.Mute))
tplayer.Spawn()
2018-07-30 09:28:45 -04:00
tplayer.Health mustEqual 100
tplayer.Armor mustEqual 50
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(tplayer),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
tplayer.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
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 func = resprojectile.calculate()
2018-07-30 09:28:45 -04:00
tplayer.Armor = 0
func(tplayer)
tplayer.Health mustEqual 50
2018-07-30 09:28:45 -04:00
tplayer.Armor mustEqual 0
}
"resolve vehicle targets" in {
val vehicle = Vehicle(DamageModelTests.vehicle)
2018-07-30 09:28:45 -04:00
vehicle.Health mustEqual 650
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(vehicle),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
vehicle.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
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 func = resprojectile.calculate()
2018-07-30 09:28:45 -04:00
func(vehicle)
vehicle.Health mustEqual 518
2018-07-30 09:28:45 -04:00
}
"resolve vehicle targets (with shields)" in {
val vehicle = Vehicle(DamageModelTests.vehicle)
2018-07-30 09:28:45 -04:00
vehicle.Shields = 10
vehicle.Health mustEqual 650
vehicle.Shields mustEqual 10
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(vehicle),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
vehicle.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
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 func = resprojectile.calculate()
2018-07-30 09:28:45 -04:00
func(vehicle)
vehicle.Health mustEqual 528
vehicle.Shields mustEqual 0
2018-07-30 09:28:45 -04:00
}
"resolve vehicle targets (losing shields)" in {
val vehicle = Vehicle(DamageModelTests.vehicle)
2018-07-30 09:28:45 -04:00
vehicle.Shields = 10
vehicle.Health mustEqual 650
vehicle.Shields mustEqual 10
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(vehicle),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
vehicle.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
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 func = resprojectile.calculate()
2018-07-30 09:28:45 -04:00
func(vehicle)
vehicle.Health mustEqual 528
vehicle.Shields mustEqual 0
2018-07-30 09:28:45 -04:00
func(vehicle)
vehicle.Health mustEqual 396
2018-07-30 09:28:45 -04:00
vehicle.Shields mustEqual 0
}
"resolve vehicle targets in a specific way" in {
val vehicle = Vehicle(DamageModelTests.vehicle)
2018-07-30 09:28:45 -04:00
vehicle.Health mustEqual 650
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 resprojectile = DamageInteraction(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
SourceEntry(vehicle),
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
ProjectileReason(
DamageResolution.Hit,
projectile,
vehicle.DamageModel
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Vector3.Zero
)
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 func = resprojectile.calculate(DamageType.Splash)
2018-07-30 09:28:45 -04:00
func(vehicle)
vehicle.Health mustEqual 518
2018-07-30 09:28:45 -04:00
}
}
}
object DamageModelTests {
final val projectile = new ProjectileDefinition(Projectiles.heavy_grenade_projectile.id) {
Damage0 = 50
Damage1 = 82
Damage2 = 82
Damage3 = 75
Damage4 = 66
DamageAtEdge = 0.1f
DamageRadius = 5f
DegradeMultiplier = 0.5f
LashRadius = 5f
ProjectileDamageType = DamageType.Splash
InitialVelocity = 75
Lifespan = 5f
ProjectileDefinition.CalculateDerivedFields(pdef = this)
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
Modifiers = RadialDegrade
}
final val vehicle = new VehicleDefinition(ObjectClass.fury) {
MaxHealth = 650
Damageable = true
Repairable = true
RepairIfDestroyed = false
MaxShields = 130 + 1
}
}