Skip to content

Commit

Permalink
impruve final
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Andreev committed Aug 11, 2022
1 parent 2fded24 commit 10c11bb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
16 changes: 13 additions & 3 deletions multiplay/script/mods/landingOfWaves.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,16 @@ function scheduler()
queue("scheduler", 6*1000);
return;
}
wave.droids = enumDroid(AI, "DROID_WEAPON").filter((d) => {return (!d.isVTOL || !d.canHitGround);});
wave.droids = enumDroid(AI, "DROID_WEAPON").filter((d) => {return (!d.isVTOL && d.canHitGround);});


// отразили финальную волну
if (wave.droids.length == 0 && wave.active == true && wave.budget <= 0 && wave.type == "FINAL")
{
wave.active = false;
return;
}


// отразили волну
if (wave.droids.length == 0 && wave.active == true && wave.budget <= 0 )
Expand Down Expand Up @@ -280,7 +289,7 @@ function newWave()
let {x, y, x2, y2} = getScrollLimits();
let unitZone = {x:x+BORDER+LZRADIUS, y:y+BORDER+LZRADIUS, x2:x2-BORDER-LZRADIUS, y2:y2-BORDER-LZRADIUS};
let structZone = {x:x, y:y, x2:x2, y2:y2};
if (y < settings.expansion) //Final
if ((y < settings.expansion) && (numberWave % 4 == 0)) //Final
{
y = 0;
x = 0;
Expand All @@ -291,7 +300,7 @@ function newWave()
const budget = calcBudget(getTotalTimeS());
wave= {
type: "FINAL",
budget: budget.budget,
budget: budget.budget * settings.Kfinal,
rang: budget.rang,
experience: budget.experience,
droids: [],
Expand Down Expand Up @@ -496,6 +505,7 @@ function getStructs(timeS)

function pushStructss(avalibleStructs)
{
if (!wave.structZone) {return;}
const {x, y, x2, y2} = wave.structZone;
if (avalibleStructs.length === 0)
{
Expand Down
2 changes: 1 addition & 1 deletion multiplay/script/rules/endconditions.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ function checkEndConditions()
{
return team.isContender();
});
if ((isMapFullyOpen() && countDroid(DROID_ANY, AI) === 0) || contenderTeams.length === 0) // custum end game
if ((isMapFullyOpen() && wave.active === false && countDroid(DROID_ANY, AI) === 0) || contenderTeams.length === 0) // custum end game
{
contenderTeams.forEach((team) =>
{
Expand Down
3 changes: 2 additions & 1 deletion multiplay/script/rules/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"doublePowerM": 90,
"pauseM": 0.8,
"inWavePauseS": 17,
"timeHandicapM": 1.5
"timeHandicapM": 1.5,
"Kfinal": 4
}

0 comments on commit 10c11bb

Please sign in to comment.