diff options
author | Stijn Buys <ingar@osirion.org> | 2012-11-18 17:09:20 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-11-18 17:09:20 +0000 |
commit | 2cd1f55f26f2236641fa2f3b36d9d23b99ca072f (patch) | |
tree | c9bc8040aea9dc84f14defe2f49d6eeb28425003 /src/game | |
parent | a8078dc796e94f4042905732b9e24253dae9347a (diff) |
Improved death messages,
shoot colored projectiles.
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/base/ship.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index a927e73..676ba65 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -522,7 +522,24 @@ void Ship::collision(core::Entity *other) ship_armor = 0; std::string message("^B"); message.append(owner()->name()); - message.append(" ^Bwas blown to bits."); + + core::Player *assassin = 0; + + if (projectile->ownerid()) { + assassin = core::server()->find_player(projectile->ownerid()); + } + + if (assassin) { + if (assassin == owner()) { + message.append(" ^Bate his own bullet."); + } else { + message.append(" ^Bwas blown to bits by "); + message.append(assassin->name()); + } + } else { + message.append(" ^Bwas blown to bits."); + } + core::server()->broadcast(message); } else { die(); } @@ -842,6 +859,7 @@ void Ship::frame(const unsigned long elapsed) (*it)->set_last_fired(core::server()->timestamp()); Projectile * projectile = new Projectile((*it)->lifespan()); projectile->set_damage(10.0f); + projectile->set_color(color()); projectile->set_zone(zone()); projectile->set_axis(axis() * (*it)->axis()); projectile->set_location(location() + (axis() * (*it)->location() * modelscale) + projectile->axis().forward() * projectile->radius()); |