Infantry Units: Difference between revisions
(Created page with "Infantry Units stats and properties can be modified as a whole, by using the '''GameEnums.UnitType_Infantry''' variable: For instance:") |
No edit summary |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Infantry Units stats and properties can be modified as a whole, by using the '''GameEnums.UnitType_Infantry''' variable: | Infantry type Units' stats and properties can be modified as a whole, by using the '''GameEnums.UnitType_Infantry''' variable.For instance: | ||
<syntaxhighlight lang="javascript"> | |||
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 | |||
} | |||
} | |||
} | |||
</syntaxhighlight> | |||
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: | |||
{| class="wikitable" style="margin:auto;text-align: center" | |||
|+ Infantry Type Units and their weapon strings | |||
|- | |||
!Infantry Type Units !!Primary Weapon String!! Secondary Weapon String | |||
|- | |||
|'''INFANTRY'''||WEAPON_INFANTRY_MG||N/A | |||
|- | |||
|'''MECH'''||WEAPON_INFANTRY_MG||WEAPON_BAZOOKA | |||
|- | |||
|'''SNIPER'''||WEAPON_SNIPER||N/A | |||
|- | |||
|'''MOTORBIKE'''<ref>Same Unit as that from Days of Ruin/Dark Conflict</ref>||WEAPON_MOTORBIKE_MG||N/A | |||
|- | |||
|'''ZCOUNIT_PARTISAN'''<ref>CO Unit of Kindle, Alexander</ref>||WEAPON_INFANTRY_MG||WEAPON_FIREBOMB | |||
|- | |||
|'''ZCOUNIT_COMMANDO'''<ref>CO Unit of Sensei, Sophie, Sami </ref>||WEAPON_RECON_MG||WEAPON_BAZOOKA | |||
|- | |||
|'''ZCOUNIT_RANGER'''<ref>CO Unit of Cairn </ref>||WEAPON_MECH_MG||WEAPON_DESIGNATOR | |||
|- | |||
|'''ZCOUNIT_AT_CYCLE'''<ref>CO Unit of Grimm, Flak, Roboandy, Beast, Mary </ref>||WEAPON_BIKE_BAZOOKA||N/A | |||
|} | |||
Of these, the ones with the '''ZCOUNIT_''' prefix are Units specific to COs that cannot be deployed by the rest. | |||
==Notes== | |||
<references/> | |||
[[Category:Units]] | |||
[[Category:UnitIDs]] | |||
[[Category:Modding tutorials]] |
Latest revision as of 22:19, 26 November 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:
Infantry Type Units | Primary Weapon String | Secondary Weapon String |
---|---|---|
INFANTRY | WEAPON_INFANTRY_MG | N/A |
MECH | WEAPON_INFANTRY_MG | WEAPON_BAZOOKA |
SNIPER | WEAPON_SNIPER | N/A |
MOTORBIKE[1] | WEAPON_MOTORBIKE_MG | N/A |
ZCOUNIT_PARTISAN[2] | WEAPON_INFANTRY_MG | WEAPON_FIREBOMB |
ZCOUNIT_COMMANDO[3] | WEAPON_RECON_MG | WEAPON_BAZOOKA |
ZCOUNIT_RANGER[4] | WEAPON_MECH_MG | WEAPON_DESIGNATOR |
ZCOUNIT_AT_CYCLE[5] | WEAPON_BIKE_BAZOOKA | N/A |
Of these, the ones with the ZCOUNIT_ prefix are Units specific to COs that cannot be deployed by the rest.