(Created page with "'''Hovercraft Units'''<nowiki/>' stats and properties can be modified as a whole, by using the '''GameEnums.UnitType_Hovercraft''' enumeration variable. For instance: <syntaxhighlight lang="javascript"> this.getOffensiveBonus = function (co, attacker, atkPosX, atkPosY, defender, defPosX, defPosY, isDefender, action, luckmode, map) { if (co.getIsCO0() === true) { if (co.getPowerMode() === GameEnums.PowerMode_Power) { if (attacker.g...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 24: Line 24:


Possible values are:
Possible values are:
{| class="wikitable"
{| class="wikitable" style="margin:auto;text-align: center"
! colspan="5" |Hovercraft Units
|+ Hovercraft Units and their weapon strings
|-
!Hovercraft Units !!Primary Weapon String!! Secondary Weapon String
|-
|'''HOVERCRAFT'''||WEAPON_HOVERCRAFT_GUN||WEAPON_HOVERCRAFT_MG
|-
|'''ARTILLERYCRAFT'''||WEAPON_CANNON||N/A
|-
|'''HOVERFLAK'''||WEAPON_HOVERVULCAN_CANNON||N/A
|-
|'''HEAVY_HOVERCRAFT'''||WEAPON_HEAVY_HOVERCRAFT_GUN||WEAPON_HEAVY_HOVERCRAFT_MG
|-
|-
| style="text-align: center;" |'''HOVERCRAFT'''
| style="text-align: center;" |'''ARTILLERYCRAFT'''
| style="text-align: center;" |'''HOVERFLAK'''
| style="text-align: center;" |'''HEAVY_HOVERCRAFT'''
|}
|}


[[Category:Units]]
[[Category:Units]]
[[Category:UnitIDs]]
[[Category:UnitIDs]]
[[Category:Modding tutorials]]

Latest revision as of 22:19, 26 November 2023

Hovercraft Units' stats and properties can be modified as a whole, by using the GameEnums.UnitType_Hovercraft enumeration variable. For instance:

this.getOffensiveBonus = function (co, attacker, atkPosX, atkPosY,
    defender, defPosX, defPosY, isDefender, action, luckmode, map)
{
    if (co.getIsCO0() === true)
    {
        if (co.getPowerMode() === GameEnums.PowerMode_Power)
        {
            if (attacker.getUnitType() === GameEnums.UnitType_Hovercraft)
            {
                return 30;
            }
        }
    }
    return 0;
};

Increases the firepower of hovercraft units by 30% during the CO Power.

Modifying stats or properties of specific Units

Each unit can be modified through a comparison of the Unit ID. The Unit ID can be obtained through unit.getUnitID(), and it's of a string type.

Possible values are:

Hovercraft Units and their weapon strings
Hovercraft Units Primary Weapon String Secondary Weapon String
HOVERCRAFT WEAPON_HOVERCRAFT_GUN WEAPON_HOVERCRAFT_MG
ARTILLERYCRAFT WEAPON_CANNON N/A
HOVERFLAK WEAPON_HOVERVULCAN_CANNON N/A
HEAVY_HOVERCRAFT WEAPON_HEAVY_HOVERCRAFT_GUN WEAPON_HEAVY_HOVERCRAFT_MG