I think he's saying why parse data like that when you can just use multidim arrays? For example you have:
PHP Code:
effects = {
"100:cause:Bleed:3:auto:460:bleed",
"75:cause:Disea se:15:auto:15,120:spread_disease"
}
Which with a multidim array could be:
PHP Code:
effects = {
{100,"cause","Bleed",3,"auto",460,"bleed"},
{75,"cause","Disease",15,"auto","15,120","spread_disease"}
}
And you avoid needing to do all the extra parsing. Alternatively to cover the damage problem, you can do:
PHP Code:
effects = {
{100,"cause","Bleed",3,"auto",460,"bleed"},
{75,"cause","Disease",15,"auto",{15,120},"spread_disease"}
}
Then, when you start working with the damage check the variable type, if it's numeric apply regularly, if it's an array apply min-max. You can do:
PHP Code:
array.add({75,"cause","Disease",15,"auto",{15,120},"spread_disease"});
you know?