OTALKENG.cpp 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137
  1. /*
  2. * Seven Kingdoms: Ancient Adversaries
  3. *
  4. * Copyright 1997,1998 Enlight Software Ltd.
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. //Filename : OTALKENG.CPP
  21. //Description : English version of the talk messages
  22. #if( !defined(GERMAN) && !defined(FRENCH) && !defined(SPANISH) )
  23. #include <OMOUSE.h>
  24. #include <OSYS.h>
  25. #include <OVGA.h>
  26. #include <OINFO.h>
  27. #include <OFONT.h>
  28. #include <OTECHRES.h>
  29. #include <OGAMESET.h>
  30. #include <ONEWS.h>
  31. #include <ONATION.h>
  32. #include <OTALKRES.h>
  33. //-------- define static vars --------//
  34. static String str; // these vars don't have to be saved as their are only used by msg_str() for passing vars to other functions
  35. static short viewing_nation_recno;
  36. static char should_disp_reply;
  37. static char disp_second_line;
  38. //------- Begin of function TalkMsg::msg_str --------//
  39. //
  40. // Return the text of this message.
  41. //
  42. // <int> viewingNationRecno = the recno of the nation viewing this message
  43. // [int] dispReply = whether display the reply if there is one
  44. // (default: 1)
  45. // [int] dispSecondLine = whether should display the second line of the
  46. // message (default: 0)
  47. //
  48. char* TalkMsg::msg_str(int viewingNationRecno, int dispReply, int dispSecondLine)
  49. {
  50. viewing_nation_recno = viewingNationRecno;
  51. should_disp_reply = dispReply;
  52. disp_second_line = dispSecondLine;
  53. //-------- compose the message str -------//
  54. switch(talk_id)
  55. {
  56. case TALK_PROPOSE_TRADE_TREATY:
  57. propose_treaty("trade");
  58. break;
  59. case TALK_PROPOSE_FRIENDLY_TREATY:
  60. propose_treaty("friendly");
  61. break;
  62. case TALK_PROPOSE_ALLIANCE_TREATY:
  63. propose_treaty("alliance");
  64. break;
  65. case TALK_END_TRADE_TREATY:
  66. end_treaty("trade");
  67. break;
  68. case TALK_END_FRIENDLY_TREATY:
  69. end_treaty("friendly");
  70. break;
  71. case TALK_END_ALLIANCE_TREATY:
  72. end_treaty("alliance");
  73. break;
  74. case TALK_REQUEST_MILITARY_AID:
  75. request_military_aid();
  76. break;
  77. case TALK_REQUEST_TRADE_EMBARGO:
  78. request_trade_embargo();
  79. break;
  80. case TALK_REQUEST_CEASE_WAR:
  81. request_cease_war();
  82. break;
  83. case TALK_REQUEST_DECLARE_WAR:
  84. request_declare_war();
  85. break;
  86. case TALK_REQUEST_BUY_FOOD:
  87. request_buy_food();
  88. break;
  89. case TALK_DECLARE_WAR:
  90. declare_war();
  91. break;
  92. case TALK_GIVE_TRIBUTE:
  93. give_tribute("tribute");
  94. break;
  95. case TALK_DEMAND_TRIBUTE:
  96. demand_tribute(0); // 1-is tribute, not aid
  97. break;
  98. case TALK_GIVE_AID:
  99. give_tribute("aid");
  100. break;
  101. case TALK_DEMAND_AID:
  102. demand_tribute(1); // 1-is aid, not tribute
  103. break;
  104. case TALK_GIVE_TECH:
  105. give_tech();
  106. break;
  107. case TALK_DEMAND_TECH:
  108. demand_tech();
  109. break;
  110. case TALK_REQUEST_SURRENDER:
  111. request_surrender();
  112. break;
  113. case TALK_SURRENDER:
  114. surrender();
  115. break;
  116. default:
  117. err_here();
  118. }
  119. return str;
  120. }
  121. //-------- End of function TalkMsg::msg_str ---------//
  122. //----- Begin of function TalkMsg::propose_treaty ------//
  123. //
  124. // talk_para1 - duration of the treaty (no. of years).
  125. //
  126. void TalkMsg::propose_treaty(char* treatyTypeStr)
  127. {
  128. //---------------------------------------------//
  129. //
  130. // Send:
  131. //
  132. // <King>'s Kingdom proposes a/an friendly/alliance treaty to you.
  133. // You propose a/an friendly/alliance treaty to <King>'s Kingdom.
  134. //
  135. // Reply:
  136. //
  137. // <King>'s Kingdom accepts/rejects your proposed
  138. // friendly/alliance treaty.
  139. //
  140. // You accept/reject the friendly/alliance treaty
  141. // proposed by <King>'s Kingdom.
  142. //
  143. //---------------------------------------------//
  144. String treatyStr;
  145. char* articleStr;
  146. if( treatyTypeStr[0] == 'a' )
  147. articleStr = "an ";
  148. else
  149. articleStr = "a ";
  150. treatyStr = treatyTypeStr;
  151. treatyStr += " treaty ";
  152. //--------------------------------------//
  153. if( reply_type == REPLY_WAITING || !should_disp_reply )
  154. {
  155. if( viewing_nation_recno == from_nation_recno )
  156. {
  157. str = "You propose ";
  158. str += articleStr;
  159. str += treatyStr;
  160. str += " to ";
  161. str += to_nation_name();
  162. str += ".";
  163. }
  164. else
  165. {
  166. str = from_nation_name();
  167. str += " proposes ";
  168. str += articleStr;
  169. str += treatyStr;
  170. str += " to you.";
  171. }
  172. }
  173. else
  174. {
  175. if( viewing_nation_recno == from_nation_recno )
  176. {
  177. str = to_nation_name();
  178. if( reply_type == REPLY_ACCEPT )
  179. str += " accepts your proposed ";
  180. else
  181. str += " rejects your proposed ";
  182. str += treatyStr;
  183. str += ".";
  184. }
  185. else
  186. {
  187. if( reply_type == REPLY_ACCEPT )
  188. str = "You accept the ";
  189. else
  190. str = "You reject the ";
  191. str += treatyStr;
  192. str += " proposed by ";
  193. str += from_nation_name();
  194. str += ".";
  195. }
  196. }
  197. }
  198. //------- End of function TalkMsg::propose_treaty ------//
  199. //----- Begin of function TalkMsg::end_treaty ------//
  200. //
  201. // talk_para1 - treaty type, NATION_FRIENDLY or NATION_ALLIANCE.
  202. //
  203. void TalkMsg::end_treaty(char* treatyTypeStr)
  204. {
  205. //---------------------------------------------//
  206. //
  207. // Send:
  208. // <King>'s Kingdom terminates its friendly/alliance treaty with you.
  209. // You terminate your friendly/alliance treaty with <King>'s Kingdom.
  210. //
  211. //---------------------------------------------//
  212. if( viewing_nation_recno == from_nation_recno )
  213. {
  214. str = "You terminate your ";
  215. str += treatyTypeStr;
  216. str += " treaty with ";
  217. str += to_nation_name();
  218. str += ".";
  219. }
  220. else
  221. {
  222. str = from_nation_name();
  223. str += " terminates its ";
  224. str += treatyTypeStr;
  225. str += " treaty with you.";
  226. }
  227. }
  228. //------- End of function TalkMsg::end_treaty ------//
  229. //----- Begin of function TalkMsg::request_cease_war ------//
  230. //
  231. void TalkMsg::request_cease_war()
  232. {
  233. //---------------------------------------------//
  234. //
  235. // Send:
  236. // <King>'s Kingdom requests a cease-fire.
  237. // You request a cease-fire with <King>'s Kingdom.
  238. //
  239. // Reply:
  240. // <King>'s Kingdom agrees to a cease-fire.
  241. // <King>'s Kingdom refuses a cease-fire.
  242. // You agree to a cease-fire with <King>'s Kingdom.
  243. // You refuse a cease-fire with <King>'s Kingdom.
  244. //
  245. //---------------------------------------------//
  246. if( reply_type == REPLY_WAITING || !should_disp_reply )
  247. {
  248. if( viewing_nation_recno == from_nation_recno )
  249. {
  250. str = "You request a cease-fire with ";
  251. str += to_nation_name();
  252. str += ".";
  253. }
  254. else
  255. {
  256. str = from_nation_name();
  257. str += " requests a cease-fire.";
  258. }
  259. }
  260. else
  261. {
  262. if( viewing_nation_recno == from_nation_recno )
  263. {
  264. str = to_nation_name();
  265. if( reply_type == REPLY_ACCEPT )
  266. str += " agrees to";
  267. else
  268. str += " refuses";
  269. str += " a cease-fire.";
  270. }
  271. else
  272. {
  273. if( reply_type == REPLY_ACCEPT )
  274. str = "You agree to";
  275. else
  276. str = "You refuse";
  277. str += " a cease-fire with ";
  278. str += from_nation_name();
  279. }
  280. }
  281. }
  282. //------- End of function TalkMsg::request_cease_war ------//
  283. //----- Begin of function TalkMsg::request_declare_war ------//
  284. //
  285. // talk_para1 - the recno of the nation to declare war with.
  286. //
  287. void TalkMsg::request_declare_war()
  288. {
  289. //---------------------------------------------//
  290. //
  291. // Send:
  292. // <King>'s Kingdom requests that you declare war on <King B>'s Kingdom.
  293. // You request <King>'s Kingdom to declare war on <King B>'s Kingdom.
  294. //
  295. // Reply:
  296. // <King>'s Kingdom agrees/refuses to declare war on <King B>'s Kingdom.
  297. // You agree/refuse to declare war on <King B>'s Kingdom.
  298. //
  299. //---------------------------------------------//
  300. if( reply_type == REPLY_WAITING || !should_disp_reply )
  301. {
  302. if( viewing_nation_recno == from_nation_recno )
  303. {
  304. str = "You request ";
  305. str += to_nation_name();
  306. str += " to";
  307. }
  308. else
  309. {
  310. str = from_nation_name();
  311. str += " requests that you";
  312. }
  313. str += " declare war on ";
  314. str += nation_array[talk_para1]->nation_name();
  315. str += nation_color_code_str(talk_para1);
  316. str += ".";
  317. }
  318. else
  319. {
  320. if( viewing_nation_recno == from_nation_recno )
  321. {
  322. str = to_nation_name();
  323. if( reply_type == REPLY_ACCEPT )
  324. str += " agrees";
  325. else
  326. str += " refuses";
  327. }
  328. else
  329. {
  330. if( reply_type == REPLY_ACCEPT )
  331. str = "You agree";
  332. else
  333. str = "You refuse";
  334. }
  335. str += " to declare war on ";
  336. str += nation_array[talk_para1]->nation_name();
  337. str += nation_color_code_str(talk_para1);
  338. str += ".";
  339. }
  340. }
  341. //------- End of function TalkMsg::request_declare_war ------//
  342. //----- Begin of function TalkMsg::request_buy_food ------//
  343. //
  344. // talk_para1 - the qty of food the nation wants to buy.
  345. // talk_para2 - price offered for 10 qty of food.
  346. //
  347. void TalkMsg::request_buy_food()
  348. {
  349. //---- display the second line in the reply question ----//
  350. //
  351. // <King>'s Kingdom offers $10 for 10 units of food.
  352. //
  353. //-------------------------------------------------------//
  354. if( disp_second_line )
  355. {
  356. str = from_nation_name();
  357. str += " offers ";
  358. str += m.format(talk_para2,2);
  359. str += " for 10 units of food.";
  360. return;
  361. }
  362. //---------------------------------------------//
  363. //
  364. // Send:
  365. // <King>'s Kingdom requests to purchase <amount>
  366. // units of food from you.
  367. //
  368. // You request to purchase <amount> units of food
  369. // from <King>'s Kingdom.
  370. //
  371. // Reply:
  372. // <King>'s Kingdom agrees/refuses to sell <amount> units
  373. // of food to you.
  374. //
  375. // You agree/refuse to sell <amount> units of food to
  376. // <King>'s Kingdom.
  377. //
  378. //---------------------------------------------//
  379. if( reply_type == REPLY_WAITING || !should_disp_reply )
  380. {
  381. if( viewing_nation_recno == from_nation_recno )
  382. {
  383. str = "You request to purchase ";
  384. str += talk_para1;
  385. str += " units of food from ";
  386. str += to_nation_name();
  387. str += ".";
  388. }
  389. else
  390. {
  391. str = from_nation_name();
  392. str += " requests to purchase ";
  393. str += talk_para1;
  394. str += " units of food from you.";
  395. }
  396. }
  397. else
  398. {
  399. if( viewing_nation_recno == from_nation_recno )
  400. {
  401. str = to_nation_name();
  402. if( reply_type == REPLY_ACCEPT )
  403. str += " agrees";
  404. else
  405. str += " refuses";
  406. str += " to sell ";
  407. str += talk_para1;
  408. str += " units of food to you.";
  409. }
  410. else
  411. {
  412. if( reply_type == REPLY_ACCEPT )
  413. str = "You agree";
  414. else
  415. str = "You refuse";
  416. str += " to sell ";
  417. str += talk_para1;
  418. str += " units of food to ";
  419. str += from_nation_name();
  420. str += ".";
  421. }
  422. }
  423. }
  424. //------- End of function TalkMsg::request_buy_food ------//
  425. //----- Begin of function TalkMsg::declare_war ------//
  426. //
  427. void TalkMsg::declare_war()
  428. {
  429. //---------------------------------------------//
  430. //
  431. // Send:
  432. // <King>'s Kingdom declares war on you.
  433. // You declare war on <King>'s Kingdom.
  434. //
  435. //---------------------------------------------//
  436. if( viewing_nation_recno == from_nation_recno )
  437. {
  438. str = "You declare war on ";
  439. str += to_nation_name();
  440. str += ".";
  441. }
  442. else
  443. {
  444. str = from_nation_name();
  445. str += " declares war on you.";
  446. }
  447. }
  448. //------- End of function TalkMsg::declare_war ------//
  449. //----- Begin of function TalkMsg::give_tribute ------//
  450. //
  451. // <char*> tributeStr - either "tribute" or "aid".
  452. //
  453. // talk_para1 - amount of the tribute.
  454. //
  455. void TalkMsg::give_tribute(char* tributeStr)
  456. {
  457. //---------------------------------------------//
  458. //
  459. // Send:
  460. // <King>'s Kingdom offers you <$999> in aid/tribute.
  461. // You offer <King>'s Kingdom <$999> in aid/tribute.
  462. //
  463. // Reply:
  464. // <King>'s Kingdom accepts/rejects your aid/tribute of <$999>.
  465. // You accept/reject the <$999> in aid/tribute from <King>'s Kingdom.
  466. //
  467. //---------------------------------------------//
  468. if( reply_type == REPLY_WAITING || !should_disp_reply )
  469. {
  470. if( viewing_nation_recno == from_nation_recno )
  471. {
  472. str = "You offer ";
  473. str += to_nation_name();
  474. str += " ";
  475. str += m.format(talk_para1, 2);
  476. str += " in ";
  477. str += tributeStr;
  478. str += ".";
  479. }
  480. else
  481. {
  482. str = from_nation_name();
  483. str += " offers you ";
  484. str += m.format(talk_para1, 2);
  485. str += " in ";
  486. str += tributeStr;
  487. str += ".";
  488. }
  489. }
  490. else
  491. {
  492. if( viewing_nation_recno == from_nation_recno )
  493. {
  494. str = to_nation_name();
  495. if( reply_type == REPLY_ACCEPT )
  496. str += " accepts your ";
  497. else
  498. str += " rejects your ";
  499. str += tributeStr;
  500. str += " of ";
  501. str += m.format(talk_para1, 2);
  502. str += ".";
  503. }
  504. else
  505. {
  506. if( reply_type == REPLY_ACCEPT )
  507. str = "You accept the ";
  508. else
  509. str = "You reject the ";
  510. str += m.format(talk_para1, 2);
  511. str += " in ";
  512. str += tributeStr;
  513. str += " from ";
  514. str += from_nation_name();
  515. str += ".";
  516. }
  517. }
  518. }
  519. //------- End of function TalkMsg::give_tribute ------//
  520. //----- Begin of function TalkMsg::demand_tribute ------//
  521. //
  522. // <int> isAid - 1 if it's a aid, 0 if it's a tribute.
  523. //
  524. // talk_para1 - the amount of the tribute.
  525. //
  526. void TalkMsg::demand_tribute(int isAid)
  527. {
  528. //---------------------------------------------//
  529. //
  530. // Send:
  531. // <King>'s Kingdom requests/demands <tribute amount> in aid/tribute
  532. // from you.
  533. //
  534. // You request/demand <tribute amount> in aid/tribute from
  535. // <King>'s Kingdom.
  536. //
  537. // Reply:
  538. // <King>'s Kingdom agrees/refuses to give/pay you <tribute amount>
  539. // in aid/tribute.
  540. //
  541. // You agree/refuse to give/pay <King>'s Kingdom <tribute amount>
  542. // in aid/tribute.
  543. //
  544. //---------------------------------------------//
  545. char* aidStr;
  546. if( isAid )
  547. aidStr = "aid";
  548. else
  549. aidStr = "tribute";
  550. if( reply_type == REPLY_WAITING || !should_disp_reply )
  551. {
  552. if( viewing_nation_recno == from_nation_recno )
  553. {
  554. if( isAid )
  555. str = "You request ";
  556. else
  557. str = "You demand ";
  558. str += m.format(talk_para1,2);
  559. str += " in ";
  560. str += aidStr;
  561. str += " from ";
  562. str += to_nation_name();
  563. str += ".";
  564. }
  565. else
  566. {
  567. str = from_nation_name();
  568. if( isAid )
  569. str += " requests ";
  570. else
  571. str += " demands ";
  572. str += m.format(talk_para1,2);
  573. str += " in ";
  574. str += aidStr;
  575. str += " from you.";
  576. }
  577. }
  578. else
  579. {
  580. if( viewing_nation_recno == from_nation_recno )
  581. {
  582. str = to_nation_name();
  583. if( reply_type == REPLY_ACCEPT )
  584. str += " agrees";
  585. else
  586. str += " refuses";
  587. if( isAid )
  588. str += " to give you ";
  589. else
  590. str += " to pay you ";
  591. }
  592. else
  593. {
  594. if( reply_type == REPLY_ACCEPT )
  595. str = "You agree";
  596. else
  597. str = "You refuse";
  598. if( isAid )
  599. str += " to give ";
  600. else
  601. str += " to pay ";
  602. str += from_nation_name();
  603. str += " ";
  604. }
  605. str += m.format(talk_para1,2);
  606. str += " in ";
  607. str += aidStr;
  608. str += ".";
  609. }
  610. }
  611. //------- End of function TalkMsg::demand_tribute ------//
  612. //----- Begin of function TalkMsg::give_tech ------//
  613. //
  614. // talk_para1 - id. of the tech given.
  615. // talk_para2 - version of the tech.
  616. //
  617. void TalkMsg::give_tech()
  618. {
  619. //---------------------------------------------//
  620. //
  621. // Send:
  622. // <King>'s Kingdom offers <tech><version> technology to you.
  623. //
  624. // You offer <tech><version> technology to <King>'s Kingdom.
  625. //
  626. // Reply:
  627. // <King>'s Kingdom accepts/rejects your gift of <tech><version>
  628. // technology.
  629. //
  630. // You accept/reject the gift of <tech><version> technology
  631. // from <King>'s Kingdom.
  632. //
  633. //---------------------------------------------//
  634. if( reply_type == REPLY_WAITING || !should_disp_reply )
  635. {
  636. if( viewing_nation_recno == from_nation_recno )
  637. {
  638. str = "You offer ";
  639. str += tech_res[talk_para1]->tech_des();
  640. if( talk_para2 ) // Ships do not have different versions
  641. {
  642. str += " ";
  643. str += m.roman_number(talk_para2);
  644. }
  645. str += " technology to ";
  646. str += to_nation_name();
  647. str += ".";
  648. }
  649. else
  650. {
  651. str = from_nation_name();
  652. str += " offers ";
  653. str += tech_res[talk_para1]->tech_des();
  654. if( talk_para2 ) // Ships do not have different versions
  655. {
  656. str += " ";
  657. str += m.roman_number(talk_para2);
  658. }
  659. str += " technology to you.";
  660. }
  661. }
  662. else
  663. {
  664. if( viewing_nation_recno == from_nation_recno )
  665. {
  666. str = to_nation_name();
  667. if( reply_type == REPLY_ACCEPT )
  668. str += " accepts your gift of ";
  669. else
  670. str += " rejects your gift of ";
  671. str += tech_res[talk_para1]->tech_des();
  672. if( talk_para2 ) // Ships do not have different versions
  673. {
  674. str += " ";
  675. str += m.roman_number(talk_para2);
  676. }
  677. str += " technology.";
  678. }
  679. else
  680. {
  681. if( reply_type == REPLY_ACCEPT )
  682. str = "You accept the gift of ";
  683. else
  684. str = "You reject the gift of ";
  685. str += tech_res[talk_para1]->tech_des();
  686. if( talk_para2 ) // Ships do not have different versions
  687. {
  688. str += " ";
  689. str += m.roman_number(talk_para2);
  690. }
  691. str += " technology from ";
  692. str += from_nation_name();
  693. str += ".";
  694. }
  695. }
  696. }
  697. //------- End of function TalkMsg::give_tech ------//
  698. //----- Begin of function TalkMsg::demand_tech ------//
  699. //
  700. // Demand for the latest version of the technology.
  701. //
  702. // talk_para1 - id. of the tech demanded.
  703. // talk_para2 - version of the tech if the nation agrees to transfer
  704. // technology.
  705. //
  706. void TalkMsg::demand_tech()
  707. {
  708. //---------------------------------------------//
  709. //
  710. // Send:
  711. // <King>'s Kingdom demands/requests the latest
  712. // <tech> technology from you.
  713. //
  714. // You demand/request the latest <tech> technology from
  715. // <King>'s Kingdom.
  716. //
  717. // Reply:
  718. // <King>'s Kingdom agrees/refuses to transfer its latest <tech>
  719. // technology to you.
  720. //
  721. // You agree/refuse to transfer your <tech> technology to
  722. // <King>'s Kingdom.
  723. //
  724. //---------------------------------------------//
  725. char* requestStr;
  726. if( nation_array[from_nation_recno]->get_relation_status(to_nation_recno)
  727. >= NATION_FRIENDLY )
  728. {
  729. requestStr = "request";
  730. }
  731. else
  732. {
  733. requestStr = "demand";
  734. }
  735. //------------------------------------------//
  736. if( reply_type == REPLY_WAITING || !should_disp_reply )
  737. {
  738. if( viewing_nation_recno == from_nation_recno )
  739. {
  740. str = "You ";
  741. str += requestStr;
  742. str += " the latest ";
  743. str += tech_res[talk_para1]->tech_des();
  744. str += " technology from ";
  745. str += to_nation_name();
  746. str += ".";
  747. }
  748. else
  749. {
  750. str = from_nation_name();
  751. str += " ";
  752. str += requestStr;
  753. str += "s the latest ";
  754. str += tech_res[talk_para1]->tech_des();
  755. str += " technology from you.";
  756. }
  757. }
  758. else
  759. {
  760. if( viewing_nation_recno == from_nation_recno )
  761. {
  762. str = to_nation_name();
  763. if( reply_type == REPLY_ACCEPT )
  764. str += " agrees";
  765. else
  766. str += " refuses";
  767. str += " to transfer its latest ";
  768. str += tech_res[talk_para1]->tech_des();
  769. str += " technology to you.";
  770. }
  771. else
  772. {
  773. if( reply_type == REPLY_ACCEPT )
  774. str = "You agree";
  775. else
  776. str = "You refuse";
  777. str += " to transfer your latest ";
  778. str += tech_res[talk_para1]->tech_des();
  779. str += " technology to ";
  780. str += from_nation_name();
  781. str += ".";
  782. }
  783. }
  784. }
  785. //------- End of function TalkMsg::demand_tech ------//
  786. //----- Begin of function TalkMsg::request_military_aid ------//
  787. //
  788. void TalkMsg::request_military_aid()
  789. {
  790. //---------------------------------------------//
  791. //
  792. // Send:
  793. // <King>'s Kingdom requests immediate military aid from you.
  794. // You request immediate military aid from <King>'s Kingdom.
  795. //
  796. // Reply:
  797. // <King>'s Kingdom agrees to immediately send your requested
  798. // military aid.
  799. // <King>'s Kingdom denies you your requested military aid.
  800. //
  801. // You agree to immediately send military aid to <King>'s Kingdom.
  802. // You refuse to send military aid to <King>'s Kingdom.
  803. //
  804. //---------------------------------------------//
  805. if( reply_type == REPLY_WAITING || !should_disp_reply )
  806. {
  807. if( viewing_nation_recno == from_nation_recno )
  808. {
  809. str = "You request immediate military aid from ";
  810. str += to_nation_name();
  811. str += ".";
  812. }
  813. else
  814. {
  815. str = from_nation_name();
  816. str += " requests immediate military aid from you.";
  817. }
  818. }
  819. else
  820. {
  821. if( viewing_nation_recno == from_nation_recno )
  822. {
  823. str = to_nation_name();
  824. if( reply_type == REPLY_ACCEPT )
  825. str += " agrees to immediately send your requested military aid.";
  826. else
  827. str += " denies you your requested military aid.";
  828. }
  829. else
  830. {
  831. if( reply_type == REPLY_ACCEPT )
  832. str = "You agree to immediately send military aid to ";
  833. else
  834. str = "You refuse to send military aid to ";
  835. str += from_nation_name();
  836. str += ".";
  837. }
  838. }
  839. }
  840. //------- End of function TalkMsg::request_military_aid ------//
  841. //----- Begin of function TalkMsg::request_trade_embargo ------//
  842. //
  843. // talk_para1 - the nation to have a trade embargo on.
  844. //
  845. void TalkMsg::request_trade_embargo()
  846. {
  847. //---------------------------------------------//
  848. //
  849. // Send:
  850. // <King>'s Kingdom requests you to join an embargo on trade with
  851. // <King B>'s Kingdom.
  852. //
  853. // You request <King>'s Kingdom to join an embargo on trade with
  854. // <King B>'s Kingdom.
  855. //
  856. // Reply:
  857. // <King>'s Kingdom agrees/refuses to join an embargo on trade
  858. // with <King B>'s Kingdom.
  859. //
  860. // You agree/refuse to join an embargo on trade with <King B>'s Kingdom
  861. // as requested by <King>'s Kingdom.
  862. //
  863. //---------------------------------------------//
  864. if( reply_type == REPLY_WAITING || !should_disp_reply )
  865. {
  866. if( viewing_nation_recno == from_nation_recno )
  867. {
  868. str = "You request ";
  869. str += to_nation_name();
  870. }
  871. else
  872. {
  873. str = from_nation_name();
  874. str += " requests you";
  875. }
  876. str += " to join an embargo on trade with ";
  877. str += nation_array[talk_para1]->nation_name();
  878. str += nation_color_code_str(talk_para1);
  879. str += ".";
  880. }
  881. else
  882. {
  883. if( viewing_nation_recno == from_nation_recno )
  884. {
  885. str = to_nation_name();
  886. if( reply_type == REPLY_ACCEPT )
  887. str += " agrees";
  888. else
  889. str += " refuses";
  890. str += " to join an embargo on trade with ";
  891. str += nation_array[talk_para1]->nation_name();
  892. str += nation_color_code_str(talk_para1);
  893. str += ".";
  894. }
  895. else
  896. {
  897. if( reply_type == REPLY_ACCEPT )
  898. str = "You agree";
  899. else
  900. str = "You refuse";
  901. str += " to join an embargo on trade with ";
  902. str += nation_array[talk_para1]->nation_name();
  903. str += nation_color_code_str(talk_para1);
  904. str += " as requested by ";
  905. str += from_nation_name();
  906. str += ".";
  907. }
  908. }
  909. }
  910. //------- End of function TalkMsg::request_trade_embargo ------//
  911. //----- Begin of function TalkMsg::request_surrender ------//
  912. //
  913. void TalkMsg::request_surrender()
  914. {
  915. //---------------------------------------------//
  916. //
  917. // Send:
  918. //
  919. // To unite our two Kingdoms under his rule, King
  920. // <King name> offers <amount> for your throne.
  921. //
  922. // You offer <amount> for the throne of <King>'s
  923. // Kingdom.
  924. //
  925. // Reply:
  926. //
  927. // King <king name> refuses to dishonor himself by
  928. // selling his throne!
  929. //
  930. // King <king name> agrees to take your money in
  931. // exchange for his throne.
  932. //
  933. // You refuse to dishonor yourself by selling your
  934. // throne to <King>'s kingdom.
  935. //
  936. //---------------------------------------------//
  937. if( reply_type == REPLY_WAITING || !should_disp_reply )
  938. {
  939. if( viewing_nation_recno == from_nation_recno )
  940. {
  941. str = "You offer ";
  942. str += talk_para1*10; // *10 to restore its original value.
  943. str += " for the throne of ";
  944. str += to_nation_name();
  945. str += ".";
  946. }
  947. else
  948. {
  949. str = "To unite our two Kingdoms under his rule, ";
  950. str += from_king_name();
  951. str += " offers ";
  952. str += talk_para1*10; // *10 to restore its original value.
  953. str += " for your throne.";
  954. }
  955. }
  956. else
  957. {
  958. if( viewing_nation_recno == from_nation_recno )
  959. {
  960. str = to_king_name();
  961. if( reply_type == REPLY_ACCEPT )
  962. str += " agrees to take your money in exchange for his throne.";
  963. else
  964. str += " refuses to dishonor himself by selling his throne!";
  965. }
  966. else
  967. {
  968. if( reply_type == REPLY_ACCEPT )
  969. {
  970. str = "You agree to take the money in exchange for your throne.";
  971. }
  972. else
  973. {
  974. str = "You refuse to dishonor yourself by selling your throne to ";
  975. str += from_nation_name();
  976. str += ".";
  977. }
  978. }
  979. }
  980. }
  981. //------- End of function TalkMsg::request_surrender ------//
  982. //----- Begin of function TalkMsg::surrender ------//
  983. //
  984. void TalkMsg::surrender()
  985. {
  986. //---------------------------------------------//
  987. //
  988. // Send:
  989. // <King>'s Kingdom offerrrendered to you.
  990. // You have surrendered to <King>'s Kingdom.
  991. //
  992. //---------------------------------------------//
  993. if( viewing_nation_recno == from_nation_recno )
  994. {
  995. str = "You have surrendered to ";
  996. str += to_nation_name();
  997. str += ".";
  998. }
  999. else
  1000. {
  1001. str = from_nation_name();
  1002. str += " has surrendered to you.";
  1003. }
  1004. }
  1005. //------- End of function TalkMsg::surrender ------//
  1006. #endif