Question: How do I make abilities consume a certain amount of AP?

Question: How do I make abilities consume a certain amount of AP? For example, one ability should cost 1 and another cost everything available.

4,750 views 10 replies
Reply #1 Top

I don't think there is a way.  

Everything seems to affect next turn - not current turn.  For example, I can take away the unit's next turn or even lower their overall AP next turn (by reducing combat speed by a multiplier), but I don't see any way to set an AP cost.  

I think such a tag is necessary for both abilities and spells. 

Reply #2 Top

A strange thing though... I have an ability that consumes 3 AP. And I cannot understand why.

Oh well... I worked around the issue for now.

Reply #3 Top

Heavenfall,

Can you post the XML data snippet for the 3 AP cost ability? Then we all can take a shot at figuring it out.

Reply #4 Top

 

  <SpellDef InternalName="ef_uu_destructiveleap">
        <DisplayName>Destructive Leap</DisplayName>
      <Description>Unit launches itself through the air to an area, dealing 5-10% of the golem's attack in true damage to everyone in the area.</Description>
        <Image>StoneSkin_Icon.png</Image>
        <IconFG>StoneSkin_Icon_BG.png</IconFG>
        <IconColor>32,45,243</IconColor>
        <Range>4</Range>
        <Radius>1</Radius>
        <SoundFX>Hit_Hammer1</SoundFX>
        <Cooldown>6</Cooldown>
        <Manacost>3</Manacost>
        <SpellLevel>0</SpellLevel>
        <SpellType>Tactical</SpellType>
    <SpellClass>Offensive</SpellClass>
    <SpellTargetType>EnemyUnit</SpellTargetType>
        <IsSpecialAbility>1</IsSpecialAbility>

        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>CurHealth</Attribute>
            <Calculate InternalName="AttBonus" ValueOwner="CastingUnit">
                <Expression><![CDATA[[UnitStat_Attack]*-1]]></Expression>
            </Calculate>
            <Calculate InternalName="MinValue">
                <Expression><![CDATA[[AttBonus]*0.1]]></Expression>
            </Calculate>
            <Calculate InternalName="MaxValue">
                <Expression><![CDATA[[AttBonus]*0.05]]></Expression>
            </Calculate>          
        </GameModifier>

     <GameModifier InternalName="BlinkModifier">
      <ModType>Map</ModType>
      <Attribute>TransportUnit</Attribute>
    </GameModifier>

  <SpellDefEffect>
      <EffectName>Titans_Breath</EffectName>
      <LocalPosition>0,25,0</LocalPosition>
      <EffectScale>.6</EffectScale>
      <EffectDelay>0.0</EffectDelay>
      <SnapToTerrain>1</SnapToTerrain>
    </SpellDefEffect>

    </SpellDef>

End of quote

 

And no, it's not the <Manacost>

Reply #5 Top

Heavenfall,

Does the unit using this have an AP of 3 to start with? Since 1.1 casting spell has used all remaining AP to cast. With my Sov I tend to make one attack and then cast in order to do more then one action. Like you, I see nothing in the code there that controls AP used.

In some of the spells in the data folder are showing a Tag called CastTime. Perhaps that is what dictates AP use. Now looking at that more I know casting fireball has burned more then one AP. So maybe 1 for CastTime is 100% of AP. Take some playing with or someone from SD telling us how to set AP use when casting.

Reply #6 Top

Well strike that 1 = 100% thought. Firestorm is CastTime of 2. Both have wiped out my full AP if done first. Perhaps we are looking at a bug in the main code.

Reply #7 Top

Quoting Capn, reply 6
Well strike that 1 = 100% thought. Firestorm is CastTime of 2. Both have wiped out my full AP if done first. Perhaps we are looking at a bug in the main code.
End of Capn's quote

I don't know if it's a bug, I think it's just not hooked up yet. There was talk about getting casting time into the game a while back.

Reply #8 Top

I think the higher ap cost of the ability I linked was caused by the blink modifier combined with the <radius> being 1. Effectively, the unit was blinking to all 9 tiles.

Reply #9 Top


I think the higher ap cost of the ability I linked was caused by the blink modifier combined with the being 1. Effectively, the unit was blinking to all 9 tiles.
End of quote

From my experience with abilities, the reason this cost 3 AP is fairly straight forward, the ability itself costs 2 AP to use, but since you are not specifying the skill as a movement class spell, you also have to pay 1 AP for the move cost. This is my best guess. To answer the initial question, I have yet to find an effective way to change the AP cost of a special ability. There used to be a tag called movecost but it does not seem to work anymore.

Reply #10 Top

I think it's tied into the change in spells- why it uses up all your MP.