Change the value of the unit if you have been declared at war

TzeLust

Chieftain
Joined
Apr 6, 2022
Messages
3
I want to add a unit for my civilization that will cost 60% less production if you are at war. I already have a unit template:
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
    <Types>
        <!-- Melee-->
        <Row Type="UNIT_TERDEF" Kind="KIND_UNIT"/>
    </Types>
    <UnitAiInfos>
        <!-- Melee-->
        <Row UnitType="UNIT_TERDEF" AiType="UNITAI_COMBAT"/>
        <Row UnitType="UNIT_TERDEF" AiType="UNITAI_EXPLORE"/>
        <Row UnitType="UNIT_TERDEF" AiType="UNITTYPE_MELEE"/>
        <Row UnitType="UNIT_TERDEF" AiType="UNITTYPE_LAND_COMBAT"/>
    </UnitAiInfos>
    <UnitReplaces>
        <Row CivUniqueUnitType="UNIT_TERDEF" ReplacesUnitType="UNIT_INFANTRY"/>
    </UnitReplaces>
    <UnitUpgrades>
        <Row Unit="UNIT_TERDEF" UpgradeUnit="UNIT_MECHANIZED_INFANTRY"/>
    </UnitUpgrades>
    <TypeTags>
        <Row Type="UNIT_TERDEF" Tag="CLASS_MELEE"/>
        <Row Type="UNIT_TERDEF" Tag="CLASS_TERDEF"/>
    </TypeTags>
    <Units>
        <Row UnitType="UNIT_TERDEF" BaseMoves="2" Cost="450" AdvisorType="ADVISOR_CONQUEST" BaseSightRange="2" ZoneOfControl="true" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_LAND_COMBAT" Name="LOC_UNIT_TERDEF_NAME" Description="LOC_UNIT_TERDEF_DESCRIPTION" PurchaseYield="YIELD_GOLD" PromotionClass="PROMOTION_CLASS_MELEE" Maintenance="8" Combat="75" PrereqTech="TECH_REPLACEABLE_PARTS" TraitType="TRAIT_CIVILIZATION_UNIT_TERDEF"/>
    </Units>
</GameInfo>
How can I add this ability to him?
 
you have a trait already associated with the unit:
TRAIT_CIVILIZATION_UNIT_TERDEF

Now you just have to associate with the leader you want, example:
Code:
  <LeaderTraits>
  <Row LeaderType="LEADER_JOAO_III"  TraitType="TRAIT_LEADER_UNIT_GALEAO"/>
  </LeaderTraits>
 
Top Bottom