Hi,
I want all my different character actions to be read in by XML so i can easily balance things out and modify all those actions. I would like some feedback on what I have started. I will have some basic actions like attack, move, cast, etc but most of the skills will be a combination of those (like "Dash" and "Wound" in the example below).
Q: I would also like to incorporate some kind of formula. Like a cooldown is based on (X * weapon weight) or damage is based on (skill level * weapon damage) but i am not sure how to implement this.
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<ability>
<name>Attack</name>
<info>A regular melee attack with your main weapon.</info>
<coodown>10</coodown>
<action>
<type>damage</type>
<sort>mainWeapon</sort>
</action>
</ability>
<ability>
<name>Dash</name>
<info>Dash forward to a target to hit him with greater impact.</info>
<coodown>20</coodown>
<action>
<type>move</type>
<location>target</location>
</action>
<action>
<type>damage</type>
<sort>mainWeapon</sort>
</action>
</ability>
<ability>
<name>Wound</name>
<info>Inflicts a wound to your target.</info>
<action>
<type>damage</type>
<sort>mainWeapon</sort>
</action>
<action>
<type>dot</type>
<element>physical</element>
</action>
</ability>
</actions>
I basically check for the type value and read XML accordingly. Q: Later i want to expand on this and i'm wondering if it is ok to to have different elements/nodes below these same types? Can i filter those out with something like:
if (action.GetChildByName("childThatMayOrMayNotExist"))
{
//Do something if it exists!
}
For those formula's i can think of something hacky like below. But i am really looking for something more flexibel and of course compatible with LibGDX/Android if you recommend a library.
<first>weaponDamage</first>
<operator>*</operator>
<second>skillLevel</second>
Like i said, i would love to have some feedback from people with more experience.
Thank you,