… | |
… | |
113 | { |
113 | { |
114 | if (operate_altar (altar, &money)) |
114 | if (operate_altar (altar, &money)) |
115 | { |
115 | { |
116 | identify (marked); |
116 | identify (marked); |
117 | |
117 | |
118 | buf.printf ("You have %s.", long_desc (marked, pl)); |
118 | buf.printf ("You have %s.\n\n", long_desc (marked, pl)); |
119 | if (marked->msg) |
119 | if (marked->msg) |
120 | buf << "The item has a story:\n" << marked->msg; |
120 | buf << "The item has a story:\n\n" << marked->msg << "\n\n"; |
121 | |
121 | |
122 | return !money; |
122 | return !money; |
123 | } |
123 | } |
124 | } |
124 | } |
125 | |
125 | |
… | |
… | |
129 | { |
129 | { |
130 | if (operate_altar (altar, &money)) |
130 | if (operate_altar (altar, &money)) |
131 | { |
131 | { |
132 | identify (id); |
132 | identify (id); |
133 | |
133 | |
134 | buf.printf ("You have %s.", long_desc (id, pl)); |
134 | buf.printf ("You have %s.\n\n", long_desc (id, pl)); |
135 | if (id->msg) |
135 | if (id->msg) |
136 | buf << "The item has a story:\n" << id->msg; |
136 | buf << "The item has a story:\n\n" << id->msg << "\n\n"; |
137 | |
137 | |
138 | /* If no more money, might as well quit now */ |
138 | /* If no more money, might as well quit now */ |
139 | if (!money || !check_altar_sacrifice (altar, money)) |
139 | if (!money || !check_altar_sacrifice (altar, money)) |
140 | break; |
140 | break; |
141 | } |
141 | } |
… | |
… | |
146 | } |
146 | } |
147 | } |
147 | } |
148 | } |
148 | } |
149 | |
149 | |
150 | if (buf.empty ()) |
150 | if (buf.empty ()) |
151 | buf << ("You have nothing that needs identifying"); |
151 | pl->failmsg ("You have nothing that needs identifying"); |
152 | |
152 | else |
153 | pl->contr->infobox ("Identify", buf); |
153 | pl->contr->infobox (MSG_CHANNEL ("identify"), buf); |
154 | |
154 | |
155 | return !money; |
155 | return !money; |
156 | } |
156 | } |
157 | |
157 | |
158 | /** |
158 | /** |
… | |
… | |
623 | if (i < NROFATTACKS || weapon->stats.hp || /* regeneration */ |
623 | if (i < NROFATTACKS || weapon->stats.hp || /* regeneration */ |
624 | (weapon->stats.sp && weapon->type == WEAPON) || /* sp regeneration */ |
624 | (weapon->stats.sp && weapon->type == WEAPON) || /* sp regeneration */ |
625 | weapon->stats.exp || /* speed */ |
625 | weapon->stats.exp || /* speed */ |
626 | weapon->stats.ac) /* AC - only taifu's I think */ |
626 | weapon->stats.ac) /* AC - only taifu's I think */ |
627 | { |
627 | { |
628 | op->failmsg ("You cannot prepare magic weapons."); |
628 | op->failmsg ("You cannot prepare magic weapons. " |
|
|
629 | "H<A weapon is considered magical if it changes regeneration, " |
|
|
630 | "speed or ac.>"); |
629 | return 0; |
631 | return 0; |
630 | } |
632 | } |
631 | |
633 | |
632 | sacrifice_count = check_sacrifice (op, improver); |
634 | sacrifice_count = check_sacrifice (op, improver); |
633 | if (sacrifice_count <= 0) |
635 | if (sacrifice_count <= 0) |
… | |
… | |
1311 | |
1313 | |
1312 | if (op->contr) |
1314 | if (op->contr) |
1313 | if (client *ns = op->contr->ns) |
1315 | if (client *ns = op->contr->ns) |
1314 | { |
1316 | { |
1315 | ns->play_sound (sign->sound); |
1317 | ns->play_sound (sign->sound); |
1316 | msgType = get_readable_message_type (sign); |
|
|
1317 | |
1318 | |
1318 | if (ns->can_msg) |
1319 | if (ns->can_msg) |
1319 | ns->send_msg (NDI_NAVY, msgType->msgtype, &sign->msg); |
1320 | op->contr->infobox (MSG_CHANNEL ("examine"), format ("T<%s>\n\n\n\n%s", &sign->name, &sign->msg)); |
1320 | else |
1321 | else |
1321 | { |
1322 | { |
1322 | char newbuf[HUGE_BUF]; |
1323 | msgType = get_readable_message_type (sign); |
1323 | snprintf (newbuf, sizeof (newbuf), "%u %s", autoapply ? 1 : 0, &sign->msg); |
1324 | const char *somemsg = format ("%u %s", autoapply ? 1 : 0, &sign->msg); |
1324 | draw_ext_info (NDI_UNIQUE | NDI_NAVY, 0, op, msgType->message_type, msgType->message_subtype, newbuf, &sign->msg); |
1325 | draw_ext_info (NDI_UNIQUE | NDI_NAVY, 0, op, msgType->message_type, msgType->message_subtype, somemsg, &sign->msg); |
1325 | } |
1326 | } |
1326 | } |
1327 | } |
1327 | } |
1328 | } |
1328 | |
1329 | |
1329 | /** |
1330 | /** |
… | |
… | |
1524 | * players output. |
1525 | * players output. |
1525 | */ |
1526 | */ |
1526 | if (trap->msg && strncmp (EXIT_PATH (trap), "/!", 2)) |
1527 | if (trap->msg && strncmp (EXIT_PATH (trap), "/!", 2)) |
1527 | victim->statusmsg (trap->msg, NDI_NAVY); |
1528 | victim->statusmsg (trap->msg, NDI_NAVY); |
1528 | |
1529 | |
|
|
1530 | trap->play_sound (trap->sound); |
1529 | victim->enter_exit (trap); |
1531 | victim->enter_exit (trap); |
1530 | } |
1532 | } |
1531 | goto leave; |
1533 | goto leave; |
1532 | |
1534 | |
1533 | case ENCOUNTER: |
1535 | case ENCOUNTER: |
… | |
… | |
1600 | } |
1602 | } |
1601 | |
1603 | |
1602 | lev_diff = tmp->level - (skill_ob->level + 5); |
1604 | lev_diff = tmp->level - (skill_ob->level + 5); |
1603 | if (!QUERY_FLAG (op, FLAG_WIZ) && lev_diff > 0) |
1605 | if (!QUERY_FLAG (op, FLAG_WIZ) && lev_diff > 0) |
1604 | { |
1606 | { |
1605 | op->failmsg (lev_diff < 2 ? "This book is just barely beyond your comprehension." |
1607 | op->failmsg (lev_diff < 2 ? "This book is just barely beyond your comprehension." |
1606 | : lev_diff < 3 ? "This book is slightly beyond your comprehension." |
1608 | : lev_diff < 3 ? "This book is slightly beyond your comprehension." |
1607 | : lev_diff < 5 ? "This book is beyond your comprehension." |
1609 | : lev_diff < 5 ? "This book is beyond your comprehension." |
1608 | : lev_diff < 8 ? "This book is quite a bit beyond your comprehension." |
1610 | : lev_diff < 8 ? "This book is quite a bit beyond your comprehension." |
1609 | : lev_diff < 15 ? "This book is way beyond your comprehension." |
1611 | : lev_diff < 15 ? "This book is way beyond your comprehension." |
1610 | : "This book is totally beyond your comprehension."); |
1612 | : "This book is totally beyond your comprehension."); |
… | |
… | |
1614 | readable_message_type *msgType = get_readable_message_type (tmp); |
1616 | readable_message_type *msgType = get_readable_message_type (tmp); |
1615 | |
1617 | |
1616 | if (player *pl = op->contr) |
1618 | if (player *pl = op->contr) |
1617 | if (client *ns = pl->ns) |
1619 | if (client *ns = pl->ns) |
1618 | if (ns->can_msg) |
1620 | if (ns->can_msg) |
1619 | { |
1621 | pl->infobox (MSG_CHANNEL ("book"), format ("T<%s>\n\n\n\n%s", (char *)long_desc (tmp, op), &tmp->msg)); |
1620 | dynbuf_text buf; |
|
|
1621 | buf << long_desc (tmp, op) |
|
|
1622 | << "\n\n" |
|
|
1623 | << tmp->msg |
|
|
1624 | << '\0'; |
|
|
1625 | ns->send_msg (NDI_NAVY, msgType->msgtype, buf.linearise ()); |
|
|
1626 | } |
|
|
1627 | else |
1622 | else |
1628 | draw_ext_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, |
1623 | draw_ext_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, |
1629 | msgType->message_type, msgType->message_subtype, |
1624 | msgType->message_type, msgType->message_subtype, |
1630 | "You open the %s and start reading.\n%s", (char *)"%s\n%s", |
1625 | "You open the %s and start reading.\n%s", (char *)"%s\n%s", |
1631 | long_desc (tmp, op), &tmp->msg); |
1626 | long_desc (tmp, op), &tmp->msg); |
… | |
… | |
1998 | if (tmp->type == FOOD || tmp->type == FLESH) |
1993 | if (tmp->type == FOOD || tmp->type == FLESH) |
1999 | op->failmsg ("You feel full, but what a waste of food!"); |
1994 | op->failmsg ("You feel full, but what a waste of food!"); |
2000 | else |
1995 | else |
2001 | op->statusmsg ("Most of the drink goes down your face not your throat!"); |
1996 | op->statusmsg ("Most of the drink goes down your face not your throat!"); |
2002 | } |
1997 | } |
|
|
1998 | |
|
|
1999 | tmp->play_sound ( |
|
|
2000 | tmp->sound |
|
|
2001 | ? tmp->sound |
|
|
2002 | : tmp->type == DRINK |
|
|
2003 | ? sound_find ("eat_drink") |
|
|
2004 | : sound_find ("eat_food") |
|
|
2005 | ); |
2003 | |
2006 | |
2004 | if (!QUERY_FLAG (tmp, FLAG_CURSED)) |
2007 | if (!QUERY_FLAG (tmp, FLAG_CURSED)) |
2005 | { |
2008 | { |
2006 | const char *buf; |
2009 | const char *buf; |
2007 | |
2010 | |
… | |
… | |
2278 | |
2281 | |
2279 | #if 0 //TODO |
2282 | #if 0 //TODO |
2280 | if (!has_been_loaded (EXIT_PATH (exit)) && exit->race) |
2283 | if (!has_been_loaded (EXIT_PATH (exit)) && exit->race) |
2281 | return 0; /* This is a reset town portal */ |
2284 | return 0; /* This is a reset town portal */ |
2282 | #endif |
2285 | #endif |
|
|
2286 | |
|
|
2287 | LOG (llevError | logBacktrace, "sync map load due to %s\n", exit->debug_desc ()); |
2283 | |
2288 | |
2284 | maptile *exitmap = maptile::find_sync (EXIT_PATH (exit), exit->map); |
2289 | maptile *exitmap = maptile::find_sync (EXIT_PATH (exit), exit->map); |
2285 | |
2290 | |
2286 | if (exitmap) |
2291 | if (exitmap) |
2287 | { |
2292 | { |