Unit design - Stat changer techs/effects

Here you may find answers to your questions.

Unit design - Stat changer techs/effects

Postby Stratego (dev) » Sun Sep 24, 2017 7:52 am

There are techs or effects that changes stats of a given unit (eg. Archer upgrades incrreases unit range, also there are spells (eg. clear vision) that also changes stats of spec units)

These changes are defined in the same format as the units itself (so any numerical value can be given (plus or minus sign) to change thevalue.

some samples:

Elf armor adds +1 armor to all elves
Code: Select all
{                   
   "unitTypeName":"TECH_ELF_ARMORS_1",
   "unitType":2042,
   "uiDefinition":{
      "visuals":[
     
     
         {
            "imgName":"tech_elf_armors_1.png",
            "type":"DEFAULT",
            "shiftIndicatorsDown":0,
            "typeExtra":0.0,
            "imgColumns":1,
            "imageDefParts":[
               {
                  "cropToRect":{"top": 0,"left":0,"bottom":32,"right":32},
                  "layer":"UNITS",
                  "shiftCol":0,
                  "shiftRow":0,
                  "clickable":true
               }
            ]
         }

         
         ]
   },
   
   "unitStatSheet":{
         "unit":{

            "trnRaces":["RACE_ELF"],
         "isTechnology":true,
            "costTurn":4,
            "grantorShopItems":[296],
            "trnCategories":["M_ELVEN_BUFFS"],
       "trnRevokerTechs":{"unitTypes":["TECH_ELF_ARMORS_2"]},
       "armorNormal":1,
            "trnBuilders":{"unitTypes":["UNIT_ELF_BUILDING_CRAFTSMAN"]}
           

         }
   }
   
   
   
}




Veteraning power is used by Zurgo to increase power and armor on every attack:
Code: Select all
{
   "unitTypeName":"EFFECT_VETERANING_POWER",
   "unitType":10022,
   "uiDefinition":{
      "visuals":[
         
      ]
   },
   "unitStatSheet":{
      "unit":{
         "isTechnology":true,
         "costTurn":0,
         "grantorShopItems":null,
         "hpMax":2,
         "hp":0,
         "power":1,
         "rangeAttack":0,
         "armorPierce":1,
         "armorNormal":1,
         "sight":0,
         "unitSizeCol":1,
         "unitSizeRow":1,
         "isUnderConstruction":false,
         "isFactory":false,
         "isFactoryThatNotAffectsFactoryLimits":false,
         "isOccupiableBuilding":false,
         "isWalkableThrough":true,
         "powerAccuracyPenalty":0.0,
         "powerRange":0,
         "powerRangePenaltyPercent":0,
         "attackTypeBurningRock":false,
         "attackTypeArrow":false,
         "rangeWalk":0,
         "convertRange":0,
         "convertResistance":0.0,
         "convertPossibility":0.0,
         "rangeHeal":0,
         "healRate":0,
         "rangeMend":0,
         "mendRate":0,
         "canBuild":false,
         "bonusMendingWhenConstructing":0.0,
         "bonusMending":0.0,
         "bonusHealing":0.0,
         "carryCapacity":0,
         "canBeCarried":true,
         "isCarriedUnitSurvivesIfIDie":false,
         "isCarrierCanCarryUnderConstruction":false,
         "isCarrierHidesCarriedUnits":true,
         "isCarrierLetCarriedUnitsToShoot":false,
         "isCarrierRemovesTerrainDrawbacks":false,
         "maxActionCount":0,
         "canOccupyBuilding":true,
         "canKillForest":false,
         "canFlyAsteroid":false,
         "isStealthUnit":false,
         "canSeeStealthUnits":false,
         "trnWeaponEffects":null,
         "trnCategories":["M_FLESH_AND_BLOOD_MODS"],

         "trnBonusList":[]
               
         }
       
   }
   
}


Special cases

Apart from changing the numerical values you can change:
- The specUnitActions array (you can add new item)
- The weaponeffects - you can influence the weapon to eg. poisoneing/flaming.
Stratego (dev)
Site Admin
 
Posts: 6026
Joined: Fri Apr 25, 2014 9:28 pm

Re: Unit design - Stat changer techs/effects

Postby Stratego (dev) » Sun Sep 24, 2017 7:53 am

I have just implemented a special thing:
- the "specunitactions" can be altered by techs and effects (even in aura-s), currently only adding.

it will be first used by the "siege tower" that will give the units inside a "CAN_FLY" property meaning it wil lbe able to jump tru the walls because they have "CAN_BE_FLOWN_TRU" special action.
Stratego (dev)
Site Admin
 
Posts: 6026
Joined: Fri Apr 25, 2014 9:28 pm


Return to FAQ

Who is online

Users browsing this forum: No registered users and 1 guest