| 408 | } |
| 409 | |
| 410 | staticfn long |
| 411 | encodeconduct(void) |
| 412 | { |
| 413 | long e = 0L; |
| 414 | |
| 415 | if (!u.uconduct.food) |
| 416 | e |= 1L << 0; |
| 417 | if (!u.uconduct.unvegan) |
| 418 | e |= 1L << 1; |
| 419 | if (!u.uconduct.unvegetarian) |
| 420 | e |= 1L << 2; |
| 421 | if (!u.uconduct.gnostic) |
| 422 | e |= 1L << 3; |
| 423 | if (!u.uconduct.weaphit) |
| 424 | e |= 1L << 4; |
| 425 | if (!u.uconduct.killer) |
| 426 | e |= 1L << 5; |
| 427 | if (!u.uconduct.literate) |
| 428 | e |= 1L << 6; |
| 429 | if (!u.uconduct.polypiles) |
| 430 | e |= 1L << 7; |
| 431 | if (!u.uconduct.polyselfs) |
| 432 | e |= 1L << 8; |
| 433 | if (!u.uconduct.wishes) |
| 434 | e |= 1L << 9; |
| 435 | if (!u.uconduct.wisharti) |
| 436 | e |= 1L << 10; |
| 437 | if (!num_genocides()) |
| 438 | e |= 1L << 11; |
| 439 | /* one bit isn't really adequate for sokoban conduct: |
| 440 | reporting "obeyed sokoban rules" is misleading if sokoban wasn't |
| 441 | completed or at least attempted; however, suppressing that when |
| 442 | sokoban was never entered, as we do here, risks reporting |
| 443 | "violated sokoban rules" when no such thing occurred; this can |
| 444 | be disambiguated in xlogfile post-processors by testing the |
| 445 | entered-sokoban bit in the 'achieve' field */ |
| 446 | if (!u.uconduct.sokocheat && sokoban_in_play()) |
| 447 | e |= 1L << 12; |
| 448 | if (!u.uconduct.pets) |
| 449 | e |= 1L << 13; |
| 450 | |
| 451 | return e; |
| 452 | } |
| 453 | |
| 454 | staticfn long |
| 455 | encodeachieve( |
no test coverage detected