… | |
… | |
1551 | if (QUERY_FLAG (op, FLAG_BLIND) && !QUERY_FLAG (op, FLAG_WIZ)) |
1551 | if (QUERY_FLAG (op, FLAG_BLIND) && !QUERY_FLAG (op, FLAG_WIZ)) |
1552 | { |
1552 | { |
1553 | new_draw_info (NDI_UNIQUE, 0, op, "You are unable to read while blind."); |
1553 | new_draw_info (NDI_UNIQUE, 0, op, "You are unable to read while blind."); |
1554 | return; |
1554 | return; |
1555 | } |
1555 | } |
|
|
1556 | |
1556 | if (tmp->msg == NULL) |
1557 | if (!tmp->msg) |
1557 | { |
1558 | { |
1558 | new_draw_info_format (NDI_UNIQUE, 0, op, "You open the %s and find it empty.", &tmp->name); |
1559 | new_draw_info_format (NDI_UNIQUE, 0, op, "You open the %s and find it empty.", &tmp->name); |
1559 | return; |
1560 | return; |
1560 | } |
1561 | } |
1561 | |
1562 | |
… | |
… | |
1564 | if (!skill_ob) |
1565 | if (!skill_ob) |
1565 | { |
1566 | { |
1566 | new_draw_info (NDI_UNIQUE, 0, op, "You are unable to decipher the strange symbols."); |
1567 | new_draw_info (NDI_UNIQUE, 0, op, "You are unable to decipher the strange symbols."); |
1567 | return; |
1568 | return; |
1568 | } |
1569 | } |
|
|
1570 | |
1569 | lev_diff = tmp->level - (skill_ob->level + 5); |
1571 | lev_diff = tmp->level - (skill_ob->level + 5); |
1570 | if (!QUERY_FLAG (op, FLAG_WIZ) && lev_diff > 0) |
1572 | if (!QUERY_FLAG (op, FLAG_WIZ) && lev_diff > 0) |
1571 | { |
1573 | { |
1572 | if (lev_diff < 2) |
1574 | if (lev_diff < 2) |
1573 | new_draw_info (NDI_UNIQUE, 0, op, "This book is just barely beyond your comprehension."); |
1575 | new_draw_info (NDI_UNIQUE, 0, op, "This book is just barely beyond your comprehension."); |
… | |
… | |
1584 | return; |
1586 | return; |
1585 | } |
1587 | } |
1586 | |
1588 | |
1587 | readable_message_type *msgType = get_readable_message_type (tmp); |
1589 | readable_message_type *msgType = get_readable_message_type (tmp); |
1588 | |
1590 | |
|
|
1591 | if (player *pl = op->contr) |
|
|
1592 | if (client *ns = pl->ns) |
|
|
1593 | if (ns->can_msg) |
|
|
1594 | { |
|
|
1595 | dynbuf_text buf; |
|
|
1596 | buf << long_desc (tmp, op) |
|
|
1597 | << "\n\n" |
|
|
1598 | << tmp->msg |
|
|
1599 | << '\0'; |
|
|
1600 | ns->send_msg (NDI_NAVY, msgType->msgtype, buf.linearise ()); |
|
|
1601 | } |
|
|
1602 | else |
1589 | draw_ext_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, |
1603 | draw_ext_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, |
1590 | msgType->message_type, msgType->message_subtype, |
1604 | msgType->message_type, msgType->message_subtype, |
1591 | "You open the %s and start reading.\n%s", (char *)"%s\n%s", |
1605 | "You open the %s and start reading.\n%s", (char *)"%s\n%s", |
1592 | long_desc (tmp, op), &tmp->msg); |
1606 | long_desc (tmp, op), &tmp->msg); |
1593 | |
1607 | |
1594 | /* gain xp from reading */ |
1608 | /* gain xp from reading */ |
1595 | if (!QUERY_FLAG (tmp, FLAG_NO_SKILL_IDENT)) |
1609 | if (!QUERY_FLAG (tmp, FLAG_NO_SKILL_IDENT)) |
1596 | { /* only if not read before */ |
1610 | { /* only if not read before */ |
1597 | int exp_gain = calc_skill_exp (op, tmp, skill_ob); |
1611 | int exp_gain = calc_skill_exp (op, tmp, skill_ob); |