OSDN Git Service

翻訳
[lcs-jp/lcs-jp.git] / src / news / news.cpp
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 //TODO: Add logging for this file? --Addictgamer
30
31 #include <externs.h>
32
33 /* news - major newspaper reporting on lcs and other topics */
34 void majornewspaper(char &clearformess,char canseethings)
35 {
36    clearformess = true;
37
38    int n=0;
39
40    generate_random_event_news_stories();
41
42    clean_up_empty_news_stories();
43
44    if(canseethings) run_television_news_stories();
45
46    assign_page_numbers_to_newspaper_stories();
47    if(canseethings) display_newspaper();
48
49    //DELETE STORIES
50    for(n=0;n<len(newsstory);n++)
51       handle_public_opinion_impact(*newsstory[n]);
52    delete_and_clear(newsstory);
53 }
54
55 void display_newspaper()
56 {
57    int writers = liberal_guardian_writing_power();
58
59    for(int n=0;n<len(newsstory);n++)
60    {
61       bool liberalguardian=0;
62       int header = -1;
63       if(writers&&newsstory[n]->type!=NEWSSTORY_MAJOREVENT)
64          liberalguardian=1;
65
66       switch(newsstory[n]->type)
67       {
68          case NEWSSTORY_SQUAD_SITE:
69          case NEWSSTORY_SQUAD_KILLED_SITE:
70             switch(location[newsstory[n]->loc]->type)
71             {
72             case SITE_LABORATORY_COSMETICS:
73                header=VIEW_ANIMALRESEARCH;
74                break;
75             case SITE_LABORATORY_GENETIC:
76                header=VIEW_GENETICS;
77                break;
78             case SITE_GOVERNMENT_POLICESTATION:
79                header=VIEW_POLICEBEHAVIOR;
80                break;
81             case SITE_GOVERNMENT_COURTHOUSE:
82                header=VIEW_JUSTICES;
83                break;
84             case SITE_GOVERNMENT_PRISON:
85                header=VIEW_DEATHPENALTY;
86                break;
87             case SITE_GOVERNMENT_INTELLIGENCEHQ:
88                header=VIEW_INTELLIGENCE;
89                break;
90             case SITE_INDUSTRY_SWEATSHOP:
91                header=VIEW_SWEATSHOPS;
92                break;
93             case SITE_INDUSTRY_POLLUTER:
94                header=VIEW_POLLUTION;
95                break;
96             case SITE_INDUSTRY_NUCLEAR:
97                header=VIEW_NUCLEARPOWER;
98                break;
99             case SITE_CORPORATE_HEADQUARTERS:
100                header=VIEW_CORPORATECULTURE;
101                break;
102             case SITE_CORPORATE_HOUSE:
103                header=VIEW_CEOSALARY;
104                break;
105             case SITE_MEDIA_AMRADIO:
106                header=VIEW_AMRADIO;
107                break;
108             case SITE_MEDIA_CABLENEWS:
109                header=VIEW_CABLENEWS;
110                break;
111             case SITE_RESIDENTIAL_APARTMENT_UPSCALE:
112             case SITE_BUSINESS_CIGARBAR:
113             case SITE_BUSINESS_BANK:
114                header=VIEW_TAXES;
115                break;
116             }
117             break;
118          case NEWSSTORY_SQUAD_ESCAPED:
119          case NEWSSTORY_SQUAD_FLEDATTACK:
120          case NEWSSTORY_SQUAD_DEFENDED:
121          case NEWSSTORY_SQUAD_BROKESIEGE:
122          case NEWSSTORY_SQUAD_KILLED_SIEGEATTACK:
123          case NEWSSTORY_SQUAD_KILLED_SIEGEESCAPE:
124             break;
125          case NEWSSTORY_CCS_NOBACKERS:
126          case NEWSSTORY_CCS_DEFEATED:
127             break;
128       }
129       if(liberalguardian)
130       {
131          if(newsstory[n]->type==NEWSSTORY_CCS_SITE||
132             newsstory[n]->type==NEWSSTORY_CCS_KILLED_SITE)
133          {
134             newsstory[n]->positive=0;
135          }
136          displaystory(*newsstory[n],liberalguardian,header);
137          if(newsstory[n]->positive)newsstory[n]->positive+=1;
138       }
139       else displaystory(*newsstory[n],0,-1);
140    }
141 }
142
143 void generate_random_event_news_stories()
144 {
145    //Conservative Crime Squad Strikes!
146    if(endgamestate < ENDGAME_CCS_DEFEATED &&
147       LCSrandom(30) < endgamestate)
148    {
149       newsstory.push_back(ccs_strikes_story());
150    }
151
152    // The slow defeat of the conservative crime squad...
153    if(endgamestate < ENDGAME_CCS_DEFEATED &&
154       ccsexposure >= CCSEXPOSURE_EXPOSED &&
155       !LCSrandom(60))
156    {
157       advance_ccs_defeat_storyline();
158    }
159
160    // Random major event news stories
161    if(!LCSrandom(60)) {
162       newsstory.push_back(new_major_event());
163    }
164 }
165
166 void advance_ccs_defeat_storyline()
167 {
168    switch(ccsexposure)
169    {
170    default:
171    case CCSEXPOSURE_NONE:
172    case CCSEXPOSURE_LCSGOTDATA:
173       break;
174    case CCSEXPOSURE_EXPOSED:
175       newsstory.push_back(ccs_exposure_story());
176       break;
177    case CCSEXPOSURE_NOBACKERS:
178       newsstory.push_back(ccs_fbi_raid_story());
179       break;
180    }
181 }
182
183 void clean_up_empty_news_stories()
184 {
185    // Delete stories that have no content or shouldn't be reported on
186    for(int n=len(newsstory)-1;n>=0;n--)
187    {
188       // Squad site action stories without crimes
189       if(newsstory[n]->type==NEWSSTORY_SQUAD_SITE&&
190         !len(newsstory[n]->crime))
191       {
192          delete_and_remove(newsstory,n);
193          continue;
194       }
195
196       // Police killed stories without police being killed
197       if(newsstory[n]->type==NEWSSTORY_CARTHEFT ||
198          newsstory[n]->type==NEWSSTORY_NUDITYARREST ||
199          newsstory[n]->type==NEWSSTORY_WANTEDARREST ||
200          newsstory[n]->type==NEWSSTORY_DRUGARREST ||
201          newsstory[n]->type==NEWSSTORY_GRAFFITIARREST ||
202          newsstory[n]->type==NEWSSTORY_BURIALARREST)
203       {
204          char conf=0;
205          for(int c=0;c<len(newsstory[n]->crime);c++)
206          {
207             if(newsstory[n]->crime[c]==CRIME_KILLEDSOMEBODY)
208             {
209                conf=1;
210                break;
211             }
212          }
213          if(!conf)
214          {
215             delete_and_remove(newsstory,n);
216             continue;
217          }
218       }
219
220       // Sieges that aren't police actions
221       if((newsstory[n]->type==NEWSSTORY_SQUAD_ESCAPED||
222           newsstory[n]->type==NEWSSTORY_SQUAD_FLEDATTACK||
223           newsstory[n]->type==NEWSSTORY_SQUAD_DEFENDED||
224           newsstory[n]->type==NEWSSTORY_SQUAD_BROKESIEGE||
225           newsstory[n]->type==NEWSSTORY_SQUAD_KILLED_SIEGEATTACK||
226           newsstory[n]->type==NEWSSTORY_SQUAD_KILLED_SIEGEESCAPE)&&
227           newsstory[n]->siegetype!=SIEGE_POLICE)
228       {
229          delete_and_remove(newsstory,n);
230          continue;
231       }
232    }
233 }
234
235 void assign_page_numbers_to_newspaper_stories()
236 {
237    for(int n=len(newsstory)-1;n>=0;n--)
238    {
239       setpriority(*newsstory[n]);
240       // Suppress squad actions that aren't worth a story
241       if(newsstory[n]->type==NEWSSTORY_SQUAD_SITE &&
242        ((newsstory[n]->priority<50 &&
243          newsstory[n]->claimed==0)||
244          newsstory[n]->priority<4))
245       {
246          delete_and_remove(newsstory,n);
247          continue;
248       }
249       newsstory[n]->page=-1;
250    }
251    char acted;
252    int curpage=1,curguardianpage=1;
253    do
254    {
255       acted=0;
256       // Sort the major newspapers
257       int maxn=-1,maxp=-1;
258       for(int n=0;n<len(newsstory);n++)
259       {
260          if(newsstory[n]->priority>maxp&&
261             newsstory[n]->page==-1)
262          {
263             maxn=n;
264             maxp=newsstory[n]->priority;
265          }
266       }
267       if(maxn!=-1)
268       {
269          if(newsstory[maxn]->priority<30&&curpage==1) curpage=2;
270          if(newsstory[maxn]->priority<25&&curpage<3) curpage=3+LCSrandom(2);
271          if(newsstory[maxn]->priority<20&&curpage<5) curpage=5+LCSrandom(5);
272          if(newsstory[maxn]->priority<15&&curpage<10) curpage=10+LCSrandom(10);
273          if(newsstory[maxn]->priority<10&&curpage<20) curpage=20+LCSrandom(10);
274          if(newsstory[maxn]->priority<5&&curpage<30) curpage=30+LCSrandom(20);
275
276          newsstory[maxn]->page=curpage;
277          newsstory[maxn]->guardianpage=curguardianpage;
278          curpage++;
279          curguardianpage++;
280          acted=1;
281       }
282    } while(acted);
283 }
284
285 void handle_public_opinion_impact(const newsstoryst &ns)
286 {
287    // Check if this function is meant to handle public opinion impact
288    // for this type of news story (primarily deals with squad/site actions)
289    int okay_types[] = { NEWSSTORY_SQUAD_SITE, NEWSSTORY_SQUAD_ESCAPED, NEWSSTORY_SQUAD_FLEDATTACK,
290       NEWSSTORY_SQUAD_DEFENDED, NEWSSTORY_SQUAD_BROKESIEGE, NEWSSTORY_SQUAD_KILLED_SIEGEATTACK,
291       NEWSSTORY_SQUAD_KILLED_SIEGEESCAPE, NEWSSTORY_SQUAD_KILLED_SITE, NEWSSTORY_WANTEDARREST,
292       NEWSSTORY_GRAFFITIARREST, NEWSSTORY_CCS_SITE, NEWSSTORY_CCS_KILLED_SITE };
293    int okay_type_num = len(okay_types);
294
295    int i;
296    for(i=0; i < okay_type_num; i++)
297    {
298       if(okay_types[i] == ns.type)
299          break;
300    }
301    if(i == okay_type_num) return; // No impact for this news story type
302
303    int impact = ns.priority;
304
305    // Magnitude of impact will be affected by which page of the newspaper the story appears on
306    if(ns.page==1) impact*=5;
307    else if(ns.page==2) impact*=3;
308    else if(ns.page==3) impact*=2;
309
310    int maxpower = 1;
311    if(ns.page==1) maxpower=100;
312    else if(ns.page<5) maxpower=100-10*ns.page;
313    else if(ns.page<10) maxpower=40;
314    else if(ns.page<20) maxpower=20;
315    else if(ns.page<30) maxpower=10;
316    else if(ns.page<40) maxpower=5;
317    else maxpower=1;
318
319    // Five times effectiveness with the Liberal Guardian
320    if(ns.positive==2)
321       impact*=5;
322    // Cap power
323    if(impact>maxpower)
324       impact=maxpower;
325
326    impact/=10;
327    impact++;
328
329    // Account for squad responsible, rampages, and Liberal Guardian bias
330    int impact_direction = ALIGN_LIBERAL;
331    if(ns.type==NEWSSTORY_CCS_SITE || ns.type==NEWSSTORY_CCS_KILLED_SITE)
332    {
333       impact_direction = ALIGN_CONSERVATIVE;
334       if(ns.positive)
335          change_public_opinion(VIEW_CONSERVATIVECRIMESQUAD,impact,0);
336       else
337          change_public_opinion(VIEW_CONSERVATIVECRIMESQUAD,-impact,0);
338    }
339    else
340    {
341       change_public_opinion(VIEW_LIBERALCRIMESQUAD,2+impact);
342       impact_direction = ALIGN_LIBERAL;
343       if(ns.positive)
344          change_public_opinion(VIEW_LIBERALCRIMESQUADPOS,impact);
345       else
346          change_public_opinion(VIEW_LIBERALCRIMESQUADPOS,-impact);
347    }
348    impact *= impact_direction;
349    int squad_responsible = impact_direction;
350    if(!ns.positive) impact /= 4;
351
352    // Impact gun control issue
353    change_public_opinion(VIEW_GUNCONTROL, ABS(impact)/10, 0, ABS(impact)*10);
354
355    if(ns.loc == -1) return;
356
357    // Location-specific issue impact
358    std::vector<int> issues;
359    switch(location[ns.loc]->type)
360    {
361    case SITE_LABORATORY_COSMETICS:
362       issues.push_back(VIEW_ANIMALRESEARCH);
363       issues.push_back(VIEW_WOMEN);
364       break;
365    case SITE_LABORATORY_GENETIC:
366       issues.push_back(VIEW_ANIMALRESEARCH);
367       issues.push_back(VIEW_GENETICS);
368       break;
369    case SITE_GOVERNMENT_POLICESTATION:
370       issues.push_back(VIEW_POLICEBEHAVIOR);
371       issues.push_back(VIEW_PRISONS);
372       issues.push_back(VIEW_DRUGS);
373       break;
374    case SITE_GOVERNMENT_COURTHOUSE:
375       issues.push_back(VIEW_DEATHPENALTY);
376       issues.push_back(VIEW_JUSTICES);
377       issues.push_back(VIEW_FREESPEECH);
378       issues.push_back(VIEW_GAY);
379       issues.push_back(VIEW_WOMEN);
380       issues.push_back(VIEW_CIVILRIGHTS);
381       break;
382    case SITE_GOVERNMENT_PRISON:
383       issues.push_back(VIEW_DEATHPENALTY);
384       issues.push_back(VIEW_DRUGS);
385       issues.push_back(VIEW_TORTURE);
386       issues.push_back(VIEW_PRISONS);
387       break;
388    case SITE_GOVERNMENT_ARMYBASE:
389       issues.push_back(VIEW_TORTURE);
390       issues.push_back(VIEW_MILITARY);
391       break;
392    case SITE_GOVERNMENT_WHITE_HOUSE:
393       break;
394    case SITE_GOVERNMENT_INTELLIGENCEHQ:
395       issues.push_back(VIEW_INTELLIGENCE);
396       issues.push_back(VIEW_TORTURE);
397       issues.push_back(VIEW_PRISONS);
398       break;
399    case SITE_INDUSTRY_SWEATSHOP:
400       issues.push_back(VIEW_SWEATSHOPS);
401       issues.push_back(VIEW_IMMIGRATION);
402       break;
403    case SITE_INDUSTRY_POLLUTER:
404       issues.push_back(VIEW_SWEATSHOPS);
405       issues.push_back(VIEW_POLLUTION);
406       break;
407    case SITE_INDUSTRY_NUCLEAR:
408       issues.push_back(VIEW_NUCLEARPOWER);
409       break;
410    case SITE_CORPORATE_HEADQUARTERS:
411       issues.push_back(VIEW_TAXES);
412       issues.push_back(VIEW_CORPORATECULTURE);
413       issues.push_back(VIEW_WOMEN);
414       break;
415    case SITE_CORPORATE_HOUSE:
416       issues.push_back(VIEW_TAXES);
417       issues.push_back(VIEW_CEOSALARY);
418       break;
419    case SITE_MEDIA_AMRADIO:
420       issues.push_back(VIEW_AMRADIO);
421       issues.push_back(VIEW_FREESPEECH);
422       issues.push_back(VIEW_GAY);
423       issues.push_back(VIEW_WOMEN);
424       issues.push_back(VIEW_CIVILRIGHTS);
425       break;
426    case SITE_MEDIA_CABLENEWS:
427       issues.push_back(VIEW_CABLENEWS);
428       issues.push_back(VIEW_FREESPEECH);
429       issues.push_back(VIEW_GAY);
430       issues.push_back(VIEW_WOMEN);
431       issues.push_back(VIEW_CIVILRIGHTS);
432       break;
433    case SITE_RESIDENTIAL_APARTMENT_UPSCALE:
434       issues.push_back(VIEW_TAXES);
435       issues.push_back(VIEW_CEOSALARY);
436       issues.push_back(VIEW_GUNCONTROL);
437       break;
438    case SITE_BUSINESS_CIGARBAR:
439       issues.push_back(VIEW_TAXES);
440       issues.push_back(VIEW_CEOSALARY);
441       issues.push_back(VIEW_WOMEN);
442       break;
443    case SITE_BUSINESS_BANK:
444       issues.push_back(VIEW_TAXES);
445       issues.push_back(VIEW_CEOSALARY);
446       issues.push_back(VIEW_CORPORATECULTURE);
447       break;
448    }
449    for(i=0; i<len(issues); i++)
450       change_public_opinion(issues[i],impact,squad_responsible,impact*10);
451 }
452
453 /* news - determines the priority of a news story */
454 void setpriority(newsstoryst &ns)
455 {
456    // Priority is set differently based on the type of the news story
457    switch(ns.type)
458    {
459       // Major events always muscle to the front page by having a very high priority
460       case NEWSSTORY_MAJOREVENT:
461          ns.priority=30000;
462          break;
463       // LCS-related news stories are more important if they involve lots of headline-grabbing
464       // crimes
465       case NEWSSTORY_SQUAD_SITE:
466       case NEWSSTORY_SQUAD_ESCAPED:
467       case NEWSSTORY_SQUAD_FLEDATTACK:
468       case NEWSSTORY_SQUAD_DEFENDED:
469       case NEWSSTORY_SQUAD_BROKESIEGE:
470       case NEWSSTORY_SQUAD_KILLED_SIEGEATTACK:
471       case NEWSSTORY_SQUAD_KILLED_SIEGEESCAPE:
472       case NEWSSTORY_SQUAD_KILLED_SITE:
473       case NEWSSTORY_CARTHEFT:
474       case NEWSSTORY_NUDITYARREST:
475       case NEWSSTORY_WANTEDARREST:
476       case NEWSSTORY_DRUGARREST:
477       case NEWSSTORY_GRAFFITIARREST:
478       case NEWSSTORY_BURIALARREST:
479       {
480          ns.priority=0;
481
482          int crime[CRIMENUM];
483          memset(crime,0,CRIMENUM*sizeof(int));
484          // Record all the crimes in this story
485          for(int c=0;c<len(ns.crime);c++)
486             crime[ns.crime[c]]++;
487          // Cap publicity for more than ten repeats of an action of some type
488          if(crime[CRIME_STOLEGROUND]>10) crime[CRIME_STOLEGROUND]=10;
489          if(crime[CRIME_BROKEDOWNDOOR]>10) crime[CRIME_BROKEDOWNDOOR]=10;
490          if(crime[CRIME_ATTACKED_MISTAKE]>10) crime[CRIME_ATTACKED_MISTAKE]=10;
491          if(crime[CRIME_ATTACKED]>10) crime[CRIME_ATTACKED]=10;
492          if(crime[CRIME_BREAK_SWEATSHOP]>10) crime[CRIME_BREAK_SWEATSHOP]=10;
493          if(crime[CRIME_BREAK_FACTORY]>10) crime[CRIME_BREAK_FACTORY]=10;
494          if(crime[CRIME_FREE_RABBITS]>10) crime[CRIME_FREE_RABBITS]=10;
495          if(crime[CRIME_FREE_BEASTS]>10) crime[CRIME_FREE_BEASTS]=10;
496          if(crime[CRIME_TAGGING]>10) crime[CRIME_TAGGING]=10;
497
498          // Increase news story priority based on the number of instances of
499          // various crimes, scaled by a factor dependant on the crime
500
501          // Unique site crimes
502          ns.priority+=crime[CRIME_BANKVAULTROBBERY ] * 100;
503          ns.priority+=crime[CRIME_BANKSTICKUP      ] * 100;
504          ns.priority+=crime[CRIME_SHUTDOWNREACTOR  ] * 100;
505          ns.priority+=crime[CRIME_HACK_INTEL       ] * 100;
506          ns.priority+=crime[CRIME_ARMORY           ] * 100;
507          ns.priority+=crime[CRIME_HOUSE_PHOTOS     ] * 100;
508          ns.priority+=crime[CRIME_CORP_FILES       ] * 100;
509          ns.priority+=crime[CRIME_PRISON_RELEASE   ] *  50;
510          ns.priority+=crime[CRIME_JURYTAMPERING    ] *  30;
511          ns.priority+=crime[CRIME_POLICE_LOCKUP    ] *  30;
512          ns.priority+=crime[CRIME_COURTHOUSE_LOCKUP] *  30;
513          ns.priority+=crime[CRIME_BANKTELLERROBBERY] *  30;
514
515          // Common site crimes
516          ns.priority+=crime[CRIME_KILLEDSOMEBODY   ] *  30;
517          ns.priority+=crime[CRIME_FREE_BEASTS      ] *  12;
518          ns.priority+=crime[CRIME_BREAK_SWEATSHOP  ] *   8;
519          ns.priority+=crime[CRIME_BREAK_FACTORY    ] *   8;
520          ns.priority+=crime[CRIME_FREE_RABBITS     ] *   8;
521          ns.priority+=crime[CRIME_ATTACKED_MISTAKE ] *   7;
522          ns.priority+=crime[CRIME_ATTACKED         ] *   4;
523          ns.priority+=crime[CRIME_TAGGING          ] *   2;
524          ns.priority+=crime[CRIME_VANDALISM        ] *   2;
525          //ns.priority+=crime[CRIME_STOLEGROUND      ];
526          //ns.priority+=crime[CRIME_BROKEDOWNDOOR    ];
527
528          // Set story's political and violence levels for determining whether
529          // a story becomes positive or negative
530          if(ns.claimed) ns.politics_level=5;
531          else ns.politics_level=0;
532
533          ns.politics_level+=crime[CRIME_SHUTDOWNREACTOR  ] * 100;
534          ns.politics_level+=crime[CRIME_HACK_INTEL       ] * 100;
535          ns.politics_level+=crime[CRIME_HOUSE_PHOTOS     ] * 100;
536          ns.politics_level+=crime[CRIME_CORP_FILES       ] * 100;
537          ns.politics_level+=crime[CRIME_PRISON_RELEASE   ] *  50;
538          ns.politics_level+=crime[CRIME_POLICE_LOCKUP    ] *  30;
539          ns.politics_level+=crime[CRIME_COURTHOUSE_LOCKUP] *  30;
540          ns.politics_level+=crime[CRIME_FREE_BEASTS      ] *  10;
541          ns.politics_level+=crime[CRIME_BREAK_SWEATSHOP  ] *  10;
542          ns.politics_level+=crime[CRIME_BREAK_FACTORY    ] *  10;
543          ns.politics_level+=crime[CRIME_FREE_RABBITS     ] *  10;
544          ns.politics_level+=crime[CRIME_VANDALISM        ] *   5;
545          ns.politics_level+=crime[CRIME_TAGGING          ] *   3;
546
547          ns.violence_level=0;
548
549          ns.violence_level+=crime[CRIME_ARMORY           ] * 100;
550          ns.violence_level+=crime[CRIME_KILLEDSOMEBODY   ] *  20;
551          ns.violence_level+=crime[CRIME_ATTACKED_MISTAKE ] *  12;
552          ns.violence_level+=crime[CRIME_ATTACKED         ] *   4;
553
554          /*
555          short violence_threshhold;
556          if(attitude[VIEW_POLITICALVIOLENCE]+attitude[VIEW_LIBERALCRIMESQUADPOS]<5)violence_threshhold=1;
557          else if(attitude[VIEW_POLITICALVIOLENCE]+attitude[VIEW_LIBERALCRIMESQUADPOS]<25)violence_threshhold=2;
558          else if(attitude[VIEW_POLITICALVIOLENCE]+attitude[VIEW_LIBERALCRIMESQUADPOS]<45)violence_threshhold=3;
559          else if(attitude[VIEW_POLITICALVIOLENCE]+attitude[VIEW_LIBERALCRIMESQUADPOS]<65)violence_threshhold=4;
560          else if(attitude[VIEW_POLITICALVIOLENCE]+attitude[VIEW_LIBERALCRIMESQUADPOS]<85)violence_threshhold=5;
561          else if(attitude[VIEW_POLITICALVIOLENCE]+attitude[VIEW_LIBERALCRIMESQUADPOS]<105)violence_threshhold=6;
562          else if(attitude[VIEW_POLITICALVIOLENCE]+attitude[VIEW_LIBERALCRIMESQUADPOS]<125)violence_threshhold=7;
563          else if(attitude[VIEW_POLITICALVIOLENCE]+attitude[VIEW_LIBERALCRIMESQUADPOS]<145)violence_threshhold=8;
564          else if(attitude[VIEW_POLITICALVIOLENCE]+attitude[VIEW_LIBERALCRIMESQUADPOS]<165)violence_threshhold=9;
565          else if(attitude[VIEW_POLITICALVIOLENCE]+attitude[VIEW_LIBERALCRIMESQUADPOS]<185)violence_threshhold=10;
566          else violence_threshhold=50;
567          */
568
569          //if(ns.violence_level / (ns.politics_level+1) > violence_threshhold)
570          //   ns.positive = 0;
571          //else ns.positive = 1;
572
573          // Add additional priority based on the type of news story
574          // and how high profile the LCS is
575          switch(ns.type)
576          {
577             case NEWSSTORY_SQUAD_ESCAPED:
578                ns.priority+=10+attitude[VIEW_LIBERALCRIMESQUAD]/3;
579                break;
580             case NEWSSTORY_SQUAD_FLEDATTACK:
581                ns.priority+=15+attitude[VIEW_LIBERALCRIMESQUAD]/3;
582                break;
583             case NEWSSTORY_SQUAD_DEFENDED:
584                ns.priority+=30+attitude[VIEW_LIBERALCRIMESQUAD]/3;
585                break;
586             case NEWSSTORY_SQUAD_BROKESIEGE:
587                ns.priority+=45+attitude[VIEW_LIBERALCRIMESQUAD]/3;
588                break;
589             case NEWSSTORY_SQUAD_KILLED_SIEGEATTACK:
590                ns.priority+=10+attitude[VIEW_LIBERALCRIMESQUAD]/3;
591                break;
592             case NEWSSTORY_SQUAD_KILLED_SIEGEESCAPE:
593                ns.priority+=15+attitude[VIEW_LIBERALCRIMESQUAD]/3;
594                break;
595             case NEWSSTORY_SQUAD_KILLED_SITE:
596                ns.priority+=10+attitude[VIEW_LIBERALCRIMESQUAD]/3;
597                break;
598             default:
599                // Suppress actions at CCS safehouses
600                if(ns.loc!=-1 &&
601                   location[ns.loc]->renting==RENTING_CCS)
602                {
603                   ns.priority = 0;
604                }
605                break;
606          }
607
608          // Double profile if the squad moved out in full battle colors
609          if(ns.claimed==2) ns.priority*=2;
610
611          // Modify notability by location
612          if(ns.loc!=-1)
613          {
614             switch(location[ns.loc]->type)
615             {
616                // Not even reported
617             case SITE_BUSINESS_CRACKHOUSE:
618                if(ns.type == NEWSSTORY_SQUAD_KILLED_SITE ||
619                   ns.type == NEWSSTORY_SQUAD_SITE)
620                {
621                   ns.priority = 0;
622                   break;
623                }
624                // Nobody cares
625             case SITE_RESIDENTIAL_TENEMENT:
626                ns.priority/=8;
627                break;
628
629                // Normal priority
630             case SITE_RESIDENTIAL_SHELTER:
631             case SITE_INDUSTRY_WAREHOUSE:
632             case SITE_RESIDENTIAL_BOMBSHELTER:
633             case SITE_DOWNTOWN:
634             case SITE_COMMERCIAL:
635             case SITE_UDISTRICT:
636             case SITE_OUTOFTOWN:
637             case SITE_INDUSTRIAL:
638             case SITE_RESIDENTIAL_APARTMENT:
639             case SITE_RESIDENTIAL_APARTMENT_UPSCALE:
640             case SITE_LABORATORY_COSMETICS:
641             case SITE_LABORATORY_GENETIC:
642             case SITE_HOSPITAL_CLINIC:
643             case SITE_HOSPITAL_UNIVERSITY:
644             case SITE_INDUSTRY_SWEATSHOP:
645             case SITE_INDUSTRY_POLLUTER:
646             case SITE_BUSINESS_PAWNSHOP:
647             case SITE_BUSINESS_JUICEBAR:
648             case SITE_BUSINESS_CIGARBAR:
649             case SITE_BUSINESS_LATTESTAND:
650             case SITE_BUSINESS_VEGANCOOP:
651             case SITE_BUSINESS_INTERNETCAFE:
652             case SITE_BUSINESS_DEPTSTORE:
653             case SITE_BUSINESS_HALLOWEEN:
654             case SITE_BUSINESS_BARANDGRILL:
655             case SITE_BUSINESS_ARMSDEALER:
656             case SITE_BUSINESS_CARDEALERSHIP:
657             case SITE_OUTDOOR_PUBLICPARK:
658             case SITE_OUTDOOR_BUNKER:
659             default:
660                break;
661
662                // WOAH OMG
663             case SITE_INDUSTRY_NUCLEAR:
664             case SITE_GOVERNMENT_POLICESTATION:
665             case SITE_GOVERNMENT_COURTHOUSE:
666             case SITE_GOVERNMENT_PRISON:
667             case SITE_GOVERNMENT_INTELLIGENCEHQ:
668             case SITE_GOVERNMENT_ARMYBASE:
669             case SITE_GOVERNMENT_FIRESTATION:
670             case SITE_CORPORATE_HEADQUARTERS:
671             case SITE_CORPORATE_HOUSE:
672             case SITE_MEDIA_AMRADIO:
673             case SITE_MEDIA_CABLENEWS:
674             case SITE_BUSINESS_BANK:
675             case SITE_GOVERNMENT_WHITE_HOUSE:
676                ns.priority*=2;
677                break;
678             }
679          }
680
681          // Cap news priority, in part so it can't displace major news stories
682          if(ns.priority>20000) ns.priority=20000;
683          break;
684       }
685       case NEWSSTORY_KIDNAPREPORT:
686          // Kidnappings are higher priority if they're an archconservative
687          ns.priority=20;
688          if(ns.cr->type==CREATURE_CORPORATE_CEO||
689             ns.cr->type==CREATURE_RADIOPERSONALITY||
690             ns.cr->type==CREATURE_NEWSANCHOR||
691             ns.cr->type==CREATURE_SCIENTIST_EMINENT||
692             ns.cr->type==CREATURE_JUDGE_CONSERVATIVE) ns.priority=40;
693          break;
694       case NEWSSTORY_MASSACRE:
695          // More people massacred, higher priority (I think; not verified ns.crime[1] is people present)
696          ns.priority=10 + ns.crime[1]*5;
697          break;
698       case NEWSSTORY_CCS_SITE:
699       case NEWSSTORY_CCS_KILLED_SITE:
700          // CCS actions loosely simulate LCS actions; here it adds some
701          // random site crimes to the story and increases the
702          // priority accordingly
703          ns.crime.push_back(CRIME_BROKEDOWNDOOR);
704          ns.priority=1;
705          ns.politics_level+=20;
706          if(ns.positive==0)
707          {
708             ns.crime.push_back(CRIME_ATTACKED_MISTAKE);
709             ns.priority+=7;
710             ns.violence_level+=12;
711          }
712          ns.crime.push_back(CRIME_ATTACKED);
713          ns.priority+=4*(LCSrandom(10)+1);
714          ns.violence_level+=LCSrandom(10) *  4;
715          if(LCSrandom(endgamestate+1))
716          {
717             ns.crime.push_back(CRIME_KILLEDSOMEBODY);
718             ns.priority+=LCSrandom(10)*30;
719             ns.violence_level+=LCSrandom(10) * 20;
720          }
721          if(LCSrandom(endgamestate+1))
722          {
723             ns.crime.push_back(CRIME_STOLEGROUND);
724             ns.priority+=LCSrandom(10);
725          }
726          if(!LCSrandom(endgamestate+4))
727          {
728             ns.crime.push_back(CRIME_BREAK_FACTORY);
729             ns.priority+=LCSrandom(10)*2;
730             ns.politics_level+=LCSrandom(10) *  10;
731          }
732          if(LCSrandom(2))
733          {
734             ns.crime.push_back(CRIME_CARCHASE);
735          }
736          break;
737       case NEWSSTORY_CCS_DEFENDED:
738       case NEWSSTORY_CCS_KILLED_SIEGEATTACK:
739          ns.priority=40+attitude[VIEW_LIBERALCRIMESQUAD]/3;
740          break;
741    }
742 }
743
744
745
746 /* news - show major news story */
747 void displaystory(newsstoryst &ns,bool liberalguardian,int header)
748 {
749    music.play(MUSIC_NEWSPAPER);
750    int it2;
751    preparepage(ns,liberalguardian);
752
753    char story[5000];
754    short storyx_s[25];
755    short storyx_e[25];
756    for(it2=0;it2<25;it2++) storyx_s[it2]=1;
757    for(it2=0;it2<25;it2++) storyx_e[it2]=78;
758    displayads(ns,liberalguardian,storyx_s,storyx_e,it2);
759
760    const char *city;
761    if(multipleCityMode && ns.loc != -1)
762    {
763       Location * ns_site = find_site_in_city(location[ns.loc]->city, -1);
764       switch(ns_site->type)
765       {
766       case SITE_CITY_SEATTLE: city = "Seattle, WA"; break;
767       case SITE_CITY_NEW_YORK: city = "New York, NY"; break;
768       case SITE_CITY_LOS_ANGELES: city = "Los Angeles, CA"; break;
769       case SITE_CITY_CHICAGO: city = "Chicago, IL"; break;
770       case SITE_CITY_DETROIT: city = "Detroit, MI"; break;
771       case SITE_CITY_ATLANTA: city = "Atlanta, GA"; break;
772       case SITE_CITY_MIAMI: city = "Miami, FL"; break;
773       case SITE_CITY_WASHINGTON_DC: city = "Washington, DC"; break;
774       default: city = lcityname;
775       }
776    }
777    else city = lcityname;
778
779    switch(ns.type)
780    {
781       case NEWSSTORY_MAJOREVENT:
782          displaymajoreventstory(ns,story,storyx_s,storyx_e);
783          break;
784       case NEWSSTORY_CCS_NOBACKERS:
785       case NEWSSTORY_CCS_DEFEATED:
786       case NEWSSTORY_SQUAD_SITE:
787       case NEWSSTORY_SQUAD_ESCAPED:
788       case NEWSSTORY_SQUAD_FLEDATTACK:
789       case NEWSSTORY_SQUAD_DEFENDED:
790       case NEWSSTORY_SQUAD_BROKESIEGE:
791       case NEWSSTORY_SQUAD_KILLED_SIEGEATTACK:
792       case NEWSSTORY_SQUAD_KILLED_SIEGEESCAPE:
793       case NEWSSTORY_SQUAD_KILLED_SITE:
794       case NEWSSTORY_CCS_SITE:
795       case NEWSSTORY_CCS_KILLED_SITE:
796       case NEWSSTORY_CARTHEFT:
797       case NEWSSTORY_NUDITYARREST:
798       case NEWSSTORY_WANTEDARREST:
799       case NEWSSTORY_DRUGARREST:
800       case NEWSSTORY_GRAFFITIARREST:
801       case NEWSSTORY_BURIALARREST:
802       {
803          int y=2;
804          if((!liberalguardian&&ns.page==1)||(liberalguardian&&ns.guardianpage==1))
805          {
806             y=21;
807
808             displaystoryheader(ns,liberalguardian,y,header);
809          }
810
811          strcpy(story,city);
812          strcat(story," - ");
813
814          switch(ns.type)
815          {
816             case NEWSSTORY_CCS_NOBACKERS:
817                strcat(story,"The FBI investigation into the Conservative Crime Squad's government connections has led to the arrest of more than ");
818                strcat(story,"a dozen elected officials and revealed extensive corruption in law enforcement.");
819                strcat(story,"&r");
820                strcat(story,"  \"The uphevals in the police force, and arrest of corrupt officials, are only the beginning,\" FBI Chief ");
821                strcat(story,"Roberta T. Malton said during a news conference.  \"A major focus ");
822                strcat(story,"of our efforts will be on the complete destruction of the Conservative Crime Squad. Within six months, we'll have their ");
823                strcat(story,"entire leadership, dead or alive. I personally guarantee it.\"");
824                strcat(story,"&r");
825                break;
826             case NEWSSTORY_CCS_DEFEATED:
827                strcat(story,"An elite FBI force conducted simultaneous ");
828                strcat(story,"raids on several suspected Conservative Crime Squad safehouses in the early hours. Despite resistance from ");
829                strcat(story,"CCS terrorists armed with automatic weapons and body armor, no FBI agents were killed in the raids, and all ");
830                strcat(story,"three raids were successful. Seventeen suspects were killed in the fighting, and twenty-three are ");
831                strcat(story,"now in custody.");
832                strcat(story,"&r");
833                strcat(story,"  The Conservative Crime Squad fell on hard times when the alternative newspaper Liberal Guardian published ");
834                strcat(story,"1147 pages of documents showing extensive government support for the group. The ensuing scandal ");
835                strcat(story,"led to the arrest of twenty-five members of Congress, as well as several leadership figures in the ");
836                strcat(story,"Conservative Party's National Committee.");
837                strcat(story,"&r");
838                strcat(story,"  \"I want parents to rest easy tonight,\" FBI Chief ");
839                strcat(story,"Roberta T. Malton said during a news conference to announce the raids.  \"You don't need the Liberal Crime Squad ");
840                strcat(story,"to protect you. The Government can handle it.\"");
841                strcat(story,"&r");
842                break;
843             case NEWSSTORY_WANTEDARREST:
844             case NEWSSTORY_GRAFFITIARREST:
845             {
846                int crime[CRIMENUM];
847                std::memset(crime,0,sizeof(int)*CRIMENUM);
848                for(int c=0;c<len(ns.crime);c++)
849                   crime[ns.crime[c]]++;
850                if(crime[CRIME_KILLEDSOMEBODY]>1)
851                {
852                   if(crime[CRIME_KILLEDSOMEBODY]==2)
853                      strcat(story,"Two");
854                   else
855                      strcat(story,"Several");
856                   strcat(story," police officers were");
857                }
858                else strcat(story,"A police officer was");
859                strcat(story," killed in the line of duty yesterday, ");
860                strcat(story,"according to a spokesperson from the police department.");
861                strcat(story,"&r");
862                strcat(story,"  A suspect, identified only as a member of the ");
863                strcat(story,"radical political group known as the Liberal Crime Squad, is believed to have killed ");
864                if(crime[CRIME_KILLEDSOMEBODY]>1)
865                {
866                   strcat(story,crime[CRIME_KILLEDSOMEBODY]);
867                   strcat(story," officers ");
868                }
869                else strcat(story,"the police officer ");
870                strcat(story," while they were attempting to perform an arrest.  ");
871                strcat(story,"The names of the officers have not been released pending notification of their families.");
872                strcat(story,"&r");
873                break;
874             }
875             case NEWSSTORY_NUDITYARREST:
876             case NEWSSTORY_CARTHEFT:
877             case NEWSSTORY_DRUGARREST:
878             case NEWSSTORY_BURIALARREST:
879             {
880                int crime[CRIMENUM];
881                std::memset(crime,0,sizeof(int)*CRIMENUM);
882                for(int c=0;c<len(ns.crime);c++)
883                   crime[ns.crime[c]]++;
884                strcat(story,"A routine arrest went horribly wrong yesterday, ");
885                strcat(story,"according to a spokesperson from the police department.");
886                strcat(story,"&r");
887                strcat(story,"  A suspect, whose identity is unclear, ");
888                strcat(story,"killed ");
889                if(crime[CRIME_KILLEDSOMEBODY]>1)
890                {
891                   strcat(story,crime[CRIME_KILLEDSOMEBODY]);
892                   strcat(story," police officers that were");
893                }
894                else strcat(story,"a police officer that was");
895                strcat(story," attempting to perform an arrest.  ");
896                if(ns.type==NEWSSTORY_NUDITYARREST)
897                   strcat(story,"The incident apparently occurred as a response to a public nudity complaint.  ");
898                else if(ns.type==NEWSSTORY_DRUGARREST)
899                   strcat(story,"The suspect was allegedly selling \"pot brownies\".  ");
900                else if(ns.type==NEWSSTORY_BURIALARREST)
901                {
902                   strcat(story,"A passerby allegedly called the authorities after seeing the suspect dragging what ");
903                   strcat(story,"appeared to be a corpse through an empty lot.  ");
904                }
905                else
906                   strcat(story,"A passerby had allegedly spotted the suspect committing a car theft.  ");
907
908                if(crime[CRIME_KILLEDSOMEBODY]>1)
909                   strcat(story,"The names of the officers have not been released pending notification of their families.");
910                else strcat(story,"The name of the officer has not been released pending notification of the officer's family.");
911                strcat(story,"&r");
912                break;
913             }
914             case NEWSSTORY_SQUAD_ESCAPED:
915                strcat(story,"Members of the Liberal Crime Squad ");
916                strcat(story,"escaped from a police siege yesterday, according ");
917                if(!liberalguardian)strcat(story,"to a spokesperson from the police department.");
918                else strcat(story,"to a Liberal Crime Squad spokesperson.");
919                strcat(story,"&r");
920                break;
921             case NEWSSTORY_SQUAD_FLEDATTACK:
922                strcat(story,"Members of the Liberal Crime Squad ");
923                strcat(story,"escaped from police officers during a raid yesterday, according ");
924                if(!liberalguardian)strcat(story,"to a spokesperson from the police department.");
925                else strcat(story,"to a Liberal Crime Squad spokesperson.");
926                strcat(story,"&r");
927                break;
928             case NEWSSTORY_SQUAD_DEFENDED:
929                strcat(story,"Members of the Liberal Crime Squad ");
930                strcat(story,"fought off a police raid yesterday, according ");
931                if(!liberalguardian)strcat(story,"to a spokesperson from the police department.");
932                else strcat(story,"to a Liberal Crime Squad spokesperson.");
933                strcat(story,"&r");
934                break;
935             case NEWSSTORY_SQUAD_BROKESIEGE:
936                strcat(story,"Members of the Liberal Crime Squad ");
937                strcat(story,"violently broke a police siege yesterday, according ");
938                if(!liberalguardian)strcat(story,"to a spokesperson from the police department.");
939                else strcat(story,"to a Liberal Crime Squad spokesperson.");
940                strcat(story,"&r");
941                break;
942             case NEWSSTORY_SQUAD_KILLED_SIEGEATTACK:
943                strcat(story,"Members of the Liberal Crime Squad were ");
944                if(!liberalguardian)
945                {
946                   strcat(story,"slain during a police raid yesterday, according ");
947                   strcat(story,"to a spokesperson from the police department.");
948                }
949                else
950                {
951                   strcat(story,"murdered during a police raid yesterday, according ");
952                   strcat(story,"to a Liberal Crime Squad spokesperson.");
953                }
954                strcat(story,"&r");
955                break;
956             case NEWSSTORY_SQUAD_KILLED_SIEGEESCAPE:
957                strcat(story,"Members of the Liberal Crime Squad were ");
958                if(!liberalguardian)
959                {
960                   strcat(story,"slain trying to escape from a police siege yesterday, according ");
961                   strcat(story,"to a spokesperson from the police department.");
962                }
963                else
964                {
965                   strcat(story,"murdered trying to escape from a police siege yesterday, according ");
966                   strcat(story,"to a Liberal Crime Squad spokesperson.");
967                }
968                strcat(story,"&r");
969                break;
970             default:
971             {
972                bool ccs=0;
973                if(ns.type==NEWSSTORY_CCS_KILLED_SITE||ns.type==NEWSSTORY_CCS_SITE)ccs=1;
974
975                squadstory_text_opening(ns,liberalguardian,ccs,story);
976
977                int crime[CRIMENUM];
978                memset(crime,0,sizeof(int)*CRIMENUM);
979                int typesum=0;
980                for(int c=0;c<len(ns.crime);c++)
981                {
982                   // Count crimes of each type
983                   crime[ns.crime[c]]++;
984
985                   // Special crimes are described at the start or end of the article;
986                   // others should be recorded in the body
987                   if(ns.crime[c]==CRIME_HOUSE_PHOTOS) continue;
988                   if(ns.crime[c]==CRIME_CORP_FILES) continue;
989                   if(ns.crime[c]==CRIME_SHUTDOWNREACTOR) continue;
990                   if(ns.crime[c]==CRIME_BANKVAULTROBBERY) continue;
991                   if(ns.crime[c]==CRIME_BANKSTICKUP) continue;
992                   if(ns.crime[c]==CRIME_POLICE_LOCKUP) continue;
993                   if(ns.crime[c]==CRIME_COURTHOUSE_LOCKUP) continue;
994                   if(ns.crime[c]==CRIME_PRISON_RELEASE) continue;
995                   if(ns.crime[c]==CRIME_JURYTAMPERING) continue;
996                   if(ns.crime[c]==CRIME_HACK_INTEL) continue;
997                   if(ns.crime[c]==CRIME_ARMORY) continue;
998                   if(ns.crime[c]==CRIME_HOUSE_PHOTOS) continue;
999                   if(ns.crime[c]==CRIME_CORP_FILES) continue;
1000                   if(ns.crime[c]==CRIME_CARCHASE) continue;
1001                   if(ns.crime[c]==CRIME_CARCRASH) continue;
1002                   if(ns.crime[c]==CRIME_FOOTCHASE) continue;
1003                   //if(ns.crime[c]==CRIME_TAGGING) continue;
1004                   if(crime[ns.crime[c]]==1) typesum++;
1005                }
1006
1007                if(crime[CRIME_SHUTDOWNREACTOR])
1008                {
1009                   if(law[LAW_NUCLEARPOWER]==2)
1010                   {
1011                      if(!liberalguardian)
1012                      {
1013                         strcat(story,"  現場の状況によると、");
1014                         strcat(story,"リベラル・クライム・スコードは施設の設備を不正操作して州の水道を汚染させたようだ。");
1015                         strcat(story,"&r");
1016                      }
1017                      else
1018                      {
1019                         strcat(story,"  リベラル・クライム・スコードは、核汚染の危険性を示すため");
1020                         strcat(story,"州の水道を汚染させた。");
1021                         strcat(story,"&r");
1022                      }
1023                   }
1024                   else
1025                   {
1026                      if(!liberalguardian)
1027                      {
1028                         strcat(story,"  現場の状況によると、");
1029                         strcat(story,"リベラル・クライム・スコードの行為で原子炉は破滅的なメルトダウン寸前だったようだ。");
1030                         strcat(story,"&r");
1031                      }
1032                      else
1033                      {
1034                         strcat(story,"  リベラル・クライム・スコードは、原子力発電所の脆弱性と危険性を示すため、");
1035                         strcat(story,"原子炉をメルトダウン寸前にまで追い込んだ。");
1036                         strcat(story,"&r");
1037                      }
1038                   }
1039                }
1040                if(crime[CRIME_POLICE_LOCKUP])
1041                {
1042                   if(!liberalguardian)
1043                   {
1044                      strcat(story,"  現場の状況によると、");
1045                      strcat(story,"リベラル・クライム・スコードは警察署から容疑者を脱走させようとした、または脱走させたようだ。");
1046                      strcat(story,"&r");
1047                   }
1048                   else
1049                   {
1050                      strcat(story,"  リベラル・クライム・スコードは、警察に拘束された無実の人々を解放し、");
1051                      strcat(story,"保守的な警察の尋問官による拷問と暴行から彼らを救い出した。");
1052                      strcat(story,"&r");
1053                   }
1054                }
1055                if(crime[CRIME_BANKVAULTROBBERY])
1056                {
1057                   if(!liberalguardian)
1058                   {
1059                      strcat(story,"  現場の状況によると、");
1060                      strcat(story,"リベラル・クライム・スコードは銀行の金庫を開け、$100,000以上を持ち去ったようだ。");
1061                      strcat(story,"&r");
1062                   }
1063                   else
1064                   {
1065                      strcat(story,"  リベラル・クライム・スコードは銀行の金庫を開け、");
1066                      strcat(story,"保守経済に対するリベラル思想の勝利を証明した。");
1067                      strcat(story,"&r");
1068                   }
1069                }
1070                else if(crime[CRIME_BANKSTICKUP])
1071                {
1072                   if(!liberalguardian)
1073                   {
1074                      strcat(story,"  現場の状況によると、");
1075                      strcat(story,"リベラル・クライム・スコードは銀行員を脅し、金庫を開けさせたようだ。");
1076                      strcat(story,"&r");
1077                   }
1078                   else
1079                   {
1080                      strcat(story,"  リベラル・クライム・スコードは悪と戦う資源を求めるため、");
1081                      strcat(story,"銀行の金庫へのアクセスを要求した。");
1082                      strcat(story,"&r");
1083                   }
1084                }
1085                if(crime[CRIME_COURTHOUSE_LOCKUP])
1086                {
1087                   if(!liberalguardian)
1088                   {
1089                      strcat(story,"  現場の状況によると、");
1090                      strcat(story,"リベラル・クライム・スコードは裁判所から容疑者を脱走させようとした、または脱走させたようだ。");
1091                      strcat(story,"&r");
1092                   }
1093                   else
1094                   {
1095                      strcat(story,"  リベラル・クライム・スコードは、裁判所に拘束された無実の人々を解放し、");
1096                      strcat(story,"保守によって腐敗した司法から彼らを救い出した。");
1097                      strcat(story,"&r");
1098                   }
1099                }
1100                if(crime[CRIME_PRISON_RELEASE])
1101                {
1102                   if(!liberalguardian)
1103                   {
1104                      strcat(story,"  現場の状況によると、");
1105                      strcat(story,"リベラル・クライム・スコードは施設から囚人を脱走させようとしたようだ。");
1106                      strcat(story,"&r");
1107                   }
1108                   else
1109                   {
1110                      strcat(story,"  リベラル・クライム・スコードは、保守に虐待されている無実の人々を収容所から解放した。");
1111                      strcat(story,"&r");
1112                   }
1113                }
1114                if(crime[CRIME_JURYTAMPERING])
1115                {
1116                   if(!liberalguardian)
1117                   {
1118                      strcat(story,"  現場の警察関係者の情報からすると、");
1119                      strcat(story,"リベラル・クライム・スコードの行為は陪審員に影響を与え、");
1120                      strcat(story,"裁判の信頼を失墜させるものだ。");
1121                      strcat(story,"&r");
1122                   }
1123                   else
1124                   {
1125                      strcat(story,"  リベラル・クライム・スコードが陪審員の熟慮を妨げたことをここで謝罪する。");
1126                      strcat(story,"&r");
1127                   }
1128                }
1129                if(crime[CRIME_HACK_INTEL])
1130                {
1131                   if(!liberalguardian)
1132                   {
1133                      strcat(story,"  現場の警察関係者の情報によると、");
1134                      strcat(story,"情報局職員はこの件で非常に動揺しているようだ。");
1135                      strcat(story,"&r");
1136                   }
1137                   else
1138                   {
1139                      strcat(story,"  リベラル・クライム・スコードのコンピュータ専門チームはCIAのコンピュータから機密情報を解放した。");
1140                      strcat(story,"&r");
1141                   }
1142                }
1143                if(crime[CRIME_ARMORY])
1144                {
1145                   if(!liberalguardian)
1146                   {
1147                      strcat(story,"  関係者の情報によると、");
1148                      strcat(story,"リベラル・クライム・スコードは武器庫へ侵入を試みたようだ。");
1149                      strcat(story,"&r");
1150                   }
1151                   else
1152                   {
1153                      strcat(story,"  リベラル・クライム・スコードの特殊潜入班は抑圧者から武器を解放した。");
1154                      strcat(story,"&r");
1155                   }
1156                }
1157                if(crime[CRIME_HOUSE_PHOTOS])
1158                {
1159                   if(!liberalguardian)
1160                   {
1161                      strcat(story,"  現場の警察関係者の情報によると、");
1162                      strcat(story,"物を盗まれた家主はパニック状態だったようだ。");
1163                      strcat(story,"&r");
1164                   }
1165                   else
1166                   {
1167                      strcat(story,"  リベラル・クライム・スコードが保守CEOの腐敗を明らかにした。");
1168                      strcat(story,"&r");
1169                   }
1170                }
1171                if(crime[CRIME_CORP_FILES])
1172                {
1173                   if(!liberalguardian)
1174                   {
1175                      strcat(story,"  現場の警察関係者の情報によると、");
1176                      strcat(story,"現場の企業幹部たちはこの件で非常に動揺しているようだ。");
1177                      strcat(story,"&r");
1178                   }
1179                   else
1180                   {
1181                      strcat(story,"  リベラル・クライム・スコードが企業における保守の腐敗を明らかにした。");
1182                      strcat(story,"&r");
1183                   }
1184                }
1185
1186                if(liberalguardian&&!ccs)
1187                {
1188                   if(crime[CRIME_ATTACKED_MISTAKE]) typesum--;
1189                   if(crime[CRIME_KILLEDSOMEBODY]) typesum--;
1190                }
1191
1192                if(typesum>0)
1193                {
1194                   if(typesum>0)
1195                   {
1196                      if(!ccs)
1197                      {
1198                         if(!liberalguardian)
1199                         {
1200                            strcat(story,"  詳細は不明だが、警察はLCSが");
1201                         }
1202                         else
1203                         {
1204                            strcat(story,"  リベラル・クライム・スコードは");
1205                         }
1206                      }
1207                      else
1208                      {
1209                         strcat(story,"  詳細は不明だが、警察はCCSが");
1210                      }
1211                      if(crime[CRIME_ARSON])
1212                      {
1213                         if(!liberalguardian||ccs)
1214                         {
1215                            strcat(story,"放火");
1216                         }
1217                         else
1218                         {
1219                            strcat(story,"保守の設備の焼却処分");
1220                         }
1221
1222                         if(typesum>=3)strcat(story,"、");
1223                         else if(typesum==2)strcat(story,"と");
1224                         typesum--;
1225                      }
1226                      if(!liberalguardian||ccs)
1227                      {
1228                         if(crime[CRIME_KILLEDSOMEBODY])
1229                         {
1230                            strcat(story,"殺人");
1231                            if(typesum>=3)strcat(story,"、");
1232                            else if(typesum==2)strcat(story,"と");
1233                            typesum--;
1234                         }
1235                         if(crime[CRIME_ATTACKED_MISTAKE])
1236                         {
1237                            strcat(story,"傷害");
1238                            if(typesum>=3)strcat(story,"、");
1239                            else if(typesum==2)strcat(story,"と");
1240                            typesum--;
1241                         }
1242                         if(crime[CRIME_ATTACKED])
1243                         {
1244                            if(crime[CRIME_ATTACKED_MISTAKE])strcat(story,"多数を巻き込んだ傷害");
1245                            else strcat(story,"傷害");
1246                            if(typesum>=3)strcat(story,"、");
1247                            else if(typesum==2)strcat(story,"と");
1248                            typesum--;
1249                         }
1250                      }
1251                      else
1252                      {
1253                         if(crime[CRIME_ATTACKED])
1254                         {
1255                            strcat(story,"保守派との戦闘");
1256                            if(typesum>=3)strcat(story,"、");
1257                            else if(typesum==2)strcat(story,"と");
1258                            typesum--;
1259                         }
1260                      }
1261                      if(crime[CRIME_STOLEGROUND]||crime[CRIME_BANKTELLERROBBERY])
1262                      {
1263                         if(!liberalguardian||ccs)
1264                         {
1265                            strcat(story,"強盗");
1266                         }
1267                         else
1268                         {
1269                            strcat(story,"敵の資源の解放");
1270                         }
1271                         if(typesum>=3)strcat(story,"、");
1272                         else if(typesum==2)strcat(story,"と");
1273                         typesum--;
1274                      }
1275                      if(crime[CRIME_FREE_RABBITS]||crime[CRIME_FREE_BEASTS])
1276                      {
1277                         if(!liberalguardian)
1278                         {
1279                            strcat(story,"研究所の動物の放出");
1280                         }
1281                         else
1282                         {
1283                            strcat(story,"虐待された動物の解放");
1284                         }
1285
1286                         if(typesum>=3)strcat(story,"、");
1287                         else if(typesum==2)strcat(story,"と");
1288                         typesum--;
1289                      }
1290                      if(crime[CRIME_BREAK_SWEATSHOP]||crime[CRIME_BREAK_FACTORY]||crime[CRIME_VANDALISM])
1291                      {
1292                         if(!liberalguardian||ccs)
1293                         {
1294                            strcat(story,"設備の破壊");
1295                         }
1296                         else
1297                         {
1298                            strcat(story,"敵のインフラの破壊");
1299                         }
1300
1301                         if(typesum>=3)strcat(story,"、");
1302                         else if(typesum==2)strcat(story,"と");
1303                         typesum--;
1304                      }
1305                      if(crime[CRIME_TAGGING])
1306                      {
1307                         if(!liberalguardian||ccs)
1308                         {
1309                            strcat(story,"破壊行為");
1310                         }
1311                         else
1312                         {
1313                            strcat(story,"解放の印のマーキング");
1314                         }
1315
1316                         if(typesum>=3)strcat(story,"、");
1317                         else if(typesum==2)strcat(story,"と");
1318                         typesum--;
1319                      }
1320                      if(crime[CRIME_BROKEDOWNDOOR])
1321                      {
1322                         if(!liberalguardian||ccs)
1323                         {
1324                            strcat(story,"破壊と侵入");
1325                         }
1326                         else
1327                         {
1328                            strcat(story,"破壊された扉からの入場");
1329                         }
1330
1331                         if(typesum>=3)strcat(story,"、");
1332                         else if(typesum==2)strcat(story,"と");
1333                         typesum--;
1334                      }
1335                      if(crime[CRIME_UNLOCKEDDOOR])
1336                      {
1337                         if(!liberalguardian||ccs)
1338                         {
1339                            strcat(story,"不法侵入");
1340                         }
1341                         else
1342                         {
1343                            strcat(story,"鍵の解除");
1344                         }
1345
1346                         if(typesum>=3)strcat(story,"、");
1347                         else if(typesum==2)strcat(story,"と");
1348                         typesum--;
1349                      }
1350                      if(!ccs&&!liberalguardian)
1351                         {
1352                         strcat(story,"の犯行に及んだと見て調査している");
1353                         }
1354                      else
1355                         {
1356                         strcat(story,"を敢行した");
1357                         }
1358                      strcat(story,"。");
1359                   }
1360                   strcat(story,"&r");
1361                }
1362
1363                if(crime[CRIME_CARCHASE])
1364                {
1365                   if(!liberalguardian||ccs)
1366                   {
1367                      strcat(story,"  事件の後、車は猛スピードで追跡された。");
1368                   }
1369                   else
1370                   {
1371                      strcat(story,"  保守派は無謀にもLCSを猛スピードで追跡した。");
1372                   }
1373
1374                   if(crime[CRIME_CARCRASH])
1375                   {
1376                      if(crime[CRIME_CARCRASH]>1)
1377                      {
1378                         strcat(story,"そして");
1379                         strcat(story,crime[CRIME_CARCRASH]);
1380                         strcat(story,"台の車が事故を起こした。");
1381                      }
1382                      else strcat(story,"そして1台の車が破損した。");
1383                      if(!liberalguardian||ccs)
1384                         strcat(story,"犠牲者の詳細はまだ発表されていない。");//XXX: Why not turn them into martyrs?
1385                   }
1386
1387                   if(crime[CRIME_FOOTCHASE])
1388                   {
1389                      if(!liberalguardian||ccs)
1390                         strcat(story,"車による追跡の後にも、徒歩による追跡が容疑者を見失うまで続いた。");
1391                      else
1392                         strcat(story,"リベラル・クライム・スコードは市民を車による危険な追跡から守るため、徒歩で逃走することを選択した。");
1393                   }
1394                   strcat(story,"&r");
1395                }
1396                if(!ccs)
1397                {
1398                   if(!LCSrandom(8))
1399                   {
1400                      if(crime[CRIME_TAGGING])
1401                      {
1402                         strcat(story,"  壁には" "\"");
1403                         strcat(story,slogan);
1404                         strcat(story,"\"" "という言葉が残されていた。");
1405                      }
1406                      else
1407                      {
1408                         switch(LCSrandom(3))
1409                         {
1410                         case 0:
1411                            if (ns.type==NEWSSTORY_SQUAD_KILLED_SITE)
1412                            {
1413                               strcat(story,"  生存者によれば、現場を去る前に" "\"");
1414                               strcat(story,slogan);
1415                               strcat(story,"\"" "とつぶやいていたとも伝えられている。");
1416                            }
1417                            else
1418                            {
1419                               strcat(story,"  現場を去る前に" "\"");
1420                               strcat(story,slogan);
1421                               strcat(story,"\"" "と叫んでいたとも伝えられている。");
1422                            }
1423                            break;
1424                         case 1:
1425                            strcat(story,"  彼らの内の一人が" "\"");
1426                            strcat(story,slogan);
1427                            strcat(story,"\"" "と叫んだとも伝えられている。");
1428                            break;
1429                         case 2:
1430                            strcat(story,"  目撃者は" "\"");
1431                            strcat(story,slogan);
1432                            strcat(story,"\"" "という言葉を聞いたと証言している。");
1433                            break;
1434                         }
1435                      }
1436                      strcat(story,"&r");
1437                   }
1438                }
1439                break;
1440             }
1441          }
1442
1443          generatefiller(story,200);
1444          displaynewsstory(story,storyx_s,storyx_e,y);
1445
1446          if(!newscherrybusted)newscherrybusted=1;
1447          if(ns.type==NEWSSTORY_CCS_SITE||
1448             ns.type==NEWSSTORY_CCS_KILLED_SITE)newscherrybusted=2;
1449          break;
1450       }
1451       case NEWSSTORY_MASSACRE:
1452       {
1453          int y=3;
1454          if(ns.page==1)
1455          {
1456             y=21;
1457             if(ns.crime[0]==SIEGE_CCS)
1458             {
1459                displaycenterednewsfont("CCS MASSACRE",5);
1460             }
1461             else if(!liberalguardian)
1462             {
1463                displaycenterednewsfont("MYSTERIOUS",5);
1464                displaycenterednewsfont("MASSACRE",13);
1465             }
1466             else
1467             {
1468                displaycenterednewsfont("CONSERVATIVE",5);
1469                displaycenterednewsfont("MASSACRE",13);
1470             }
1471          }
1472
1473          strcpy(story,city);
1474          strcat(story," - ");
1475          strcat(story,"昨日、");
1476          strcat(story,location[ns.loc]->name);
1477          strcat(story,"で");
1478          if(ns.crime[1]>2)
1479          {
1480             strcat(story,ns.crime[1]);
1481             strcat(story,"体の遺体"); //Gruesome pile, large pile.
1482          }
1483          else if(ns.crime[1]>1)strcat(story,"2体の遺体");
1484          else strcat(story,"遺体");
1485          strcat(story,"が発見された。");
1486          if(!liberalguardian)
1487          {
1488             strcat(story,"  警察は殺人事件として調査している。");
1489             strcat(story,"&r");
1490             strcat(story,"  今のところ有効な手がかりはないが、専門家は「");
1491          }
1492          else
1493          {
1494             strcat(story,"  警察はこの事件について調査を開始したが、");
1495             strcat(story,"深い追求を避けているように思われる。");
1496             strcat(story,"&r");
1497             strcat(story,"  リベラル・クライム・スコードは、犠牲となったLCSの");
1498             if(ns.crime[1]>1)strcat(story,"メンバーたち");
1499             else strcat(story,"メンバー");
1500             strcat(story,"はその政治的信念が原因で狙われたと見ている。");
1501             strcat(story,"LCSの広報官は「");
1502          }
1503          switch(ns.crime[0])
1504          {
1505             case SIEGE_CIA:
1506                if(!liberalguardian)
1507                {
1508                   if(ns.crime[1]>1)strcat(story,"遺体からは顔も");
1509                   else strcat(story,"遺体からは顔も");
1510                   strcat(story,"指紋も全て消されていた。これまで見た中で、最も");
1511                   if(law[LAW_FREESPEECH]==-2)strcat(story,"[おかしな]事件だ");
1512                   else if(law[LAW_FREESPEECH]==2)strcat(story,"イカレた事件だ");
1513                   else strcat(story,"奇妙な事件だ");
1514                }
1515                else
1516                {
1517                   strcat(story,"この事件は中央情報局による超法的殺戮であるという確かな証拠が我々にはある。");
1518                   strcat(story,"これは情報局の人権侵害と腐敗を暴こうとする我々に対する復讐だ");
1519                }
1520                break;
1521             case SIEGE_POLICE:
1522             case SIEGE_HICKS:
1523                if(!liberalguardian)
1524                {
1525                   strcat(story,"火傷と…恐らく干草用の熊手による刺し傷がある。咬まれたような傷もあるようだ。");
1526                   strcat(story,"証拠は何も残されていない。完璧な虐殺だ");
1527                }
1528                else
1529                {
1530                   strcat(story,"これは保守メディアの洗脳的プロパガンダに影響を受けた残忍な虐殺であると確信している");
1531                }
1532                break;
1533             case SIEGE_CORPORATE:
1534                if(!liberalguardian)
1535                {
1536                   strcat(story,"まるで処刑のようだ。これはプロの犯行だ。手がかりは何もない");
1537                }
1538                else
1539                {
1540                   strcat(story,"殺戮現場には、以前から我々と対立している複数の企業と協力関係にある民間傭兵グループのサインがあった。");
1541                   strcat(story,"「もし」警察がこのことを公表しないならば、それは隠そうとしているのだろう");
1542                }
1543                break;
1544             case SIEGE_CCS:
1545                if(!liberalguardian)
1546                {
1547                   strcat(story,"見よ、これがコンサバ・クライム・スコードの攻撃だ。");
1548                   strcat(story,"知っての通り、彼らには名前も顔もなく、本当はどこで起こったことなのかさえもわからない");
1549                }
1550                else
1551                {
1552                   strcat(story,"これはコンサバ・クライム・スコードの殺戮者によるものだ。");
1553                   strcat(story,"再び殺戮を行う前に阻止しなければならない");
1554                }
1555                break;
1556             case SIEGE_FIREMEN:
1557                if(!liberalguardian)
1558                {
1559                   if(ns.crime[1]>1)strcat(story,"発見された遺体は");
1560                   else strcat(story,"発見された遺体は");
1561                   strcat(story,"焼かれて判別不能だった。");
1562                   strcat(story,"建物の焼失状況によると、これは事件ではない。");
1563                   strcat(story,"我々は消防局と協力して放火犯を追跡しているところだ。");
1564                   strcat(story,"幸いなことに、他の建物に燃え広がる前に消防士が消し止めることができた");
1565                }
1566                else
1567                {
1568                   if(ns.crime[1]>1)strcat(story,"殺害されたのはこの新聞の記者たち");
1569                   else strcat(story,"殺害されたのはこの新聞の記者");
1570                   strcat(story,"だ。");
1571                   strcat(story,"これは新聞発行の自由を侵害する保守の殺戮者による反抗であることは明白だ");
1572                }
1573          }
1574          strcat(story,"。」と語っている。");
1575          strcat(story,"&r");
1576
1577          generatefiller(story,200);
1578          displaynewsstory(story,storyx_s,storyx_e,y);
1579          break;
1580       }
1581       case NEWSSTORY_KIDNAPREPORT:
1582       {
1583          int y=2;
1584          if(ns.page==1)
1585          {
1586             y=21;
1587             if(liberalguardian)
1588             {
1589                displaycenterednewsfont("LCS DENIES",5);
1590                displaycenterednewsfont("KIDNAPPING",13);break;
1591             }
1592             else
1593             {
1594                switch(ns.cr->type)
1595                {
1596                   case CREATURE_CORPORATE_CEO:
1597                      displaycenterednewsfont("CEO",5);
1598                      displaycenterednewsfont("KIDNAPPED",13);break;
1599                   case CREATURE_RADIOPERSONALITY:
1600                      displaycenterednewsfont("RADIO HOST",5);
1601                      displaycenterednewsfont("KIDNAPPED",13);break;
1602                   case CREATURE_NEWSANCHOR:
1603                      displaycenterednewsfont("NEWS ANCHOR",5);
1604                      displaycenterednewsfont("KIDNAPPED",13);break;
1605                   case CREATURE_SCIENTIST_EMINENT:
1606                      displaycenterednewsfont("SCIENTIST",5);
1607                      displaycenterednewsfont("KIDNAPPED",13);break;
1608                   case CREATURE_JUDGE_CONSERVATIVE:
1609                      displaycenterednewsfont("JUDGE",5);
1610                      displaycenterednewsfont("KIDNAPPED",13);break;
1611                   case CREATURE_COP:
1612                   case CREATURE_GANGUNIT:
1613                   case CREATURE_DEATHSQUAD:
1614                      displaycenterednewsfont("COP",5);
1615                      displaycenterednewsfont("KIDNAPPED",13);break;
1616                   default:
1617                      displaycenterednewsfont("SOMEONE",5);
1618                      displaycenterednewsfont("KIDNAPPED",13);break;
1619                }
1620             }
1621          }
1622
1623          strcpy(story,city);
1624          strcat(story," - The disappearance of ");
1625          strcat(story,ns.cr->propername);
1626          strcat(story," is now considered a kidnapping, ");
1627          strcat(story,"according to a police spokesperson.");
1628          strcat(story,"&r");
1629
1630          char dstr[200],dstr2[200];
1631          strcat(story,"  ");
1632          generate_name(dstr,dstr2);
1633          strcat(story,dstr);
1634          strcat(story," ");
1635          strcat(story,dstr2);
1636          strcat(story,", speaking on behalf of the police department, stated ");
1637          strcat(story,"\"We now believe that ");
1638          strcat(story,ns.cr->propername);
1639          strcat(story," was taken ");
1640          strcat(story,ns.cr->joindays-1);
1641          strcat(story," days ago, by a person or persons as yet undetermined.  ");
1642          strcat(story,"We have several leads and are confident that we will ");
1643          strcat(story,"bring ");
1644          strcat(story,ns.cr->propername);
1645          strcat(story," back home and bring the kidnappers to justice.  ");
1646          strcat(story,"As the investigation is ongoing, I cannot be more specific at this time.  ");
1647          strcat(story,"To the citizens, please contact the department if you have any additional information.");
1648          strcat(story,"\"");
1649          strcat(story,"&r");
1650          strcat(story,"  According to sources, ");
1651          strcat(story,ns.cr->propername);
1652          strcat(story,"'s last known location was the ");
1653          strcat(story,location[ns.cr->worklocation]->name);
1654          strcat(story,".  Police were seen searching the surrounding area yesterday.");
1655          strcat(story,"&r");
1656
1657          generatefiller(story,200);
1658          displaynewsstory(story,storyx_s,storyx_e,y);
1659          break;
1660       }
1661    }
1662
1663    int c;
1664    do c=getkey(); while(c!='x'&&c!=ESC&&c!=ENTER&&c!=SPACEBAR);
1665 }
1666
1667
1668
1669 /* news - graphics */
1670 void loadgraphics()
1671 {
1672    int picnum,dimx,dimy;
1673
1674    FILE *h;
1675
1676    if((h=LCSOpenFile("largecap.cpc", "rb", LCSIO_PRE_ART))!=NULL)
1677    {
1678
1679       fread(&picnum,sizeof(int),1,h);
1680       fread(&dimx,sizeof(int),1,h);
1681       fread(&dimy,sizeof(int),1,h);
1682       for(int p=0;p<picnum;p++)
1683          for(int x=0;x<dimx;x++)
1684             for(int y=0;y<dimy;y++)
1685                fread(&bigletters[p][x][y][0],sizeof(char),4,h);
1686       LCSCloseFile(h);
1687    }
1688
1689    if((h=LCSOpenFile("newstops.cpc", "rb", LCSIO_PRE_ART))!=NULL)
1690    {
1691
1692       fread(&picnum,sizeof(int),1,h);
1693       fread(&dimx,sizeof(int),1,h);
1694       fread(&dimy,sizeof(int),1,h);
1695       for(int p=0;p<picnum;p++)
1696          for(int x=0;x<dimx;x++)
1697             for(int y=0;y<dimy;y++)
1698                fread(&newstops[p][x][y][0],sizeof(char),4,h);
1699       LCSCloseFile(h);
1700    }
1701
1702    if((h=LCSOpenFile("newspic.cpc", "rb", LCSIO_PRE_ART))!=NULL)
1703    {
1704
1705       fread(&picnum,sizeof(int),1,h);
1706       fread(&dimx,sizeof(int),1,h);
1707       fread(&dimy,sizeof(int),1,h);
1708       for(int p=0;p<picnum;p++)
1709          for(int x=0;x<dimx;x++)
1710             for(int y=0;y<dimy;y++)
1711                fread(&newspic[p][x][y][0],sizeof(char),4,h);
1712       LCSCloseFile(h);
1713    }
1714 }
1715
1716 void displaycenterednewsfont(const std::string& str,int y)
1717 {
1718    int width=-1;
1719    int s;
1720    for(s=0;s<len(str);s++)
1721    {
1722       if(str[s]>='A'&&str[s]<='Z')width+=6;
1723       else if(str[s]=='\'')width+=4;
1724       else width+=3;
1725    }
1726
1727    int x=39-width/2;
1728
1729    for(s=0;s<len(str);s++)
1730    {
1731       if((str[s]>='A'&&str[s]<='Z')||str[s]=='\'')
1732       {
1733          int p;
1734          if(str[s]>='A'&&str[s]<='Z') p=str[s]-'A';
1735          else p=26;
1736          int lim=6;
1737          if(str[s]=='\'') lim=4;
1738          if(s==len(str)-1) lim--;
1739          for(int x2=0;x2<lim;x2++) for(int y2=0;y2<7;y2++)
1740          {
1741             move(y+y2,x+x2);
1742
1743 #ifdef NCURSES
1744             // Clean the square first.
1745             set_color(COLOR_BLACK, COLOR_BLACK, 0);
1746             addchar(' ');
1747             move(y+y2,x+x2);
1748 #endif
1749
1750             if(x2==5)
1751             {
1752                set_color(COLOR_WHITE,COLOR_WHITE,0);
1753                addchar(' ');
1754             }
1755             else
1756             {
1757                set_color(translateGraphicsColor(bigletters[p][x2][y2][1]),
1758                          translateGraphicsColor(bigletters[p][x2][y2][2]),
1759                          bigletters[p][x2][y2][3]);
1760                addgrah(bigletters[p][x2][y2][0]);
1761             }
1762          }
1763          x+=lim;
1764       }
1765       else
1766       {
1767          set_color(COLOR_WHITE,COLOR_WHITE,0);
1768          for(int x2=0;x2<3;x2++) for(int y2=0;y2<7;y2++)
1769          {
1770             move(y+y2,x+x2);
1771             addchar(' ');
1772          }
1773          x+=3;
1774       }
1775    }
1776 }
1777
1778 void displaycenteredsmallnews(const std::string& str,int y)
1779 {
1780    int x=39-((len(str)-1)>>1);
1781    move(y,x);
1782    set_color(COLOR_BLACK,COLOR_WHITE,0);
1783    addstr(str);
1784 }
1785
1786 void displaynewspicture(int p,int y)
1787 {
1788    for(int x2=0;x2<78;x2++)
1789       for(int y2=0;y2<15;y2++)
1790       {
1791          if(y+y2>24) break;
1792          move(y+y2,1+x2);
1793          set_color(translateGraphicsColor(newspic[p][x2][y2][1]),
1794                    translateGraphicsColor(newspic[p][x2][y2][2]),
1795                    newspic[p][x2][y2][3]);
1796          addgrah(newspic[p][x2][y2][0]);
1797       }
1798 }
1799
1800 int chrsize(char *str)
1801 {
1802    if(strlen("漢")==3) // UTF-8
1803    {
1804       if((*str & 0x80) == 0)
1805          return 1;
1806       else if((*str & 0xe0) == 0xc0)
1807          return 2;
1808       else if((*str & 0xf0) == 0xe0)
1809         return 3;
1810       else if((*str & 0xf8) == 0xf0)
1811         return 4;
1812       else if((*str & 0xfc) == 0xf8)
1813         return 5;
1814       else if((*str & 0xfe) == 0xfc)
1815         return 6;
1816       else
1817         return 1;
1818    }
1819    else // ShiftJIS or EUC
1820    {
1821       if(*str & 0x80)
1822          return 2;
1823       else
1824          return 1;
1825    }
1826 }
1827
1828 /* news - draws the specified block of text to the screen */
1829 void displaynewsstory(char *story,short *storyx_s,short *storyx_e,int y)
1830 {
1831    vector<char *> text;
1832    vector<char> centered;
1833
1834    int totalwidth;
1835    int curpos=0;
1836
1837    int addstrcur;
1838    char addstring[500];
1839
1840    char content;
1841    int cury=y;
1842    int length;
1843    char endparagraph=0;
1844    char iscentered=0;
1845    int i=0;
1846    int j;
1847    int size;
1848
1849    while(curpos<len(story)&&cury<25)
1850    {
1851       content=0;
1852       totalwidth=0;
1853       addstrcur=0;
1854       length=storyx_e[cury]-storyx_s[cury]+1;
1855       if(length==0){cury++;if(endparagraph>0)endparagraph--;continue;}
1856
1857       for(i=curpos;i<len(story);i++)
1858       {
1859          if(story[i]=='&'&&story[i+1]!='&')
1860          {
1861             i++;
1862             if(story[i]=='c')iscentered=1;
1863             if(story[i]=='r')
1864             {
1865                content=1;
1866                i++;
1867                addstrcur+=1;
1868                addstring[addstrcur-1]=' ';
1869                addstring[addstrcur]='\x0';
1870                endparagraph=1;
1871                break;
1872             }
1873          }
1874          else
1875          {
1876             content=1;
1877
1878             if(story[i]=='&')i++;
1879             if((size = chrsize(&story[i])) > 1) {
1880                for(j=0;j<size-1;j++)
1881                           addstring[addstrcur++]=story[i++];
1882                totalwidth++;
1883             }
1884             addstring[addstrcur]=story[i];
1885             addstring[addstrcur+1]='\x0';
1886             totalwidth++;
1887             if(totalwidth+1>length&&size>1)
1888             {
1889                i-=(size-1);
1890                addstrcur-=(size-1);
1891                addstring[addstrcur]='\x0';
1892                break;
1893             }
1894             if(totalwidth>length)
1895             {
1896                while(story[i]!=' ') i--,addstrcur--;
1897                while(story[i]==' ') i++;
1898                addstring[addstrcur]='\x0';
1899                break;
1900             }
1901             addstrcur++;
1902          }
1903       }
1904
1905       if(i==len(story)) addstring[addstrcur]='\x0';
1906
1907       if(len(addstring)&&content)
1908       {
1909          int words=0;
1910          char silent=1;
1911          vector<int> spacex;
1912          for(int s2=0;s2<len(addstring);s2++)
1913          {
1914             if(addstring[s2]==' ')
1915             {
1916                if(!silent)
1917                {
1918                   silent=1;
1919                   words++;
1920                   spacex.push_back(s2);
1921                }
1922             }
1923             else
1924             {
1925                if(silent)
1926                {
1927                   words++;
1928                   silent=0;
1929                }
1930             }
1931          }
1932
1933          while(!endparagraph&&words>1&&len(addstring)<length&&!iscentered)
1934          {
1935             int csp=pickrandom(spacex);
1936
1937             for(int x=0;x<len(spacex);x++)
1938                if(spacex[x]>csp) spacex[x]++;
1939
1940             int l=len(addstring);
1941             for(int s=l+1;s>csp;s--)
1942                addstring[s]=addstring[s-1];
1943          }
1944
1945          char *news=new char[len(addstring)+1];
1946          strcpy(news,addstring);
1947          text.push_back(news);
1948          centered.push_back(iscentered);
1949          cury++;
1950          if(endparagraph>0)
1951             endparagraph--,iscentered=0;
1952       }
1953
1954       curpos=i;
1955    }
1956
1957    set_color(COLOR_BLACK,COLOR_WHITE,0);
1958    for(int t=0;t<len(text);t++)
1959    {
1960       if(y+t>=25) break;
1961       if(text[t][len(text[t])-1]==' ') // remove trailing space
1962          text[t][len(text[t])-1]='\x0'; // (necessary for proper centering and to not overwrite borders around an ad)
1963       if(centered[t])
1964          move(y+t,((storyx_s[y+t]+storyx_e[y+t]-len(text[t])+1)>>1));
1965       else move(y+t,storyx_s[y+t]);
1966       addstr(text[t]);
1967
1968       delete[] text[t];
1969    }
1970    text.clear();
1971 }
1972
1973
1974
1975 /* news - make some filler junk */
1976 void generatefiller(char *story,int amount)
1977 {  //TODO: Use text from filler.cpp
1978    strcat(story,"&r"+cityname()+" - ");
1979    for(int par=0;amount>0;amount--)
1980    {
1981       par++;
1982       for(int i=0;i<LCSrandom(10)+3;i++)strcat(story,"~");
1983       if(amount>1)strcat(story," ");
1984       if(par>=50&&!LCSrandom(5)&&amount>20)
1985       {
1986          par=0;
1987          strcat(story,"&r  ");
1988       }
1989    }
1990    strcat(story,"&r");
1991 }
1992
1993
1994 newsstoryst* new_major_event()
1995 {
1996    newsstoryst *ns=new newsstoryst;
1997    ns->type=NEWSSTORY_MAJOREVENT;
1998    while(true)
1999    {
2000       ns->view=LCSrandom(VIEWNUM-3);
2001       ns->positive=LCSrandom(2);
2002
2003       // Skip issues that we have no news stories for
2004       if(ns->view==VIEW_IMMIGRATION)continue;
2005       if(ns->view==VIEW_DRUGS)continue;
2006       if(ns->view==VIEW_MILITARY)continue;
2007       if(ns->view==VIEW_CIVILRIGHTS)continue;
2008       if(ns->view==VIEW_TORTURE)continue;
2009       //if(ns->view==VIEW_POLITICALVIOLENCE)continue;
2010
2011       // News stories that don't apply when the law is extreme -- covering
2012       // nuclear power when it's banned, police corruption when it doesn't
2013       // exist, out of control pollution when it's under control, etc.
2014       if(ns->positive) {
2015          if(ns->view==VIEW_WOMEN&&law[LAW_ABORTION]==-2)continue; // Abortion banned
2016          if(ns->view==VIEW_DEATHPENALTY&&law[LAW_DEATHPENALTY]==2)continue; // Death penalty banned
2017          if(ns->view==VIEW_NUCLEARPOWER&&law[LAW_NUCLEARPOWER]==2)continue; // Nuclear power banned
2018          if(ns->view==VIEW_ANIMALRESEARCH&&law[LAW_ANIMALRESEARCH]==2)continue; // Animal research banned
2019          if(ns->view==VIEW_POLICEBEHAVIOR&&law[LAW_POLICEBEHAVIOR]==2)continue; // Police corruption eliminated
2020          if(ns->view==VIEW_INTELLIGENCE&&law[LAW_PRIVACY]==2)continue; // Privacy rights respected
2021          if(ns->view==VIEW_SWEATSHOPS&&law[LAW_LABOR]==2)continue; // Sweatshops nonexistant
2022          if(ns->view==VIEW_POLLUTION&&law[LAW_POLLUTION]>=1)continue; // Pollution under control
2023          if(ns->view==VIEW_CORPORATECULTURE&&law[LAW_CORPORATE]==2)continue; // Regulation controls corporate corruption
2024          if(ns->view==VIEW_CEOSALARY&&law[LAW_CORPORATE]==2)continue; // CEOs aren't rich
2025       } else {
2026          if(ns->view==VIEW_WOMEN&&law[LAW_ABORTION]<2)continue; // Partial birth abortion banned
2027          if(ns->view==VIEW_AMRADIO&&law[LAW_FREESPEECH]==-2)continue; // AM Radio is censored to oblivion
2028          if(ns->view==VIEW_ANIMALRESEARCH&&law[LAW_ANIMALRESEARCH]==2)continue; // Animal research banned
2029       }
2030
2031       break;
2032    }
2033
2034    if(ns->positive) change_public_opinion(ns->view,20,0);
2035    else change_public_opinion(ns->view,-20,0);
2036    public_interest[ns->view]+=50;
2037    return ns;
2038 }
2039
2040 int liberal_guardian_writing_power()
2041 {
2042    int power=0;
2043    for(int i=0;i<len(pool);i++)
2044    {
2045       if(pool[i]->alive&&pool[i]->activity.type==ACTIVITY_WRITE_GUARDIAN)
2046       {
2047          if(pool[i]->location!=-1&&
2048             location[pool[i]->location]->compound_walls & COMPOUND_PRINTINGPRESS)
2049          {
2050             pool[i]->train(SKILL_WRITING,LCSrandom(3)); // Experience gain
2051             power+=pool[i]->skill_roll(SKILL_WRITING); // Record the writer on this topic
2052             criminalize(*pool[i],LAWFLAG_SPEECH); // Record possibly illegal speech activity
2053          }
2054          else pool[i]->activity.type=ACTIVITY_NONE;
2055       }
2056    }
2057    return power;
2058 }
2059
2060 newsstoryst* ccs_strikes_story()
2061 {
2062    newsstoryst *ns=new newsstoryst;
2063
2064    // Chance of CCS squad wipe
2065    if(LCSrandom(10))ns->type=NEWSSTORY_CCS_SITE;
2066    else ns->type=NEWSSTORY_CCS_KILLED_SITE;
2067
2068    // Chance of positive CCS story
2069    ns->positive=true;
2070
2071    do {
2072       ns->loc=LCSrandom(len(location));
2073    } while(location[ns->loc]->renting!=-1);
2074
2075    return ns;
2076 }
2077
2078 newsstoryst* ccs_exposure_story()
2079 {
2080    newsstoryst* ns=new newsstoryst;
2081    ns->type=NEWSSTORY_CCS_NOBACKERS;
2082    ns->priority=8000;
2083    ccsexposure=CCSEXPOSURE_NOBACKERS;
2084    // arrest seventeen representatives and eight senators
2085    int arrestsleft = 8;
2086    for(int i=0; i<SENATENUM; i++)
2087    {
2088       if((senate[i]==-2 || senate[i]==-1)&&!LCSrandom(4))
2089       {
2090          senate[i]=ALIGN_ELITELIBERAL;
2091          arrestsleft--;
2092          if(arrestsleft<=0) break;
2093       }
2094    }
2095    arrestsleft = 17;
2096    for(int i=0; i<HOUSENUM; i++)
2097    {
2098       if((house[i]==-2 || house[i]==-1)&&!LCSrandom(4))
2099       {
2100          house[i]=ALIGN_ELITELIBERAL;
2101          arrestsleft--;
2102          if(arrestsleft<=0) break;
2103       }
2104    }
2105    // change police regulation issue to be more liberal
2106    law[LAW_POLICEBEHAVIOR] += 2;
2107    if(law[LAW_POLICEBEHAVIOR] > ALIGN_ELITELIBERAL)
2108       law[LAW_POLICEBEHAVIOR] = ALIGN_ELITELIBERAL;
2109    change_public_opinion(VIEW_POLICEBEHAVIOR,50);
2110    change_public_opinion(VIEW_CONSERVATIVECRIMESQUAD,50);
2111
2112    return ns;
2113 }
2114
2115 newsstoryst* ccs_fbi_raid_story()
2116 {
2117    newsstoryst* ns=new newsstoryst;
2118    ns->type=NEWSSTORY_CCS_DEFEATED;
2119    ns->priority=8000;
2120    endgamestate=ENDGAME_CCS_DEFEATED;
2121    // arrest or kill ccs sleepers
2122    for(int p=0;p<len(pool);p++)
2123    {
2124       if(pool[p]->flag&CREATUREFLAG_SLEEPER)
2125       {
2126          if(pool[p]->type==CREATURE_CCS_VIGILANTE||pool[p]->type==CREATURE_CCS_ARCHCONSERVATIVE||
2127             pool[p]->type==CREATURE_CCS_MOLOTOV||pool[p]->type==CREATURE_CCS_SNIPER)
2128          {
2129             pool[p]->flag&=~CREATUREFLAG_SLEEPER;
2130             criminalize(*pool[p],LAWFLAG_RACKETEERING);
2131             capturecreature(*pool[p]);
2132          }
2133       }
2134    }
2135    // hide ccs safehouses
2136    for(int l=0;l<len(location);l++)
2137    {
2138       if(location[l]->renting==RENTING_CCS)
2139       {
2140          location[l]->renting=RENTING_NOCONTROL;
2141          location[l]->hidden=true;
2142       }
2143    }
2144    // go militarized police
2145    change_public_opinion(VIEW_POLICEBEHAVIOR,-20);
2146    return ns;
2147 }
2148