Infantry Units: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
Infantry Units stats and properties can be modified as a whole, by using the '''GameEnums.UnitType_Infantry''' variable.For instance: | Infantry type Units' stats and properties can be modified as a whole, by using the '''GameEnums.UnitType_Infantry''' variable.For instance: | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
Line 9: | Line 9: | ||
case GameEnums.PowerMode_Power: | case GameEnums.PowerMode_Power: | ||
if (attacker.getUnitType() === GameEnums. | if (attacker.getUnitType() === GameEnums.UnitType_Infantry) { | ||
return 30; | return 30; | ||
} | } | ||
Line 22: | Line 22: | ||
Increases the Offense of | Increases the Offense of Infantry type Units by 30% during the CO Power. | ||
Revision as of 04:50, 3 March 2023
Infantry type Units' stats and properties can be modified as a whole, by using the GameEnums.UnitType_Infantry variable.For instance:
CO_TEST.getOffensiveBonus = function (co, attacker, atkPosX, atkPosY,
defender, defPosX, defPosY, isDefender, action,luckmode, map) {
if (co.getIsCO0() === true) {
switch (co.getPowerMode()) {
case GameEnums.PowerMode_Power:
if (attacker.getUnitType() === GameEnums.UnitType_Infantry) {
return 30;
}
break;
//rest of the code goes here
}
}
}
Increases the Offense of Infantry type Units by 30% during the CO Power.
Modifying stats or properties of specific Units
Each Unit can be modified through a comparison of the UnitID. The Unit ID can be obtained through unit.getUnitID() And it's of a String type.
Possible values are:
Ground Units | |||||||||
---|---|---|---|---|---|---|---|---|---|
INFANTRY | MECH | SNIPER | MOTORBIKE[1] | ||||||
ZCOUNIT_PARTISAN[2] | ZCOUNIT_COMMANDO[3] | ZCOUNIT_RANGER[4] | ZCOUNIT_AT_CYCLE[5] |
Of these, the ones with the ZCOUNIT_ prefix are Units specific to COs that cannot be deployed by the rest.