Differential D274 Diff 7220 binaries/data/mods/public/simulation/components/tests/test_ValueModificationHelper.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/tests/test_ValueModificationHelper.js
Engine.LoadHelperScript("Player.js"); | Engine.LoadHelperScript("Player.js"); | ||||
Engine.LoadHelperScript("ValueModification.js"); | Engine.LoadHelperScript("ValueModification.js"); | ||||
Engine.LoadComponentScript("interfaces/AuraManager.js"); | Engine.LoadComponentScript("interfaces/AuraManager.js"); | ||||
Engine.LoadComponentScript("interfaces/Player.js"); | Engine.LoadComponentScript("interfaces/Player.js"); | ||||
Engine.LoadComponentScript("interfaces/TechnologyManager.js"); | Engine.LoadComponentScript("interfaces/ModificationsManager.js"); | ||||
let player = 1; | let player = 1; | ||||
let playerEnt = 10; | let playerEnt = 10; | ||||
let ownedEnt = 60; | let ownedEnt = 60; | ||||
let techKey = "Attack/BigAttack"; | let techKey = "Attack/BigAttack"; | ||||
AddMock(playerEnt, IID_TechnologyManager, { | AddMock(playerEnt, IID_ModificationsManager, { | ||||
"ApplyModifications": (key, val, ent) => { | "ApplyModifications": (key, val, ent) => { | ||||
if (key != techKey) | if (key != techKey) | ||||
return val; | return val; | ||||
if (ent == playerEnt) | if (ent == playerEnt) | ||||
return val + 3; | return val + 3; | ||||
if (ent == ownedEnt) | if (ent == ownedEnt) | ||||
return val + 7; | return val + 7; | ||||
return val; | return val; | ||||
Show All 30 Lines |
Wildfire Games · Phabricator