Attached Files |
display_real_mp_for_dd.patch [^] (4,162 bytes) 2018-05-17 20:37 [Show Content] [Hide Content]diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index 2c36c2e..c857168 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -733,11 +733,21 @@ static void _print_stats_mp(int x, int y)
if (!boosted)
textcolour(HUD_VALUE_COLOUR);
CPRINTF("/%d", you.max_magic_points);
- if (boosted)
- textcolour(HUD_VALUE_COLOUR);
int col = _count_digits(you.magic_points)
+ _count_digits(you.max_magic_points) + 1;
+
+ int real_mp = get_real_mp(false);
+ if (you.species == SP_DEEP_DWARF
+ && real_mp != you.max_magic_points)
+ {
+ CPRINTF(" (%d)", real_mp);
+ col += _count_digits(real_mp) + 3;
+ }
+
+ if (boosted)
+ textcolour(HUD_VALUE_COLOUR);
+
for (int i = 11-col; i > 0; i--)
CPRINTF(" ");
@@ -2152,6 +2162,9 @@ static vector<formatted_string> _get_overview_stats()
entry.textcolour(HUD_VALUE_COLOUR);
entry.cprintf("%d/%d", you.magic_points, you.max_magic_points);
+ if (you.species == SP_DEEP_DWARF
+ && get_real_mp(false) != you.max_magic_points)
+ entry.cprintf(" (%d)", get_real_mp(false));
cols.add_formatted(0, entry.to_colour_string(), false);
entry.clear();
diff --git a/crawl-ref/source/tileweb.cc b/crawl-ref/source/tileweb.cc
index a81a376..62ccd28 100644
--- a/crawl-ref/source/tileweb.cc
+++ b/crawl-ref/source/tileweb.cc
@@ -756,6 +756,9 @@ void TilesFramework::_send_player(bool force_full)
_update_int(force_full, c.real_hp_max, max_max_hp, "real_hp_max");
_update_int(force_full, c.mp, you.magic_points, "mp");
_update_int(force_full, c.mp_max, you.max_magic_points, "mp_max");
+ _update_int(force_full, c.dd_real_mp_max,
+ you.species == SP_DEEP_DWARF ? get_real_mp(false) : 0,
+ "dd_real_mp_max");
_update_int(force_full, c.poison_survival, max(0, poison_survival()),
"poison_survival");
diff --git a/crawl-ref/source/tileweb.h b/crawl-ref/source/tileweb.h
index 1a6b0ec..a5f8559 100644
--- a/crawl-ref/source/tileweb.h
+++ b/crawl-ref/source/tileweb.h
@@ -53,7 +53,7 @@ struct player_info
uint8_t form;
int hp, hp_max, real_hp_max, poison_survival;
- int mp, mp_max;
+ int mp, mp_max, dd_real_mp_max;
int contam;
int noise;
int adjusted_noise;
diff --git a/crawl-ref/source/webserver/game_data/static/player.js b/crawl-ref/source/webserver/game_data/static/player.js
index 03ce363..fc68f7e 100644
--- a/crawl-ref/source/webserver/game_data/static/player.js
+++ b/crawl-ref/source/webserver/game_data/static/player.js
@@ -381,6 +381,11 @@ function ($, comm, enums, map_knowledge, messages, options) {
else
$("#stats_real_hp_max").text("");
+ if (player.species == "Deep Dwarf" && player.dd_real_mp_max != player.mp_max)
+ $("#stats_dd_real_mp_max").text("(" + player.dd_real_mp_max + ")");
+ else
+ $("#stats_dd_real_mp_max").text("");
+
percentage_color("hp");
percentage_color("mp");
update_bar("hp");
@@ -495,7 +500,7 @@ function ($, comm, enums, map_knowledge, messages, options) {
$.extend(player, {
name: "", god: "", title: "", species: "",
hp: 0, hp_max: 0, real_hp_max: 0, poison_survival: 0,
- mp: 0, mp_max: 0,
+ mp: 0, mp_max: 0, dd_real_mp_max: 0,
ac: 0, ev: 0, sh: 0,
xl: 0, progress: 0,
time: 0, time_delta: 0,
diff --git a/crawl-ref/source/webserver/game_data/templates/game.html b/crawl-ref/source/webserver/game_data/templates/game.html
index 8f4acca..2d0a65a 100644
--- a/crawl-ref/source/webserver/game_data/templates/game.html
+++ b/crawl-ref/source/webserver/game_data/templates/game.html
@@ -53,6 +53,7 @@
--></span>
<span class="stats_caption">Magic:</span>
<span id="stats_mp" /><span id="stats_mp_separator">/</span><span id="stats_mp_max" />
+ <span id="stats_dd_real_mp_max" />
</div>
<div>
<div id="stats_leftcolumn" style="float:left;width:45%;">
display_real_mp_left_for_heal_wounds.patch [^] (519 bytes) 2019-01-10 13:15 [Show Content] [Hide Content]diff --git a/crawl-ref/source/ability.cc b/crawl-ref/source/ability.cc
index 235cccb..2d8074d 100644
--- a/crawl-ref/source/ability.cc
+++ b/crawl-ref/source/ability.cc
@@ -770,7 +770,7 @@ const string make_cost_description(ability_type ability)
ret += ", MP";
if (ability == ABIL_HEAL_WOUNDS)
- ret += ", Permanent MP";
+ ret += make_stringf(", Permanent MP (%d left)", get_real_mp(false));
if (abil.hp_cost)
ret += make_stringf(", %d HP", abil.hp_cost.cost(you.hp_max));
|