Author Topic: [done] Make attack-boost parameters optional  (Read 774 times)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
[done] Make attack-boost parameters optional
« on: 20 December 2012, 13:52:43 »
According to current documentation, attack boosts cannot change the unit's HP regeneration or EP regeneration, meaning that it's impossible to make a healing attack boost (one of the most useful possibilities). Can such be implemented?

As well, I noticed that, at least in 3.7.1, attack boosts must have all the tags, even if they aren't using them. MegaGlest returns an error otherwise. Can the stat tags be made optional, defaulting to zero?

So in other words, this:
Code: [Select]
<attack-boost>
<allow-multiple-boosts value="false" />
<radius value="10" />
<target value="ally" />
<move-speed value="120" value-percent-multipler="true" />
<particles value="false" />
</attack-boost>

Should be the same as:
Code: [Select]
<attack-boost>
<allow-multiple-boosts value="false" />
<radius value="10" />
<target value="ally" include-self="false" />
<max-hp value="0" />
<max-ep value="0" />
<sight value="0" />
<attack-strenght value="0" />
<attack-range value="0" />
<armor value="0" />
<move-speed value="120" value-percent-multipler="true" />
<production-speed value="0" />
<particles value="false" />
</attack-boost>

The reason is legibility. It's much easier to glance at the XML code for the first example and know what it does than for the second example. We could even further that by setting allow-multiple-boosts and particles as optional (defaulting to false).
« Last Edit: 26 December 2012, 19:35:45 by Omega »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
it is possible but not documented
Code: [Select]
<max-hp value="0" regeneration="-99999..0..99999"/>
<max-ep value="0"  regeneration="-99999..0..99999"/>
-99999..0..99999 = any number

optional parameters  ... could be implemented

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
it is possible but not documented
Code: [Select]
<max-hp value="0" regeneration="-99999..0..99999"/>
<max-ep value="0"  regeneration="-99999..0..99999"/>
-99999..0..99999 = any number

optional parameters  ... could be implemented
Ah, thanks. In which case, is it impossible to use a multiplier on the regeneration? Or is a multiplier on HP forced on regeneration as well?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
Re: Make attack-boost parameters optional
« Reply #3 on: 20 December 2012, 14:20:50 »
Have not tested, yet (or forgotten the result)

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: Make attack-boost parameters optional
« Reply #4 on: 26 December 2012, 07:58:26 »
svn rev# 3960 now implements the requested xml tags mentioned above as optional.