Skip to content

Commit

Permalink
spectral blade messages
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed Nov 10, 2023
1 parent 8ef310e commit ce6514a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/game_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void Game::place_player(void)
}
level->thing_new("tentacleye", point(x + 1, y));
}
if (1) {
if (0) {
auto w = level->thing_new("mace", point(x, y));
t->carry(w, carry_options);
if (1) {
Expand Down
5 changes: 4 additions & 1 deletion src/thing_attack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ bool Thing::attack(Thingp victim, ThingAttackOptionsp attack_options)
idle_count_set(0);

auto owner = top_owner();
auto l = leader();

if (d1000() < chance_d1000_teleport_attack()) {
TeleportOptions teleport_options;
Expand Down Expand Up @@ -2031,7 +2032,9 @@ bool Thing::attack(Thingp victim, ThingAttackOptionsp attack_options)
}

if (! hit) {
if (is_player() || (owner && owner->is_player())) {
if (is_player() || (l && l->is_player())) {
msg("Your %s misses %s.%%fg=reset$", text_long_name().c_str(), victim->text_the().c_str());
} else if (is_player() || (owner && owner->is_player())) {
if (fumble) {
msg("%%fg=orange$You fumble and miss %s.%%fg=reset$", victim->text_the().c_str());
popup("You fumble");
Expand Down
6 changes: 5 additions & 1 deletion src/thing_hit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ int Thing::ai_hit_actual(Thingp hitter, // an arrow / monst /.
return false;
}

auto l = hitter->leader();

dbg("Hit actual, damage %d", damage);
TRACE_NO_INDENT();

Expand Down Expand Up @@ -1423,7 +1425,7 @@ int Thing::ai_hit_actual(Thingp hitter, // an arrow / monst /.
TRACE_NO_INDENT();

if (o_top && o_top->is_player()) {
dbg("Player is onwer of dead or dying thing");
dbg("Player is owner of dead or dying thing");
if (! o_top->is_dead && ! o_top->is_dying) {
if (is_drained) {
msg("Your %s is drained.", text_long_name().c_str());
Expand Down Expand Up @@ -2178,6 +2180,8 @@ int Thing::ai_hit_actual(Thingp hitter, // an arrow / monst /.
real_hitter->msg("%s hits %s with %s.", real_hitter->text_The().c_str(), text_the().c_str(),
hitter->text_the().c_str());
}
} else if (l && l->is_player()) {
msg("Your %s hits %s.%%fg=reset$", hitter->text_long_name().c_str(), text_the().c_str());
} else if (real_hitter != this) {
TRACE_NO_INDENT();
//
Expand Down

0 comments on commit ce6514a

Please sign in to comment.