From d03ad7b05a931a1bd0bc69eb809d30fca8177cb6 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Fri, 27 Jun 2008 16:15:37 +0000 Subject: Add a new command for firing without quivering on 'F'. Use puff of fire/ice tiles for ammo of flame/ice being fired. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6169 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/tile1.cc | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'crawl-ref/source/tile1.cc') diff --git a/crawl-ref/source/tile1.cc b/crawl-ref/source/tile1.cc index ed2c3bf65a..d088b05d2e 100644 --- a/crawl-ref/source/tile1.cc +++ b/crawl-ref/source/tile1.cc @@ -1925,8 +1925,18 @@ int tileidx_item_throw(const item_def &item, int dx, int dy) int ch = -1; int dir = _tile_bolt_dir(dx, dy); + switch (get_ammo_brand(item)) + { + case SPMSL_FLAME: + return (tileidx_zap(RED)); + case SPMSL_ICE: + return (tileidx_zap(WHITE)); + default: + break; + } + // Thrown items with multiple directions - switch(item.sub_type) + switch (item.sub_type) { case MI_ARROW: ch = TILE_MI_ARROW0; @@ -1952,7 +1962,7 @@ int tileidx_item_throw(const item_def &item, int dx, int dy) return ch + dir; // Thrown items with a single direction - switch(item.sub_type) + switch (item.sub_type) { case MI_STONE: ch = TILE_MI_STONE0; @@ -2333,12 +2343,14 @@ int tileidx_bolt(const bolt &bolt) return tileidx_zap(col); } -int tileidx_zap(int color) +int tileidx_zap(int colour) { - int col = color; - if (col > 8) col -= 8; - if (col < 1) col = 7; - return TILE_SYM_BOLT_OFS -1 + col; + int col = colour; + if (col > 8) + col -= 8; + if (col < 1) + col = 7; + return (TILE_SYM_BOLT_OFS - 1 + col); } // Convert normal tile to 3D tile if it exists @@ -4472,9 +4484,9 @@ static void _finish_inven_data(int n, int *tiles, int *num, int *idx, if (q == 1) q = -1; - if ( type == OBJ_WANDS - && ((itm->flags & ISFLAG_KNOW_PLUSES ) - || itm->plus2 == ZAPCOUNT_EMPTY) ) + if (type == OBJ_WANDS + && ((itm->flags & ISFLAG_KNOW_PLUSES) + || itm->plus2 == ZAPCOUNT_EMPTY)) { q = itm->plus; } -- cgit v1.2.3-54-g00ecf