Skip to content

Commit

Permalink
Fix various brokenness with exploding monster attributions (Midn8)
Browse files Browse the repository at this point in the history
The most obvious breakage is that the player was incorrectly getting
penance for blazeheart core explosions, but the player also was not getting
XP for some things like ballisto spore explosions. I *think* this should
straighten most of that out.
  • Loading branch information
DracoOmega committed Nov 18, 2024
1 parent 648c01e commit 4d9de50
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions crawl-ref/source/mon-explode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,17 @@ static void _setup_base_explosion(bolt & beam, const monster& origin)
beam.target = origin.pos();
beam.explode_noise_msg = "You hear an explosion!";

if (!crawl_state.game_is_arena()
&& origin.friendly() && origin.was_created_by(you))
if (!crawl_state.game_is_arena() && origin.friendly())
{
if (origin.is_abjurable())
// Prisms, ball lightning, etc. are considered to have been damage
// caused by the player directly.
if (!origin.is_abjurable() && origin.was_created_by(you))
beam.thrower = KILL_YOU;
else
{
beam.thrower = KILL_MON;
beam.source_id = ANON_FRIENDLY_MONSTER;
beam.source_id = MID_ANON_FRIEND;
}
else
beam.thrower = KILL_YOU;
}
else
beam.thrower = KILL_MON;
Expand Down Expand Up @@ -103,7 +104,7 @@ static void _setup_blazeheart_core_explosion(bolt & beam, const monster& origin)
// Don't place the player under penance for their golem exploding,
// but DO give them xp for its kills.
beam.thrower = KILL_MON;
beam.source_id = MID_PLAYER;
beam.source_id = MID_ANON_FRIEND;

// This is so it places flame clouds under the explosion
beam.origin_spell = SPELL_FORGE_BLAZEHEART_GOLEM;
Expand Down

0 comments on commit 4d9de50

Please sign in to comment.