Use a factor for barter prices (not for barter prices difference which are common to all players).
We could use a factor only for buy prices or even something for all resources but while at it, use the more detailed thing.
Those prices are used when adding resources (and in the gui for preview).
Those factor are modifiable by techs or auras.
Those data are in Player component but could lie elsewhere. Though I find it was the best place.
If I am not wrong AI take care of that.
Add related tests.
Details
./binaries/system/test
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1158/ for more details.
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1159/ for more details.
binaries/data/mods/public/simulation/components/Player.js | ||
---|---|---|
177 ↗ | (On Diff #1868) | would be better to do something analoguous to the spyCostMultiplier, i.e. to avoid 8 calls to ApplyValueModifications each time GetBarterMultiplier is called. |
ok, as the component already listen to that, that caching seems good. Thx for the feedback.
grrr doesn't work anymore (for the modification part, I messed something or it doesn't take into account the modification as it arrives after for D480)
binaries/data/mods/public/simulation/components/Player.js | ||
---|---|---|
65 ↗ | (On Diff #2040) | perhaps we can simply do this.barterMultiplier.buy[res] = +this.template.BarterMultiplier.Buy[res] |
binaries/data/mods/public/simulation/components/Player.js | ||
---|---|---|
770 ↗ | (On Diff #2040) | well it's ok |
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1258/ for more details.
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1261/ for more details.
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1263/ for more details.
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1264/ for more details.
Patch is fine, my only worry is if we do really need all these 8 multipliers, as i'm afraid too much flexibility could be confusing.
All the use cases i've in mind could be done with only modifying one set of multiplier (preferentially the Sell ones as in your mace team bonus patch) but i may miss some and i'm also fine with that patch.
binaries/data/mods/public/simulation/components/Player.js | ||
---|---|---|
776 ↗ | (On Diff #2040) | such changes should be very rare, so does not matter |