torpedo: Don't disclose uid, type, owner of torpedoed subs
torp() reports target uid and type to the player. Hide for submarine targets, just like we hide attacking submarine details in bulletins to the target's owner. torp() and fire_torp() leak submarine owners through the news. Suppress news for submarine targets. This is consistent with fire: mfir() doesn't report depth-charging, and quiet_bigdef() doesn't report return torpedoes. Historical note: the code has always hidden submarine uid, type and owner in places, and leaked them in others. When capability sub-torp was added in Chainsaw, no attention was paid to hiding. When Empire 2 hid attacking submarines, it did nothing for submarine targets. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
2bfc574943
commit
7b8700fe00
1 changed files with 14 additions and 10 deletions
|
@ -178,17 +178,19 @@ torp(void)
|
|||
wu(0, vshipown, "%s in %s torpedoed %s for %d damage.\n",
|
||||
prsub(&sub), xyas(sub.shp_x, sub.shp_y, vshipown),
|
||||
prship(&vship), dam);
|
||||
pr("Torpedo hit %s for %d damage.\n", prship(&vship), dam);
|
||||
pr("Torpedo hit %s for %d damage.\n", prsub(&vship), dam);
|
||||
shipdamage(&vship, dam);
|
||||
if (vship.shp_effic < SHIP_MINEFF)
|
||||
pr("%s sunk!\n", prship(&vship));
|
||||
pr("%s sunk!\n", prsub(&vship));
|
||||
if (vship.shp_rflags & RET_TORPED)
|
||||
retreat_ship(&vship, 't');
|
||||
putship(vship.shp_uid, &vship);
|
||||
if (!(mchr[vship.shp_type].m_flags & M_SUB)) {
|
||||
if (mchr[(int)sub.shp_type].m_flags & M_SUB)
|
||||
nreport(vshipown, N_TORP_SHIP, 0, 1);
|
||||
else
|
||||
nreport(vshipown, N_SHIP_TORP, player->cnum, 1);
|
||||
}
|
||||
} else {
|
||||
pr("Missed\n");
|
||||
if (vshipown != 0)
|
||||
|
@ -312,10 +314,12 @@ fire_torp(struct shpstr *sp, struct shpstr *targ, int ntargets)
|
|||
shipdamage(targ, dam);
|
||||
putship(targ->shp_uid, targ);
|
||||
|
||||
if (!(mchr[targ->shp_type].m_flags & M_SUB)) {
|
||||
if (mchr[(int)sp->shp_type].m_flags & M_SUB)
|
||||
nreport(targ->shp_own, N_TORP_SHIP, 0, 1);
|
||||
else
|
||||
nreport(targ->shp_own, N_SHIP_TORP, sp->shp_own, 1);
|
||||
}
|
||||
} else {
|
||||
pr("Missed!\n");
|
||||
if (sp->shp_own != 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue