Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
fungamer2-2 committed Jan 5, 2024
1 parent 514edb3 commit 27c1752
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ def shoot_projectile_at(self, target_pos, proj):
for pos in g.do_projectile(self.pos, target):
if not board.passable(pos):
break
dist += 1
if dist > proj.long_range:
break

Expand Down Expand Up @@ -354,4 +355,4 @@ def shoot_projectile_at(self, target_pos, proj):
elif one_in(2) and c.is_monster():
if self.is_player():
c.alerted()

6 changes: 5 additions & 1 deletion projectile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ def on_hit(self, attacker, defender, margin):

damage = self.roll_damage(crit)
damage = defender.apply_armor(damage)
attacker.add_msg_if_u_see(defender, f"The {self.name} hits {defender.get_name()}.")
msg = f"The {self.name} hits {defender.get_name()}"
if attacker.is_player():
msg += " for {damage} damage"
msg += "."
attacker.add_msg_if_u_see(defender, msg)
if damage > 0 and crit:
attacker.add_msg("Critical hit!", "good")

Expand Down

0 comments on commit 27c1752

Please sign in to comment.