Advertisement
Guest User

Untitled

a guest
Sep 9th, 2015
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 57.65 KB | None | 0 0
  1. /*
  2.  
  3. Copyright (c) 2002,2003,2004 by Tarn Adams //
  4. //
  5. This file is part of Liberal Crime Squad. //
  6. //
  7. Liberal Crime Squad is free software; you can redistribute it and/or modify //
  8. it under the terms of the GNU General Public License as published by //
  9. the Free Software Foundation; either version 2 of the License, or //
  10. (at your option) any later version. //
  11. //
  12. Liberal Crime Squad is distributed in the hope that it will be useful, //
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of //
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
  15. GNU General Public License for more details. //
  16. //
  17. You should have received a copy of the GNU General Public License //
  18. along with Liberal Crime Squad; if not, write to the Free Software //
  19. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
  20. */
  21.  
  22. /*
  23. This file was created by Chris Johnson (grundee@users.sourceforge.net)
  24. by copying code from game.cpp.
  25. To see descriptions of files and functions, see the list at
  26. the bottom of includes.h in the top src folder.
  27. */
  28.  
  29. // Note: this file is encoded in the PC-8 / Code Page 437 / OEM-US character set
  30. // (The same character set used by Liberal Crime Squad when it is running)
  31. // Certain special characters won't display correctly unless your text editor is
  32. // set to use that character set, such as this e with an accent: ‚
  33.  
  34. // In Windows Notepad with the Terminal font, OEM/DOS encoding it should work fine.
  35. // You can set this in Notepad by going to Format->Font and choosing the Terminal font,
  36. // then choosing OEM/DOS in the Script dropdown box.
  37.  
  38. // In Notepad++ go to the Encoding menu, Character sets, Western European, OEM-US... easy!
  39.  
  40. // In Code::Blocks's editor go to Settings->Editor->the Other Settings tab and
  41. // then pick WINDOWS-437 from the dropdown box and then choose the radio button
  42. // to make this the default encoding and disable auto-detection of the encoding.
  43. // Then close the file and reopen it (since Code::Blocks detects the encoding
  44. // when it opens the file and it can't be changed after that; what we changed was
  45. // how it detects encoding for files it opens in the future, not files already open).
  46.  
  47. // In Microsoft Visual C++, right-click the file in the Solution Explorer,
  48. // select "Open With...", choose "C++ Source Code Editor (with encoding)",
  49. // then choose "OEM United States - Codepage 437".
  50.  
  51. // In MS-DOS Editor (included with Windows as EDIT.COM in your system32 directory),
  52. // the codepage will be correct already since it's running in a console window just
  53. // like Liberal Crime Squad. Well OK, the encoding might be wrong, but then it's wrong
  54. // in Liberal Crime Squad TOO, and to fix it, go to Control Panel, Regional and Language Settings,
  55. // Advanced tab, and choose English (United States) from the dropdown box as the encoding
  56. // for non-Unicode applications, then press OK.
  57.  
  58. // If you have a Linux or other UNIX-based system you are obviously smart enough
  59. // to figure out for yourself how to open a file in OEM-US PC-8 codepage 437 in
  60. // your favorite text editor. If you're on Mac OS X, well that's UNIX-based, figure
  61. // it out for yourself.
  62.  
  63. #include <externs.h>
  64.  
  65. // This is the lesson data for the University. Keep data_lesson_num matching the number of classes on offer. The code handles the rest.
  66. const int data_lesson_num = 15;
  67. struct data_lesson { char *label; int code; data_lesson(int _code, char *_label) : code(_code), label(_label) {} }
  68. data_lessons[data_lesson_num] = // format is activity-code, menu-label
  69. {
  70. data_lesson(ACTIVITY_STUDY_DEBATING, "Public Policy"),
  71. data_lesson(ACTIVITY_STUDY_BUSINESS, "Economics"),
  72. data_lesson(ACTIVITY_STUDY_PSYCHOLOGY, "Psychology"),
  73. data_lesson(ACTIVITY_STUDY_LAW, "Criminal Law"),
  74. data_lesson(ACTIVITY_STUDY_SCIENCE, "Physics"),
  75. data_lesson(ACTIVITY_STUDY_DRIVING, "Drivers Ed"),
  76. data_lesson(ACTIVITY_STUDY_FIRST_AID, "First Aid"),
  77. data_lesson(ACTIVITY_STUDY_ART, "Painting"),
  78. data_lesson(ACTIVITY_STUDY_DISGUISE, "Theatre"),
  79. data_lesson(ACTIVITY_STUDY_MARTIAL_ARTS,"Kung Fu"),
  80. data_lesson(ACTIVITY_STUDY_GYMNASTICS, "Gymnastics"),
  81. data_lesson(ACTIVITY_STUDY_WRITING, "Writing"),
  82. data_lesson(ACTIVITY_STUDY_TEACHING, "Education"),
  83. data_lesson(ACTIVITY_STUDY_MUSIC, "Music"),
  84. data_lesson(ACTIVITY_STUDY_LOCKSMITHING,"Locksmithing")
  85. };
  86.  
  87. // this data struct is for activities, it relates to their info text and a couple of other things to avoid needing big switches in the code
  88. struct data_activity
  89. {
  90. bool show_name;
  91. int code, key, skill;
  92. char *_line[3];
  93.  
  94. data_activity(int _code, char _key, bool _show_name, char *_line0, char *_line1 = "", char *_line2 = "", int _skill = -1) : code(_code), key(_key), show_name(_show_name), skill(_skill)
  95. {
  96. _line[0] = _line0; _line[1] = _line1; _line[2] = _line2;
  97. }
  98.  
  99. char *line(int row, Creature *cr)
  100. {
  101. if (skill < 0) return _line[row];
  102. else
  103. {
  104. if (row > 0) return "";
  105. if (cr->get_skill(skill) >= 8) return _line[2];
  106. if (cr->get_skill(skill) >= 4) return _line[1];
  107. return _line[0];
  108. }
  109. }
  110. };
  111.  
  112. char *study_string1 = " will attend classes in the University District";
  113. char *study_string2 = " at a cost of $60 a day.";
  114.  
  115. // this is the string data for activities. they write up to three lines of text about the activity
  116. // the ones with a skill on the end (e.g. ACTIVITY_SELL_ART, ACTIVITY_SELL_MUSIC) pick one of the three lines of text based on the skill in question
  117. // format is <activity_code>, <menu_key>, <show_name>, <text lines 1-3>, <skill>
  118. data_activity data_activities[] =
  119. {
  120. data_activity(ACTIVITY_COMMUNITYSERVICE,'a', true, " help the elderly, local library, anything", " that is Liberal."),
  121. data_activity(ACTIVITY_TROUBLE, 'a', true, " create public disturbances. "),
  122. data_activity(ACTIVITY_GRAFFITI, 'a', true, " spray political graffiti. Art and Heart will", " enhance the liberal effect."),
  123. data_activity(ACTIVITY_POLLS, 'a', true, " search the internet for public opinion polls.", " Polls will give an idea on how the liberal agenda is going. Computers", " and intelligence will provide better results."),
  124. data_activity(ACTIVITY_DOS_ATTACKS, 'a', true, " harass Conservative websites. Computer skill", " will give greater effect."),
  125. data_activity(ACTIVITY_HACKING, 'a', true, " harass websites and hack private networks.", " Computer skill and intelligence will give more frequent results.", " Multiple hackers will increase chances of both success and detection."),
  126. data_activity(ACTIVITY_WRITE_LETTERS, 'a', true, " write letters to newspapers about current events."),
  127. data_activity(ACTIVITY_WRITE_GUARDIAN, 'a', true, " write articles for the LCS's newspaper."),
  128. data_activity(ACTIVITY_DONATIONS, 'b', true, " walk around and ask for donations to the LCS.", " Based on persuasion, public's view on the cause, and how well dressed the", " activist is."),
  129. data_activity(ACTIVITY_SELL_TSHIRTS, 'b', true, " tie-dye T-shirts and sell them on the street.", " will embroider shirts and sell them on the street.", " will print and distribute shirts with Liberal slogans.", SKILL_TAILORING),
  130. data_activity(ACTIVITY_SELL_ART, 'b', true, " sketch people and sell portraits back to them.", " will make pretty paintings and sell them on the streets.", " will create and sell paintings embracing the Liberal agenda.", SKILL_ART),
  131. data_activity(ACTIVITY_SELL_MUSIC, 'b', true, " go out into the streets and drum on buckets,", " or play guitar if one is equipped."),
  132. data_activity(ACTIVITY_SELL_DRUGS, 'c', true, " bake and sell special adult brownies that open", " magical shimmering doorways to the adamantium pits."),
  133. data_activity(ACTIVITY_PROSTITUTION, 'c', true, " trade sex for money."),
  134. data_activity(ACTIVITY_CCFRAUD, 'c', true, " commit credit card fraud online."),
  135. data_activity(ACTIVITY_DOS_RACKET, 'c', true, " demand money in exchange for not bringing down", "major websites."),
  136. data_activity(ACTIVITY_RECRUITING, 'd', true, " try to find someone to join the LCS."),
  137. data_activity(ACTIVITY_STEALCARS, 'd', true, " try to find and steal a car."),
  138. data_activity(ACTIVITY_MAKE_ARMOR, 'd', true, ""), // did not have any strings listed
  139. data_activity(ACTIVITY_REPAIR_ARMOR, 'd', true, ""), // did not have any strings listed
  140. data_activity(ACTIVITY_WHEELCHAIR, 'd', true, ""), // did not have any strings listed
  141. data_activity(ACTIVITY_HEAL, 'h', true, ""), // did not have any strings listed
  142. data_activity(ACTIVITY_HOSTAGETENDING, 'i', true, ""), // did not have any strings listed
  143. data_activity(ACTIVITY_CLINIC, 'm', true, ""), // did not have any strings listed
  144. data_activity(ACTIVITY_BURY, 'z', true, ""), // did not have any strings listed
  145. data_activity(ACTIVITY_TEACH_POLITICS, 't', false, " Skills Trained: Writing, Persuasion, Law, Street Sense, Science,", " Religion, Business, Music, Art", " Classes cost up to $20/day to conduct. All Liberals able will attend."),
  146. data_activity(ACTIVITY_TEACH_COVERT, 't', false, " Skills Trained: Computers, Security, Stealth, Disguise, Tailoring,", " Seduction, Psychology, Driving", " Classes cost up to $60/day to conduct. All Liberals able will attend."),
  147. data_activity(ACTIVITY_TEACH_FIGHTING, 't', false, " Skills Trained: All Weapon Skills, Martial Arts, Dodge, First Aid", "", " Classes cost up to $100/day to conduct. All Liberals able will attend."),
  148. data_activity(ACTIVITY_STUDY_DEBATING, 'l', true, study_string1, study_string2),
  149. data_activity(ACTIVITY_STUDY_MARTIAL_ARTS, 'l', true, study_string1, study_string2),
  150. data_activity(ACTIVITY_STUDY_DRIVING, 'l', true, study_string1, study_string2),
  151. data_activity(ACTIVITY_STUDY_PSYCHOLOGY, 'l', true, study_string1, study_string2),
  152. data_activity(ACTIVITY_STUDY_FIRST_AID, 'l', true, study_string1, study_string2),
  153. data_activity(ACTIVITY_STUDY_LAW, 'l', true, study_string1, study_string2),
  154. data_activity(ACTIVITY_STUDY_DISGUISE, 'l', true, study_string1, study_string2),
  155. data_activity(ACTIVITY_STUDY_SCIENCE, 'l', true, study_string1, study_string2),
  156. data_activity(ACTIVITY_STUDY_BUSINESS, 'l', true, study_string1, study_string2),
  157. // data_activity(ACTIVITY_STUDY_COOKING,'l', true,study_string1, study_string2),
  158. data_activity(ACTIVITY_STUDY_GYMNASTICS, 'l', true, study_string1, study_string2),
  159. data_activity(ACTIVITY_STUDY_WRITING, 'l', true, study_string1, study_string2),
  160. data_activity(ACTIVITY_STUDY_ART, 'l', true, study_string1, study_string2),
  161. data_activity(ACTIVITY_STUDY_MUSIC, 'l', true, study_string1, study_string2),
  162. data_activity(ACTIVITY_STUDY_TEACHING, 'l', true, study_string1, study_string2),
  163. data_activity(ACTIVITY_STUDY_LOCKSMITHING, 'l', true, study_string1, study_string2),
  164. data_activity(ACTIVITY_NONE, 'x', false, "") // indicates the end of the list
  165. };
  166.  
  167. data_activity &get_activity(int code) // function gets the activity struct based on the activity code
  168. {
  169. int index = 0;
  170. while (data_activities[index].code != code && data_activities[index].code != ACTIVITY_NONE) index++;
  171. return data_activities[index];
  172. }
  173.  
  174. enum // these codes are used to add special checks to what you're allowed to pick in activity menus
  175. {
  176. ACTIVITIY_MENU_CHECK_NONE,
  177. ACTIVITIY_MENU_CHECK_PRESS,
  178. ACTIVITIY_MENU_CHECK_AGE,
  179. ACTIVITIY_MENU_CHECK_CAN_WALK,
  180. ACTIVITIY_MENU_CHECK_WHEELCHAIR
  181. };
  182.  
  183. // here we pull out the data for the activate menus. Compacts the code and makes it much easier to mod the system
  184. struct activate_menu_item
  185. {
  186. char key_group, key; // which letter key it belongs to, and which key for this menu item
  187. char *_label[3];
  188. int code;
  189. char check;
  190. int skill;
  191.  
  192. // basic version
  193. activate_menu_item(char _key_group, char _key, int _code, char* _label1, char _check = ACTIVITIY_MENU_CHECK_NONE) : key_group(_key_group), key(_key), code(_code), check(_check), skill(-1)
  194. {
  195. _label[0] = _label1;
  196. }
  197.  
  198. // variable skill-based text version
  199. activate_menu_item(char _key_group, char _key, int _code, char* _label1, char* _label2, char* _label3, int _skill) : key_group(_key_group), key(_key), code(_code), check(ACTIVITIY_MENU_CHECK_NONE), skill(_skill)
  200. {
  201. _label[0] = _label1;
  202. _label[1] = _label2;
  203. _label[2] = _label3;
  204. }
  205.  
  206. bool ok(Creature *cr)
  207. {
  208. switch(check)
  209. {
  210. case ACTIVITIY_MENU_CHECK_NONE: return true;
  211. case ACTIVITIY_MENU_CHECK_PRESS: return (cr->location != -1 && location[cr->location]->compound_walls & COMPOUND_PRINTINGPRESS);
  212. case ACTIVITIY_MENU_CHECK_CAN_WALK: return cr->canwalk();
  213. case ACTIVITIY_MENU_CHECK_WHEELCHAIR: return (!cr->canwalk()) && (!cr->flag&CREATUREFLAG_WHEELCHAIR);
  214. case ACTIVITIY_MENU_CHECK_AGE:
  215. #ifndef ZEROMORAL
  216. return (cr->age >= 18);
  217. #else
  218. return true;
  219. #endif
  220. }
  221. }
  222.  
  223. char *label(Creature *cr)
  224. {
  225. if(skill < 0) return _label[0];
  226. if (cr->get_skill(skill) >= 8) return _label[2];
  227. if (cr->get_skill(skill) >= 4) return _label[1];
  228. return _label[0];
  229. }
  230. };
  231.  
  232. // This will be used to replace the menu items that are currently generate by a switch.
  233. // It's not fully implemented yet, so the existing switch statement is still active, and this code does nothing
  234. vector<activate_menu_item> activate_menu_items =
  235. {
  236. activate_menu_item('a', '1', ACTIVITY_COMMUNITYSERVICE, "Community Service" ),
  237. activate_menu_item('a', '2', ACTIVITY_TROUBLE, "Liberal Disobedience" ),
  238. activate_menu_item('a', '3', ACTIVITY_GRAFFITI, "Graffiti" ),
  239. activate_menu_item('a', '4', ACTIVITY_POLLS, "Search Opinion Polls" ),
  240. //activate_menu_item('a', '5', ACTIVITY_DOS_ATTACKS, "Harass Websites"),
  241. activate_menu_item('a', '5', ACTIVITY_HACKING, "Hacking" ),
  242. activate_menu_item('a', '6', ACTIVITY_WRITE_LETTERS, "Write to Newspapers"),
  243. activate_menu_item('a', '7', ACTIVITY_WRITE_GUARDIAN, "Write for The Liberal Guardian", ACTIVITIY_MENU_CHECK_PRESS), //
  244. activate_menu_item('b', '1', ACTIVITY_DONATIONS, "Solicit Donations"),
  245. activate_menu_item('b', '2', ACTIVITY_SELL_TSHIRTS, "Sell Tie-Dyed T-Shirts", "Sell Embroidered Shirts", "Sell Liberal T-Shirts", SKILL_TAILORING),
  246. activate_menu_item('b', '3', ACTIVITY_SELL_ART, "Sell Portrait Sketches", "Sell Paintings", "Sell Liberal Art", SKILL_ART),
  247. activate_menu_item('b', '4', ACTIVITY_SELL_MUSIC, "Play Street Music", "Play Street Music", "Play Liberal Music", SKILL_MUSIC),
  248. activate_menu_item('c', '1', ACTIVITY_SELL_DRUGS, "Sell Brownies"),
  249. activate_menu_item('c', '2', ACTIVITY_PROSTITUTION, "Prostitution", ACTIVITIY_MENU_CHECK_AGE),
  250. activate_menu_item('c', '3', ACTIVITY_CCFRAUD, "Steal Credit Card Numbers"),
  251. // activate_menu_item('c', '4', ACTIVITY_DOS_RACKET, "Electronic Protection Racket"),
  252. activate_menu_item('d', '1', ACTIVITY_RECRUITING, "Recruiting"),
  253. activate_menu_item('d', '2', ACTIVITY_MAKE_ARMOR, "Make Clothing"),
  254. activate_menu_item('d', '3', ACTIVITY_REPAIR_ARMOR, "Repair Clothing"),
  255. activate_menu_item('d', '4', ACTIVITY_STEALCARS, "Steal a Car", ACTIVITIY_MENU_CHECK_CAN_WALK),
  256. activate_menu_item('d', '4', ACTIVITY_WHEELCHAIR, "Procure a Wheelchair", ACTIVITIY_MENU_CHECK_WHEELCHAIR),
  257. activate_menu_item('t', 0, ACTIVITY_NONE, "Teach Liberals About What?"),
  258. activate_menu_item('t', '1', ACTIVITY_TEACH_POLITICS, "Political Activism"),
  259. activate_menu_item('t', '2', ACTIVITY_TEACH_COVERT, "Infiltration"),
  260. activate_menu_item('t', '3', ACTIVITY_TEACH_FIGHTING, "Urban Warfare")
  261. };
  262.  
  263. vector<Creature *> activatable_liberals()
  264. {
  265. vector<Creature *> temppool;
  266. for (int p = 0; p < len(pool); p++)
  267. {
  268. if (pool[p]->is_active_liberal())
  269. {
  270. if (pool[p]->squadid != -1)
  271. {
  272. int sq = getsquad(pool[p]->squadid);
  273. if (sq != -1) if (squad[sq]->activity.type != ACTIVITY_NONE) continue;
  274. }
  275. temppool.push_back(pool[p]);
  276. }
  277. }
  278. return temppool;
  279. }
  280.  
  281. /* base - activate the uninvolved */
  282. void activate()
  283. {
  284. vector<Creature *> temppool = activatable_liberals();
  285.  
  286. if(!len(temppool)) return;
  287.  
  288. sortliberals(temppool,activesortingchoice[SORTINGCHOICE_ACTIVATE]);
  289.  
  290. int page=0;
  291.  
  292. while(true)
  293. {
  294. music.play(MUSIC_ACTIVATE);
  295. erase();
  296.  
  297. set_color(COLOR_WHITE,COLOR_BLACK,0);
  298. printfunds();
  299.  
  300. mvaddstr(0,0, "Activate Uninvolved Liberals");
  301. mvaddstr(1,0, "ÄÄÄÄCODE NAMEÄÄÄÄÄÄÄÄÄÄÄÄSKILLÄÄÄHEALTHÄÄÄLOCATIONÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ");
  302. mvaddstr(1,57,"ACTIVITY");
  303.  
  304. int y=2;
  305. for(int p=page*19;p<len(temppool)&&p<page*19+19;p++,y++)
  306. {
  307. set_color(COLOR_WHITE,COLOR_BLACK,0);
  308. move(y,0);
  309. addchar(y+'A'-2);addstr(" - ");
  310. addstr(temppool[p]->name);
  311.  
  312. char bright=0;
  313. int skill=0;
  314. for(int sk=0;sk<SKILLNUM;sk++)
  315. {
  316. skill+=temppool[p]->get_skill(sk);
  317. if(temppool[p]->get_skill_ip(sk)>=100+(10*temppool[p]->get_skill(sk))&&
  318. temppool[p]->get_skill(sk)<temppool[p]->skill_cap(sk,true))bright=1;
  319. }
  320.  
  321. set_color(COLOR_WHITE,COLOR_BLACK,bright);
  322.  
  323. mvaddstr(y,25, skill);
  324.  
  325. printhealthstat(*temppool[p],y,33,TRUE);
  326.  
  327. if(mode==REVIEWMODE_JUSTICE)set_color(COLOR_YELLOW,COLOR_BLACK,1);
  328. else set_color(COLOR_WHITE,COLOR_BLACK,0);
  329. mvaddstr(y,42, location[temppool[p]->location]->getname(true, true));
  330.  
  331. move(y,57);
  332. // Let's add some color here...
  333. set_activity_color(temppool[p]->activity.type);
  334. addstr(getactivity(temppool[p]->activity));
  335. }
  336.  
  337. set_color(COLOR_WHITE,COLOR_BLACK,0);
  338. mvaddstr(22,0, "Press a Letter to Assign an Activity.");
  339. move(23,0);
  340. addpagestr();
  341. addstr(" T to sort people.");
  342. mvaddstr(24,0, "Press Z to assign simple tasks in bulk.");
  343.  
  344. int c=getkey();
  345.  
  346. //PAGE UP
  347. if((c==interface_pgup||c==KEY_UP||c==KEY_LEFT)&&page>0) page--;
  348. //PAGE DOWN
  349. if((c==interface_pgdn||c==KEY_DOWN||c==KEY_RIGHT)&&(page+1)*19<len(temppool)) page++;
  350.  
  351. if(c>='a'&&c<='s')
  352. {
  353. int p=page*19+c-'a';
  354. if(p<len(temppool)) activate(temppool[p]);
  355. }
  356.  
  357. if(c=='t')
  358. {
  359. sorting_prompt(SORTINGCHOICE_ACTIVATE);
  360. sortliberals(temppool,activesortingchoice[SORTINGCHOICE_ACTIVATE],true);
  361. }
  362.  
  363. if(c=='z') activatebulk();
  364.  
  365. if(c=='x'||c==ENTER||c==ESC||c==SPACEBAR) break;
  366. }
  367. }
  368.  
  369. // These two functions handle listing and updating class choices
  370. int classlist=0;
  371. void listclasses(Creature *cr)
  372. {
  373. set_color(COLOR_WHITE,COLOR_BLACK,0);
  374. mvaddstr(10,40, "Classes cost $60 a day. Study what?");
  375. for (int i = 0; i < 5; ++i)
  376. {
  377. if (i + classlist < data_lesson_num)
  378. {
  379. set_color(COLOR_WHITE, COLOR_BLACK, cr->activity.type == data_lessons[i + classlist].code);
  380. mvaddstr(12 + i, 40, to_string(i + 1).c_str());
  381. addstr(" - "); addstr(data_lessons[i + classlist].label);
  382. }
  383. }
  384. set_color(COLOR_WHITE, COLOR_BLACK, 0);
  385. mvaddstr(17, 40, "6 - Other classes");
  386. }
  387.  
  388. void updateclasschoice(Creature *cr, char choice)
  389. {
  390. if (choice >= '1' && choice <= '5')
  391. {
  392. if (choice - '1' + classlist < data_lesson_num)
  393. cr->activity.type = data_lessons[choice - '1' + classlist].code;
  394. listclasses(cr);
  395. }
  396. else if (choice == '6')
  397. {
  398. classlist += 5;
  399. if (classlist >= data_lesson_num)
  400. classlist = 0;
  401. listclasses(cr);
  402. }
  403. }
  404.  
  405. void activate(Creature *cr)
  406. {
  407. int hostagecount=0,state=0,oldstate=0,choice=0;
  408. char havedead=0;
  409. for(int p=0;p<len(pool);p++)
  410. {
  411. if(pool[p]->alive&&pool[p]->align!=1&&pool[p]->location==cr->location) hostagecount++;
  412. if(!pool[p]->alive) havedead=1;
  413. }
  414.  
  415. while(true)
  416. {
  417. erase();
  418.  
  419. set_color(COLOR_WHITE,COLOR_BLACK,0);
  420. printfunds();
  421.  
  422. move(0,0);
  423. if(cr->income)
  424. {
  425. addstr(cr->name);
  426. addstr(" made $");
  427. addstr(cr->income);
  428. addstr(" yesterday. What now?");
  429. }
  430. else
  431. {
  432. addstr("Taking Action: What will ");
  433. addstr(cr->name);
  434. addstr(" be doing today?");
  435. }
  436.  
  437. printcreatureinfo(cr);
  438.  
  439. makedelimiter();
  440.  
  441. data_activity activity = get_activity(cr->activity.type);
  442. if(!state)
  443. {
  444. if(activity.key != 'x')
  445. state = activity.key;
  446. }
  447. oldstate=state;
  448.  
  449. set_color(COLOR_WHITE,COLOR_BLACK,state=='a');
  450. mvaddstr(10,1,"A - Engaging in Liberal Activism");
  451.  
  452. set_color(COLOR_WHITE,COLOR_BLACK,state=='b');
  453. mvaddstr(11,1,"B - Legal Fundraising");
  454.  
  455. set_color(COLOR_WHITE,COLOR_BLACK,state=='c');
  456. mvaddstr(12,1,"C - Illegal Fundraising");
  457.  
  458. set_color(COLOR_WHITE,COLOR_BLACK,state=='d');
  459. mvaddstr(13,1,"D - Recruitment and Acquisition");
  460.  
  461. set_color(COLOR_WHITE,COLOR_BLACK,state=='t');
  462. mvaddstr(14,1,"T - Teaching Other Liberals");
  463.  
  464. if(hostagecount>0)set_color(COLOR_WHITE,COLOR_BLACK,state=='i');
  465. else set_color(COLOR_BLACK,COLOR_BLACK,1);
  466. mvaddstr(15,1,"I - Tend to a Conservative hostage");
  467.  
  468. set_color(COLOR_WHITE,COLOR_BLACK,state=='l');
  469. mvaddstr(16,1,"L - Learn in the University District");
  470.  
  471. if(clinictime(*cr)) set_color(COLOR_WHITE,COLOR_BLACK,state=='m');
  472. else set_color(COLOR_BLACK,COLOR_BLACK,1);
  473. mvaddstr(17,1,"M - Move to the Free Clinic");
  474.  
  475. if(cr->get_skill(SKILL_FIRSTAID)!=0)
  476. set_color(COLOR_WHITE,COLOR_BLACK,state=='h');
  477. else
  478. set_color(COLOR_BLACK,COLOR_BLACK,1);
  479. mvaddstr(18,1,"H - Heal Liberals");
  480.  
  481. if(havedead)set_color(COLOR_WHITE,COLOR_BLACK,state=='z');
  482. else set_color(COLOR_BLACK,COLOR_BLACK,1);
  483. mvaddstr(19,1,"Z - Dispose of bodies");
  484.  
  485. siegest *siege=NULL;
  486. if(selectedsiege!=-1) siege=&location[selectedsiege]->siege;
  487. if(activesquad) if(activesquad->squad[0]->location!=-1) siege=&location[activesquad->squad[0]->location]->siege;
  488. char sieged=0;
  489. if(siege) sieged=siege->siege;
  490. /*char underattack=0;
  491. if(siege&&sieged) underattack=siege->underattack;*/
  492.  
  493. if(!sieged)
  494. set_color(COLOR_WHITE,COLOR_BLACK,0);
  495. else
  496. set_color(COLOR_BLACK,COLOR_BLACK,1);
  497. mvaddstr(20,1,"E - Equip this Liberal");
  498.  
  499. if(state=='a'||state=='b'||state=='c'||state=='d')
  500. {
  501. set_color(COLOR_WHITE,COLOR_BLACK,0);
  502. mvaddstr(19,40,"? - Help");
  503. }
  504.  
  505. set_color(COLOR_WHITE,COLOR_BLACK,0);
  506. mvaddstr(20,40,"Enter - Confirm Selection");
  507.  
  508. set_color(COLOR_WHITE,COLOR_BLACK,state=='x');
  509. mvaddstr(21,1,"X - Nothing for Now");
  510.  
  511. addchar(state);
  512.  
  513. if(state == 'l')
  514. {
  515. listclasses(cr);
  516. }
  517. else
  518. {
  519. int ypos = 10;
  520. for(int i=0; i < activate_menu_items.size(); ++i)
  521. {
  522. if(activate_menu_items[i].key_group == state && activate_menu_items[i].ok(cr))
  523. {
  524. set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==activate_menu_items[i].code);
  525. move(ypos, 40);
  526. if(activate_menu_items[i].key > 0)
  527. {
  528. addchar(activate_menu_items[i].key);
  529. addstr(" - ");
  530. }
  531. ypos++;
  532. addstr(activate_menu_items[i].label(cr));
  533. }
  534. }
  535. }
  536.  
  537. set_color(COLOR_WHITE, COLOR_BLACK, 0);
  538. move(22, 3);
  539. if (activity.show_name)
  540. {
  541. addstr(cr->name);
  542. addstr(" will ");
  543. }
  544. addstr(activity.line(0, cr));
  545. mvaddstr(23, 1, activity.line(1, cr));
  546. mvaddstr(24, 1, activity.line(2, cr));
  547.  
  548. int c=getkey();
  549.  
  550. if(c>='a'&&c<='z') state=c;
  551. if((c>='a'&&c<='z') || (c>='0'&&c<='9'))
  552. {
  553. choice=c;
  554. switch(state)
  555. {
  556. case 'a':
  557. switch(choice)
  558. {
  559. case '1':cr->activity.type=ACTIVITY_COMMUNITYSERVICE;break;
  560. case '2':cr->activity.type=ACTIVITY_TROUBLE;break;
  561. case '3':cr->activity.type=ACTIVITY_GRAFFITI;
  562. cr->activity.arg=-1;
  563. break;
  564. case '4':cr->activity.type=ACTIVITY_POLLS;break;
  565. //case '5':cr->activity.type=ACTIVITY_DOS_ATTACKS;break;
  566. case '5':cr->activity.type=ACTIVITY_HACKING;break;
  567. case '6':cr->activity.type=ACTIVITY_WRITE_LETTERS;break;
  568. case '7':
  569. if(cr->location!=-1&&
  570. location[cr->location]->compound_walls & COMPOUND_PRINTINGPRESS)
  571. {
  572. cr->activity.type=ACTIVITY_WRITE_GUARDIAN;break;
  573. }
  574. default:
  575. if(cr->get_attribute(ATTRIBUTE_WISDOM,true)>7||cr->juice<0)
  576. cr->activity.type=ACTIVITY_COMMUNITYSERVICE;
  577. else if(cr->get_attribute(ATTRIBUTE_WISDOM,true)>4)
  578. cr->activity.type=ACTIVITY_TROUBLE;
  579. else
  580. {
  581. if(cr->get_skill(SKILL_COMPUTERS)>2)
  582. cr->activity.type=ACTIVITY_HACKING;
  583. else if(cr->get_skill(SKILL_ART)>1)
  584. {
  585. cr->activity.type=ACTIVITY_GRAFFITI;
  586. cr->activity.arg=-1;
  587. }
  588. else
  589. cr->activity.type=ACTIVITY_TROUBLE;
  590. }
  591. }
  592. break;
  593. case 'b':
  594. switch(choice)
  595. {
  596. case '1':cr->activity.type=ACTIVITY_DONATIONS;break;
  597. case '2':cr->activity.type=ACTIVITY_SELL_TSHIRTS;break;
  598. case '3':cr->activity.type=ACTIVITY_SELL_ART;break;
  599. case '4':cr->activity.type=ACTIVITY_SELL_MUSIC;break;
  600. default:
  601. if(cr->get_weapon().is_instrument())
  602. cr->activity.type=ACTIVITY_SELL_MUSIC;
  603. else if(cr->get_skill(SKILL_ART)>1)
  604. cr->activity.type=ACTIVITY_SELL_ART;
  605. else if(cr->get_skill(SKILL_TAILORING)>1)
  606. cr->activity.type=ACTIVITY_SELL_TSHIRTS;
  607. else if(cr->get_skill(SKILL_MUSIC)>1)
  608. cr->activity.type=ACTIVITY_SELL_MUSIC;
  609. else cr->activity.type=ACTIVITY_DONATIONS;
  610. }
  611. break;
  612. case 'c':
  613. switch(choice)
  614. {
  615. case '1':cr->activity.type=ACTIVITY_SELL_DRUGS;break;
  616. case '2':
  617. #ifndef ZEROMORAL
  618. if(cr->age >= 18)
  619. #endif
  620. cr->activity.type=ACTIVITY_PROSTITUTION;break;
  621. case '3':cr->activity.type=ACTIVITY_CCFRAUD;break;
  622. //case '4':cr->activity.type=ACTIVITY_DOS_RACKET;break;
  623. default:
  624. if(cr->get_skill(SKILL_COMPUTERS)>1)
  625. cr->activity.type=ACTIVITY_CCFRAUD;
  626. #ifndef ZEROMORAL
  627. else if(cr->get_skill(SKILL_SEDUCTION)>1 && cr->age >= 18)
  628. #else
  629. else if(cr->get_skill(SKILL_SEDUCTION)>1)
  630. #endif
  631. cr->activity.type=ACTIVITY_PROSTITUTION;
  632. else cr->activity.type=ACTIVITY_SELL_DRUGS;
  633. }
  634. break;
  635. case 'd':
  636. switch(choice)
  637. {
  638. case '1': { // Pick type to recruit
  639. activityst oact=cr->activity;
  640. cr->activity.type=ACTIVITY_NONE;
  641. recruitSelect(*cr);
  642. if(cr->activity.type==ACTIVITY_RECRUITING) break;
  643. else cr->activity=oact;
  644. break; }
  645. case '2': { // Pick clothing to make
  646. activityst oact=cr->activity;
  647. cr->activity.type=ACTIVITY_NONE;
  648. select_makeclothing(cr);
  649. if(cr->activity.type==ACTIVITY_MAKE_ARMOR) break;
  650. else cr->activity=oact;
  651. break; }
  652. case '3':cr->activity.type=ACTIVITY_REPAIR_ARMOR;break;
  653. case '4':
  654. if(cr->canwalk())
  655. cr->activity.type=ACTIVITY_STEALCARS;
  656. else if(!(cr->flag & CREATUREFLAG_WHEELCHAIR))
  657. cr->activity.type=ACTIVITY_WHEELCHAIR;
  658. break;
  659. default: break;
  660. }
  661. break;
  662. case 't':
  663. switch(choice)
  664. {
  665. case '1':cr->activity.type=ACTIVITY_TEACH_POLITICS;break;
  666. case '2':cr->activity.type=ACTIVITY_TEACH_COVERT;break;
  667. case '3':cr->activity.type=ACTIVITY_TEACH_FIGHTING;break;
  668. default:
  669. switch(cr->type)
  670. {
  671. // this first block are creatures with All Weapon Skills, Martial Arts, Dodge, and First Aid
  672. case CREATURE_ATHLETE:
  673. case CREATURE_BOUNCER: // for fighting skills
  674. case CREATURE_COP: // for fighting skills
  675. case CREATURE_CCS_ARCHCONSERVATIVE: // for fighting skills
  676. case CREATURE_CCS_MOLOTOV: // for fighting skills
  677. case CREATURE_CCS_SNIPER: // for fighting skills
  678. case CREATURE_CCS_VIGILANTE: // for fighting skills
  679. case CREATURE_DEATHSQUAD: // for fighting skills
  680. case CREATURE_DOCTOR: // for First Aid
  681. case CREATURE_FIREFIGHTER: // for fighting skills
  682. case CREATURE_GANGMEMBER: // for fighting skills
  683. case CREATURE_GANGUNIT: // for fighting skills
  684. case CREATURE_GUARDDOG:
  685. case CREATURE_GENETIC:
  686. case CREATURE_HARDENED_VETERAN: // for fighting skills
  687. case CREATURE_HICK:
  688. case CREATURE_MARTIALARTIST: // for fighting skills
  689. case CREATURE_MERC: // for fighting skills
  690. case CREATURE_MILITARYOFFICER: // for fighting skills
  691. case CREATURE_MILITARYPOLICE: // for fighting skills
  692. case CREATURE_MUTANT:
  693. case CREATURE_NURSE: // for First Aid
  694. case CREATURE_PRISONGUARD: // for fighting skills
  695. case CREATURE_SEAL: // for fighting skills
  696. case CREATURE_SECURITYGUARD: // for fighting skills
  697. case CREATURE_SOLDIER: // for fighting skills
  698. case CREATURE_SWAT: // for fighting skills
  699. case CREATURE_TANK: // fpr fighting skills
  700. case CREATURE_VETERAN: // for fighting skills
  701. cr->activity.type=ACTIVITY_TEACH_FIGHTING;
  702. break;
  703. // this second block are creatures with Computers, Security, Stealth, Disguise, Tailoring, Seduction, Psychology, & Driving
  704. case CREATURE_ACTOR: // for Disguise
  705. case CREATURE_AGENT: // for Driving & Psychology
  706. case CREATURE_AMATEURMAGICIAN:
  707. case CREATURE_BIKER: // for Driving
  708. case CREATURE_BUM:
  709. case CREATURE_CONSTRUCTIONWORKER: // for Driving
  710. case CREATURE_CRACKHEAD:
  711. case CREATURE_EDUCATOR: // for Psychology & Driving
  712. case CREATURE_FASHIONDESIGNER: // for Tailoring
  713. case CREATURE_GARBAGEMAN: // for Driving
  714. case CREATURE_HSDROPOUT:
  715. case CREATURE_LOCKSMITH: // for Security
  716. case CREATURE_MAILMAN:
  717. case CREATURE_PLUMBER:
  718. case CREATURE_PRISONER:
  719. case CREATURE_PROGRAMMER: // for Computers
  720. case CREATURE_PROSTITUTE: // for Seduction
  721. case CREATURE_PSYCHOLOGIST: // for Psychology
  722. case CREATURE_SECRET_SERVICE: // for Driving & Psychology
  723. case CREATURE_SEWERWORKER:
  724. case CREATURE_TAXIDRIVER: // for Driving
  725. case CREATURE_THIEF: // for Disguise, Security, & Stealth
  726. case CREATURE_TRUCKER: // for Driving
  727. case CREATURE_WORKER_FACTORY_CHILD:
  728. case CREATURE_WORKER_SERVANT:
  729. case CREATURE_WORKER_SWEATSHOP: // for Tailoring
  730. cr->activity.type=ACTIVITY_TEACH_COVERT;
  731. break;
  732. // this third block are creatures with Writing, Persuasion, Law, Street Sense, Science, Religion, Business, Music, & Art
  733. case CREATURE_AUTHOR: // for Writing & Persuasion
  734. case CREATURE_BANK_MANAGER: // for Business
  735. case CREATURE_BANK_TELLER:
  736. case CREATURE_CAMERAMAN: // for Art
  737. case CREATURE_CARSALESMAN: // for Business & Persuasion
  738. case CREATURE_CHEF:
  739. case CREATURE_CLERK:
  740. case CREATURE_COLLEGESTUDENT: // for Art, Music, Science, & Writing
  741. case CREATURE_CORPORATE_CEO: // for Business
  742. case CREATURE_CORPORATE_MANAGER: // for Business
  743. case CREATURE_CRITIC_ART: // for Writing, Persuasion, & Art
  744. case CREATURE_CRITIC_MUSIC: // for Writing, Persuasion, & Music
  745. case CREATURE_DANCER: // for Art & Music
  746. case CREATURE_ENGINEER: // for Science
  747. case CREATURE_FASTFOODWORKER:
  748. case CREATURE_BAKER:
  749. case CREATURE_BARISTA:
  750. case CREATURE_BARTENDER:
  751. case CREATURE_FOOTBALLCOACH: // for Persuasion
  752. case CREATURE_HAIRSTYLIST: // for Art
  753. case CREATURE_HIPPIE: // for Art & Music
  754. case CREATURE_JOURNALIST: // for Writing & Persuasion
  755. case CREATURE_JUDGE_CONSERVATIVE: // for Law & Writing
  756. case CREATURE_JUDGE_LIBERAL: // for Law & Writing
  757. case CREATURE_JUROR:
  758. case CREATURE_LANDLORD: // for Business
  759. case CREATURE_LAWYER: // for Law & Persuasion
  760. case CREATURE_MATHEMATICIAN: // for Science
  761. case CREATURE_MUSICIAN: // for Music
  762. case CREATURE_NEWSANCHOR:
  763. case CREATURE_NUN: // for Religion
  764. case CREATURE_OFFICEWORKER: // for Business
  765. case CREATURE_PAINTER: // for Art
  766. case CREATURE_PHOTOGRAPHER: // for Art
  767. case CREATURE_POLITICALACTIVIST: // for Persuasion, Law, & Writing
  768. case CREATURE_POLITICIAN: // for Law & Persuasion
  769. case CREATURE_PRIEST: // for Religion
  770. case CREATURE_RADIOPERSONALITY: // for Persuasion
  771. case CREATURE_RETIREE:
  772. case CREATURE_SCIENTIST_EMINENT: // for Science
  773. case CREATURE_SCIENTIST_LABTECH: // for Science
  774. case CREATURE_SCULPTOR: // for Art
  775. case CREATURE_SOCIALITE: // for Persuasion, Art, & Music
  776. case CREATURE_TEACHER:
  777. case CREATURE_TEENAGER:
  778. case CREATURE_TELEMARKETER: // for Persuasion
  779. case CREATURE_WORKER_FACTORY_NONUNION:
  780. case CREATURE_WORKER_FACTORY_UNION:
  781. case CREATURE_WORKER_JANITOR:
  782. case CREATURE_WORKER_SECRETARY: // for Writing
  783. case CREATURE_YOGAINSTRUCTOR:
  784. default:
  785. cr->activity.type=ACTIVITY_TEACH_POLITICS;
  786. break;
  787. }
  788. break;
  789. }
  790. break;
  791. case 'i':
  792. if(hostagecount>0)
  793. {
  794. activityst oact=cr->activity;
  795. cr->activity.type=ACTIVITY_NONE;
  796. select_tendhostage(cr);
  797. if(cr->activity.type==ACTIVITY_HOSTAGETENDING) break;
  798. else cr->activity=oact;
  799. }
  800. state=oldstate;
  801. break;
  802. case 'l':
  803. updateclasschoice(cr, choice);
  804. break;
  805. case 'm':
  806. if(clinictime(*cr)) cr->activity.type=ACTIVITY_CLINIC;
  807. else state=oldstate;
  808. break;
  809. case 'h':
  810. if(cr->get_skill(SKILL_FIRSTAID)) cr->activity.type=ACTIVITY_HEAL;
  811. else state=oldstate;
  812. break;
  813. case 'z':
  814. if(havedead) cr->activity.type=ACTIVITY_BURY;
  815. else state=oldstate;
  816. break;
  817. case 'e':
  818. if(!sieged)
  819. {
  820. //create a temp squad containing just this liberal
  821. int oldsquadid = cr->squadid;
  822. squadst *oldactivesquad = activesquad;
  823. activesquad=new squadst;
  824. strcpy(activesquad->name, "Temporary Squad");
  825. activesquad->id=cursquadid;
  826. activesquad->squad[0]=cr;
  827. cr->squadid = activesquad->id;
  828. //go to equipment screen
  829. equip(location[activesquad->squad[0]->location]->loot,-1);
  830. //once you're done, restore original squad status.
  831. delete activesquad;
  832. activesquad = oldactivesquad;
  833. cr->squadid = oldsquadid;
  834. }
  835. state=oldstate;
  836. break;
  837. /*case 'w':
  838. if(location[cr->location]->compound_walls==COMPOUND_PRINTINGPRESS)
  839. {
  840. activityst oact=cr->activity;
  841. cr->activity.type=ACTIVITY_NONE;
  842. if(select_view(cr,cr->activity.arg))
  843. {
  844. cr->activity.type=ACTIVITY_WRITE_GUARDIAN;
  845. break;
  846. }
  847. else cr->activity=oact;
  848. }
  849. state=oldstate;
  850. break;*/
  851. case 'x':
  852. cr->activity.type=ACTIVITY_NONE;
  853. break;
  854. default:
  855. state=oldstate;
  856. break;
  857. }
  858. }
  859.  
  860. // Enter pressed
  861. if(c=='x'||c==ENTER||c==ESC||c==SPACEBAR) break;
  862. // ? Pressed
  863. if(c=='?')
  864. if(state=='a'||state=='b'||state=='c'||state=='d')
  865. HelpActivities(cr->activity.type); // Call activity help pages
  866. }
  867. }
  868.  
  869.  
  870. void activatebulk()
  871. {
  872. vector<Creature *> temppool = activatable_liberals();
  873.  
  874. if(!len(temppool)) return;
  875.  
  876. int page=0,selectedactivity=0;
  877.  
  878. while(true)
  879. {
  880. erase();
  881.  
  882. set_color(COLOR_WHITE,COLOR_BLACK,0);
  883. printfunds();
  884.  
  885. mvaddstr(0,0, "Activate Uninvolved Liberals");
  886. mvaddstr(1,0, "ÄÄÄÄCODE NAMEÄÄÄÄÄÄÄÄÄÄÄÄCURRENT ACTIVITYÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ");
  887. mvaddstr(1,51, "BULK ACTIVITY");
  888.  
  889. if(selectedactivity==0) set_color(COLOR_WHITE,COLOR_BLACK,1);
  890. else set_color(COLOR_WHITE,COLOR_BLACK,0);
  891. mvaddstr(2,51, "1 - Liberal Activism");
  892. if(selectedactivity==1) set_color(COLOR_WHITE,COLOR_BLACK,1);
  893. else set_color(COLOR_WHITE,COLOR_BLACK,0);
  894. mvaddstr(3,51, "2 - Legal Fundraising");
  895. if(selectedactivity==2) set_color(COLOR_WHITE,COLOR_BLACK,1);
  896. else set_color(COLOR_WHITE,COLOR_BLACK,0);
  897. mvaddstr(4,51, "3 - Illegal Fundraising");
  898. if(selectedactivity==3) set_color(COLOR_WHITE,COLOR_BLACK,1);
  899. else set_color(COLOR_WHITE,COLOR_BLACK,0);
  900. mvaddstr(5,51, "4 - Checking Polls");
  901. if(selectedactivity==4) set_color(COLOR_WHITE,COLOR_BLACK,1);
  902. else set_color(COLOR_WHITE,COLOR_BLACK,0);
  903. mvaddstr(6,51, "5 - Stealing Cars");
  904. if(selectedactivity==5) set_color(COLOR_WHITE,COLOR_BLACK,1);
  905. else set_color(COLOR_WHITE,COLOR_BLACK,0);
  906. mvaddstr(7,51, "6 - Community Service");
  907.  
  908. int y=2;
  909. for(int p=page*19;p<len(temppool)&&p<page*19+19;p++,y++)
  910. {
  911. set_color(COLOR_WHITE,COLOR_BLACK,0);
  912. move(y,0);
  913. addchar(y+'A'-2);addstr(" - ");
  914. addstr(temppool[p]->name);
  915.  
  916. move(y,25);
  917. set_activity_color(temppool[p]->activity.type);
  918. addstr(getactivity(temppool[p]->activity));
  919. /*if(temppool[p]->activity.type==ACTIVITY_TROUBLE)
  920. {
  921. addstr(" ($");
  922. addstr(temppool[p]->activity.arg);
  923. addstr(")");
  924. }*/
  925. }
  926.  
  927. set_color(COLOR_WHITE,COLOR_BLACK,0);
  928. mvaddstr(22,0, "Press a Letter to Assign an Activity. Press a Number to select an Activity.");
  929. move(23,0);
  930. addpagestr();
  931.  
  932. int c=getkey();
  933.  
  934. //PAGE UP
  935. if((c==interface_pgup||c==KEY_UP||c==KEY_LEFT)&&page>0) page--;
  936. //PAGE DOWN
  937. if((c==interface_pgdn||c==KEY_DOWN||c==KEY_RIGHT)&&(page+1)*19<len(temppool)) page++;
  938.  
  939. if(c>='a'&&c<='s')
  940. {
  941. int p=page*19+c-'a';
  942. if(p<len(temppool))
  943. {
  944. switch(selectedactivity)
  945. {
  946. case 0: //Activism
  947. if(temppool[p]->get_attribute(ATTRIBUTE_WISDOM,true)>7||temppool[p]->juice<0)
  948. temppool[p]->activity.type=ACTIVITY_COMMUNITYSERVICE;
  949. else if(temppool[p]->get_attribute(ATTRIBUTE_WISDOM,true)>4)
  950. temppool[p]->activity.type=ACTIVITY_TROUBLE;
  951. else
  952. {
  953. if(temppool[p]->get_skill(SKILL_COMPUTERS)>2)
  954. temppool[p]->activity.type=ACTIVITY_HACKING;
  955. else if(temppool[p]->get_skill(SKILL_ART)>1)
  956. {
  957. temppool[p]->activity.type=ACTIVITY_GRAFFITI;
  958. temppool[p]->activity.arg=-1;
  959. }
  960. else temppool[p]->activity.type=ACTIVITY_TROUBLE;
  961. }
  962. break;
  963. case 1: //Fundraising
  964. if(temppool[p]->get_weapon().is_instrument())
  965. temppool[p]->activity.type=ACTIVITY_SELL_MUSIC;
  966. else if(temppool[p]->get_skill(SKILL_ART)>1)
  967. temppool[p]->activity.type=ACTIVITY_SELL_ART;
  968. else if(temppool[p]->get_skill(SKILL_TAILORING)>1)
  969. temppool[p]->activity.type=ACTIVITY_SELL_TSHIRTS;
  970. else if(temppool[p]->get_skill(SKILL_MUSIC)>1)
  971. temppool[p]->activity.type=ACTIVITY_SELL_MUSIC;
  972. else temppool[p]->activity.type=ACTIVITY_DONATIONS;
  973. break;
  974. case 2: //Illegal Fundraising
  975. if(temppool[p]->get_skill(SKILL_COMPUTERS)>1)
  976. temppool[p]->activity.type=ACTIVITY_CCFRAUD;
  977. #ifndef ZEROMORAL
  978. else if(temppool[p]->get_skill(SKILL_SEDUCTION)>1 && temppool[p]->age >=18)
  979. #else
  980. else if(temppool[p]->get_skill(SKILL_SEDUCTION)>1)
  981. #endif
  982. temppool[p]->activity.type=ACTIVITY_PROSTITUTION;
  983. else
  984. temppool[p]->activity.type=ACTIVITY_SELL_DRUGS;
  985. break;
  986. case 3: //Check polls
  987. temppool[p]->activity.type=ACTIVITY_POLLS;
  988. break;
  989. case 4: //Steal cars
  990. temppool[p]->activity.type=ACTIVITY_STEALCARS;
  991. break;
  992. case 5: //Volunteer
  993. temppool[p]->activity.type=ACTIVITY_COMMUNITYSERVICE;
  994. break;
  995. }
  996. }
  997. }
  998. if(c>='1'&&c<='6')
  999. selectedactivity=c-'1';
  1000.  
  1001. if(c=='x'||c==ENTER||c==ESC||c==SPACEBAR) break;
  1002. }
  1003. }
  1004.  
  1005.  
  1006. /* base - activate - hostages */
  1007. void select_tendhostage(Creature *cr)
  1008. {
  1009. vector<Creature *> temppool;
  1010.  
  1011. for(int p=0;p<len(pool);p++)
  1012. {
  1013. if(pool[p]->align!=1&&
  1014. pool[p]->alive&&
  1015. pool[p]->location==cr->location)
  1016. {
  1017. temppool.push_back(pool[p]);
  1018. }
  1019. }
  1020.  
  1021. if(!len(temppool))return;
  1022. if(len(temppool)==1)
  1023. {
  1024. cr->activity.type=ACTIVITY_HOSTAGETENDING;
  1025. cr->activity.arg=temppool[0]->id;
  1026. return;
  1027. }
  1028.  
  1029. int page=0;
  1030.  
  1031. while(true)
  1032. {
  1033. erase();
  1034.  
  1035. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1036. mvaddstr(0,0, "Which hostage will ");
  1037. addstr(cr->name);
  1038. addstr(" be watching over?");
  1039. mvaddstr(1,0, "ÄÄÄÄCODE NAMEÄÄÄÄÄÄÄÄÄÄÄÄSKILLÄÄÄHEALTHÄÄÄLOCATIONÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ");
  1040. mvaddstr(1,57, "DAYS IN CAPTIVITY");
  1041.  
  1042. int y=2;
  1043. for(int p=page*19;p<len(temppool)&&p<page*19+19;p++,y++)
  1044. {
  1045. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1046. move(y,0);
  1047. addchar(y+'A'-2);addstr(" - ");
  1048. addstr(temppool[p]->name);
  1049.  
  1050. char bright=0;
  1051. int skill=0;
  1052. for(int sk=0;sk<SKILLNUM;sk++)
  1053. {
  1054. skill+=temppool[p]->get_skill(sk);
  1055. if(temppool[p]->get_skill_ip(sk)>=100+(10*temppool[p]->get_skill(sk))&&
  1056. temppool[p]->get_skill(sk)<temppool[p]->skill_cap(sk,true))bright=1;
  1057. }
  1058.  
  1059. set_color(COLOR_WHITE,COLOR_BLACK,bright);
  1060.  
  1061. mvaddstr(y,25, skill);
  1062.  
  1063. printhealthstat(*temppool[p],y,33,TRUE);
  1064.  
  1065. if(mode==REVIEWMODE_JUSTICE)set_color(COLOR_YELLOW,COLOR_BLACK,1);
  1066. else set_color(COLOR_WHITE,COLOR_BLACK,0);
  1067. mvaddstr(y,42,location[temppool[p]->location]->getname(true, true));
  1068.  
  1069. set_color(COLOR_MAGENTA,COLOR_BLACK,1);
  1070. mvaddstr(y,57, temppool[p]->joindays);
  1071. addstr(" ");
  1072. if(temppool[p]->joindays>1)addstr("Days");
  1073. else addstr("Day");
  1074. }
  1075.  
  1076. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1077. mvaddstr(22,0, "Press a Letter to select a Conservative");
  1078. move(23,0);
  1079. addpagestr();
  1080.  
  1081. int c=getkey();
  1082.  
  1083. //PAGE UP
  1084. if((c==interface_pgup||c==KEY_UP||c==KEY_LEFT)&&page>0) page--;
  1085. //PAGE DOWN
  1086. if((c==interface_pgdn||c==KEY_DOWN||c==KEY_RIGHT)&&(page+1)*19<len(temppool)) page++;
  1087.  
  1088. if(c>='a'&&c<='s')
  1089. {
  1090. int p=page*19+(int)(c-'a');
  1091. if(p<len(temppool))
  1092. {
  1093. cr->activity.type=ACTIVITY_HOSTAGETENDING;
  1094. cr->activity.arg=temppool[p]->id;
  1095. return;
  1096. }
  1097. }
  1098.  
  1099. if(c=='x'||c==ENTER||c==ESC||c==SPACEBAR) break;
  1100. }
  1101. }
  1102.  
  1103.  
  1104. long select_hostagefundinglevel(Creature *cr,Creature *hs)
  1105. {
  1106. long flevel=-1;
  1107.  
  1108. erase();
  1109.  
  1110. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1111. printfunds();
  1112. mvaddstr(0,0, "Select a Funding Level for this Operation:");
  1113.  
  1114. mvaddstr(2,0, "A - Don't spend anything. ");
  1115. addstr(cr->name);
  1116. addstr(" is just on watch duty.");
  1117.  
  1118. mvaddstr(3,0, "B - Don't spend anything. ");
  1119. addstr(cr->name);
  1120. addstr(" will turn the prisoner over time.");
  1121.  
  1122. mvaddstr(4,0, "C - $20 per day. Enough for some props.");
  1123.  
  1124. mvaddstr(5,0, "D - $50 per day. ");
  1125. addstr(cr->name);
  1126. addstr(" will go for a thrifty indoctrination.");
  1127.  
  1128. mvaddstr(6,0, "E - $100 per day. ");
  1129. addstr(cr->name);
  1130. addstr(" needs enough freedom to be creative.");
  1131.  
  1132. mvaddstr(7,0, "F - $500 per day. It is imperative that the Conservative be turned quickly.");
  1133.  
  1134. mvaddstr(8,0, "K - This Conservative has become a liability and needs to be terminated.");
  1135.  
  1136. mvaddstr(10,0, "Enter - On second thought, this isn't a job for ");
  1137. addstr(cr->name);
  1138. addstr(".");
  1139.  
  1140. do
  1141. {
  1142. int c=getkey();
  1143.  
  1144. if(c=='a')flevel=0;
  1145. if(c=='b')flevel=1;
  1146. if(c=='c')flevel=20;
  1147. if(c=='d')flevel=50;
  1148. if(c=='e')flevel=100;
  1149. if(c=='f')flevel=500;
  1150. if(c=='k')flevel=666;
  1151. if(c=='x'||c==ENTER||c==ESC||c==SPACEBAR) break;
  1152. } while(flevel==-1);
  1153.  
  1154. return flevel;
  1155. }
  1156.  
  1157. struct recruitData
  1158. {
  1159. int type;
  1160. char* name;
  1161. int difficulty;
  1162. recruitData(int type_,char* name_,int difficulty_) : type(type_),name(name_),difficulty(difficulty_) { }
  1163. };
  1164.  
  1165. recruitData recruitable_creatures[] = {
  1166. recruitData(CREATURE_VETERAN, (char*)"Army Veteran", 4),
  1167. recruitData(CREATURE_ATHLETE, (char*)"Athlete", 4),
  1168. recruitData(CREATURE_COLLEGESTUDENT, (char*)"College Student", 1),
  1169. recruitData(CREATURE_PROGRAMMER, (char*)"Computer Programmer", 4),
  1170. recruitData(CREATURE_DANCER, (char*)"Dancer", 4),
  1171. recruitData(CREATURE_DOCTOR, (char*)"Doctor", 4),
  1172. recruitData(CREATURE_FASHIONDESIGNER, (char*)"Fashion Designer", 6),
  1173. recruitData(CREATURE_GANGMEMBER, (char*)"Gang Member", 2),
  1174. recruitData(CREATURE_HIPPIE, (char*)"Hippie", 1),
  1175. recruitData(CREATURE_JOURNALIST, (char*)"Journalist", 4),
  1176. recruitData(CREATURE_JUDGE_LIBERAL, (char*)"Judge", 6),
  1177. recruitData(CREATURE_LAWYER, (char*)"Lawyer", 4),
  1178. recruitData(CREATURE_LOCKSMITH, (char*)"Locksmith", 6),
  1179. recruitData(CREATURE_MARTIALARTIST, (char*)"Martial Artist", 4),
  1180. recruitData(CREATURE_MUSICIAN, (char*)"Musician", 4),
  1181. recruitData(CREATURE_MUTANT, (char*)"Mutant", 4),
  1182. recruitData(CREATURE_PROSTITUTE, (char*)"Prostitute", 2),
  1183. recruitData(CREATURE_PSYCHOLOGIST, (char*)"Psychologist", 4),
  1184. recruitData(CREATURE_TAXIDRIVER, (char*)"Taxi Driver", 4),
  1185. recruitData(CREATURE_TEACHER, (char*)"Teacher", 4)
  1186. };
  1187.  
  1188. // Return the difficulty of tracking this character type down, for the
  1189. // purpose of the activation menu. 0 is trivial, 10 is impossible.
  1190. int recruitFindDifficulty(int creatureType)
  1191. {
  1192. for(int i=0; i<len(recruitable_creatures); i++)
  1193. if(recruitable_creatures[i].type == creatureType)
  1194. return recruitable_creatures[i].difficulty;
  1195. return 10; // No recruitData; assume impossible to recruit
  1196. }
  1197.  
  1198. char* recruitName(int creatureType)
  1199. {
  1200. for(int i=0; i<len(recruitable_creatures); i++)
  1201. if(recruitable_creatures[i].type == creatureType)
  1202. return recruitable_creatures[i].name;
  1203. return (char*)"missingno";
  1204. }
  1205.  
  1206. void displayDifficulty(int difficulty)
  1207. {
  1208. const char *_difficulty[] = { "Simple", "Very Easy", "Easy", "Below Average", "Average", "Above Average", "Hard", "Very Hard", "Extremely Difficult", "Nearly Impossible", "Impossible"};
  1209.  
  1210. switch(difficulty)
  1211. {
  1212. case 0: set_color(COLOR_GREEN,COLOR_BLACK,1);break;
  1213. case 1: set_color(COLOR_CYAN,COLOR_BLACK,1); break;
  1214. case 2: set_color(COLOR_CYAN,COLOR_BLACK,0); break;
  1215. case 3: set_color(COLOR_BLUE,COLOR_BLACK,1); break;
  1216. case 4: set_color(COLOR_WHITE,COLOR_BLACK,1);break;
  1217. case 5: set_color(COLOR_WHITE,COLOR_BLACK,0);break;
  1218. case 6: set_color(COLOR_YELLOW,COLOR_BLACK,1);break;
  1219. case 7: set_color(COLOR_MAGENTA,COLOR_BLACK,0);break;
  1220. case 8: set_color(COLOR_MAGENTA,COLOR_BLACK,1);break;
  1221. case 9: set_color(COLOR_RED,COLOR_BLACK,0); break;
  1222. default:set_color(COLOR_RED,COLOR_BLACK,1); break;
  1223. }
  1224. if(difficulty >= 0 && difficulty < 10) addstr(_difficulty[difficulty]); else addstr(_difficulty[10]);
  1225. }
  1226.  
  1227. void recruitSelect(Creature &cr)
  1228. {
  1229. // Number of recruitable creatures
  1230. int options = len(recruitable_creatures);
  1231. for(int i=0; i<options; i++)
  1232. {
  1233. // Dynamic difficulty for certain creatures, recalculated each time the function is called
  1234. if(recruitable_creatures[i].type == CREATURE_MUTANT)
  1235. {
  1236. if(law[LAW_NUCLEARPOWER] == -2 && law[LAW_POLLUTION] == -2)
  1237. recruitable_creatures[i].difficulty = 2;
  1238. else if(law[LAW_NUCLEARPOWER] == -2 || law[LAW_POLLUTION] == -2)
  1239. recruitable_creatures[i].difficulty = 6;
  1240. else
  1241. recruitable_creatures[i].difficulty = 9;
  1242. }
  1243. }
  1244.  
  1245. int page=0;
  1246. while(true)
  1247. {
  1248. erase();
  1249. set_color(COLOR_WHITE,COLOR_BLACK,1);
  1250. mvaddstr(0,0, "What type of person will ");
  1251. addstr(cr.name);
  1252. addstr(" try to meet and recruit today?");
  1253. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1254. mvaddstr(1,0, "ÄÄÄÄTYPEÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄDIFFICULTY TO ARRANGE MEETINGÄÄ");
  1255.  
  1256. int y=2,difficulty;
  1257. for(int p=page*19;p<options&&p<page*19+19;p++)
  1258. {
  1259. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1260. move(y,0);
  1261. addchar(y+'A'-2);addstr(" - ");
  1262. addstr(recruitable_creatures[p].name);
  1263.  
  1264. move(y,49);
  1265. difficulty=recruitable_creatures[p].difficulty;
  1266. displayDifficulty(difficulty);
  1267.  
  1268. y++;
  1269. }
  1270.  
  1271. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1272. mvaddstr(22,0, "Press a Letter to select a Profession");
  1273. move(23,0);
  1274. addpagestr();
  1275.  
  1276. int c=getkey();
  1277.  
  1278. //PAGE UP
  1279. if((c==interface_pgup||c==KEY_UP||c==KEY_LEFT)&&page>0)page--;
  1280. //PAGE DOWN
  1281. if((c==interface_pgdn||c==KEY_DOWN||c==KEY_RIGHT)&&(page+1)*19<options)page++;
  1282.  
  1283. if(c>='a'&&c<='s')
  1284. {
  1285. int p=page*19+(int)(c-'a');
  1286. if(p<options)
  1287. {
  1288. cr.activity.type = ACTIVITY_RECRUITING;
  1289. cr.activity.arg = recruitable_creatures[p].type;
  1290. break;
  1291. }
  1292. }
  1293.  
  1294. if(c=='x'||c==ENTER||c==ESC||c==SPACEBAR) break;
  1295. }
  1296.  
  1297. return;
  1298. }
  1299.  
  1300. /* base - activate - make clothing */
  1301. void select_makeclothing(Creature *cr)
  1302. {
  1303. vector<int> armortypei;
  1304. for(int a=0;a<len(armortype);a++)
  1305. {
  1306. if(armortype[a]->get_make_difficulty() == 0)
  1307. continue;
  1308.  
  1309. if(armortype[a]->deathsquad_legality()
  1310. && (law[LAW_POLICEBEHAVIOR]!=-2 || law[LAW_DEATHPENALTY]!=-2))
  1311. continue;
  1312.  
  1313. armortypei.push_back(a);
  1314. }
  1315.  
  1316. int page=0;
  1317.  
  1318. while(true)
  1319. {
  1320. erase();
  1321.  
  1322. set_color(COLOR_WHITE,COLOR_BLACK,1);
  1323. mvaddstr(0,0, "Which will ");
  1324. addstr(cr->name);
  1325. addstr(" try to make? (Note: Half Cost if you have cloth)");
  1326. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1327. mvaddstr(1,0, "ÄÄÄÄNAMEÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄDIFFICULTYÄÄÄÄÄÄÄÄÄÄÄÄÄCOSTÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ");
  1328.  
  1329. int y=2,difficulty;
  1330. for(int p=page*19;p<len(armortypei)&&p<page*19+19;p++,y++)
  1331. {
  1332. difficulty=armor_makedifficulty(*armortype[armortypei[p]],cr);
  1333. if(difficulty<0) difficulty=0;
  1334.  
  1335. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1336. move(y,0);
  1337. addchar(y+'A'-2);addstr(" - ");
  1338. addstr(armortype[armortypei[p]]->get_name());
  1339.  
  1340. move(y,37);
  1341. displayDifficulty(difficulty);
  1342.  
  1343. set_color(COLOR_GREEN,COLOR_BLACK,1);
  1344. string price = '$'+tostring(armortype[armortypei[p]]->get_make_price());
  1345. mvaddstr(y,64-len(price), price);
  1346. }
  1347.  
  1348. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1349. mvaddstr(22,0, "Press a Letter to select a Type of Clothing");
  1350. move(23,0);
  1351. addpagestr();
  1352.  
  1353. int c=getkey();
  1354.  
  1355. //PAGE UP
  1356. if((c==interface_pgup||c==KEY_UP||c==KEY_LEFT)&&page>0)page--;
  1357. //PAGE DOWN
  1358. if((c==interface_pgdn||c==KEY_DOWN||c==KEY_RIGHT)&&(page+1)*19<len(armortypei))page++;
  1359.  
  1360. if(c>='a'&&c<='s')
  1361. {
  1362. int p=page*19+c-'a';
  1363. if(p<len(armortypei))
  1364. {
  1365. cr->activity.type=ACTIVITY_MAKE_ARMOR;
  1366. cr->activity.arg=armortypei[p]; //Use id name of armor type instead? -XML
  1367. return;
  1368. }
  1369. }
  1370.  
  1371. if(c=='x'||c==ENTER||c==ESC||c==SPACEBAR) break;
  1372. }
  1373. }
  1374.  
  1375. int armor_makedifficulty(Armor& type, Creature *cr)
  1376. {
  1377. return armor_makedifficulty(*armortype[getarmortype(type.get_itemtypename())], cr);
  1378. }
  1379.  
  1380. int armor_makedifficulty(ArmorType& type,Creature *cr) //Make class method? -XML
  1381. {
  1382. int basedif=type.get_make_difficulty()-cr->get_skill(SKILL_TAILORING)+3;
  1383. return MAX(basedif,0);
  1384. }
  1385.  
  1386.  
  1387. /* base - activate - trouble */
  1388. long select_troublefundinglevel(Creature *cr)
  1389. {
  1390. long flevel=-1;
  1391.  
  1392. erase();
  1393.  
  1394. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1395. printfunds();
  1396. mvaddstr(0,0, "Select a Funding Level for this Operation:");
  1397.  
  1398. mvaddstr(2,0, "A - Don't spend anything. ");
  1399. addstr(cr->name);
  1400. addstr(" just needs something constructive to do.");
  1401.  
  1402. mvaddstr(3,0, "B - $20 per day. Some minor purchases are needed.");
  1403. mvaddstr(4,0, "C - $50 per day. Disobedience costs money.");
  1404. mvaddstr(5,0, "D - $100 per day. Enough to be really disobedient.");
  1405. mvaddstr(6,0, "E - $500 per day. The Machine will buckle under the weight of");
  1406.  
  1407. mvaddstr(7,0, " ");
  1408. addstr(cr->name);
  1409. addstr("'s Numerous and Varied Liberal Acts.");
  1410.  
  1411. mvaddstr(9,0, "Enter - On second thought, this isn't a job for ");
  1412. addstr(cr->name);
  1413. addstr(".");
  1414.  
  1415. do
  1416. {
  1417. int c=getkey();
  1418.  
  1419. if(c=='a')flevel=0;
  1420. if(c=='b')flevel=20;
  1421. if(c=='c')flevel=50;
  1422. if(c=='d')flevel=100;
  1423. if(c=='e')flevel=500;
  1424. if(c=='x'||c==ENTER||c==ESC||c==SPACEBAR) break;
  1425. } while(flevel==-1);
  1426.  
  1427. return flevel;
  1428. }
  1429.  
  1430.  
  1431.  
  1432. /* base - activate - select a topic to write about */
  1433. char select_view(Creature *cr,int &v)
  1434. {
  1435. int page=0;
  1436.  
  1437. while(true)
  1438. {
  1439. erase();
  1440.  
  1441. set_color(COLOR_WHITE,COLOR_BLACK,1);
  1442. mvaddstr(0,0, "Write a news story if the LCS makes the news on the selected topic today, or");
  1443. mvaddstr(1,0, "write editorials if there is no current news but there is public interest.");
  1444. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1445. mvaddstr(2,0, "ÄÄÄÄTOPICÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄINTERESTÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ");
  1446.  
  1447. int y=3,x=0;
  1448. for(int p=page*18;p<VIEWNUM-3&&p<page*18+18;p++,y++)
  1449. {
  1450. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1451. move(y,x);
  1452. addchar((p-page*18)+'A');addstr(" - ");
  1453. addstr(getview(p,false));
  1454.  
  1455. move(y,44);
  1456. if(public_interest[p]>100)
  1457. {
  1458. set_color(COLOR_RED,COLOR_BLACK,1);
  1459. addstr("Extremely Controversial");
  1460. }
  1461. else if(public_interest[p]>50)
  1462. {
  1463. set_color(COLOR_YELLOW,COLOR_BLACK,1);
  1464. addstr("Dinner Table Topic");
  1465. }
  1466. else if(public_interest[p]>10)
  1467. {
  1468. set_color(COLOR_WHITE,COLOR_BLACK,1);
  1469. addstr("Significant Interest");
  1470. }
  1471. else if(public_interest[p]>0)
  1472. {
  1473. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1474. addstr("Minor Discussion");
  1475. }
  1476. else
  1477. {
  1478. set_color(COLOR_BLACK,COLOR_BLACK,1);
  1479. addstr("Exhausted");
  1480. }
  1481. }
  1482.  
  1483. set_color(COLOR_WHITE,COLOR_BLACK,0);
  1484. mvaddstr(22,0, "Press a Letter to select a Topic");
  1485. move(23,0);
  1486. addpagestr();
  1487.  
  1488. int c=getkey();
  1489.  
  1490. //PAGE UP
  1491. if((c==interface_pgup||c==KEY_UP||c==KEY_LEFT)&&page>0) page--;
  1492. //PAGE DOWN
  1493. if((c==interface_pgdn||c==KEY_DOWN||c==KEY_RIGHT)&&(page+1)*16<VIEWNUM-3) page++;
  1494.  
  1495. if(c>='a'&&c<='a'+18)
  1496. {
  1497. int p=page*18+c-'a';
  1498. if(p<VIEWNUM-3)
  1499. {
  1500. v=p;
  1501. return 1;
  1502. }
  1503. }
  1504.  
  1505. if(c=='x'||c==ENTER||c==ESC||c==SPACEBAR) break;
  1506. }
  1507.  
  1508. return 0;
  1509. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement