From 29a8852ea4af261daa285ac8ae36063d0b7bbb02 Mon Sep 17 00:00:00 2001 From: bb Date: Tue, 16 Jul 2019 15:14:49 +0000 Subject: [PATCH] Rename "CauseSplashDamage" to the more generic "CauseDamageOverArea" Patch By: Freagarach Comments By: wraitii, Nescio Differential Revision: https://code.wildfiregames.com/D2065 This was SVN commit r22486. --- binaries/data/mods/public/simulation/components/Damage.js | 4 ++-- .../data/mods/public/simulation/components/DeathDamage.js | 2 +- .../mods/public/simulation/components/tests/test_Damage.js | 6 +++--- .../public/simulation/components/tests/test_DeathDamage.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/binaries/data/mods/public/simulation/components/Damage.js b/binaries/data/mods/public/simulation/components/Damage.js index 5c91fc8335..2b82e715c3 100644 --- a/binaries/data/mods/public/simulation/components/Damage.js +++ b/binaries/data/mods/public/simulation/components/Damage.js @@ -113,7 +113,7 @@ Damage.prototype.MissileHit = function(data, lateness) // Do this first in case the direct hit kills the target if (data.isSplash) { - this.CauseSplashDamage({ + this.CauseDamageOverArea({ "attacker": data.attacker, "origin": Vector2D.from3D(data.position), "radius": data.radius, @@ -184,7 +184,7 @@ Damage.prototype.MissileHit = function(data, lateness) * @param {Object} data.splashBonus - The attack bonus template from the attacker. * @param {number[]} data.playersToDamage - The array of player id's to damage. */ -Damage.prototype.CauseSplashDamage = function(data) +Damage.prototype.CauseDamageOverArea = function(data) { // Get nearby entities and define variables let nearEnts = this.EntitiesNearPoint(data.origin, data.radius, data.playersToDamage); diff --git a/binaries/data/mods/public/simulation/components/DeathDamage.js b/binaries/data/mods/public/simulation/components/DeathDamage.js index a15e1dc4e2..d0f26864a7 100644 --- a/binaries/data/mods/public/simulation/components/DeathDamage.js +++ b/binaries/data/mods/public/simulation/components/DeathDamage.js @@ -79,7 +79,7 @@ DeathDamage.prototype.CauseDeathDamage = function() let radius = ApplyValueModificationsToEntity("DeathDamage/Range", +this.template.Range, this.entity); - cmpDamage.CauseSplashDamage({ + cmpDamage.CauseDamageOverArea({ "attacker": this.entity, "origin": pos, "radius": radius, diff --git a/binaries/data/mods/public/simulation/components/tests/test_Damage.js b/binaries/data/mods/public/simulation/components/tests/test_Damage.js index 46b8083923..c309787102 100644 --- a/binaries/data/mods/public/simulation/components/tests/test_Damage.js +++ b/binaries/data/mods/public/simulation/components/tests/test_Damage.js @@ -212,7 +212,7 @@ function TestLinearSplashDamage() } }); - cmpDamage.CauseSplashDamage(data); + cmpDamage.CauseDamageOverArea(data); TS_ASSERT(hitEnts.has(60)); TS_ASSERT(hitEnts.has(61)); TS_ASSERT(hitEnts.has(62)); @@ -228,7 +228,7 @@ function TestLinearSplashDamage() } }); - cmpDamage.CauseSplashDamage(data); + cmpDamage.CauseDamageOverArea(data); TS_ASSERT(hitEnts.has(60)); TS_ASSERT(hitEnts.has(61)); TS_ASSERT(hitEnts.has(62)); @@ -310,7 +310,7 @@ function TestCircularSplashDamage() } }); - cmpDamage.CauseSplashDamage({ + cmpDamage.CauseDamageOverArea({ "attacker": 50, "origin": new Vector2D(3, 4), "radius": radius, diff --git a/binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js b/binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js index f0d5753384..3f48723261 100644 --- a/binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js +++ b/binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js @@ -52,7 +52,7 @@ let result = { }; AddMock(SYSTEM_ENTITY, IID_Damage, { - "CauseSplashDamage": data => TS_ASSERT_UNEVAL_EQUALS(data, result), + "CauseDamageOverArea": data => TS_ASSERT_UNEVAL_EQUALS(data, result), "GetPlayersToDamage": (owner, friendlyFire) => playersToDamage });