Attached Files |
0001-Show-halo-radius-in-tiles.patch [^] (10,068 bytes) 2011-08-01 02:19 [Show Content] [Hide Content]From 297f88db3a8c930a0cd0d7cb8ab6e0522e5e514f Mon Sep 17 00:00:00 2001
From: Florian Diebold <flodiebold@gmail.com>
Date: Mon, 1 Aug 2011 01:58:08 +0200
Subject: [PATCH] Show halo radius in tiles.
packed_cell.is_haloed (which previously was only set for haloed
monsters) becomes packed_cell.halo, with either HALO_NONE, HALO_RANGE
or HALO_MONSTER as value.
There is a combined tile for silence + halo range, since this may
often happen with Mennas, and thus should look discernable. The tiles
may need work, though.
---
crawl-ref/source/rltiles/dc-feat.txt | 2 ++
crawl-ref/source/rltiles/effect/halo_range.png | Bin 0 -> 233 bytes
.../source/rltiles/effect/halo_range_silenced.png | Bin 0 -> 254 bytes
crawl-ref/source/tilecell.cc | 4 ++--
crawl-ref/source/tilecell.h | 13 ++++++++++---
crawl-ref/source/tiledgnbuf.cc | 8 ++++++--
crawl-ref/source/tileview.cc | 12 ++++++++----
crawl-ref/source/tileweb.cc | 4 ++--
crawl-ref/source/webserver/static/game/enums.js | 5 +++++
crawl-ref/source/webserver/static/game/render.js | 8 ++++++--
10 files changed, 41 insertions(+), 15 deletions(-)
create mode 100644 crawl-ref/source/rltiles/effect/halo_range.png
create mode 100644 crawl-ref/source/rltiles/effect/halo_range_silenced.png
diff --git a/crawl-ref/source/rltiles/dc-feat.txt b/crawl-ref/source/rltiles/dc-feat.txt
index a78a9bc..3d0bb89 100644
--- a/crawl-ref/source/rltiles/dc-feat.txt
+++ b/crawl-ref/source/rltiles/dc-feat.txt
@@ -458,6 +458,8 @@ wall_blood7_e
wall_blood8_e
%sdir dc-misc
halo HALO
+effect/halo_range HALO_RANGE
+effect/halo_range_silenced HALO_RANGE_SILENCED
ray RAY
ray_out_of_range RAY_OUT_OF_RANGE
travel_exclusion TRAVEL_EXCLUSION_BG
diff --git a/crawl-ref/source/rltiles/effect/halo_range.png b/crawl-ref/source/rltiles/effect/halo_range.png
new file mode 100644
index 0000000000000000000000000000000000000000..e1c2e093893e1735280e104f053bde91a774d2d3
GIT binary patch
literal 233
zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Y)RhkE)4%c
zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmP?yS%uz@Y4%dt^<WKJzX3_A`U12
z`M=SwH<5vnd&)dhhi}Ub4S5VC3fMO!bo{yN70fN!dd}d_|A_wMi~+7&82;a%$+J&G
zqV&KDW;a=bR}F#eJyr=<7#H(_g(5m~_g*^7xFu_n@LPr_euq1}n3=D+vNPO!A^5}W
SS(^~hQU*^~KbLh*2~7Z#V@+}Z
literal 0
HcmV?d00001
diff --git a/crawl-ref/source/rltiles/effect/halo_range_silenced.png b/crawl-ref/source/rltiles/effect/halo_range_silenced.png
new file mode 100644
index 0000000000000000000000000000000000000000..ad747175cb8b86d30dd0aeb6c6fc920a6fd27c1c
GIT binary patch
literal 254
zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Y)RhkE)4%c
zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmP?yS%ub1b^vIDWFiDr;B4q#Np&W
z|2Nw8CNeN`Gcz+gE7u=xh=}{Yv9Yl;vEg8Ybpvbc1IFfuK2cFS8Xht^Gavq6GKa50
za}ldYf`NhzlSjiuw!9zqFD@Ne!R#h$@Twt@y~iry3gcoviBg~tTl{93m0y3=JIFY!
pR<pdw=kU&?r^Doc#f7`Y3{Klc@AUrP77BC;gQu&X%Q~loCIIP&R0#k8
literal 0
HcmV?d00001
diff --git a/crawl-ref/source/tilecell.cc b/crawl-ref/source/tilecell.cc
index 410bc62..97f0327 100644
--- a/crawl-ref/source/tilecell.cc
+++ b/crawl-ref/source/tilecell.cc
@@ -25,7 +25,7 @@ void packed_cell::clear()
is_bloody = false;
is_silenced = false;
- is_haloed = false;
+ halo = HALO_NONE;
is_moldy = false;
glowing_mold = false;
is_sanctuary = false;
@@ -40,7 +40,7 @@ bool packed_cell::operator ==(const packed_cell &other) const
if (is_bloody != other.is_bloody) return false;
if (is_silenced != other.is_silenced) return false;
- if (is_haloed != other.is_haloed) return false;
+ if (halo != other.halo) return false;
if (is_moldy != other.is_moldy) return false;
if (glowing_mold != other.glowing_mold) return false;
if (is_sanctuary != other.is_sanctuary) return false;
diff --git a/crawl-ref/source/tilecell.h b/crawl-ref/source/tilecell.h
index e801f2b..b3fd854 100644
--- a/crawl-ref/source/tilecell.h
+++ b/crawl-ref/source/tilecell.h
@@ -2,6 +2,13 @@
#ifndef TILECELL_H
#define TILECELL_H
+enum halo_type
+{
+ HALO_NONE = 0,
+ HALO_RANGE = 1,
+ HALO_MONSTER = 2
+};
+
struct packed_cell
{
// For anything that requires multiple dungeon tiles (such as waves)
@@ -16,7 +23,7 @@ struct packed_cell
bool is_bloody;
bool is_silenced;
- bool is_haloed;
+ char halo;
bool is_moldy;
bool glowing_mold;
bool is_sanctuary;
@@ -28,7 +35,7 @@ struct packed_cell
bool operator !=(const packed_cell &other) const { return !(*this == other); }
packed_cell() : num_dngn_overlay(0), fg(0), bg(0), is_bloody(false),
- is_silenced(false), is_haloed(false), is_moldy(false),
+ is_silenced(false), halo(HALO_NONE), is_moldy(false),
glowing_mold(false), is_sanctuary(false), is_liquefied(false),
swamp_tree_water (false), blood_rotation(0) {}
@@ -36,7 +43,7 @@ struct packed_cell
fg(c->fg), bg(c->bg), flv(c->flv),
is_bloody(c->is_bloody),
is_silenced(c->is_silenced),
- is_haloed(c->is_haloed),
+ halo(c->halo),
is_moldy(c->is_moldy),
glowing_mold(c->glowing_mold),
is_sanctuary(c->is_sanctuary),
diff --git a/crawl-ref/source/tiledgnbuf.cc b/crawl-ref/source/tiledgnbuf.cc
index 6bc8338..9ef5792 100644
--- a/crawl-ref/source/tiledgnbuf.cc
+++ b/crawl-ref/source/tiledgnbuf.cc
@@ -256,15 +256,19 @@ void DungeonCellBuffer::pack_background(int x, int y, const packed_cell &cell)
m_buf_feat.add(TILE_ELDRITCH_OVERLAY_SW, x, y);
}
- if (cell.is_haloed)
+ if (cell.halo == HALO_MONSTER)
m_buf_feat.add(TILE_HALO, x, y);
if (!(bg & TILE_FLAG_UNSEEN))
{
if (cell.is_sanctuary)
m_buf_feat.add(TILE_SANCTUARY, x, y);
- if (cell.is_silenced)
+ if (cell.is_silenced && (cell.halo == HALO_RANGE))
+ m_buf_feat.add(TILE_HALO_RANGE_SILENCED, x, y);
+ else if (cell.is_silenced)
m_buf_feat.add(TILE_SILENCED, x, y);
+ else if (cell.halo == HALO_RANGE)
+ m_buf_feat.add(TILE_HALO_RANGE, x, y);
// Apply the travel exclusion under the foreground if the cell is
// visible. It will be applied later if the cell is unseen.
diff --git a/crawl-ref/source/tileview.cc b/crawl-ref/source/tileview.cc
index 5cf8a6b..f8f1d59 100644
--- a/crawl-ref/source/tileview.cc
+++ b/crawl-ref/source/tileview.cc
@@ -1030,19 +1030,23 @@ void tile_apply_properties(const coord_def &gc, packed_cell &cell)
if (haloed(gc))
{
monster* mon = monster_at(gc);
- if (you.see_cell(gc) && mon)
+ if (you.see_cell(gc))
{
- if (!mons_class_flag(mon->type, M_NO_EXP_GAIN)
+ if (mon && !mons_class_flag(mon->type, M_NO_EXP_GAIN)
&& (!mons_is_mimic(mon->type)
|| testbits(mon->flags, MF_KNOWN_MIMIC)))
{
- cell.is_haloed = true;
+ cell.halo = HALO_MONSTER;
print_blood = false;
}
+ else
+ {
+ cell.halo = HALO_RANGE;
+ }
}
}
else
- cell.is_haloed = false;
+ cell.halo = HALO_NONE;
if (liquefied(gc, true))
cell.is_liquefied = true;
diff --git a/crawl-ref/source/tileweb.cc b/crawl-ref/source/tileweb.cc
index bb53e61..065b0b8 100644
--- a/crawl-ref/source/tileweb.cc
+++ b/crawl-ref/source/tileweb.cc
@@ -289,8 +289,8 @@ bool TilesFramework::_send_cell(int x, int y,
if (cell.is_silenced != old_cell.is_silenced)
write_message("silenced:%u,", cell.is_silenced);
- if (cell.is_haloed != old_cell.is_haloed)
- write_message("haloed:%u,", cell.is_haloed);
+ if (cell.halo != old_cell.halo)
+ write_message("halo:%u,", cell.halo);
if (cell.is_moldy != old_cell.is_moldy)
write_message("moldy:%u,", cell.is_moldy);
diff --git a/crawl-ref/source/webserver/static/game/enums.js b/crawl-ref/source/webserver/static/game/enums.js
index 5d9a111..d0be15a 100644
--- a/crawl-ref/source/webserver/static/game/enums.js
+++ b/crawl-ref/source/webserver/static/game/enums.js
@@ -11,6 +11,11 @@ CURSOR_TUTORIAL = 1;
CURSOR_MAP = 2;
CURSOR_MAX = 3;
+// Halo flags
+HALO_NONE = 0;
+HALO_RANGE = 1;
+HALO_MONSTER = 2;
+
// Foreground flags
// 3 mutually exclusive flags for attitude.
diff --git a/crawl-ref/source/webserver/static/game/render.js b/crawl-ref/source/webserver/static/game/render.js
index a1709cc..d28a39a 100644
--- a/crawl-ref/source/webserver/static/game/render.js
+++ b/crawl-ref/source/webserver/static/game/render.js
@@ -637,7 +637,7 @@ function draw_background(x, y, cell)
draw_dngn(TILE_ELDRITCH_OVERLAY_SW, x, y);
}
- if (cell.haloed)
+ if (cell.halo == HALO_MONSTER)
draw_dngn(TILE_HALO, x, y);
if (!(bg & TILE_FLAG_UNSEEN))
@@ -645,8 +645,12 @@ function draw_background(x, y, cell)
{
if (cell.sanctuary)
draw_dngn(TILE_SANCTUARY, x, y);
- if (cell.silenced)
+ if (cell.silenced && (cell.halo == HALO_RANGE))
+ draw_dngn(TILE_HALO_RANGE_SILENCED, x, y);
+ else if (cell.silenced)
draw_dngn(TILE_SILENCED, x, y);
+ else if (cell.halo == HALO_RANGE)
+ draw_dngn(TILE_HALO_RANGE, x, y);
// Apply the travel exclusion under the foreground if the cell is
// visible. It will be applied later if the cell is unseen.
--
1.7.4.1
|