Feature request from @Nescio.
Uploading it here because perhaps someday someone wants support for this in vanilla.
Details
- Reviewers
Silier
Give an entity the ResourceCost-node in the attack-template and watch every attack cost resources.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- /ps/trunk
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 10411 Build 17793: Vulcan Build Jenkins Build 17792: Vulcan Build (Windows) Jenkins Build 17791: arc lint + arc unit
Time | Test | |
---|---|---|
0 ms | Jenkins > TestComponentScripts::test_scripts Assertion failed: componentManager->LoadScript(VfsPath(L"simulation/components") / pathname)
Test failed: L"Running script simulation/components/tests/test_Attack.js"
Assertion failed: scriptInterface.LoadScript(pathname, content)
| |
0 ms | Jenkins > cxxtest-debug-gcc6.xml::[failed-to-read] Failed to read test report file /zpool0/trunk/cxxtest-debug-gcc6.xml
org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog.
at org.dom4j.io.SAXReader.read(SAXReader.java:462)
| |
0 ms | Jenkins > TestAllocators::test_da | |
0 ms | Jenkins > TestAtlasObjectXML::test_parse_attributes1 | |
0 ms | Jenkins > TestAtlasObjectXML::test_parse_attributes2 | |
View Full Test Results (2 Failed · 332 Passed) |
Event Timeline
Thanks again!
Interestingly, the technology contribution is displayed in the tooltips (5 stone), but somehow only the default (4 stone) is deduced in game. I suppose something should be changed in Attack.js lines 692 to 697?
binaries/data/mods/public/gui/common/tooltips.js | ||
---|---|---|
340 | "costs"? Elsewhere simply "cost" is used. (Again, just curious; it works here.) | |
binaries/data/mods/public/simulation/components/Attack.js | ||
107 | Any particular reason why you list it here (melee) before bonusSchema etc but below (ranged) after? (Just curious, doesn't really matter.) |
binaries/data/mods/public/simulation/components/Attack.js | ||
---|---|---|
594 | successful |
Thanks, I tried again, and it works now.
binaries/data/mods/public/simulation/components/Attack.js | ||
---|---|---|
594 | successful |
binaries/data/mods/public/simulation/components/Attack.js | ||
---|---|---|
594 | Oh boy, I'm sorry you had to correct me on this twice,,, |
I did not test this or had critical view but I have some notes:
Attack.prototype.GetResourceCost = function(attackType) is very expensive function which will be called a lot
Entity should take resource to its repository and if has enough of them then start to attack. Now it looks like this:
entity 1 can attack so it starts attack (attack animation is playing) another entity or player uses all resources entity 1 cannot finish attack but animation is at the end so its gives up
and it should be like
entity 1 can attack so it takes resources from player and starts attack (attack animation is playing) another entity or player uses all resources entity 1 can still finish attack and fails later because does not have enough resources
Another note to think is that getBestAttackAgainst should probably not return attack without needed resources
Petra will probably screw up her resources usage and planing with having this.
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/822/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1338/display/redirect