ONEWSSPA.cpp 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672
  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 : ONEWS3.CPP
  21. //Description : Object news msg generating routines
  22. #if(defined(SPANISH))
  23. #include <OSTR.h>
  24. #include <OTOWN.h>
  25. #include <OFIRMRES.h>
  26. #include <ONATION.h>
  27. #include <OUNIT.h>
  28. #include <OSPY.h>
  29. #include <OFONT.h>
  30. #include <OTECHRES.h>
  31. #include <OMONSRES.h>
  32. #include <OREMOTE.h>
  33. #include <OGODRES.h>
  34. #include <ORACERES.h>
  35. #include <OTALKRES.h>
  36. #include <ONEWS.h>
  37. //--------- Define variable type ----------//
  38. typedef void (News::*NewsFP)();
  39. //-------- Define struct NewsInfo -------//
  40. struct NewsInfo
  41. {
  42. NewsFP news_function_ptr;
  43. char is_major; // whether this is a major news or not
  44. };
  45. //------ Define function pointers array ------//
  46. static NewsInfo news_info_array[] =
  47. {
  48. { &News::diplomacy, 1 },
  49. { &News::town_rebel, 1 },
  50. { &News::migrate, 0 },
  51. { &News::new_nation, 1 },
  52. { &News::nation_destroyed, 1 },
  53. { &News::nation_surrender, 1 },
  54. { &News::king_die, 1 },
  55. { &News::new_king, 1 },
  56. { &News::firm_destroyed, 0 },
  57. { &News::firm_captured, 0 },
  58. { &News::town_destroyed, 0 },
  59. { &News::town_abandoned, 0 },
  60. { &News::town_surrendered, 0 },
  61. { &News::monster_king_killed, 0 },
  62. { &News::monster_firm_destroyed, 0 },
  63. { &News::scroll_acquired, 1 },
  64. { &News::monster_gold_acquired, 0 },
  65. { &News::your_spy_killed, 1 },
  66. { &News::enemy_spy_killed, 1 },
  67. { &News::unit_betray, 1 },
  68. { &News::unit_assassinated, 1 },
  69. { &News::assassinator_caught, 1 },
  70. { &News::general_die, 1 },
  71. { &News::raw_exhaust, 1 },
  72. { &News::tech_researched, 1 },
  73. { &News::lightning_damage, 1 },
  74. { &News::earthquake_damage, 1 },
  75. { &News::goal_deadline, 1 },
  76. { &News::weapon_ship_worn_out, 0 },
  77. { &News::firm_worn_out, 0 },
  78. { &News::chat_msg, 1 },
  79. { &News::multi_retire, 1 },
  80. { &News::multi_quit_game, 1 },
  81. { &News::multi_save_game, 1 },
  82. { &News::multi_connection_lost, 1 },
  83. };
  84. //------- Define static variables --------//
  85. static String str;
  86. //------ Begin of function News::msg -----//
  87. //
  88. // Return the msg string of current news.
  89. //
  90. char* News::msg()
  91. {
  92. NewsFP newsFP = news_info_array[id-1].news_function_ptr;
  93. (this->*newsFP)(); // call the corrsponding function to return the news msg
  94. return str;
  95. }
  96. //------- End of function News::msg -----//
  97. //------ Begin of function News::is_major -----//
  98. //
  99. // Whether this is a major news or not.
  100. //
  101. int News::is_major()
  102. {
  103. if( id==NEWS_TOWN_REBEL )
  104. {
  105. //-- only rebellions happening in the player's village are considered as major news --//
  106. return nation_array.player_recno &&
  107. nation_name_id1 == (~nation_array)->nation_name_id;
  108. }
  109. else
  110. {
  111. return news_info_array[id-1].is_major;
  112. }
  113. }
  114. //------- End of function News::is_major -----//
  115. //------ Begin of function News::diplomacy -----//
  116. //
  117. // Diplomatic messages from other nations.
  118. //
  119. // short_para1 = the recno of TalkMsg in talk_res.talk_msg_array.
  120. //
  121. void News::diplomacy()
  122. {
  123. err_when( talk_res.is_talk_msg_deleted(short_para1) );
  124. TalkMsg* talkMsgPtr = talk_res.get_talk_msg(short_para1);
  125. str = talkMsgPtr->msg_str(nation_array.player_recno);
  126. }
  127. //------- End of function News::diplomacy -----//
  128. //------ Begin of function News::town_rebel -----//
  129. //
  130. // Generate a news that a firm is built
  131. //
  132. // nation_name1() - the name of the nation the rebel took place.
  133. //
  134. // short_para1 = the town name id.
  135. // short_para2 = no. of rebels
  136. //
  137. void News::town_rebel()
  138. {
  139. //---------------- Text Format -----------------//
  140. //
  141. // <no. of rebel> Peasants in <town name> in
  142. // <nation name> is/are rebelling.
  143. //
  144. //----------------------------------------------//
  145. //
  146. // <no. of rebel> Campesino(s) de <town name> del
  147. // <nation name> se está(n) revelando.
  148. //
  149. //----------------------------------------------//
  150. err_when( short_para2 < 1 );
  151. str = short_para2;
  152. if( short_para2 > 1 )
  153. str += " Campesinos de ";
  154. else
  155. str += " Campesino de ";
  156. str += town_res.get_name(short_para1);
  157. str += " del ";
  158. str += nation_name1();
  159. if( short_para2 > 1 )
  160. str += " se están revelando.";
  161. else
  162. str += " se está revelando.";
  163. }
  164. //------- End of function News::town_rebel -----//
  165. //------ Begin of function News::migrate -------//
  166. //
  167. // nation_name1() - from nation
  168. // nation_name2() - to nation
  169. //
  170. // short_para1 = the town name id. that the worker migrates from
  171. // short_para2 = the town name id. that the worker migrates to
  172. // short_para3 = race id. of the migrated worker/peasant
  173. // short_para4 = no. of people migrated
  174. // short_para5 = the firm id. that the worker works for
  175. //
  176. void News::migrate()
  177. {
  178. //---------------- Text Format -----------------//
  179. //
  180. // A <racial> <worker name>/Peasant has emigrated from your
  181. // village of <town name> to <town name> in <nation name>.
  182. //
  183. // A <racial> <worker name>/Peasant has immigrated from
  184. // <town name> in <nation name> to your village of <town name>.
  185. //
  186. //----------------------------------------------//
  187. //
  188. // Un <worker name>/Campesino <racial> ha emigrado de tu
  189. // aldea de <town name> a <town name> del <nation name>.
  190. //
  191. // Un <worker name>/Campesino <racial> ha emigrado de
  192. // <town name> del <nation name> a tu aldea de <town name>.
  193. //
  194. //----------------------------------------------//
  195. if( short_para4 == 1 )
  196. str = "Un";
  197. else
  198. str = m.format(short_para4);
  199. str += " ";
  200. if( short_para5 )
  201. str += firm_res[short_para5]->worker_title;
  202. else
  203. str += "Campesino";
  204. str += " ";
  205. str += race_res[short_para3]->name;
  206. if( short_para4 == 1 )
  207. str += " ha";
  208. else
  209. str += " ha";
  210. //------------------------------------//
  211. if( nation_array.player_recno && nation_name_id1 == (~nation_array)->nation_name_id ) // from player nation to another nation
  212. {
  213. str += "emigrado de tu aldea de ";
  214. str += town_res.get_name(short_para1);
  215. str += " a ";
  216. str += town_res.get_name(short_para2);
  217. if( nation_name_id2 ) // only if it is not an independent town
  218. {
  219. str += " del ";
  220. str += nation_name2();
  221. }
  222. str += ".";
  223. }
  224. else
  225. {
  226. str += " emigrado de ";
  227. str += town_res.get_name(short_para1);
  228. if( nation_name_id1 )
  229. {
  230. str += " del ";
  231. str += nation_name1();
  232. }
  233. str += " a tu aldea de ";
  234. str += town_res.get_name(short_para2);
  235. str += ".";
  236. }
  237. }
  238. //------- End of function News::migrate --------//
  239. //------ Begin of function News::new_nation -----//
  240. //
  241. // king_name1() - name of the king of the new kingdom.
  242. //
  243. void News::new_nation()
  244. {
  245. //---------------- Text Format -----------------//
  246. //
  247. // A new Kingdom has emerged under the leadership of <king Name>.
  248. //
  249. //----------------------------------------------//
  250. //
  251. // Ha surgido un nuevo Reino bajo el mando de <king Name>.
  252. //
  253. //----------------------------------------------//
  254. str = "Ha surgido un nuevo Reino bajo el mando de ";
  255. str += king_name1(1);
  256. str += ".";
  257. }
  258. //------- End of function News::new_nation -----//
  259. //------ Begin of function News::nation_destroyed -----//
  260. //
  261. // nation_name1() - name of the destroyed nation.
  262. //
  263. void News::nation_destroyed()
  264. {
  265. //---------------- Text Format -----------------//
  266. //
  267. // <King>'s Kingdom has been destroyed.
  268. //
  269. //----------------------------------------------//
  270. //
  271. // El Reino de <King> ha sido destruido.
  272. //
  273. //----------------------------------------------//
  274. str = "El ";
  275. str += nation_name1();
  276. str += " ha sido destruido.";
  277. }
  278. //------- End of function News::nation_destroyed -----//
  279. //------ Begin of function News::nation_surrender -----//
  280. //
  281. // nation_name1() - name of the surrendering nation.
  282. // nation_name2() - name of the nation to surrender.
  283. //
  284. void News::nation_surrender()
  285. {
  286. //---------------- Text Format -----------------//
  287. //
  288. // <King>'s Kingdom has surrendered to <King B>'s Kingdom.
  289. //
  290. // <King>'s Kingdom has surrendered to you.
  291. //
  292. //----------------------------------------------//
  293. //
  294. // El Reino de <King> se ha rendido al Reino de <King B>.
  295. //
  296. // El Reino de <King> se te ha rendido.
  297. //
  298. //----------------------------------------------//
  299. str = "El ";
  300. str += nation_name1();
  301. if( nation_array.player_recno && nation_name_id2 == (~nation_array)->nation_name_id )
  302. {
  303. str += " se te ha rendido.";
  304. }
  305. else
  306. {
  307. str += " se ha rendido al ";
  308. str += nation_name2();
  309. str += ".";
  310. }
  311. }
  312. //------- End of function News::nation_surrender -----//
  313. //------ Begin of function News::king_die -----//
  314. //
  315. // king_name1() - the nation whose king has died.
  316. //
  317. void News::king_die()
  318. {
  319. //---------------- Text Format -----------------//
  320. //
  321. // Your King, <king name>, has been slain.
  322. //
  323. // OR
  324. //
  325. // King <king name> of <nation name> has been slain.
  326. //
  327. //----------------------------------------------//
  328. //
  329. // Tu Rey, <king name>, ha sido liquidado.
  330. //
  331. // O
  332. //
  333. // El Rey <king name> del <nation name> ha sido liquidado.
  334. //
  335. //----------------------------------------------//
  336. if( nation_array.player_recno && nation_name_id1 == (~nation_array)->nation_name_id )
  337. {
  338. str = "Tu Rey, ";
  339. str += king_name1();
  340. str += ", ha sido liquidado.";
  341. }
  342. else
  343. {
  344. str = "El Rey ";
  345. str += king_name1();
  346. str += " del ";
  347. str += nation_name1();
  348. str += " ha sido liquidado.";
  349. }
  350. }
  351. //------- End of function News::king_die -----//
  352. //------ Begin of function News::new_king -----//
  353. //
  354. // nation_name1() - name of the nation where there is a new king.
  355. //
  356. // short_para1 - race id. of the new king.
  357. // short_para2 - name id. of the new king.
  358. //
  359. void News::new_king()
  360. {
  361. //---------------- Text Format -----------------//
  362. //
  363. // <unit name> has ascended the throne as your new King.
  364. //
  365. // OR
  366. //
  367. // <unit name> has ascended the throne as the new King of
  368. // <nation name>.
  369. //
  370. //----------------------------------------------//
  371. //
  372. // <unit name> ha subido al trono como tu nuevo Rey.
  373. //
  374. // O
  375. //
  376. // <unit name> ha subido al trono como nuevo Rey del
  377. // <nation name>.
  378. //
  379. //----------------------------------------------//
  380. str = race_res[short_para1]->get_name(short_para2);
  381. if( nation_array.player_recno && nation_name_id1 == (~nation_array)->nation_name_id )
  382. {
  383. str += " ha subido al trono como tu nuevo Rey.";
  384. }
  385. else
  386. {
  387. str += " ha subido al trono como nuevo Rey del ";
  388. str += nation_name1();
  389. str += ".";
  390. }
  391. }
  392. //------- End of function News::new_king -----//
  393. //------ Begin of function News::firm_destroyed -----//
  394. //
  395. // short_para1 - name id. of the firm destroyed.
  396. // short_para2 - id of the town where the firm is located.
  397. // short_para3 - destroyer type: 1 - a nation, 2 - rebels, 3 - Fryhtans.
  398. //
  399. void News::firm_destroyed()
  400. {
  401. //---------------- Text Format -----------------//
  402. //
  403. // Your <firm type> near <town name> has been destroyed by <kingdom name>.
  404. // Your <firm type> near <town name> has been destroyed by Rebels.
  405. // Your <firm type> near <town name> has been destroyed by Fryhtans.
  406. //
  407. //----------------------------------------------//
  408. //
  409. // El <kingdom name> ha destruido tu <firm type> cerca de <town name>.
  410. // Los Rebeldes han destruido tu <firm type> cerca de <town name>.
  411. // Los Fryhtans han destruido tu <firm type> cerca de <town name>.
  412. //
  413. //----------------------------------------------//
  414. str = "";
  415. switch( short_para3 )
  416. {
  417. case DESTROYER_NATION:
  418. str += "El ";
  419. str += nation_name2();
  420. str += " ha";
  421. break;
  422. case DESTROYER_REBEL:
  423. str += "Los Rebeldes han";
  424. break;
  425. case DESTROYER_MONSTER:
  426. str += "Los Fryhtans han";
  427. break;
  428. case DESTROYER_UNKNOWN:
  429. str += "";
  430. break;
  431. }
  432. str += " destruido tu ";
  433. str += firm_res[short_para1]->name;
  434. str += " cerca de ";
  435. str += town_res.get_name(short_para2);
  436. str += ".";
  437. }
  438. //------- End of function News::firm_destroyed -----//
  439. //------ Begin of function News::firm_captured -----//
  440. //
  441. // nation_name2() - name of the nation that took over your firm.
  442. //
  443. // short_para1 - id. of the firm took over
  444. // short_para2 - id of the town where the firm is located.
  445. // short_para3 - whether the capturer of the firm is a spy.
  446. //
  447. void News::firm_captured()
  448. {
  449. //---------------- Text Format -----------------//
  450. //
  451. // Your <firm type> near <town name> has been
  452. // captured by <kingdom name>.
  453. //
  454. // If the capturer is a spy:
  455. //
  456. // Your <firm type> near <town name> has been
  457. // captured by a spy from <kingdom name>.
  458. //
  459. //----------------------------------------------//
  460. //
  461. // El <kingdom name> ha capturado tu <firm type>
  462. // cerca de <town name>.
  463. //
  464. // Si el capturador es un espía:
  465. //
  466. // Un espía del <kingdom name> ha capturado tu <firm type>
  467. // cerca de <town name>.
  468. //
  469. //----------------------------------------------//
  470. str = "";
  471. if( short_para3 )
  472. str += "Un espía del ";
  473. else
  474. str += "El ";
  475. str += nation_name2();
  476. str += " ha capturado tu ";
  477. str += firm_res[short_para1]->name;
  478. str += " cerca de ";
  479. str += town_res.get_name(short_para2);
  480. str += ".";
  481. }
  482. //------- End of function News::firm_captured -----//
  483. //------ Begin of function News::town_destroyed -----//
  484. //
  485. // short_para1 - name id. of the town
  486. // short_para2 - destroyer type
  487. //
  488. void News::town_destroyed()
  489. {
  490. //---------------- Text Format -----------------//
  491. //
  492. // Your village of <name name> has been destroyed by <kingdom name>.
  493. // Your village of <name name> has been destroyed by Rebels.
  494. // Your village of <name name> has been destroyed by Fryhtans.
  495. //
  496. //----------------------------------------------//
  497. //
  498. // El <kingdom name> ha destruido tu aldea de <name name>.
  499. // Los Rebeldes han destruido tu aldea de <name name>.
  500. // Los Fryhtans han destruido tu aldea de <name name>.
  501. //
  502. //----------------------------------------------//
  503. str = "";
  504. switch( short_para2 )
  505. {
  506. case DESTROYER_NATION:
  507. str += "El ";
  508. str += nation_name2();
  509. str += " ha";
  510. break;
  511. case DESTROYER_REBEL:
  512. str += "Los Rebeldes han";
  513. break;
  514. case DESTROYER_MONSTER:
  515. str += "Los Fryhtans han";
  516. break;
  517. case DESTROYER_UNKNOWN:
  518. str += "";
  519. break;
  520. }
  521. str += " destruido tu aldea de ";
  522. str += town_res.get_name(short_para1);
  523. str += ".";
  524. }
  525. //------- End of function News::town_destroyed -----//
  526. //------ Begin of function News::town_abandoned -----//
  527. //
  528. // short_para1 - name id of the town
  529. //
  530. void News::town_abandoned()
  531. {
  532. //---------------- Text Format -----------------//
  533. //
  534. // Your village of <village name> has been abandoned by
  535. // its people.
  536. //
  537. //----------------------------------------------//
  538. //
  539. // Tu aldea de <village name> ha sido abandonada por
  540. // su gente.
  541. //
  542. //----------------------------------------------//
  543. str = "Tu aldea de ";
  544. str += town_res.get_name(short_para1);
  545. str += " ha sido abandonada por su gente.";
  546. }
  547. //------- End of function News::town_abandoned -----//
  548. //------ Begin of function News::town_surrendered -----//
  549. //
  550. // short_para1 - name id. of the surrendering town.
  551. //
  552. // nation_name1() - name of the nation the town surrenders to.
  553. // nation_name2() - name of the nation of the surrendering town.
  554. //
  555. void News::town_surrendered()
  556. {
  557. //---------------- Text Format -----------------//
  558. //
  559. // The village of <village name> in <King's Kingdom> has
  560. // surrendered to you.
  561. //
  562. // The independent village of <village name> has
  563. // surrendered to you.
  564. //
  565. // Your village of <village name> has surrendered
  566. // to <King's Kingdom>.
  567. //
  568. //----------------------------------------------//
  569. //
  570. // La aldea de <village name> del <King's Kingdom> se
  571. // te ha rendido.
  572. //
  573. // La aldea independiente de <village name> se
  574. // te ha rendido.
  575. //
  576. // Tu aldea de <village name> se ha rendido
  577. // al <King's Kingdom>.
  578. //
  579. //----------------------------------------------//
  580. if( nation_array.player_recno && nation_name_id2 == (~nation_array)->nation_name_id )
  581. {
  582. str = "Tu aldea de ";
  583. str += town_res.get_name(short_para1);
  584. str += " se ha rendido al ";
  585. str += nation_name1();
  586. str += ".";
  587. }
  588. else if( nation_name_id2 )
  589. {
  590. str = "La aldea de ";
  591. str += town_res.get_name(short_para1);
  592. str += " del ";
  593. str += nation_name2();
  594. str += " se te ha rendido.";
  595. }
  596. else // nation_name_id2 == 0, it's an independent town
  597. {
  598. str = "La aldea independiente de ";
  599. str += town_res.get_name(short_para1);
  600. str += " se te ha rendido.";
  601. }
  602. }
  603. //------- End of function News::town_surrendered -----//
  604. //------ Begin of function News::monster_king_killed -----//
  605. //
  606. // short_para1 - monster id.
  607. //
  608. void News::monster_king_killed()
  609. {
  610. //---------------- Text Format -----------------//
  611. //
  612. // An All High <monster type name> has been slain.
  613. //
  614. //----------------------------------------------//
  615. //
  616. // El Rey <monster type name> ha sido aniquilado.
  617. //
  618. //----------------------------------------------//
  619. str = "El Rey ";
  620. str += monster_res[short_para1]->name;
  621. str += " ha sido aniquilado.";
  622. }
  623. //------- End of function News::monster_king_killed -----//
  624. //------ Begin of function News::monster_firm_destroyed -----//
  625. //
  626. // short_para1 - monster id.
  627. //
  628. void News::monster_firm_destroyed()
  629. {
  630. //---------------- Text Format -----------------//
  631. //
  632. // A <monster type name> Lair has been destroyed.
  633. //
  634. //----------------------------------------------//
  635. //
  636. // Una Guarida <monster type name> ha sido destruida.
  637. //
  638. //----------------------------------------------//
  639. char* nameStr = monster_res[short_para1]->name;
  640. str = "Una Guarida ";
  641. str += nameStr;
  642. str += " ha sido destruida.";
  643. }
  644. //------- End of function News::monster_firm_destroyed -----//
  645. //------ Begin of function News::scroll_acquired -----//
  646. //
  647. // nation_name1() - the nation that has acquired the scroll.
  648. //
  649. // short_para1 = the race id. of the scroll.
  650. //
  651. void News::scroll_acquired()
  652. {
  653. //---------------- Text Format -----------------//
  654. //
  655. // You have acquired the <race name> Scroll of Power.
  656. // <nation name> has acquired the <race name> Scroll of Power.
  657. //
  658. //----------------------------------------------//
  659. //
  660. // Has conseguido el Pergamino del Poder <race name>.
  661. // El <nation name> ha conseguido el Pergamino del Poder <race name>.
  662. //
  663. //----------------------------------------------//
  664. if( nation_array.player_recno && nation_name_id1 == (~nation_array)->nation_name_id )
  665. {
  666. str = "Has";
  667. }
  668. else
  669. {
  670. str = "El ";
  671. str += nation_name1();
  672. str += " ha";
  673. }
  674. str += " conseguido el Pergamino del Poder ";
  675. str += race_res[short_para1]->adjective;
  676. }
  677. //------- End of function News::scroll_acquired -----//
  678. //------ Begin of function News::monster_gold_acquired -----//
  679. //
  680. // nation_name1() - the nation that has acquired the monster treasure.
  681. //
  682. // short_para1 = amount of gold.
  683. //
  684. void News::monster_gold_acquired()
  685. {
  686. //---------------- Text Format -----------------//
  687. //
  688. // Your have recovered <treasure amount> worth of treasure from the Fryhtans.
  689. //
  690. //----------------------------------------------//
  691. //
  692. // Has recuperado <treasure amount> del tesoro de los Fryhtans.
  693. //
  694. //----------------------------------------------//
  695. str = "Has recuperado ";
  696. str += m.format(short_para1,2);
  697. str += " del tesoro de los Fryhtans.";
  698. }
  699. //------- End of function News::monster_gold_acquired -----//
  700. //------ Begin of function News::your_spy_killed -----//
  701. //
  702. // nation_name1() - your nation.
  703. // nation_name2() - the nation that killed your spy.
  704. //
  705. // short_para1 - firm id. if it's a firm
  706. // 0 if it's a town
  707. // race id if spy place == SPY_MOBILE
  708. // short_para2 - the town id.
  709. // name id if spy place == SPY_MOBILE
  710. // short_para3 - spy place
  711. //
  712. void News::your_spy_killed()
  713. {
  714. //---------------- Text Format -----------------//
  715. //
  716. // Your spy has been exposed and executed on his mission to
  717. // <village name> [ in <nation name> ]. (no nation name for independent town.)
  718. //
  719. // Your spy has been exposed and executed on his mission to
  720. // a <firm type name> near <village name> in <nation name>.
  721. //
  722. // Your spy <spy name> has been exposed and executed on his mission to
  723. // <nation name>.
  724. //
  725. //----------------------------------------------//
  726. //
  727. // Tu espía ha sido descubierto y ejecutado en
  728. // <village name> [ del <nation name> ]. (no nation name for independent town.)
  729. //
  730. // Tu espía ha sido descubierto y ejecutado en
  731. // el/la <firm type name> cerca de <village name> del <nation name>.
  732. //
  733. // Tu espía <spy name> ha sido descubierto y ejecutado en
  734. // el <nation name>.
  735. //
  736. //----------------------------------------------//
  737. if( short_para3 == SPY_FIRM )
  738. {
  739. str = "Tu espía ha sido descubierto y ejecutado en la ";
  740. str += firm_res[short_para1]->name;
  741. str += " cerca de ";
  742. str += town_res.get_name(short_para2);
  743. if( nation_name_id2 ) // not for independent town.
  744. {
  745. str += " del ";
  746. str += nation_name2();
  747. }
  748. }
  749. else if( short_para3 == SPY_TOWN )
  750. {
  751. str = "Tu espía ha sido descubierto y ejecutado en ";
  752. str += town_res.get_name(short_para2);
  753. if( nation_name_id2 ) // not for independent town.
  754. {
  755. str += " del ";
  756. str += nation_name2();
  757. }
  758. }
  759. else if( short_para3 == SPY_MOBILE )
  760. {
  761. str = "Tu espía ";
  762. str += race_res[short_para1]->get_name(short_para2);
  763. str += " ha sido descubierto y ejecutado";
  764. if( nation_name_id2 ) // not for independent town.
  765. {
  766. str += " en el ";
  767. str += nation_name2();
  768. }
  769. }
  770. str += ".";
  771. }
  772. //------- End of function News::your_spy_killed -----//
  773. //------ Begin of function News::enemy_spy_killed -----//
  774. //
  775. // nation_name1() - your nation.
  776. // nation_name2() - the nation that the spy belongs to.
  777. //
  778. // short_para1 - firm id. if it's a firm
  779. // 0 if it's a town
  780. // short_para2 - town name id. if it's a town
  781. // 0 if it's a firm
  782. // short_para3 - id of the town where the firm is located.
  783. //
  784. void News::enemy_spy_killed()
  785. {
  786. //---------------- Text Format -----------------//
  787. //
  788. // A spy from <kingdom> has been uncovered and executed in your
  789. // <firm type> near <town name>.
  790. //
  791. // A spy from <kingdom> has been uncovered and executed in your
  792. // village of <town name>.
  793. //
  794. // Spy <spy name> from <kingdom> has been uncovered and executed.
  795. //
  796. //----------------------------------------------//
  797. //
  798. // Un espía del <kingdom> ha sido descubierto y ejecutado en tu
  799. // <firm type> cerca de <town name>.
  800. //
  801. // Un espía del <kingdom> ha sido descubierto y ejecutado en tu
  802. // aldea de <town name>.
  803. //
  804. // El espía <spy name> del <kingdom> ha sido descubierto y ejecutado.
  805. //
  806. //----------------------------------------------//
  807. if( short_para3==SPY_FIRM || short_para3==SPY_TOWN )
  808. {
  809. str = "Un espía del ";
  810. str += nation_name2();
  811. str += " ha sido descubierto y ejecutado en tu ";
  812. if( short_para3==SPY_FIRM )
  813. {
  814. str += firm_res[short_para1]->name;
  815. str += " cerca de ";
  816. str += town_res.get_name(short_para2);
  817. str += ".";
  818. }
  819. else
  820. {
  821. str += "aldea de ";
  822. str += town_res.get_name(short_para2);
  823. str += ".";
  824. }
  825. }
  826. else
  827. {
  828. err_when( short_para3 != SPY_MOBILE );
  829. str = "El espía ";
  830. str += race_res[short_para1]->get_name(short_para2);
  831. str += " del ";
  832. str += nation_name2();
  833. str += " ha sido descubierto y ejecutado.";
  834. }
  835. }
  836. //------- End of function News::enemy_spy_killed -----//
  837. //------ Begin of function News::unit_betray -----//
  838. //
  839. // Only for mobile units or generals in command base.
  840. //
  841. // nation_name1() - the nation that the unit originally belongs to.
  842. // nation_name2() - the nation that the unit has turned towards.
  843. //
  844. // short_para1 - race id. of the unit
  845. // short_para2 - name id. of the unit
  846. // short_para3 - rank id. of the unit
  847. //
  848. void News::unit_betray()
  849. {
  850. //---------------- Text Format -----------------//
  851. //
  852. // [General] <unit name> has betrayed you and turned towards
  853. // <nation name>.
  854. //
  855. // [General] <unit name> has renounced you and become independent.
  856. //
  857. // [General] <unit name> of <nation name> has defected to your
  858. // forces.
  859. //
  860. // Independent unit <unit name> has joined your forces.
  861. //
  862. //----------------------------------------------//
  863. //
  864. // [General] <unit name> te ha traicionado y se ha unido
  865. // al <nation name>.
  866. //
  867. // [General] <unit name> te ha abandonado y se ha hecho independiente.
  868. //
  869. // [General] <unit name> del <nation name> ha desertado a tu
  870. // ejército.
  871. //
  872. // <unit name>, unidad independiente, se ha unido a tu ejército.
  873. //
  874. //----------------------------------------------//
  875. if( nation_name_id1 == 0 ) // independent unit joining your force
  876. {
  877. str = race_res[short_para1]->get_name(short_para2);
  878. str += ", unidad independiente, se ha unido a tu ejército.";
  879. return;
  880. }
  881. //------------------------------------//
  882. str = "";
  883. if( short_para3==RANK_GENERAL )
  884. str += "General ";
  885. str += race_res[short_para1]->get_name(short_para2);
  886. //---------------------------------//
  887. if( nation_name_id2 == 0 ) // became an independent unit
  888. {
  889. str += " te ha abandonado y se ha hecho independiente.";
  890. }
  891. else
  892. {
  893. if( nation_array.player_recno && nation_name_id1 == (~nation_array)->nation_name_id )
  894. {
  895. str += " te ha traicionado y se ha unido al ";
  896. str += nation_name2();
  897. str += ".";
  898. }
  899. else
  900. {
  901. str += " del ";
  902. str += nation_name1();
  903. str += " ha desertado a tu ejército.";
  904. }
  905. }
  906. }
  907. //------- End of function News::unit_betray -----//
  908. //------ Begin of function News::general_die -----//
  909. //
  910. // short_para1 - race id. of your general
  911. // short_para2 - name id. of your general
  912. //
  913. void News::general_die()
  914. {
  915. //---------------- Text Format -----------------//
  916. //
  917. // Your general, <general name>, has been slain.
  918. //
  919. //----------------------------------------------//
  920. //
  921. // Tu General, <general name>, ha sido liquidado.
  922. //
  923. //----------------------------------------------//
  924. str = "Tu General, ";
  925. str += race_res[short_para1]->get_single_name( (WORD)short_para2 );
  926. str += ", ha sido liquidado.";
  927. }
  928. //------- End of function News::general_die -----//
  929. //------ Begin of function News::unit_assassinated -----//
  930. //
  931. // short_para1 - race id. of assassinated unit
  932. // short_para2 - name id. of assassinated unit
  933. // short_para3 - rank id. of assassinated unit
  934. // short_para4 - whether the enemy spy has been killed or not.
  935. //
  936. void News::unit_assassinated()
  937. {
  938. //---------------- Text Format -----------------//
  939. //
  940. // Your King, <king name>, has been assassinated by an enemy spy.
  941. // Your general, <general name>, has been assassinated by an enemy spy.
  942. //
  943. // [The enemy spy has been killed.]
  944. //
  945. //----------------------------------------------//
  946. //
  947. // Tu Rey, <king name>, ha sido asesinado por un espía enemigo.
  948. // Tu General, <general name>, ha sido asesinado por un espía enemigo.
  949. //
  950. // [El espía enemigo ha sido liquidado.]
  951. //
  952. //----------------------------------------------//
  953. if( short_para3 == RANK_KING )
  954. {
  955. str = "Tu Rey, ";
  956. str += race_res[short_para1]->get_single_name( (WORD)short_para2 );
  957. }
  958. else
  959. {
  960. str = "Tu General, ";
  961. str += race_res[short_para1]->get_single_name( (WORD)short_para2 );
  962. }
  963. str += ", ha sido asesinado por un espía enemigo.";
  964. if( short_para4 )
  965. str += " El espía enemigo ha sido liquidado.";
  966. }
  967. //------- End of function News::unit_assassinated -----//
  968. //------ Begin of function News::assassinator_caught -----//
  969. //
  970. // short_para1 - rank id. of the assassinating target.
  971. //
  972. void News::assassinator_caught()
  973. {
  974. //---------------- Text Format -----------------//
  975. //
  976. // An enemy spy has been killed while attempting
  977. // to assassinate your King/General.
  978. //
  979. //----------------------------------------------//
  980. //
  981. // Un espía enemigo ha sido liquidado mientras intentaba
  982. // asesinar a tu Rey/General.
  983. //
  984. //----------------------------------------------//
  985. str = "Un espía enemigo ha sido liquidado mientras intentaba asesinar a tu ";
  986. if( short_para1 == RANK_KING )
  987. str += "Rey.";
  988. else
  989. str += "General.";
  990. }
  991. //------- End of function News::assassinator_caught -----//
  992. //------ Begin of function News::raw_exhaust -----//
  993. //
  994. // short_para1 - raw id.
  995. //
  996. void News::raw_exhaust()
  997. {
  998. //---------------- Text Format -----------------//
  999. //
  1000. // Your <raw type> Mine has exhausted its <raw type> deposit.
  1001. //
  1002. //----------------------------------------------//
  1003. //
  1004. // Tu Mina de <raw type> ha agotado sus depósitos de <raw type>.
  1005. //
  1006. //----------------------------------------------//
  1007. str = "Tu Mina de ";
  1008. str += raw_res[short_para1]->name;
  1009. str += " ha agotado sus depósitos de ";
  1010. str += raw_res[short_para1]->name;
  1011. str += ".";
  1012. }
  1013. //------- End of function News::raw_exhaust -----//
  1014. //------ Begin of function News::tech_researched -----//
  1015. //
  1016. // short_para1 - tech id.
  1017. // short_para2 - tech version.
  1018. //
  1019. void News::tech_researched()
  1020. {
  1021. //---------------- Text Format -----------------//
  1022. //
  1023. // Your scientists have finished their <technology>
  1024. // [Mark <version>] research.
  1025. //
  1026. //----------------------------------------------//
  1027. //
  1028. // Tus científicos han terminado de investigar su <technology>
  1029. // [Marca <version>].
  1030. //
  1031. //----------------------------------------------//
  1032. str = "Tus científicos han terminado de investigar su ";
  1033. str += tech_res[short_para1]->tech_des();
  1034. if( tech_res[short_para1]->max_tech_level > 1 ) // if the tech has more than one level
  1035. {
  1036. str += " Marca ";
  1037. str += m.roman_number(short_para2);
  1038. }
  1039. str += ".";
  1040. }
  1041. //------- End of function News::tech_researched -----//
  1042. //------ Begin of function News::lightning_damage -----//
  1043. //
  1044. void News::lightning_damage()
  1045. {
  1046. //---------------- Text Format -----------------//
  1047. //
  1048. // Your <unit name> has been struck and injured/killed by lightning.
  1049. //
  1050. // Your <firm name> near <village name> has been struck/destroyed by lightning.
  1051. //
  1052. // Your village <village name> has been struck/destroyed by lightning.
  1053. //
  1054. //----------------------------------------------//
  1055. //
  1056. // Un rayo ha alcanzado a tu <unit name>, causando heridas/muerte.
  1057. //
  1058. // Un rayo ha alcanzado/destruido tu <firm name> cerca de <village name>.
  1059. //
  1060. // Un rayo ha alcanzado/destruido a tu aldea de <village name>.
  1061. //
  1062. //----------------------------------------------//
  1063. str = "";
  1064. switch( short_para1 )
  1065. {
  1066. case NEWS_LOC_UNIT:
  1067. str += "Un rayo ha alcanzado a tu ";
  1068. if( short_para4 == RANK_GENERAL )
  1069. str += "General ";
  1070. else if( short_para4 == RANK_KING )
  1071. str += "King ";
  1072. else
  1073. str += "unidad ";
  1074. if( short_para2 > 0 )
  1075. str += race_res[short_para2]->get_name((WORD) short_para3);
  1076. else
  1077. str += unit_res[short_para3]->name;
  1078. if( short_para5 )
  1079. str += ", causando muerte.";
  1080. else
  1081. str += ", causando heridas.";
  1082. break;
  1083. case NEWS_LOC_FIRM:
  1084. case NEWS_LOC_TOWN:
  1085. str += "Un rayo ha ";
  1086. if( short_para5 )
  1087. str += "destruido";
  1088. else
  1089. str += "alcanzado";
  1090. if( short_para1 == NEWS_LOC_FIRM )
  1091. {
  1092. str += " tu ";
  1093. str += firm_res[short_para2]->name;
  1094. if( short_para3 )
  1095. {
  1096. str += " cerca de ";
  1097. str += town_res.get_name(short_para3);
  1098. }
  1099. }
  1100. else if( short_para1 == NEWS_LOC_TOWN )
  1101. {
  1102. str += " a tu aldea de ";
  1103. str += town_res.get_name(short_para3);
  1104. }
  1105. str += ".";
  1106. default:
  1107. err_here();
  1108. }
  1109. }
  1110. //------- End of function News::lightning_damage -----//
  1111. //------ Begin of function News::earthquake_damage -----//
  1112. //
  1113. void News::earthquake_damage()
  1114. {
  1115. //---------------- Text Format -----------------//
  1116. //
  1117. // <number> of your units has/have been injured and <number> killed
  1118. // in an earthquake.
  1119. //
  1120. // <number> of your villagers has/have been killed in an earthquake.
  1121. //
  1122. // <number> of your buildings has/have been damaged and <number> destroyed
  1123. // in an earthquake.
  1124. //
  1125. //----------------------------------------------//
  1126. //
  1127. // <number> de tus unidades ha/han sido heridas y <number> muertas
  1128. // en un terremoto.
  1129. //
  1130. // <number> de tus aldeanos ha/han muerto en un terremoto.
  1131. //
  1132. // <number> de tus edificios ha/han sido dañados y <number> destruidos
  1133. // en un terremoto.
  1134. //
  1135. //----------------------------------------------//
  1136. int conjunction = 0;
  1137. str = "";
  1138. if( short_para1 == 1)
  1139. {
  1140. str += short_para2;
  1141. str += " de tus unidad";
  1142. if( short_para2 == 1)
  1143. str += " ha";
  1144. else
  1145. str += "es han";
  1146. str += " sido heridas";
  1147. if( short_para3 > 0)
  1148. {
  1149. str += " y ";
  1150. str += short_para3;
  1151. str += " muertas";
  1152. }
  1153. str += " en un terremoto.";
  1154. }
  1155. else if( short_para1 == 2 )
  1156. {
  1157. if( short_para2 > 0)
  1158. {
  1159. str += short_para2;
  1160. str += " de tus aldean";
  1161. if( short_para2 == 1)
  1162. str += " ha";
  1163. else
  1164. str += "os han";
  1165. str += " muerto en un terremoto.";
  1166. }
  1167. }
  1168. else if( short_para1 == 3)
  1169. {
  1170. str += short_para2;
  1171. str += " de tus edificio";
  1172. if( short_para2 == 1)
  1173. str += " ha";
  1174. else
  1175. str += "s han";
  1176. str += " sido dañados ";
  1177. if( short_para3 > 0)
  1178. {
  1179. str += " y ";
  1180. str += short_para3;
  1181. str += " destruidos";
  1182. }
  1183. str += " en un terremoto.";
  1184. }
  1185. else
  1186. err_here();
  1187. }
  1188. //------- End of function News::earthquake_damage -----//
  1189. //------ Begin of function News::goal_deadline -----//
  1190. //
  1191. // Display a warning message as the deadline of the goals approaches.
  1192. //
  1193. // short_para1 - years left before the deadline.
  1194. // short_para2 - months left before the deadline.
  1195. //
  1196. void News::goal_deadline()
  1197. {
  1198. //---------------- Text Format -----------------//
  1199. //
  1200. // Make haste! You have only <year> year[s] and <month> month[s]
  1201. // left to achieve your goal.
  1202. //
  1203. //----------------------------------------------//
  1204. //
  1205. // ¡Rápido! Sólo tienes <year> año[s] y <month> mes[es]
  1206. // para alcanzar tu objetivo.
  1207. //
  1208. //----------------------------------------------//
  1209. str = "¡Rápido! Sólo tienes ";
  1210. if( short_para1 )
  1211. {
  1212. str += short_para1;
  1213. if( short_para1 > 1 )
  1214. str += " años ";
  1215. else
  1216. str += " año ";
  1217. }
  1218. if( short_para1 && short_para2 )
  1219. str += "y ";
  1220. if( short_para2 )
  1221. {
  1222. str += short_para2;
  1223. if( short_para2 > 1 )
  1224. str += " meses ";
  1225. else
  1226. str += " mes ";
  1227. }
  1228. str += "para alcanzar tu objetivo.";
  1229. }
  1230. //------- End of function News::goal_deadline -----//
  1231. //------ Begin of function News::weapon_ship_worn_out -----//
  1232. //
  1233. // Your weapon or ship worn out and destroyed due to lack of money for
  1234. // maintenance.
  1235. //
  1236. // short_para1 - unit id. of the weapon
  1237. // short_para2 - level of the weapon
  1238. //
  1239. void News::weapon_ship_worn_out()
  1240. {
  1241. //---------------- Text Format -----------------//
  1242. //
  1243. // A <weapon name> <weapon level> of yours has broken
  1244. // down due to the lack of maintenance funds.
  1245. //
  1246. //----------------------------------------------//
  1247. //
  1248. // Una de tus armas, <weapon name> <weapon level>, se ha desmoronado
  1249. // por falta de fondos de mantenimiento.
  1250. //
  1251. //----------------------------------------------//
  1252. str = "Una de tus armas, ";
  1253. str += unit_res[short_para1]->name;
  1254. if( short_para2 )
  1255. {
  1256. str += " ";
  1257. str += m.roman_number(short_para2);
  1258. }
  1259. str += ", se ha desmoronado por falta de fondos de mantenimiento.";
  1260. }
  1261. //------- End of function News::weapon_ship_worn_out -----//
  1262. //------ Begin of function News::firm_worn_out -----//
  1263. //
  1264. // short_para1 - id. of the firm destroyed.
  1265. // short_para2 - id of the town where the firm is located.
  1266. //
  1267. void News::firm_worn_out()
  1268. {
  1269. //---------------- Text Format -----------------//
  1270. //
  1271. // Your <firm type> near <town name> has fallen into
  1272. // disrepair due to the lack of maintenance funds.
  1273. //
  1274. //----------------------------------------------//
  1275. //
  1276. // Tu <firm type> cerca de <town name> está en ruinas
  1277. // por falta de fondos de mantenimiento.
  1278. //
  1279. //----------------------------------------------//
  1280. str = "Tu ";
  1281. str += firm_res[short_para1]->name;
  1282. str += " cerca de ";
  1283. str += town_res.get_name(short_para2);
  1284. str += " está en ruinas por falta de fondos de mantenimiento.";
  1285. }
  1286. //------- End of function News::firm_worn_out -----//
  1287. //------ Begin of function News::chat_msg -----//
  1288. //
  1289. // short_para1 - id. of the chat msg in Info::remote_chat_str_array[]
  1290. //
  1291. // nation_name1() - the nation from which this chat message is sent.
  1292. //
  1293. void News::chat_msg()
  1294. {
  1295. str = info.remote_chat_array[short_para1-1].chat_str;
  1296. }
  1297. //------- End of function News::chat_msg -----//
  1298. //------ Begin of function News::multi_retire -----//
  1299. //
  1300. // This function is called when a human player retires.
  1301. //
  1302. // nation_name1() - the nation that has retired.
  1303. //
  1304. void News::multi_retire()
  1305. {
  1306. //---------------- Text Format -----------------//
  1307. //
  1308. // <Kingdom name> has retired and quited the game.
  1309. //
  1310. //----------------------------------------------//
  1311. //
  1312. // El <Kingdom name> se ha retirado y abandonado el juego.
  1313. //
  1314. //----------------------------------------------//
  1315. str = "El ";
  1316. str += nation_name1();
  1317. str += " se ha retirado y abandonado el juego.";
  1318. }
  1319. //------- End of function News::multi_retire -----//
  1320. //------ Begin of function News::multi_quit_game -----//
  1321. //
  1322. // This function is called when a human player quits the game.
  1323. //
  1324. void News::multi_quit_game()
  1325. {
  1326. //---------------- Text Format -----------------//
  1327. //
  1328. // <Kingdom name> has quited the game.
  1329. //
  1330. //----------------------------------------------//
  1331. //
  1332. // El <Kingdom name> ha abandonado el juego.
  1333. //
  1334. //----------------------------------------------//
  1335. str = "El ";
  1336. str += nation_name1();
  1337. str += " ha abandonado el juego.";
  1338. }
  1339. //------- End of function News::multi_quit_game -----//
  1340. //------ Begin of function News::multi_save_game -----//
  1341. //
  1342. // This function is called when a human player calls for saving the game.
  1343. //
  1344. void News::multi_save_game()
  1345. {
  1346. //---------------- Text Format -----------------//
  1347. //
  1348. // The current game has been saved to <file name>.
  1349. //
  1350. //----------------------------------------------//
  1351. //
  1352. // El juego actual se ha guardado en <file name>.
  1353. //
  1354. //----------------------------------------------//
  1355. str = "El juego actual se ha guardado en ";
  1356. str += remote.save_file_name;
  1357. str += ".";
  1358. }
  1359. //------- End of function News::multi_save_game -----//
  1360. //------ Begin of function News::multi_connection_lost -----//
  1361. //
  1362. // This function is called when a human player's connection has been lost.
  1363. //
  1364. void News::multi_connection_lost()
  1365. {
  1366. //---------------- Text Format -----------------//
  1367. //
  1368. // The connectino with <kingdom name> has been lost.
  1369. //
  1370. //----------------------------------------------//
  1371. //
  1372. // Se ha perdido la conexión con el <kingdom name>.
  1373. //
  1374. //----------------------------------------------//
  1375. str = "Se ha perdido la conexión con el ";
  1376. str += nation_name1();
  1377. str += ".";
  1378. }
  1379. //------- End of function News::multi_connection_lost -----//
  1380. //------ Begin of function News::nation_name1 -----//
  1381. //
  1382. char* News::nation_name1()
  1383. {
  1384. static String str;
  1385. str = "Reino de ";
  1386. if( nation_name_id1 < 0 ) // human player - custom name
  1387. str += nation_array.get_human_name(nation_name_id1, 1); // 1-first word of the name only
  1388. else
  1389. str += race_res[nation_race_id1]->get_single_name( (WORD)nation_name_id1 );
  1390. //------ add color bar -------//
  1391. char colorCodeStr[] = " 0";
  1392. colorCodeStr[1] = FIRST_NATION_COLOR_CODE_IN_TEXT + nation_color1;
  1393. str += colorCodeStr;
  1394. return str;
  1395. }
  1396. //------- End of function News::nation_name1 -----//
  1397. //------ Begin of function News::nation_name2 -----//
  1398. //
  1399. char* News::nation_name2()
  1400. {
  1401. static String str;
  1402. str = "Reino de ";
  1403. if( nation_name_id2 < 0 ) // human player - custom name
  1404. str += nation_array.get_human_name(nation_name_id2, 1); // 1-first word of the name only
  1405. else
  1406. str += race_res[nation_race_id2]->get_single_name( (WORD)nation_name_id2 );
  1407. //------ add color bar -------//
  1408. char colorCodeStr[] = " 0";
  1409. colorCodeStr[1] = FIRST_NATION_COLOR_CODE_IN_TEXT + nation_color2;
  1410. str += colorCodeStr;
  1411. return str;
  1412. }
  1413. //------- End of function News::nation_name2 -----//
  1414. //------ Begin of function News::king_name1 -----//
  1415. //
  1416. // [int] addColor - add color bar at the end of the king name
  1417. // (default: 0)
  1418. //
  1419. char* News::king_name1(int addColor)
  1420. {
  1421. static String str;
  1422. if( nation_name_id1 < 0 ) // human player - custom name
  1423. str = nation_array.get_human_name(nation_name_id1);
  1424. else
  1425. str = race_res[nation_race_id1]->get_name( (WORD)nation_name_id1 );
  1426. //------ add color bar -------//
  1427. if( addColor )
  1428. {
  1429. char colorCodeStr[] = " 0";
  1430. colorCodeStr[1] = FIRST_NATION_COLOR_CODE_IN_TEXT + nation_color1;
  1431. str += colorCodeStr;
  1432. }
  1433. return str;
  1434. }
  1435. //------- End of function News::king_name1 -----//
  1436. //------ Begin of function News::king_name2 -----//
  1437. //
  1438. // [int] addColor - add color bar at the end of the king name
  1439. // (default: 0)
  1440. //
  1441. char* News::king_name2(int addColor)
  1442. {
  1443. static String str;
  1444. if( nation_name_id2 < 0 ) // human player - custom name
  1445. str = nation_array.get_human_name(nation_name_id2);
  1446. else
  1447. str = race_res[nation_race_id2]->get_name( (WORD)nation_name_id2 );
  1448. //------ add color bar -------//
  1449. if( addColor )
  1450. {
  1451. char colorCodeStr[] = " 0";
  1452. colorCodeStr[1] = FIRST_NATION_COLOR_CODE_IN_TEXT + nation_color2;
  1453. str += colorCodeStr;
  1454. }
  1455. return str;
  1456. }
  1457. //------- End of function News::king_name2 -----//
  1458. #endif