(can't link to trac since it's down right now).
The attached patch does two things that would imo be quite interesting:
- It adds a "oneTimeEffect" option for technologies, which can go in addition or in replacement of "modifications". This oneTimeEffect is applied once, upon tech research. It can do anything we define in TechnologyManager.js (we may want a separate file for this?). Technologies that only have a oneTimeEffect have a "repeatable" option which allows them to be researched ∞ times.
This feature can be used to make god-power like features, such as the "spies" tech in AoE 2 or some of the god powers in AoM. It can also be used to upgrade units into other units (see upgrade tech). For the example here I've made a tech that deals 30 damage to all units, and an upgrade one.
- It allows technologies to affect tokens. This is done by extending the current technology files to support a "tokens" value, in which you can use "A>B" to change A into B, "-A" to remove A and "B" to add B to the production queue. It works well in my tests, and gets serialised properly.
It also fixes a bug where the training panel does not get refreshed when it should be.
NB: the technologies should NOT go into the game, they're here for demonstration purposes. The one time effects implemented might or might not stay, I don't really care all that much.
EDIT: for tokens, see D270 instead.