Attached Files |
xom-piety-webtiles.patch [^] (2,799 bytes) 2014-12-09 20:06 [Show Content] [Hide Content]From 0bb8b7aa86289b3180d8ce64c8764a70fc66063b Mon Sep 17 00:00:00 2001
From: "Edgar A. Bering IV" <trizor@gmail.com>
Date: Mon, 8 Dec 2014 14:12:59 -0600
Subject: [PATCH] Add Xom mood meter to webtiles.
This was added a few weeks ago to console and local tiles.
This isn't exactly the same, on console and local tiles the meter
turns red if Xom is getting BORED and lightred when Xom is BORED.
Unfortunately without making either an ugly hack or exposing
gift_timeout in the json this behavior can't be replicated in webtiles;
though the old colouring behavior was also not present in
webtiles so I'm guessing this isn't too big of a loss.
---
crawl-ref/source/tileweb.cc | 9 +--------
crawl-ref/source/webserver/game_data/static/player.js | 11 ++++++-----
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/crawl-ref/source/tileweb.cc b/crawl-ref/source/tileweb.cc
index f5160a7..753d511 100644
--- a/crawl-ref/source/tileweb.cc
+++ b/crawl-ref/source/tileweb.cc
@@ -681,14 +681,7 @@ void TilesFramework::_send_player(bool force_full)
_update_string(force_full, c.god, god, "god");
_update_int(force_full, c.under_penance, (bool) player_under_penance(), "penance");
uint8_t prank = 0;
- if (you_worship(GOD_XOM))
- {
- if (!you.gift_timeout)
- prank = 2;
- else if (you.gift_timeout == 1)
- prank = 1;
- }
- else if (!you_worship(GOD_NO_GOD))
+ if (!you_worship(GOD_NO_GOD))
prank = max(0, piety_rank() - 1);
else if (you.char_class == JOB_MONK && you.species != SP_DEMIGOD
&& !had_gods())
diff --git a/crawl-ref/source/webserver/game_data/static/player.js b/crawl-ref/source/webserver/game_data/static/player.js
index 3a3dc68..15b52c2 100644
--- a/crawl-ref/source/webserver/game_data/static/player.js
+++ b/crawl-ref/source/webserver/game_data/static/player.js
@@ -309,12 +309,13 @@ function ($, comm, enums, map_knowledge, messages, options) {
species_god += " of " + player.god;
if (player.god == "Xom")
{
- if (player.piety_rank == 1)
- $("#stats_piety").text("- getting BORED");
- else if (player.piety_rank == 2)
- $("#stats_piety").text("- BORED");
+ if (player.piety_rank >=0)
+ {
+ $("#stats_piety").text(repeat_string(".",player.piety_rank) + "*"
+ + repeat_string(".",5-player.piety_rank));
+ }
else
- $("#stats_piety").text("");
+ $("#stats_piety").text("......"); // very special plaything
}
else if ((player.piety_rank > 0 || player.god != "")
&& player.god != "Gozag")
--
1.9.3 (Apple Git-50)
|