MCPcopy Create free account
hub / github.com/NetHack/NetHack / check_caitiff

Function check_caitiff

src/uhitm.c:330–347  ·  view source on GitHub ↗

it is unchivalrous for a knight to attack the defenseless or from behind */

Source from the content-addressed store, hash-verified

328
329/* it is unchivalrous for a knight to attack the defenseless or from behind */
330void
331check_caitiff(struct monst *mtmp)
332{
333 if (u.ualign.record <= -10)
334 return;
335
336 if (Role_if(PM_KNIGHT) && u.ualign.type == A_LAWFUL
337 && !is_undead(mtmp->data)
338 && (helpless(mtmp)
339 || (mtmp->mflee && !mtmp->mavenge))) {
340 You("caitiff!");
341 adjalign(-1);
342 } else if (Role_if(PM_SAMURAI) && mtmp->mpeaceful) {
343 /* attacking peaceful creatures is bad for the samurai's giri */
344 You("dishonorably attack the innocent!");
345 adjalign(-1);
346 }
347}
348
349/* maybe unparalyze monster */
350void

Callers 4

find_roll_to_hitFunction · 0.85
kickdmgFunction · 0.85
use_poleFunction · 0.85
use_grappleFunction · 0.85

Calls 2

YouFunction · 0.85
adjalignFunction · 0.85

Tested by

no test coverage detected