|
From: <gi...@cr...> - 2025-12-03 23:20:22
|
via 765122c258c467289150f5aba6333087d248bb2a (commit)
via 1ffbecd877470ca67287806678e718a4f0a171dc (commit)
via 865ad28f680c46adce4456a57eab127752425f96 (commit)
via a2ad6df00383b53dc1d4e0440c6d8da4bcf94354 (commit)
via a1ef7c00edf5f15cc6caea46c7901ded6828b5e3 (commit)
via 0403af7a578936b118a178e939cda86b8fc9c503 (commit)
from c1c35e67119de8586bf5552ab7b108d2757b6898 (commit)
-----------------------------------------------------------------------
commit 765122c258c467289150f5aba6333087d248bb2a
Author: DracoOmega <dra...@gm...>
Date: Wed Dec 3 19:47:18 2025 -0330
Remove some oddly well-commented dead code
This statement was seemingly never live in trunk, and doesn't seem relevant
for how golem currently operates. It already can act immediately on the
turn you move towards it, regardless of this.
Perhaps this is a remnant of an older version of it that never made it to
trunk at all?
commit 1ffbecd877470ca67287806678e718a4f0a171dc
Author: DracoOmega <dra...@gm...>
Date: Wed Dec 3 19:35:41 2025 -0330
Fix a couple tiny tesseract bugs
Due to function ordering, only one of the two tesseracts was actually being
woken up when they activated (the only effect this had was on stabability,
if that one somehow remained unalerted long enough to walk up to it).
Also, fix the second tesseract still not disappearing from monster memory
when the first was killed.
commit 865ad28f680c46adce4456a57eab127752425f96
Author: DracoOmega <dra...@gm...>
Date: Wed Dec 3 18:28:53 2025 -0330
Make lua you.contaminated() return something more useful
It is renamed you.contamination() and returns the player's current
contamination percentage. (Instead of merely whether this was above 0%)
commit a2ad6df00383b53dc1d4e0440c6d8da4bcf94354
Author: DracoOmega <dra...@gm...>
Date: Wed Dec 3 18:27:16 2025 -0330
Improve the UI regarding contamination explosion damage (Odds)
The % screen now indicates the maximum damage the player could take from
their current level of contamination, if it were to explode. They are also
prevented from resting if this explosion is capable of killing them.
This number is also exposed to lua via you.max_contam_damage() (mostly so
that the Contam status tooltip can also list this number). A very minor bug
with how the tooltips are refreshed means that if the player gains an XL
without any status changes, the tooltip may very slightly underestimate the
max damage (but % will still be accurate).
commit a1ef7c00edf5f15cc6caea46c7901ded6828b5e3
Author: DracoOmega <dra...@gm...>
Date: Wed Dec 3 17:42:18 2025 -0330
Give monster alerts even if a monster causes an interrupt
Many interrupts will cause a prompt on their own, which made this
additional more seem somewhat superfluous, but travel won't, so probably
it's more consistent if it always does.
commit 0403af7a578936b118a178e939cda86b8fc9c503
Author: DracoOmega <dra...@gm...>
Date: Wed Dec 3 17:41:08 2025 -0330
Mark erythrospites as no_poly_to
-----------------------------------------------------------------------
Summary of changes:
crawl-ref/source/dat/descript/status.txt | 7 +++++++
crawl-ref/source/dat/mons/erythrospite.yaml | 2 +-
crawl-ref/source/l-you.cc | 15 +++++++++++----
crawl-ref/source/mon-abil.cc | 16 ++++++++--------
crawl-ref/source/mon-abil.h | 1 -
crawl-ref/source/mon-act.cc | 6 ------
crawl-ref/source/mon-death.cc | 5 ++---
crawl-ref/source/nearby-danger.cc | 7 +++++++
crawl-ref/source/player-notices.cc | 15 ++++++---------
crawl-ref/source/player.cc | 23 ++++++++++++++++++++++-
crawl-ref/source/player.h | 1 +
11 files changed, 65 insertions(+), 33 deletions(-)
diff --git a/crawl-ref/source/dat/descript/status.txt b/crawl-ref/source/dat/descript/status.txt
index 562df30b86..32e34b02b1 100644
--- a/crawl-ref/source/dat/descript/status.txt
+++ b/crawl-ref/source/dat/descript/status.txt
@@ -110,6 +110,13 @@ You are glowing with mutagenic radiation. This can inflict mutations over time
(usually negative) or even cause you to suffer damage as the unstable magic
explodes violently. In addition, your glow prevents invisibility and reduces
your stealth.
+{{
+ local dmg = you.contam_max_damage();
+ if dmg > 0 then
+ return "\nAn explosion at your current level of contamination could " ..
+ "inflict up to " .. dmg .. " damage."
+ end
+}}
%%%%
Drain status
diff --git a/crawl-ref/source/dat/mons/erythrospite.yaml b/crawl-ref/source/dat/mons/erythrospite.yaml
index 1a4f488f2b..c3c64257cd 100644
--- a/crawl-ref/source/dat/mons/erythrospite.yaml
+++ b/crawl-ref/source/dat/mons/erythrospite.yaml
@@ -1,6 +1,6 @@
name: "erythrospite"
glyph: {char: "E", colour: etc_blood}
-flags: [see_invis, unblindable, amorphous, no_skeleton, speaks, warm_blood]
+flags: [see_invis, unblindable, amorphous, no_skeleton, speaks, warm_blood, no_poly_to]
exp: 42
will: 10
attacks:
diff --git a/crawl-ref/source/l-you.cc b/crawl-ref/source/l-you.cc
index 8afab9df2c..ab94fc60cb 100644
--- a/crawl-ref/source/l-you.cc
+++ b/crawl-ref/source/l-you.cc
@@ -561,11 +561,17 @@ LUARET1(you_silenced, boolean, you.is_silenced())
*/
LUARET1(you_sick, boolean, you.duration[DUR_SICKNESS])
-/*** Are you contaminated?
+/*** How badly are you contaminated?
* @treturn number
- * @function contaminated
+ * @function contamination
*/
-LUARET1(you_contaminated, number, you.magic_contamination > 0)
+LUARET1(you_contamination, number, you.magic_contamination / 10)
+
+/*** How much damage could you take right now if your magic contamination exploded?
+ * @treturn number
+ * @function contam_max_damage
+ */
+LUARET1(you_contam_max_damage, number, contam_max_damage())
/*** Do you feel safe?
* @treturn boolean
@@ -1514,7 +1520,8 @@ static const struct luaL_reg you_clib[] =
{ "brilliant", you_brilliant },
{ "silenced", you_silenced },
{ "sick", you_sick },
- { "contaminated", you_contaminated },
+ { "contamination", you_contamination },
+ { "contam_max_damage", you_contam_max_damage },
{ "feel_safe", you_feel_safe },
{ "deaths", you_deaths },
{ "lives", you_lives },
diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc
index 96152db325..c78189b253 100644
--- a/crawl-ref/source/mon-abil.cc
+++ b/crawl-ref/source/mon-abil.cc
@@ -1479,14 +1479,6 @@ void activate_tesseracts()
if (mi->type != MONS_BOUNDLESS_TESSERACT)
continue;
- behaviour_event(*mi, ME_ALERT);
- env.map_knowledge(mi->pos()).set_monster(monster_info(*mi));
- set_terrain_seen(mi->pos());
- view_update_at(mi->pos());
-#ifdef USE_TILE
- tiles.update_minimap(mi->pos());
-#endif
-
if (!did_activate)
{
mprf(MSGCH_WARN, "You feel the power of Zot begin to gather its forces!");
@@ -1509,6 +1501,14 @@ void activate_tesseracts()
for (int i = 0; i < num; ++i)
_make_tesseract_spawn(false, true);
}
+
+ behaviour_event(*mi, ME_ALERT);
+ env.map_knowledge(mi->pos()).set_monster(monster_info(*mi));
+ set_terrain_seen(mi->pos());
+ view_update_at(mi->pos());
+#ifdef USE_TILE
+ tiles.update_minimap(mi->pos());
+#endif
}
}
diff --git a/crawl-ref/source/mon-abil.h b/crawl-ref/source/mon-abil.h
index 5a07a11c3c..533f2bbe06 100644
--- a/crawl-ref/source/mon-abil.h
+++ b/crawl-ref/source/mon-abil.h
@@ -16,7 +16,6 @@
#define TESSERACT_SPAWN_COUNTER_KEY "tesseract_spawn_count"
#define TESSERACT_SPAWN_TIMER_KEY "tesseract_spawn_timer"
-#define TESSERACT_DUMMY_KEY "tesseract_dummy"
class actor;
class monster;
diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc
index b2bf44918a..556ec831e7 100644
--- a/crawl-ref/source/mon-act.cc
+++ b/crawl-ref/source/mon-act.cc
@@ -1152,12 +1152,6 @@ static void _check_blazeheart_golem_link(monster& mons)
{
mons.del_ench(ENCH_PARALYSIS, true);
simple_monster_message(mons, " core flares to life once more.", true);
-
- // Since we check this at the END of the golem's move, even if it
- // started its turn with the player next to them (due to player
- // movement), grant some instant energy to make it look like it
- // activated first.
- //mons.speed_increment += mons.action_energy(EUT_MOVE);
}
// Give the golem another turn before it goes cold.
diff --git a/crawl-ref/source/mon-death.cc b/crawl-ref/source/mon-death.cc
index a8a268e5c8..bbf022506a 100644
--- a/crawl-ref/source/mon-death.cc
+++ b/crawl-ref/source/mon-death.cc
@@ -3380,13 +3380,12 @@ item_def* monster_die(monster& mons, killer_type killer,
{
if (mi->type == MONS_BOUNDLESS_TESSERACT && mi->mid != mons.mid)
{
- monster_die(**mi, KILL_RESET, NON_MONSTER);
- env.map_knowledge(mi->pos()).clear_monster();
- //set_terrain_seen(mi->pos());
+ env.map_knowledge(mi->pos()).clear();
view_update_at(mi->pos());
#ifdef USE_TILE
tiles.update_minimap(mi->pos());
#endif
+ monster_die(**mi, KILL_RESET, NON_MONSTER);
}
else if ((mi->flags & MF_TESSERACT_SPAWN))
{
diff --git a/crawl-ref/source/nearby-danger.cc b/crawl-ref/source/nearby-danger.cc
index 5e1575639a..3d4efd9157 100644
--- a/crawl-ref/source/nearby-danger.cc
+++ b/crawl-ref/source/nearby-danger.cc
@@ -261,6 +261,13 @@ bool i_feel_safe(bool announce, bool want_move, bool just_monsters,
return false;
}
+ if (contam_max_damage() >= you.hp)
+ {
+ if (announce)
+ mprf(MSGCH_WARN, "You are contaminated with a potentially lethal amount of magic!");
+ return false;
+ }
+
if (you.duration[DUR_STICKY_FLAME])
{
if (announce)
diff --git a/crawl-ref/source/player-notices.cc b/crawl-ref/source/player-notices.cc
index 8487fdd373..d4c7221abc 100644
--- a/crawl-ref/source/player-notices.cc
+++ b/crawl-ref/source/player-notices.cc
@@ -94,20 +94,17 @@ void maybe_notice_monster(monster& mons, bool stepped)
const bool already_seen = (bool)(mons.flags & MF_SEEN);
seen_monster(&mons);
+ if (!already_seen)
+ _check_monster_alert(mons);
+
// If the monster has been seen before (and thus won't print an encounter
// message), tell interrupt_activity to print something else if needed.
if (crawl_state.is_repeating_cmd() || you_are_delayed())
{
- if (_try_seen_interrupt(mons, !already_seen ? SC_NEWLY_SEEN
- : stepped ? SC_NONE
- : SC_ALREADY_IN_VIEW))
- {
- return;
- }
+ _try_seen_interrupt(mons, !already_seen ? SC_NEWLY_SEEN
+ : stepped ? SC_NONE
+ : SC_ALREADY_IN_VIEW);
}
-
- if (!already_seen)
- _check_monster_alert(mons);
}
static monster_type _mons_merge_genus(monster_type mc)
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index ad214a25df..c5d3d21751 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -4291,6 +4291,21 @@ bool player_harmful_contamination()
return you.magic_contamination >= 1000;
}
+// Returns the maximum damage the player could take if their current magic
+// contamination exploded.
+int contam_max_damage()
+{
+ if (you.magic_contamination < 1000)
+ return 0;
+
+ const bool severe = you.magic_contamination >= 2000;
+ const int pow = severe ? you.experience_level * 3 / 2
+ : you.experience_level;
+ dice_def dmg = zap_damage(ZAP_CONTAM_EXPLOSION, pow, false, false);
+
+ return dmg.size * dmg.num;
+}
+
/**
* Provide a description of the player's magic contamination.
*
@@ -4322,7 +4337,13 @@ string describe_contamination(bool verbose)
const unsigned int lvl = you.magic_contamination / 1000;
ASSERT(lvl < ARRAYSZ(verbose_desc));
- return verbose ? verbose_desc[lvl] : terse_desc[lvl];
+ string msg = verbose ? verbose_desc[lvl] : terse_desc[lvl];
+
+ const int dmg = contam_max_damage();
+ if (dmg > 0)
+ msg = make_stringf("%s (up to %d damage)", msg.c_str(), dmg);
+
+ return msg;
}
// Controlled is true if the player actively did something to cause
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index 02792aa0e6..75721b3a0b 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -1181,6 +1181,7 @@ int get_real_hp(bool trans, bool drained = true);
int get_real_mp(bool include_items);
bool player_harmful_contamination();
+int contam_max_damage();
string describe_contamination(bool verbose = true);
bool sanguine_armour_valid();
--
Dungeon Crawl Stone Soup
|