Xml Calculate question
I was trying to change the BowAttack_ a bid trying to balance it a bid more in favor of trained Archers vs spammed cheap units
so what i wanted to do is scale the damage an arrow does on how "precise" he is shot at the targe. Using the Archers Accuracy and the targets Dodge. so I inserted a GameModifier which looks like this
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>AdjustUnitStat</Attribute>
- <StrVal>UnitStat_Attack_Pierce</StrVal>
- <ApplyToCaster>1</ApplyToCaster>
- <Duration>1</Duration>
- <UpdateDurationAtTurnStart>1</UpdateDurationAtTurnStart>
- <Calculate InternalName="Do" ValueOwner="TargetUnit">
- <Expression><![CDATA[[UnitStat_Dodge]+[UnitStat_DodgeAgainstRanged]]]></Expression>
- </Calculate>
- <Calculate InternalName="AC" ValueOwner="CastingUnit">
- <Expression><![CDATA[[UnitStat_Accuracy]]]></Expression>
- </Calculate>
- <Calculate InternalName="Calc">
- <Expression><![CDATA[[AC]-[Do]]]></Expression>
- </Calculate>
- <Calculate InternalName="Value">
- <Expression><![CDATA[[Calc]*0.1]]></Expression>
- </Calculate>
- </GameModifier>
now everything does work fine except... that the variable "Do" is taken from the attacking unit not the targeted one, basically if i equip +Accuracy Items my Damage increases and if i add +Dodge it decreases. Is this me doing something wrong or is this a bug, because i have absolutly no idea how to reference the targeted unit if target refers to my archer