SupSuper/OpenXcom — pull request #893 by Yankes (2014-07-12 17:36:36+00:00)
Title: Color script for Mods

This mod add fully customizable script altering unit graphic.

e.g.: https://www.youtube.com/watch?v=_G34PHMiBv0

Scripts have full access to unit data, animation frame, what part of body is drawn and current shade.
Scripts are define per armor. I used YAML built in `&` and `*` operator to copy same script to different armors.

Performance is very good, recolor 20 solders cost only around 20 fps form 410 on my machine (this is only visible for me when I force to redraw screen moving cursor).

BTW unit cache is useless, can be removed without any fps lost.

I add self documentation options too. When debug is enabled its print all available features to log file.

Future extension could be adding full support for items (now only corpses are recolored) and possibility to change sprite number for body parts. This will allow to move code that chose torso for M/F and power armor to rules file.

Overall script could be used for different usage too, right now it can only read object data and return one variable but after some small changes it could change state of object or call custom functions. This will allow in future move game logic to rules files or create custom events that can have user defined behavior.