Differential D3846 Diff 17069 binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js
Show All 35 Lines | "Damage": { | ||||
"Crush": 35.0 | "Crush": 35.0 | ||||
} | } | ||||
}; | }; | ||||
let cmpDeathDamage = ConstructComponent(deadEnt, "DeathDamage", template); | let cmpDeathDamage = ConstructComponent(deadEnt, "DeathDamage", template); | ||||
let playersToDamage = [2, 3, 7]; | let playersToDamage = [2, 3, 7]; | ||||
let pos = new Vector2D(3, 4.2); | let pos = new Vector2D(3, 4.2); | ||||
let direction = new Vector3D(0, 0.1, 0); | |||||
let result = { | let result = { | ||||
"type": "Death", | "type": "Death", | ||||
"attackData": effects, | "attackData": effects, | ||||
"attacker": deadEnt, | "attacker": deadEnt, | ||||
"attackerOwner": player, | "attackerOwner": player, | ||||
"origin": pos, | "origin": pos, | ||||
"direction": direction, | |||||
"radius": template.Range, | "radius": template.Range, | ||||
"shape": template.Shape, | "shape": template.Shape, | ||||
"friendlyFire": false | "friendlyFire": false | ||||
}; | }; | ||||
Attacking.CauseDamageOverArea = data => TS_ASSERT_UNEVAL_EQUALS(data, result); | Attacking.CauseDamageOverArea = data => TS_ASSERT_UNEVAL_EQUALS(data, result); | ||||
Attacking.GetPlayersToDamage = () => playersToDamage; | Attacking.GetPlayersToDamage = () => playersToDamage; | ||||
AddMock(deadEnt, IID_Position, { | AddMock(deadEnt, IID_Position, { | ||||
"GetRotation": () => direction, | |||||
"GetPosition2D": () => pos, | "GetPosition2D": () => pos, | ||||
"IsInWorld": () => true | "IsInWorld": () => true | ||||
}); | }); | ||||
AddMock(deadEnt, IID_Ownership, { | AddMock(deadEnt, IID_Ownership, { | ||||
"GetOwner": () => player | "GetOwner": () => player | ||||
}); | }); | ||||
Show All 10 Lines |
Wildfire Games · Phabricator