I'm trying to work through an issue with a set of picks where each additional pick has a higher cost than the previous one.
The first pick costs 4 points, then each additional pick costs an extra 2 points, cumulatively. So pick1 costs 4 points, pick2 costs 6 points, pick3 costs 8 points, etc.
I tried to get clever with the following bit of scripting, but it didn't work as intended.
Instead of increasing the cost for each successive pick, in increased the cost for each existing pick as well. Pick1 would cost 4 points, but if I added a second pick, they would cost 6 points each. And if I added a third, they would cost 8 points each.
In retrospect, this behavior makes sense. It still leaves me confused, though, as to how to make this work.
The first pick costs 4 points, then each additional pick costs an extra 2 points, cumulatively. So pick1 costs 4 points, pick2 costs 6 points, pick3 costs 8 points, etc.
I tried to get clever with the following bit of scripting, but it didn't work as intended.
Code:
~adjust the resource appropriately
var schcount as number
var cost as number
foreach pick in hero where "component.School"
schcount += 1
nexteach
cost=2+(schcount*2)
hero.child[resCP].field[resSpent].value += cost
Instead of increasing the cost for each successive pick, in increased the cost for each existing pick as well. Pick1 would cost 4 points, but if I added a second pick, they would cost 6 points each. And if I added a third, they would cost 8 points each.
In retrospect, this behavior makes sense. It still leaves me confused, though, as to how to make this work.