Page MenuHomeWildfire Games

petra: fix a case when ptol or sele have their cc destroyed while they already had a colony, they would no more try to build a cc
ClosedPublic

Authored by mimo on Jun 19 2017, 7:52 PM.

Details

Summary

as the title says.
in addition, the civs which can have a colony is no more hard-coded

Test Plan

test with ptol or sele and destroy the cc while they have a colony, they won't build a new one, so can't phase up anymore.

Event Timeline

mimo created this revision.Jun 19 2017, 7:52 PM
Vulcan added a subscriber: Vulcan.Jun 19 2017, 8:39 PM

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!
Checking XML files...

http://jw:8080/job/phabricator/1585/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 170| »   »   »   »   builders.forEach(function·(worker)·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/209/ for more details.

Sandarac added inline comments.
binaries/data/mods/public/simulation/ai/petra/headquarters.js
1522

I guess naming this variable something like "numNonColonyCC" would be more clear.

1523

Perhaps it would be better to use a new var for "structures/{civ}_military_colony", as this raw string occurs four times here.

mimo updated this revision to Diff 2629.Jun 20 2017, 6:59 PM

update patch

mimo added inline comments.Jun 20 2017, 7:13 PM
binaries/data/mods/public/simulation/ai/petra/headquarters.js
1522

I didn't want to singularize colonies, the real point is to have one cc which allows to phase up (that's what was meant by full CC). So now the name reflects it, and the plan is later to check on the productionQueue of the cc that it indeed allows phasing rather than relying on assumption on classes, but will only be done in another patch after the release because

  • this patch should stay a simple fix for A22
  • the way to check on phasing will change after D654, so better wait for it before doing that kind of changes
1523

yes, i've tried but it broke the symmetry :( and i didn't like the look of the code, and in fact only 2 occurences of it are met in each path. (but i can add it if you insist).

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!
Checking XML files...

http://jw:8080/job/phabricator/1591/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 170| »   »   »   »   builders.forEach(function·(worker)·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/215/ for more details.

mimo updated this revision to Diff 2642.Jun 21 2017, 2:49 PM

In fact, requiring a cc with phase techs is not enough as for these civs with colony, the cc also provide heroes. Thus the new patch now requires to have at least one cc from their civ

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!
Checking XML files...

http://jw:8080/job/phabricator/1599/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 170| »   »   »   »   builders.forEach(function·(worker)·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/219/ for more details.

This revision was automatically updated to reflect the committed changes.