|
|
TWR 3.0 prototype - request for comments July 31, 2011 05:48PM |
Admin Registered: 3 years ago Posts: 137 |
<element minCount="0" maxCount="1" size="inherit" afterAppend="that.parent.stat('sta',that.parent.stat('sta')+1);" beforeRemove="that.parent.stat('sta',that.parent.stat('sta')-1);"> <uid>shield</uid> <name>Shield</name> <cost id="pts">1</cost> </element> In this case afterAppend and beforeRemove are examples of 'hooks'. You can define a piece of a JS code that will be executed after element is appended and before it is removed! This piece has access to an interface that will allow you to make anything you want with the army. In this example after adding a shield parent element stamina stat is increased by 1 and decreased prior to shield removal (play with warriors in the calc to see that it actually works).
|
|
Re: TWR 3.0 prototype - request for comments August 01, 2011 04:26PM |
Registered: 2 years ago Posts: 59 |
|
|
Re: TWR 3.0 prototype - request for comments August 01, 2011 04:56PM |
Admin Registered: 3 years ago Posts: 137 |
|
|
Re: TWR 3.0 prototype - request for comments August 01, 2011 06:04PM |
Registered: 2 years ago Posts: 8 |
.
|
|
Re: TWR 3.0 prototype - request for comments August 01, 2011 09:02PM |
Registered: 11 months ago Posts: 39 |
|
|
Re: TWR 3.0 prototype - request for comments August 10, 2011 09:00PM |
Admin Registered: 3 years ago Posts: 137 |
|
|
Re: TWR 3.0 prototype - request for comments August 16, 2011 01:07PM |
Registered: 11 months ago Posts: 39 |
|
|
Re: TWR 3.0 prototype - request for comments September 01, 2011 12:36PM |
Registered: 2 years ago Posts: 59 |