diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-28 00:17:23 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-28 00:29:40 +1000 |
commit | 23929ee3b2452b1c3a133061eff44b31dc70fb09 (patch) | |
tree | 438759a7c65a1d57fb97ec39c7a3a0beca99ed06 /crawl-ref/source/spl-util.cc | |
parent | e42132c99bf63b213388404676a54c6610bd613c (diff) | |
download | crawl-ref-23929ee3b2452b1c3a133061eff44b31dc70fb09.tar.gz crawl-ref-23929ee3b2452b1c3a133061eff44b31dc70fb09.zip |
Customisable clouds!
cloud_struct now has members for colour, name, and tile; colour will be
used instead of the default colour of the cloud type, and will be used
to recolour the tile of the cloud (if it exists). Name will be used to
rebrand the cloud's description, and also alter the message generate
while standing in a cloud.
Finally, tile can be used to completely customise the tile used for the
cloud. The value is stored as a string in order to maintain save
compatibility across ASCII and tiles. A random tile (found using
tile_main_count) from that set will also be used, however, no duration
effects will be applied.
Recoloured cloud tiles using just the colour code should be possible,
though aren't yet fully tested.
This commit bumps TAG_MAJOR_VERSION: changing marshalling of the
FogMachine Lua code causes nasty crashes on reloading saved games.
Otherwise, I don't think I broke anything else. :-)
Diffstat (limited to 'crawl-ref/source/spl-util.cc')
-rw-r--r-- | crawl-ref/source/spl-util.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc index 2f32ea67e1..75d7264e07 100644 --- a/crawl-ref/source/spl-util.cc +++ b/crawl-ref/source/spl-util.cc @@ -73,7 +73,8 @@ static struct spell_desc *_seekspell(spell_type spellid); static bool _cloud_helper(cloud_func func, const coord_def& where, int pow, int spread_rate, cloud_type ctype, kill_category whose, - killer_type killer); + killer_type killer, int colour, + std::string name, std::string tile); // // BEGIN PUBLIC FUNCTIONS @@ -677,13 +678,14 @@ int apply_area_within_radius(cell_func cf, const coord_def& where, void apply_area_cloud( cloud_func func, const coord_def& where, int pow, int number, cloud_type ctype, kill_category whose, killer_type killer, - int spread_rate ) + int spread_rate, int colour, std::string name, + std::string tile) { int good_squares = 0; int neighbours[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; if (number && _cloud_helper(func, where, pow, spread_rate, ctype, whose, - killer)) + killer, colour, name, tile)) number--; if (number == 0) @@ -703,7 +705,8 @@ void apply_area_cloud( cloud_func func, const coord_def& where, { const int aux = arrs[m][i]; if ( _cloud_helper(func, where + Compass[aux], - pow, spread_rate, ctype, whose, killer)) + pow, spread_rate, ctype, whose, killer, colour, + name, tile)) { number--; good_squares++; @@ -729,7 +732,7 @@ void apply_area_cloud( cloud_func func, const coord_def& where, number -= spread; good_squares--; apply_area_cloud(func, where + Compass[j], pow, spread, ctype, whose, - killer, spread_rate); + killer, spread_rate, colour, name, tile); } } @@ -893,11 +896,13 @@ bool is_valid_spell(spell_type spell) static bool _cloud_helper(cloud_func func, const coord_def& where, int pow, int spread_rate, cloud_type ctype, kill_category whose, - killer_type killer) + killer_type killer, int colour, std::string name, + std::string tile) { if (!feat_is_solid(grd(where)) && env.cgrid(where) == EMPTY_CLOUD) { - func(where, pow, spread_rate, ctype, whose, killer); + func(where, pow, spread_rate, ctype, whose, killer, colour, name, + tile); return (true); } |