action.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929
  1. /* =============================================================================
  2. * PROGRAM: ularn
  3. * FILENAME: action.c
  4. *
  5. * DESCRIPTION:
  6. * This module contains functions to process the player's actions.
  7. *
  8. * =============================================================================
  9. * EXPORTED VARIABLES
  10. *
  11. * None
  12. *
  13. * =============================================================================
  14. * EXPORTED FUNCTIONS
  15. *
  16. * run : Move in a direction until something interesting happens
  17. * wield : Wield an item
  18. * wear : Wear armour or shield
  19. * dropobj : Drop an object
  20. * readsrc : Read a scroll ot a book for the inventory
  21. * eatcookie : Eat a cookie in inventory, and display fortune if possible.
  22. * quaff : Drink a potion in inventory
  23. * closedoor : Close an open door
  24. * quit : Asks if really want to quit.
  25. * do_create : Create an item (wizard only)
  26. *
  27. * =============================================================================
  28. */
  29. #include "ularn_game.h"
  30. #include "ularn_win.h"
  31. #include "ularn_ask.h"
  32. #include "header.h"
  33. #include "savegame.h"
  34. #include "itm.h"
  35. #include "player.h"
  36. #include "monster.h"
  37. #include "dungeon.h"
  38. #include "dungeon_obj.h"
  39. #include "object.h"
  40. #include "potion.h"
  41. #include "scroll.h"
  42. #include "show.h"
  43. #include "fortune.h"
  44. /* =============================================================================
  45. * Local variables
  46. */
  47. /*
  48. * Possible answers to various selections
  49. */
  50. static char *SelectItemAns = "abcdefghijklmnopqrstuvwxyz*\033";
  51. static char *SelectDropAns = "abcdefghijklmnopqrstuvwxyz*.\033";
  52. static char *SelectWieldAns = "abcdefghijklmnopqrstuvwxyz*-\033";
  53. /*
  54. * Types of uses of an item
  55. */
  56. typedef enum UseType
  57. {
  58. USE_WIELD,
  59. USE_QUAFF,
  60. USE_READ,
  61. USE_WEAR,
  62. USE_EAT,
  63. USE_DROP,
  64. USE_COUNT
  65. } UseType;
  66. /*
  67. * String for each use
  68. */
  69. static char *UseStrings[USE_COUNT] =
  70. {
  71. "wield",
  72. "quaff",
  73. "read",
  74. "wear",
  75. "eat",
  76. "drop"
  77. };
  78. /* =============================================================================
  79. * Local functions
  80. */
  81. /* =============================================================================
  82. * FUNCTION: ydhi
  83. *
  84. * DESCRIPTION:
  85. * Function to print the 'you don't have item' message.
  86. *
  87. * PARAMETERS:
  88. *
  89. * x : The character index (a .. z) of the inventory slot.
  90. *
  91. * RETURN VALUE:
  92. *
  93. * None.
  94. */
  95. static void ydhi (int x)
  96. {
  97. Printf("\nYou don't have item %c!", x);
  98. }
  99. /* =============================================================================
  100. * FUNCTION: ycwi
  101. *
  102. * DESCRIPTION:
  103. * Function to print the 'you can't wield item' message.
  104. *
  105. * PARAMETERS:
  106. *
  107. * x : The character index (a .. z) of the inventory slot.
  108. *
  109. * RETURN VALUE:
  110. *
  111. * None.
  112. */
  113. static void ycwi (int x)
  114. {
  115. Printf("\nYou can't wield item %c!", x);
  116. }
  117. /* =============================================================================
  118. * FUNCTION: whatitem
  119. *
  120. * DESCRIPTION:
  121. * Ask the player what item to use for a particular use and gets the
  122. * player's response.
  123. *
  124. * PARAMETERS:
  125. *
  126. * Use : The use to which the item is to be put.
  127. *
  128. * RETURN VALUE:
  129. *
  130. * The character input:
  131. * the index of the item (a .. z) or
  132. * '*' for show list or,
  133. * '-' for nothing (wield only) or,
  134. * '.' for gold (drop only) or,
  135. * ESC for abort action.
  136. */
  137. static int whatitem (UseType Use)
  138. {
  139. int j;
  140. int i = 0;
  141. UseType ItemUse;
  142. char tmp[IVENSIZE+2]; // Each item + gold + null terminator
  143. char prompt[80];
  144. char Ans;
  145. if (Use == USE_DROP)
  146. {
  147. tmp[i++] = '.';
  148. }
  149. for (j = 0; j < IVENSIZE; j++)
  150. {
  151. switch (iven[j])
  152. {
  153. case ONOTHING:
  154. ItemUse = USE_COUNT;
  155. break;
  156. case OSWORDofSLASHING:
  157. case OHAMMER:
  158. case OSWORD:
  159. case O2SWORD:
  160. case OSPEAR:
  161. case ODAGGER:
  162. case OBATTLEAXE:
  163. case OLONGSWORD:
  164. case OFLAIL:
  165. case OSLAYER:
  166. case OLANCE:
  167. case OVORPAL:
  168. ItemUse = USE_WIELD;
  169. break;
  170. case OPOTION:
  171. ItemUse = USE_QUAFF;
  172. break;
  173. case OSCROLL:
  174. case OBOOK:
  175. ItemUse = USE_READ;
  176. break;
  177. case OPLATE :
  178. case OCHAIN:
  179. case OLEATHER :
  180. case ORING :
  181. case OSTUDLEATHER :
  182. case OSPLINT :
  183. case OPLATEARMOR :
  184. case OSSPLATE :
  185. case OSHIELD :
  186. case OELVENCHAIN :
  187. ItemUse = USE_WEAR;
  188. break;
  189. case OCOOKIE:
  190. ItemUse = USE_EAT;
  191. break;
  192. default:
  193. ItemUse = USE_DROP;
  194. break;
  195. }
  196. if ((ItemUse != USE_COUNT) && ((Use == USE_DROP) || (ItemUse == Use)))
  197. {
  198. tmp[i++] = (char) (j + 'a');
  199. }
  200. }
  201. tmp[i] = '\0';
  202. sprintf(prompt,
  203. "\nWhat do you want to %s [%s * for all%s] ?",
  204. UseStrings[Use],
  205. tmp,
  206. (Use==USE_WIELD) ? " - for none":"");
  207. if (Use == USE_WIELD)
  208. {
  209. Ans = get_prompt_input(prompt, SelectWieldAns, 1);
  210. }
  211. else if (Use == USE_DROP)
  212. {
  213. Ans = get_prompt_input(prompt, SelectDropAns, 1);
  214. }
  215. else
  216. {
  217. Ans = get_prompt_input(prompt, SelectItemAns, 1);
  218. }
  219. if (Ans == ESC)
  220. {
  221. Print(" aborted.");
  222. }
  223. return(Ans);
  224. }
  225. /* =============================================================================
  226. * Exported functions
  227. */
  228. /* =============================================================================
  229. * FUNCTION: run
  230. */
  231. void run (int dir)
  232. {
  233. int i;
  234. i=1;
  235. while (i)
  236. {
  237. i = moveplayer(dir);
  238. if (i>0)
  239. {
  240. if (c[HASTEMONST]) movemonst();
  241. movemonst();
  242. randmonst();
  243. regen();
  244. }
  245. if (hitflag) i=0;
  246. if (i!=0) showcell(playerx,playery);
  247. }
  248. }
  249. /* =============================================================================
  250. * FUNCTION: wield
  251. */
  252. void wield (void)
  253. {
  254. int i;
  255. int it;
  256. while (1)
  257. {
  258. i = whatitem(USE_WIELD);
  259. if (i == ESC)
  260. {
  261. return;
  262. }
  263. else if (i == '*')
  264. {
  265. showwield();
  266. }
  267. else if (i == '-')
  268. {
  269. c[WIELD] = -1;
  270. Print("\nYou unwield your weapon.");
  271. recalc();
  272. UpdateStatus();
  273. return;
  274. }
  275. else if ((i >= 'a') && (i <= 'z'))
  276. {
  277. it = i - 'a';
  278. if (iven[it] == ONOTHING)
  279. {
  280. ydhi(i);
  281. return;
  282. }
  283. else if (iven[it]==OPOTION)
  284. {
  285. ycwi(i);
  286. return;
  287. }
  288. else if (iven[it]==OSCROLL)
  289. {
  290. ycwi(i);
  291. return;
  292. }
  293. else if ((c[SHIELD] != -1) && (iven[it] == O2SWORD))
  294. {
  295. Print("\nBut one arm is busy with your shield!");
  296. return;
  297. }
  298. else if ((c[WEAR] == it) || (c[SHIELD] == it))
  299. {
  300. Printf("\nYou can't wield your %s while you're wearing it!",
  301. (c[WEAR] == it) ? "armor" : "shield");
  302. return;
  303. }
  304. else
  305. {
  306. c[WIELD] = it;
  307. Printf("\nYou wield %s", objectname[(int) iven[it]]);
  308. show_plusses(ivenarg[it]);
  309. Printc('.');
  310. recalc();
  311. UpdateStatus();
  312. return;
  313. }
  314. }
  315. }
  316. }
  317. /* =============================================================================
  318. * FUNCTION: wear
  319. */
  320. void wear (void)
  321. {
  322. int i;
  323. int it;
  324. while (1)
  325. {
  326. i = whatitem(USE_WEAR);
  327. if (i == ESC)
  328. {
  329. return;
  330. }
  331. else if (i == '*')
  332. {
  333. showwear();
  334. }
  335. else if ((i >= 'a') && (i <= 'z'))
  336. {
  337. it = i - 'a';
  338. switch (iven[it])
  339. {
  340. case ONOTHING:
  341. ydhi(i);
  342. return;
  343. case OLEATHER:
  344. case OCHAIN:
  345. case OPLATE:
  346. case OSTUDLEATHER:
  347. case ORING:
  348. case OSPLINT:
  349. case OPLATEARMOR:
  350. case OELVENCHAIN:
  351. case OSSPLATE:
  352. if (c[WEAR] != -1)
  353. {
  354. Print("\nYou are already wearing some armor.");
  355. return;
  356. }
  357. c[WEAR] = it;
  358. if (c[WIELD] == it) c[WIELD] = -1;
  359. Printf("\nYou put on your %s", objectname[(int) iven[it]]);
  360. show_plusses(ivenarg[it]);
  361. Printc('.');
  362. recalc();
  363. UpdateStatus();
  364. return;
  365. case OSHIELD:
  366. if (c[SHIELD] != -1)
  367. {
  368. Print("\nYou are already wearing a shield.");
  369. return;
  370. }
  371. if (iven[c[WIELD]] == O2SWORD)
  372. {
  373. Print("\nYour hands are busy with the two handed sword!");
  374. return;
  375. }
  376. c[SHIELD] = it;
  377. if (c[WIELD] == it) c[WIELD] = -1;
  378. Print("\nYou put on your shield");
  379. show_plusses(ivenarg[it]);
  380. Printc('.');
  381. recalc();
  382. UpdateStatus();
  383. return;
  384. default:
  385. Print("\nYou can't wear that!");
  386. }
  387. }
  388. }
  389. }
  390. /* =============================================================================
  391. * FUNCTION: dropobj
  392. */
  393. void dropobj (void)
  394. {
  395. int i, pitflag=0;
  396. char *p;
  397. long amt;
  398. p = &item[playerx][playery];
  399. while (1)
  400. {
  401. if ((i = whatitem(USE_DROP))== ESC)
  402. return;
  403. if (i=='*')
  404. {
  405. showstr();
  406. }
  407. else
  408. {
  409. /* drop some gold */
  410. if (i == '.')
  411. {
  412. if (*p == OPIT) pitflag=1;
  413. if ((*p != ONOTHING) && !pitflag)
  414. {
  415. Print("\nThere's something here already!");
  416. return;
  417. }
  418. Print("\n\n");
  419. Print("How much gold do you drop? ");
  420. amt = get_num_input((long)c[GOLD]);
  421. if (amt <= 0) return;
  422. if (amt > c[GOLD])
  423. {
  424. Print("\nYou don't have that much!");
  425. return;
  426. }
  427. if (amt <= 32767)
  428. {
  429. *p=OGOLDPILE;
  430. i = (int) amt;
  431. }
  432. else if (amt <= 327670L)
  433. {
  434. *p = ODGOLD;
  435. i = (int) (amt/10);
  436. amt = 10L*i;
  437. }
  438. else if (amt<=3276700L)
  439. {
  440. *p=OMAXGOLD;
  441. i = (int) (amt/100);
  442. amt = 100L*i;
  443. }
  444. else if (amt<=32767000L)
  445. {
  446. *p = OKGOLD;
  447. i = (int) (amt/1000);
  448. amt = 1000L*i;
  449. }
  450. else
  451. {
  452. *p = OKGOLD;
  453. i = (int) (32767);
  454. amt = 32767000L;
  455. }
  456. c[GOLD] -= amt;
  457. Printf(" You drop %d gold piece%s.", (long) amt, plural(amt));
  458. if (pitflag)
  459. {
  460. *p = OPIT;
  461. Print("\nThe gold disappears down the pit.");
  462. }
  463. else
  464. {
  465. iarg[playerx][playery] = (short) i;
  466. }
  467. UpdateStatus();
  468. dropflag = 1;
  469. return;
  470. }
  471. else
  472. {
  473. drop_object(i-'a');
  474. return;
  475. }
  476. }
  477. }
  478. }
  479. /* =============================================================================
  480. * FUNCTION: readscr
  481. */
  482. void readscr (void)
  483. {
  484. int i;
  485. while (1)
  486. {
  487. if ((i = whatitem(USE_READ))==ESC) return;
  488. if (i != '.')
  489. {
  490. if (i=='*')
  491. {
  492. showread();
  493. }
  494. else
  495. {
  496. if (iven[i-'a']==OSCROLL)
  497. {
  498. read_scroll(ivenarg[i-'a']);
  499. iven[i-'a'] = ONOTHING;
  500. return;
  501. }
  502. if (iven[i-'a']==OBOOK)
  503. {
  504. readbook(ivenarg[i-'a']);
  505. iven[i-'a'] = ONOTHING;
  506. return;
  507. }
  508. if (iven[i-'a'] == ONOTHING)
  509. {
  510. ydhi(i);
  511. return;
  512. }
  513. Print("\nThere's nothing on it to read."); return;
  514. }
  515. }
  516. }
  517. }
  518. /* =============================================================================
  519. * FUNCTION: eatcookie
  520. */
  521. void eatcookie (void)
  522. {
  523. int i;
  524. char *p;
  525. while (1)
  526. {
  527. if ((i = whatitem(USE_EAT))==ESC)
  528. {
  529. return;
  530. }
  531. if (i != '.')
  532. {
  533. if (i=='*')
  534. {
  535. showeat();
  536. }
  537. else if (iven[i-'a']==OCOOKIE)
  538. {
  539. Print("\nThe cookie was delicious.");
  540. iven[i-'a'] = ONOTHING;
  541. if (!c[BLINDCOUNT])
  542. {
  543. p = fortune(fortfile);
  544. if (p != NULL)
  545. {
  546. Print(" Inside you find a scrap of paper that says:\n");
  547. Print(p);
  548. }
  549. }
  550. return;
  551. }
  552. else if (iven[i-'a'] == ONOTHING)
  553. {
  554. ydhi(i);
  555. return;
  556. }
  557. else
  558. {
  559. Print("\nYou can't eat that!");
  560. return;
  561. }
  562. }
  563. }
  564. }
  565. /* =============================================================================
  566. * FUNCTION: quaff
  567. */
  568. void quaff (void)
  569. {
  570. int i;
  571. while (1)
  572. {
  573. if ((i = whatitem(USE_QUAFF)) == ESC)
  574. {
  575. return;
  576. }
  577. if (i != '.')
  578. {
  579. if (i=='*')
  580. {
  581. showquaff();
  582. }
  583. else if (iven[i-'a']==OPOTION)
  584. {
  585. quaffpotion(ivenarg[i-'a']);
  586. iven[i-'a'] = ONOTHING;
  587. return;
  588. }
  589. else if (iven[i-'a'] == ONOTHING)
  590. {
  591. ydhi(i);
  592. return;
  593. }
  594. else
  595. {
  596. Print("\nYou wouldn't want to quaff that, would you? ");
  597. return;
  598. }
  599. }
  600. }
  601. }
  602. /* =============================================================================
  603. * FUNCTION: opendoor
  604. */
  605. void opendoor(void)
  606. {
  607. int dx, dy;
  608. if (!enhance_interface)
  609. {
  610. return;
  611. }
  612. /* can't move objects is time is stopped */
  613. if (c[TIMESTOP])
  614. {
  615. Printf("\nNothing can be moved while time is stopped!");
  616. return;
  617. }
  618. dx = playerx;
  619. dy = playery;
  620. dirsub(&dx, &dy);
  621. /* don't ask about items at player's location after trying to open a door */
  622. dropflag = 1;
  623. if (!checkxy(dx, dy))
  624. {
  625. if (c[BLINDCOUNT] == 0)
  626. {
  627. Print("\nYou see no door there.");
  628. }
  629. else
  630. {
  631. Print("\nYou cannot feel any door there.");
  632. }
  633. }
  634. else
  635. {
  636. if (item[dx][dy] == OOPENDOOR)
  637. {
  638. Print("\nThat door is already open.");
  639. }
  640. else if (item[dx][dy] != OCLOSEDDOOR)
  641. {
  642. if (c[BLINDCOUNT] == 0)
  643. {
  644. Print("\nYou see no door there.");
  645. }
  646. else
  647. {
  648. Print("\nYou cannot feel any door there.");
  649. }
  650. }
  651. else
  652. {
  653. oopendoor(dx, dy);
  654. if (item[dx][dy] == OOPENDOOR)
  655. {
  656. Print("\nThe door opens.");
  657. }
  658. else
  659. {
  660. Print("\nThe door resists.");
  661. }
  662. }
  663. }
  664. }
  665. /* =============================================================================
  666. * FUNCTION: closedoor
  667. */
  668. void closedoor(void)
  669. {
  670. int i;
  671. int dx, dy;
  672. /* can't move objects is time is stopped */
  673. if (c[TIMESTOP])
  674. {
  675. Printf("\nNothing can be moved while time is stopped!");
  676. return;
  677. }
  678. showcell(playerx, playery);
  679. if (enhance_interface)
  680. {
  681. dx = playerx;
  682. dy = playery;
  683. dirsub(&dx, &dy);
  684. /* don't ask about items at player's location after trying to close a door */
  685. dropflag = 1;
  686. if (!checkxy(dx, dy))
  687. {
  688. if (c[BLINDCOUNT] == 0)
  689. {
  690. Print("\nYou see no door there.");
  691. }
  692. else
  693. {
  694. Print("\nYou cannot feel any door there.");
  695. }
  696. }
  697. else
  698. {
  699. if (item[dx][dy] == OCLOSEDDOOR)
  700. {
  701. Print("\nThat door is already closed.");
  702. }
  703. else if (item[dx][dy] != OOPENDOOR)
  704. {
  705. if (c[BLINDCOUNT] == 0)
  706. {
  707. Print("\nYou see no door there.");
  708. }
  709. else
  710. {
  711. Print("\nYou cannot feel any door there.");
  712. }
  713. }
  714. else
  715. {
  716. item[dx][dy] = OCLOSEDDOOR;
  717. iarg[dx][dy] = 0; /* Clear traps on door */
  718. Print("\nThe door closes.");
  719. }
  720. }
  721. }
  722. else
  723. {
  724. i = item[playerx][playery];
  725. if (i != OOPENDOOR)
  726. {
  727. Print("\nThere is no open door here.");
  728. return;
  729. }
  730. Print("\nThe door closes.");
  731. forget();
  732. item[playerx][playery]=OCLOSEDDOOR;
  733. iarg[playerx][playery]=0;
  734. dropflag=1; /* So we won't be asked to open it */
  735. }
  736. }
  737. /* =============================================================================
  738. * FUNCTION: openchest
  739. */
  740. void openchest(void)
  741. {
  742. if (item[playerx][playery] != OCHEST)
  743. {
  744. Print("\nThere isn't a chest to open here.");
  745. }
  746. else
  747. {
  748. oopenchest();
  749. dropflag = 1; /* so we don't get asked to open it again */
  750. }
  751. }
  752. /* =============================================================================
  753. * FUNCTION: quit
  754. */
  755. void quit (void)
  756. {
  757. int i;
  758. strcpy(lastmonst, "");
  759. i = get_prompt_input("\n\nDo you really want to quit? (y)es, (n)o, (s)ave", "yns\033", 1);
  760. switch (i)
  761. {
  762. case 'y':
  763. died(DIED_QUICK_QUIT, 0);
  764. break;
  765. case 'n':
  766. case ESC:
  767. Print(" no.");
  768. break;
  769. case 's':
  770. Print(" save.");
  771. Print("\nSaving...");
  772. savegame(savefilename);
  773. wizard=1;
  774. died(DIED_SUSPENDED, 0);
  775. break;
  776. default:
  777. break;
  778. }
  779. }
  780. /* =============================================================================
  781. * FUNCTION: do_create
  782. */
  783. void do_create(void)
  784. {
  785. int t, a;
  786. int Retry;
  787. do
  788. {
  789. Retry = 0;
  790. t = get_prompt_input("\nType of item (Scroll/Potion/Monster/Other) : ", "SsPpMmOo\033", 1);
  791. switch(t)
  792. {
  793. case ESC:
  794. break;
  795. case 's':
  796. case 'S':
  797. Print(" Scroll Arg: ");
  798. a=get_num_input((long)MAXSCROLL);
  799. Printf("\ncreateitem(OSCROLL, %d)", a);
  800. createitem(playerx,playery,OSCROLL, a);
  801. dropflag=1;
  802. break;
  803. case 'p':
  804. case 'P':
  805. Print(" Potion Arg: ");
  806. a=get_num_input((long)MAXPOTION);
  807. Printf("\ncreateitem(OPOTION, %d)", a);
  808. createitem(playerx,playery,OPOTION, a);
  809. dropflag=1;
  810. break;
  811. case 'o':
  812. case 'O':
  813. Print("\n\n");
  814. Print("Item : ");
  815. t=get_num_input(0);
  816. Print("Arg : ");
  817. a=get_num_input(0);
  818. Printf("\ncreateitem(%d, %d)", t, a);
  819. createitem(playerx,playery,t, a);
  820. dropflag=1;
  821. break;
  822. case 'm':
  823. case 'M':
  824. Print("\n\n");
  825. ClearToEOPage(1, 23);
  826. Print("Monst : ");
  827. t=get_num_input(0);
  828. Printf("\ncreatemonster(%d)", t);
  829. createmonster(t);
  830. dropflag=1;
  831. break;
  832. default:
  833. Retry = 1;
  834. break;
  835. }
  836. } while (Retry);
  837. }