(Created page with "Naval Units' stats and properties can be modified as a whole, by using the '''GameEnums.UnitType_Naval''' 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() === Gam...")
 
No edit summary
 
(11 intermediate revisions by 2 users not shown)
Line 30: Line 30:


Possible values are:
Possible values are:
{| class="wikitable"
{| class="wikitable" style="margin:auto;text-align: center"
!colspan="10"|Naval Units
|+ Naval Units and their weapon strings
|-
|-
|style="text-align: center;"|'''K_HELI'''<ref>Same Unit as Battlecopters</ref>
!Naval Units !!Primary Weapon String!! Secondary Weapon String
|style="text-align: center;"|'''T_HELI'''<ref>Same Unit as Transport Copters</ref>
|-
|style="text-align: center;"|'''DUSTER'''<ref>Same Unit as that from Days of Ruin/Dark Conflict</ref>
|'''GUNBOAT'''||WEAPON_GUNBOAT_NAVAL_GUN||N/A
|style="text-align: center;"|'''BOMBER'''
|-
|style="text-align: center;"|'''STEALTHBOMBER'''
|'''CANNONBOAT'''||WEAPON_ANTI_SHIP_MISSILE||N/A
|-
|'''TORPEDOBOAT'''||WEAPON_BOAT_TORPEDO||N/A
|-
|'''FRIGATE'''||WEAPON_FRIGATE_NAVAL_GUN||N/A
|-
|'''DESTROYER'''||WEAPON_ANTI_SHIP_MISSILE||N/A
|-
|'''CRUISER'''||WEAPON_ANTI_SHIP_CRUISER_MISSILE||WEAPON_A_AIR_GUN
|-
|'''SUBMARINE'''||WEAPON_TORPEDO||N/A
|-
|'''BATTLECRUISER'''||WEAPON_ANTI_SHIP_CANNON||WEAPON_BATTLECRUISER_A_AIR_GUN
|-
|'''BATTLESHIP'''||WEAPON_BATTLESHIP_CANNON||N/A
|-
|'''AIRCRAFTCARRIER'''||WEAPON_CARRIER_ANTI_AIR_MISSILE||N/A
|-
|'''BLACKBOAT'''||N/A||N/A
|-
|'''LANDER'''||N/A||N/A
|-
|'''WATERMINE'''||N/A||N/A
|-
|'''ZCOUNIT_MISSILE_SUB'''<ref>CO Unit of Drake, Greyfield</ref>||WEAPON_ROCKET_MISSILE||N/A
|-
|-
|style="text-align: center;"|'''TRANSPORTPLANE'''
|style="text-align: center;"|'''FIGHTER'''
|style="text-align: center;"|'''WATERPLANE'''<ref>Same Unit as that from Days of Ruin/Dark Conflict</ref>
|style="text-align: center;"|'''ZCOUNIT_KIROV'''<ref>CO Unit of Tasha, Eagle, Waylon</ref>
|}
|}


Line 50: Line 70:


==Notes==
==Notes==
<references/>
<references />


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

Latest revision as of 22:19, 26 November 2023

Naval Units' stats and properties can be modified as a whole, by using the GameEnums.UnitType_Naval 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_Naval) {
                    return 30;
                }
            break; 
       //rest of the code goes here
       }

    }

}


Increases the Offense of Naval 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:

Naval Units and their weapon strings
Naval Units Primary Weapon String Secondary Weapon String
GUNBOAT WEAPON_GUNBOAT_NAVAL_GUN N/A
CANNONBOAT WEAPON_ANTI_SHIP_MISSILE N/A
TORPEDOBOAT WEAPON_BOAT_TORPEDO N/A
FRIGATE WEAPON_FRIGATE_NAVAL_GUN N/A
DESTROYER WEAPON_ANTI_SHIP_MISSILE N/A
CRUISER WEAPON_ANTI_SHIP_CRUISER_MISSILE WEAPON_A_AIR_GUN
SUBMARINE WEAPON_TORPEDO N/A
BATTLECRUISER WEAPON_ANTI_SHIP_CANNON WEAPON_BATTLECRUISER_A_AIR_GUN
BATTLESHIP WEAPON_BATTLESHIP_CANNON N/A
AIRCRAFTCARRIER WEAPON_CARRIER_ANTI_AIR_MISSILE N/A
BLACKBOAT N/A N/A
LANDER N/A N/A
WATERMINE N/A N/A
ZCOUNIT_MISSILE_SUB[1] WEAPON_ROCKET_MISSILE N/A


Of these, the ones with the ZCOUNIT_ prefix are Units specific to COs that cannot be deployed by the rest.

Notes

  1. CO Unit of Drake, Greyfield