void Shop::choose_buyer(squadst& customers, int& buyer) const
{
   party_status = -1;

   int partysize = 0;
   for(int p = 0; p < 6; p++)
      if(customers.squad[p] != NULL)
         partysize++;

   if(partysize <= 1)return;

   do
   {
      printparty();

      move(8,20);
      set_color(COLOR_WHITE,COLOR_BLACK,1);
      addstr("Choose a Liberal squad member to SPEND.");

      refresh();

      int c = getch();
      translategetch(c);

      if (c == 10)
         return;

      if (c >= '1' && c <= partysize + '1' - 1)
      {
         buyer = c - '1';
         return;
      }
   } while (true);
}
void activatebulk(void)
{
   vector<Creature *> temppool = activatable_liberals();

   if(temppool.size()==0)return;

   int page=0;

   char str[80];

   int selectedactivity=0;

   do
   {
      erase();

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      printfunds(0,1,"Money: ");

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(0,0);
      addstr("Activate Uninvolved Liberals");
      move(1,0);
      addstr("----CODE NAME------------CURRENT ACTIVITY---------------------------------------");
      move(1,51);
      addstr("BULK ACTIVITY");

      if(selectedactivity==0)set_color(COLOR_WHITE,COLOR_BLACK,1);
      else set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(2,51);
      addstr("1 - Engaging in Liberal Activism");
      if(selectedactivity==1)set_color(COLOR_WHITE,COLOR_BLACK,1);
      else set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(3,51);
      addstr("2 - Legal Fundraising");
      if(selectedactivity==2)set_color(COLOR_WHITE,COLOR_BLACK,1);
      else set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(4,51);
      addstr("3 - Illegal Fundraising");
      if(selectedactivity==3)set_color(COLOR_WHITE,COLOR_BLACK,1);
      else set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(5,51);
      addstr("4 - Checking Polls");
      if(selectedactivity==4)set_color(COLOR_WHITE,COLOR_BLACK,1);
      else set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(6,51);
      addstr("5 - Stealing Cars");
      if(selectedactivity==5)set_color(COLOR_WHITE,COLOR_BLACK,1);
      else set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(7,51);
      addstr("6 - Community Service");

      int y=2;
      for(int p=page*19;p<temppool.size()&&p<page*19+19;p++)
      {
         set_color(COLOR_WHITE,COLOR_BLACK,0);
         move(y,0);
         addch(y+'A'-2);addstr(" - ");
         addstr(temppool[p]->name);

         move(y,25);
         set_activity_color(temppool[p]->activity.type);
         getactivity(str,temppool[p]->activity);
         addstr(str);
         /*if(temppool[p]->activity.type==ACTIVITY_TROUBLE)
         {
         addstr(" ($");
         itoa(temppool[p]->activity.arg,num,10);
         addstr(num);
         addstr(")");
         }*/

         y++;
      }

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(22,0);
      addstr("Press a Letter to Assign an Activity.  Press a Number to select an Activity.");
      move(23,0);
      addpagestr();

      refresh();

      int c=getch();
      translategetch(c);

      //PAGE UP
      if((c==interface_pgup||c==KEY_UP||c==KEY_LEFT)&&page>0)page--;
      //PAGE DOWN
      if((c==interface_pgdn||c==KEY_DOWN||c==KEY_RIGHT)&&(page+1)*19<temppool.size())page++;

      if(c>='a'&&c<='s')
      {
         int p=page*19+(int)(c-'a');
         if(p<temppool.size())
         {
            switch(selectedactivity)
            {
            case 0: //Activism
               if(temppool[p]->get_attribute(ATTRIBUTE_WISDOM,true)>7)
                  temppool[p]->activity.type=ACTIVITY_COMMUNITYSERVICE;
               else if(temppool[p]->get_attribute(ATTRIBUTE_WISDOM,true)>4)
                  temppool[p]->activity.type=ACTIVITY_TROUBLE;
               else
               {
                  if(temppool[p]->get_skill(SKILL_COMPUTERS)>2)
                     temppool[p]->activity.type=ACTIVITY_HACKING;
                  else if(temppool[p]->get_skill(SKILL_ART)>1)
                  {
                     temppool[p]->activity.type=ACTIVITY_GRAFFITI;
                     temppool[p]->activity.arg=-1;
                  }
                  else temppool[p]->activity.type=ACTIVITY_TROUBLE;
               }
               break;
            case 1: //Fundraising
               if(temppool[p]->get_skill(SKILL_ART)>1)
                  temppool[p]->activity.type=ACTIVITY_SELL_ART;
               else if(temppool[p]->get_skill(SKILL_MUSIC)>1)
                  temppool[p]->activity.type=ACTIVITY_SELL_MUSIC;
               else if(temppool[p]->get_skill(SKILL_TAILORING)>1)
                  temppool[p]->activity.type=ACTIVITY_SELL_TSHIRTS;
               else temppool[p]->activity.type=ACTIVITY_DONATIONS;
               break;
            case 2: //Illegal Fundraising
               if(temppool[p]->get_skill(SKILL_COMPUTERS)>1)
                  temppool[p]->activity.type=ACTIVITY_CCFRAUD;
#ifndef ZEROMORAL
                else if(temppool[p]->get_skill(SKILL_SEDUCTION)>1 && temppool[p]->age >=18)
#else
               else if(temppool[p]->get_skill(SKILL_SEDUCTION)>1)
#endif
                  temppool[p]->activity.type=ACTIVITY_PROSTITUTION;
               else
                  temppool[p]->activity.type=ACTIVITY_SELL_DRUGS;
               break;
            case 3: //Check polls
               temppool[p]->activity.type=ACTIVITY_POLLS;
               break;
            case 4: //Steal cars
               temppool[p]->activity.type=ACTIVITY_STEALCARS;
               break;
            case 5: //Volunteer
               temppool[p]->activity.type=ACTIVITY_COMMUNITYSERVICE;
               break;
            }
         }
      }
      if(c>='1'&&c<='6')
      {
         selectedactivity=c-'1';
      }

      if(c==10||c==ESC)break;
   }while(1);
/* base - activate the uninvolved */
void activate(void)
{
   vector<Creature *> temppool = activatable_liberals();

   if(temppool.size()==0)return;

   sortliberals(temppool,activesortingchoice[SORTINGCHOICE_ACTIVATE]);

   int page=0;

   char str[80];
   char num[20];

   do
   {
      erase();

      set_color(COLOR_WHITE,COLOR_BLACK,0);     
      printfunds(0,1,"Money: ");


      move(0,0);
      addstr("Activate Uninvolved Liberals");
      move(1,0);
      addstr("----CODE NAME------------SKILL---HEALTH---LOCATION------------------------------");
      move(1,57);
      addstr("ACTIVITY");

      int y=2;
      for(int p=page*19;p<temppool.size()&&p<page*19+19;p++)
      {
         set_color(COLOR_WHITE,COLOR_BLACK,0);
         move(y,0);
         addch(y+'A'-2);addstr(" - ");
         addstr(temppool[p]->name);

         char bright=0;
         int skill=0;
         for(int sk=0;sk<SKILLNUM;sk++)
         {
            skill+=temppool[p]->get_skill(sk);
            if(temppool[p]->get_skill_ip(sk)>=100+(10*temppool[p]->get_skill(sk))&&
               temppool[p]->get_skill(sk)<temppool[p]->skill_cap(sk,true))bright=1;
         }

         set_color(COLOR_WHITE,COLOR_BLACK,bright);

         move(y,25);
         itoa(skill,num,10);
         addstr(num);

         printhealthstat(*temppool[p],y,33,TRUE);

         if(mode==REVIEWMODE_JUSTICE)set_color(COLOR_YELLOW,COLOR_BLACK,1);
         else set_color(COLOR_WHITE,COLOR_BLACK,0);
         move(y,42);
         addstr(location[temppool[p]->location]->getname(true));

         move(y,57);
         // Let's add some color here...
         set_activity_color(temppool[p]->activity.type);
         getactivity(str,temppool[p]->activity);
         addstr(str);

         y++;
      }

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(22,0);
      addstr("Press a Letter to Assign an Activity.");
      move(23,0);
      addpagestr();
      addstr(" T to sort people.");
      move(24,0);
      addstr("Press Z to assign simple tasks in bulk.");

      refresh();

      int c=getch();
      translategetch(c);

      //PAGE UP
      if((c==interface_pgup||c==KEY_UP||c==KEY_LEFT)&&page>0)page--;
      //PAGE DOWN
      if((c==interface_pgdn||c==KEY_DOWN||c==KEY_RIGHT)&&(page+1)*19<temppool.size())page++;

      if(c>='a'&&c<='s')
      {
         int p=page*19+(int)(c-'a');
         if(p<temppool.size())
         {
            activate(temppool[p]);
         }
      }

      if(c=='t')
      {
         sorting_prompt(SORTINGCHOICE_ACTIVATE);
         sortliberals(temppool,activesortingchoice[SORTINGCHOICE_ACTIVATE],true);
      }

      if(c=='z')
      {
         activatebulk();
      }

      if(c==10||c==ESC)break;
   }while(1);
}
void activate(Creature *cr)
{
   int hostagecount=0;
   int state=0;
   int choice=0;
   char havedead=0;
   for(int p=0;p<pool.size();p++)
   {
      if(pool[p]->alive&&pool[p]->align!=1&&pool[p]->location==cr->location)hostagecount++;
      if(!pool[p]->alive)havedead=1;
   }

   do
   {
      erase();

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      printfunds(0,1,"Money: ");

      move(0,0);
     if (cr->income)
     {
        addstr(cr->name);
        addstr(" made $");
        char num[20];
        itoa(cr->income,num,10);
        addstr(num);
        addstr(" yesterday. What now?");
     }
     else
     {
        addstr("Taking Action: What will ");
        addstr(cr->name);
        addstr(" be doing today?");
     }

      printcreatureinfo(cr);

      makedelimiter(8,0);

      set_color(COLOR_WHITE,COLOR_BLACK,state=='a');
      move(10,1);
      addstr("A - Engaging in Liberal Activism");

      set_color(COLOR_WHITE,COLOR_BLACK,state=='b');
      move(11,1);
      addstr("B - Legal Fundraising");

      set_color(COLOR_WHITE,COLOR_BLACK,state=='c');
      move(12,1);
      addstr("C - Illegal Fundraising");

      set_color(COLOR_WHITE,COLOR_BLACK,state=='d');
      move(13,1);
      addstr("D - Make/Repair Clothing");

      if(cr->get_skill(SKILL_FIRSTAID)!=0)
      {
         set_color(COLOR_WHITE,COLOR_BLACK,(cr->activity.type==ACTIVITY_HEAL||cr->activity.type==ACTIVITY_NONE)&&state==0);
      }
      else
      {
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      }
      move(14,1);
      addstr("H - Heal Liberals");

      move(15,1);
      if(cr->canwalk())
      {
         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_STEALCARS&&state==0);
         addstr("S - Stealing a Car");
      }
      else
      {
         if(!(cr->flag & CREATUREFLAG_WHEELCHAIR))set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_WHEELCHAIR&&state==0);
         else set_color(COLOR_BLACK,COLOR_BLACK,1);
         addstr("S - Procuring a Wheelchair");
      }

      set_color(COLOR_WHITE,COLOR_BLACK,state=='t');
      move(16,1);
      addstr("T - Teaching Other Liberals");

     if(hostagecount>0)set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_HOSTAGETENDING&&state==0);
      else set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(17,1);
      addstr("I - Tend to a Conservative hostage");

      if(clinictime(*cr))
     {
        set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_CLINIC&&state==0);
        move(18,1);
        addstr("M - Move to the Free CLINIC");
     }
      else
     {
        set_color(COLOR_WHITE,COLOR_BLACK,state=='l');
        move(18,1);
        addstr("L - Learn in the University District");
     }
      

      if(havedead)set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_BURY&&state==0);
      else set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(19,1);
      addstr("Z - Dispose of bodies");

     siegest *siege=NULL;
      if(selectedsiege!=-1)siege=&location[selectedsiege]->siege;
      if(activesquad!=NULL && activesquad->squad[0]->location!=-1)siege=&location[activesquad->squad[0]->location]->siege;
      char sieged=0;
      if(siege!=NULL)sieged=siege->siege;
      char underattack=0;
      if(siege!=NULL)
      {
         if(sieged)underattack=siege->underattack;
      }

     if (!sieged)
     {
         set_color(COLOR_WHITE,COLOR_BLACK,0);
        move(20,1);
        addstr("E - Equip this Liberal");
     }

      if(state == 'a' || state == 'b' || state == 'c' ||state == 'd' )
      {
         set_color(COLOR_WHITE,COLOR_BLACK,0);
         move(19,40);
         addstr("? - Help");
      }

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(20,40);
      addstr("Enter - Confirm Selection");

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(21,1);
      addstr("X - Nothing for Now");

      switch(state)
      {
      case 'a':
         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_COMMUNITYSERVICE);
         move(10,40);
         addstr("1 - Community Service");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_TROUBLE);
         move(11,40);
         addstr("2 - Liberal Disobedience");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_GRAFFITI);
         move(12,40);
         addstr("3 - Graffiti");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_POLLS);
         move(13,40);
         addstr("4 - Search Opinion Polls");

         //set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_DOS_ATTACKS);
         //move(14,40);
         //addstr("5 - Harass Websites");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_HACKING);
         move(14,40);
         addstr("5 - Hacking");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_WRITE_LETTERS);
         move(15,40);
         addstr("6 - Write to Newspapers");

         if(cr->location!=-1&&
            location[cr->location]->compound_walls & COMPOUND_PRINTINGPRESS)
         {
            set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_WRITE_GUARDIAN);
            move(16,40);
            addstr("7 - Write for The Liberal Guardian");
         }
         break;
      case 'b':
         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_DONATIONS);
         move(10,40);
         addstr("1 - Solicit Donations");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_SELL_TSHIRTS);
         move(11,40);
         if(cr->get_skill(SKILL_TAILORING)>=8)
            addstr("2 - Sell Liberal T-Shirts");
         else if(cr->get_skill(SKILL_TAILORING)>=4)
            addstr("2 - Sell Embroidered Shirts");
         else
            addstr("2 - Sell Tie-Dyed T-Shirts");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_SELL_ART);
         move(12,40);
         if(cr->get_skill(SKILL_ART)>=8)
            addstr("3 - Sell Liberal Art");
         else if(cr->get_skill(SKILL_ART)>=4)
            addstr("3 - Sell Paintings");
         else
            addstr("3 - Sell Portrait Sketches");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_SELL_MUSIC);
         move(13,40);
         if(cr->get_skill(SKILL_MUSIC)>8)
            addstr("4 - Play Liberal Music");
         else
            addstr("4 - Play Street Music");
         break;
      case 'c':
         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_SELL_DRUGS);
         move(10,40);
         addstr("1 - Sell Brownies");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_PROSTITUTION);
         move(11,40);
         if(cr->age < 18)
            set_color(COLOR_BLACK, COLOR_BLACK, 1);    //Grayed out for minors
         addstr("2 - Prostitution");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_CCFRAUD);
         move(12,40);
         addstr("3 - Steal Credit Card Numbers");

         /*set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_DOS_RACKET);
         move(13,40);
         addstr("4 - Electronic Protection Racket");*/
         break;
      case 'd':
         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_MAKE_ARMOR);
         move(10,40);
         addstr("1 - Make Clothing");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_REPAIR_ARMOR);
         move(11,40);
         addstr("2 - Repair Clothing");
         break;
      case 't':
         set_color(COLOR_WHITE,COLOR_BLACK,0);
         move(10,40);
         addstr("Teach Liberals About What?");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_TEACH_POLITICS);
         move(12,40);
         addstr("1 - Political Activism");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_TEACH_COVERT);
         move(13,40);
         addstr("2 - Infiltration");

         set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_TEACH_FIGHTING);
         move(14,40);
         addstr("3 - Urban Warfare");
       break;
     case 'l':
       listclasses(cr);
       break;
      }

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      switch(cr->activity.type)
      {
      case ACTIVITY_COMMUNITYSERVICE:
         move(22,3);
         addstr(cr->name);
         addstr(" will help the elderly, local library, anything");
         move(23,1);
         addstr("  that is liberal.");
         break;
      case ACTIVITY_TROUBLE:
         move(22,3);
         addstr(cr->name);
         addstr(" will create public disturbances. ");
         break;
      case ACTIVITY_GRAFFITI:
         move(22,3);
         addstr(cr->name);
         addstr(" will spray political graffiti. Art and Heart will");
         move(23,1);
         addstr("  enhance the liberal effect.");
         break;
      case ACTIVITY_POLLS:
         move(22,3);
         addstr(cr->name);
         addstr(" will search the internet for public opinion polls.");
         move(23,1);
         addstr("  Polls will give an idea on how the liberal agenda is going. Computers");
         move(24,1);
         addstr("  and intelligence will provide better results.");
         break;
      case ACTIVITY_DOS_ATTACKS:
         move(22,3);
         addstr(cr->name);
         addstr(" will harass Conservative websites. Computer skill");
         move(23,1);
         addstr("  will give greater effect.");
         break;
      case ACTIVITY_HACKING:
         move(22,3);
         addstr(cr->name);
         addstr(" will harass websites and hack private networks.");
         move(23,1);
         addstr("  Computer skill and intelligence will give more frequent results.");
         move(24,1);
         addstr("  Multiple hackers will increase chances of both success and detection.");
         break;
      case ACTIVITY_WRITE_LETTERS:
         move(22,3);
         addstr(cr->name);
         addstr(" will write letters to newspapers about current events.");
         break;
      case ACTIVITY_WRITE_GUARDIAN:
         move(22,3);
         addstr(cr->name);
         addstr(" will write articles for the LCS's newspaper.");
         break;
      case ACTIVITY_DONATIONS:
         move(22,3);
         addstr(cr->name);
         addstr(" will walk around and ask for donations to the LCS.");
         move(23,1);
         addstr("  Based on persuasion, public's view on the cause, and how well dressed the");
         move(24,1);
         addstr("  activist is.");
         break;
      case ACTIVITY_SELL_TSHIRTS:
         move(22,3);
         addstr(cr->name);
         if(cr->get_skill(SKILL_TAILORING)>=8)
            addstr(" will print and distribute shirts with Liberal slogans.");
         else if(cr->get_skill(SKILL_TAILORING)>=4)
            addstr(" will embroider shirts and sell them on the street.");
         else
            addstr(" will tie-dye T-shirts and sell them on the street.");
         break;
      case ACTIVITY_SELL_ART:
         move(22,3);
         addstr(cr->name);
         if(cr->get_skill(SKILL_ART)>=8)
            addstr(" will create and sell paintings embracing the Liberal agenda.");
         else if(cr->get_skill(SKILL_ART)>=4)
            addstr(" will make pretty paintings and sell them on the streets.");
         else
            addstr(" will sketch people and sell portraits back to them.");
         break;
      case ACTIVITY_SELL_MUSIC:
         move(22,3);
         addstr(cr->name);
         addstr(" will go out into the streets and drum on buckets,");
         move(23,1);
         addstr("  or play guitar if one is equipped.");
         break;
      case ACTIVITY_SELL_DRUGS:
         move(22,3);
         addstr(cr->name);
         addstr(" will bake and sell special adult brownies that open");
         move(23,1);
         addstr("  magical shimmering doorways to the adamantium pits.");
         break;
      case ACTIVITY_PROSTITUTION:
         move(22,3);
         addstr(cr->name);
         addstr(" will trade sex for money.");
         break;
      case ACTIVITY_CCFRAUD:
         move(22,3);
         addstr(cr->name);
         addstr(" will commit credit card fraud online.");
         break;
      case ACTIVITY_DOS_RACKET:
         move(22,3);
         addstr(cr->name);
         addstr(" will demand money in exchange for not bringing down");
         move(23,1);
         addstr("major websites.");
         break;
      case ACTIVITY_TEACH_POLITICS:
         move(22,1);
         addstr("  Skills Trained: Writing, Persuasion, Law, Street Sense, Science,");
         move(23,1);
         addstr("    Religion, Business, Music, Art");
         move(24,1);
         addstr("  Classes cost up to $20/day to conduct. All Liberals able will attend.");
         break;
      case ACTIVITY_TEACH_COVERT:
         move(22,1);
         addstr("  Skills Trained: Computers, Security, Stealth, Disguise, Tailoring,");
         move(23,1);
         addstr("    Seduction, Psychology, Driving");
         move(24,1);
         addstr("  Classes cost up to $60/day to conduct. All Liberals able will attend.");
         break;
      case ACTIVITY_TEACH_FIGHTING:
         move(22,1);
         addstr("  Skills Trained: All Weapon Skills, Martial Arts, Dodge, First Aid");
         move(24,1);
         addstr("  Classes cost up to $100/day to conduct. All Liberals able will attend.");
         break;
      case ACTIVITY_STUDY_DEBATING:
      case ACTIVITY_STUDY_MARTIAL_ARTS:
      case ACTIVITY_STUDY_DRIVING:
      case ACTIVITY_STUDY_PSYCHOLOGY:
      case ACTIVITY_STUDY_FIRST_AID:
      case ACTIVITY_STUDY_LAW:
      case ACTIVITY_STUDY_DISGUISE:
      case ACTIVITY_STUDY_SCIENCE:
      case ACTIVITY_STUDY_BUSINESS:
      //case ACTIVITY_STUDY_COOKING:
      case ACTIVITY_STUDY_GYMNASTICS:
      case ACTIVITY_STUDY_WRITING:
      case ACTIVITY_STUDY_ART:
      case ACTIVITY_STUDY_MUSIC:
      case ACTIVITY_STUDY_TEACHING:
      case ACTIVITY_STUDY_LOCKSMITHING:
         move(22,3);
         addstr(cr->name);
         addstr(" will attend classes in the University District");
         move(23,1);
         addstr("  at a cost of $60 a day.");
         break;
      }

      refresh();
      int c=getch();
      translategetch(c);



      if(c>='a'&&c<='z'){state=c;}
      if((c>='a'&&c<='z') || (c>='1'&&c<='9'))
      {
         choice=c;
         switch(state)
         {
         case 'a':
            switch(choice)
            {
            case '1':cr->activity.type=ACTIVITY_COMMUNITYSERVICE;break;
            case '2':cr->activity.type=ACTIVITY_TROUBLE;break;
            case '3':cr->activity.type=ACTIVITY_GRAFFITI;
               cr->activity.arg=-1;
               break;
            case '4':cr->activity.type=ACTIVITY_POLLS;break;
            //case '5':cr->activity.type=ACTIVITY_DOS_ATTACKS;break;
            case '5':cr->activity.type=ACTIVITY_HACKING;break;
            case '6':cr->activity.type=ACTIVITY_WRITE_LETTERS;break;
            case '7':
               if(cr->location!=-1&&
                  location[cr->location]->compound_walls & COMPOUND_PRINTINGPRESS)
               {
                  cr->activity.type=ACTIVITY_WRITE_GUARDIAN;break;
               }
            default:
               if(cr->get_attribute(ATTRIBUTE_WISDOM,true)>7)
               {
                  cr->activity.type=ACTIVITY_COMMUNITYSERVICE;
                  choice='1';
               }
               else if(cr->get_attribute(ATTRIBUTE_WISDOM,true)>4)
               {
                  cr->activity.type=ACTIVITY_TROUBLE;
                  choice='2';
               }
               else
               {
                  if(cr->get_skill(SKILL_COMPUTERS)>2)
                  {
                     cr->activity.type=ACTIVITY_HACKING;
                     choice='5';
                  }
                  else if(cr->get_skill(SKILL_ART)>1)
                  {
                     cr->activity.type=ACTIVITY_GRAFFITI;
                     cr->activity.arg=-1;
                     choice='3';
                  }
                  else
                  {
                     cr->activity.type=ACTIVITY_TROUBLE;
                     choice='2';
                  }
               }
            }
            break;
         case 'b':
            switch(choice)
            {
            case '1':cr->activity.type=ACTIVITY_DONATIONS;break;
            case '2':cr->activity.type=ACTIVITY_SELL_TSHIRTS;break;
            case '3':cr->activity.type=ACTIVITY_SELL_ART;break;
            case '4':cr->activity.type=ACTIVITY_SELL_MUSIC;break;
            default:
               if(cr->get_skill(SKILL_ART)>1)
               {
                  cr->activity.type=ACTIVITY_SELL_ART;
                  choice='3';
               }
               else if(cr->get_skill(SKILL_TAILORING)>1)
               {
                  cr->activity.type=ACTIVITY_SELL_TSHIRTS;
                  choice='2';
               }
               else if(cr->get_skill(SKILL_MUSIC)>1)
               {
                  cr->activity.type=ACTIVITY_SELL_MUSIC;
                  choice='4';
               }
               else
               {
                  cr->activity.type=ACTIVITY_DONATIONS;
                  choice='1';
               }
            }
            break;
         case 'c':
            switch(choice)
            {
            case '1':cr->activity.type=ACTIVITY_SELL_DRUGS;break;
            case '2':
               if(cr->age >= 18) cr->activity.type=ACTIVITY_PROSTITUTION;break;
            case '3':cr->activity.type=ACTIVITY_CCFRAUD;break;
               //case '4':cr->activity.type=ACTIVITY_DOS_RACKET;break;
            default:
               if(cr->get_skill(SKILL_COMPUTERS)>1)
               {
                  cr->activity.type=ACTIVITY_CCFRAUD;
                  choice='3';
               }
               else if(cr->get_skill(SKILL_SEDUCTION)>1 && cr->age >= 18)
               {
                  cr->activity.type=ACTIVITY_PROSTITUTION;
                  choice='2';
               }
               else
               {
                  cr->activity.type=ACTIVITY_SELL_DRUGS;
                  choice='1';
               }
            }
            break;
         case 'd':
            switch(choice)
            {
            case '1':break;
            case '2':cr->activity.type=ACTIVITY_REPAIR_ARMOR;choice='2';break;
            default:cr->activity.type=ACTIVITY_REPAIR_ARMOR;choice='2';break;
            }
            break;
       case 'l':
          updateclasschoice(cr, choice);
          break;
         case 't':
            switch(choice)
            {
            case '1':cr->activity.type=ACTIVITY_TEACH_POLITICS;break;
            case '2':cr->activity.type=ACTIVITY_TEACH_COVERT;break;
            case '3':cr->activity.type=ACTIVITY_TEACH_FIGHTING;break;
            default:
               switch(cr->type)
               {
               case CREATURE_MERC:
               case CREATURE_SWAT:
               case CREATURE_DEATHSQUAD:
               case CREATURE_GANGUNIT:
               case CREATURE_SOLDIER:
               case CREATURE_VETERAN:
               case CREATURE_HARDENED_VETERAN:
               case CREATURE_GANGMEMBER:
               case CREATURE_MUTANT:
               case CREATURE_CRACKHEAD:
                  cr->activity.type=ACTIVITY_TEACH_FIGHTING;
                  choice='2';
                  break;
               case CREATURE_AGENT:
               case CREATURE_AMATEURMAGICIAN:
               case CREATURE_THIEF:
               case CREATURE_PROSTITUTE:
               case CREATURE_PRISONER:
                  cr->activity.type=ACTIVITY_TEACH_COVERT;
                  choice='3';
                  break;
               default:
                  cr->activity.type=ACTIVITY_TEACH_POLITICS;
                  choice='1';
                  break;
               }
               break;
            }
            break;
         }
      }

      if(c=='h'&&cr->get_skill(SKILL_FIRSTAID)!=0)
      {
         cr->activity.type=ACTIVITY_HEAL;
         break;
      }
      if(state=='d'&&choice=='1')
      {
         activityst oact=cr->activity;
         cr->activity.type=ACTIVITY_NONE;
         select_makeclothing(cr);
         if(cr->activity.type==ACTIVITY_MAKE_ARMOR)break;
         else cr->activity=oact;
      }
      if(c=='i'&&hostagecount>0)
      {
         activityst oact=cr->activity;
         cr->activity.type=ACTIVITY_NONE;
         select_tendhostage(cr);
         if(cr->activity.type==ACTIVITY_HOSTAGETENDING)break;
         else cr->activity=oact;
      }
      if (!sieged && c == 'e')
      {
         //create a temp squad containing just this liberal
         int oldsquadid = cr->squadid;
         squadst *oldactivesquad = activesquad;
         activesquad=new squadst;
         strcpy(activesquad->name, "Temporary Squad");
         activesquad->id=cursquadid;
         activesquad->squad[0]=cr;
         cr->squadid = activesquad->id;
         //go to equipment screen
         equip(location[activesquad->squad[0]->location]->loot,-1);
         //once you're done, restore original squad status.
         delete activesquad;
         activesquad = oldactivesquad;
         cr->squadid = oldsquadid;
      }
      if(c=='s')
      {
         if(cr->canwalk())
         {
            cr->activity.type=ACTIVITY_STEALCARS;
            break;
         }
         else if(!(cr->flag & CREATUREFLAG_WHEELCHAIR))
         {
            cr->activity.type=ACTIVITY_WHEELCHAIR;
            break;
         }
      }
      /*if(c=='w'&&location[cr->location]->compound_walls==COMPOUND_PRINTINGPRESS)
      {
      activityst oact=cr->activity;
      cr->activity.type=ACTIVITY_NONE;
      if(select_view(cr,cr->activity.arg))
      cr->activity.type=ACTIVITY_WRITE_GUARDIAN;
      else cr->activity=oact;
      break;
      }*/
      if(c=='m'&&clinictime(*cr))
      {
         cr->activity.type=ACTIVITY_CLINIC;
         break;
      }
      if(c=='z'&&havedead)
      {
         cr->activity.type=ACTIVITY_BURY;
         break;
      }
      if(c=='x')
      {
         cr->activity.type=ACTIVITY_NONE;
         break;
      }
      // Enter pressed
      if(c==10||c==ESC)
      {
         break;
      }
      // ? Pressed
      if(c==63)
      {     
         if(state == 'a' || state == 'b' || state == 'c' ||state == 'd' )
         {
            // Call activity help pages
            HelpActivities(cr->activity.type);
         }
      }
   }while(1);
}
/* full character sheet (with surrounding interface) */
void fullstatus(int p)
{
   if(activesquad==NULL)return;

   const int pagenum=3;
   int page=0;

   do
   {
      erase();

      set_color(COLOR_GREEN,COLOR_BLACK,1);
      move(0,0);
      addstr("Profile of a Liberal");

      if(page==0)
         printliberalstats(*activesquad->squad[p]);
      else if(page==1)
         printliberalskills(*activesquad->squad[p]);
      else if (page == 2)
         printliberalcrimes(*activesquad->squad[p]);

      move(23,0);
      addstr("N - Change Code Name      G - Fix Gender Label");
      if(activesquad->squad[1]!=NULL)
      {
         addstr("    LEFT/RIGHT - Other Liberals");
      }
      move(24,0);
      addstr("Press any other key to continue the Struggle");
      addstr("    UP/DOWN  - More Info");

      refresh();
      int c=getch();
      translategetch(c);

      if(activesquad->squad[1]!=NULL&&((c==KEY_LEFT)||(c==KEY_RIGHT)))
      {
         int sx=1;
         if(c==KEY_LEFT)sx=-1;
         do
         {
            p=(p+6+sx)%6;
         }while(activesquad->squad[p]==NULL);
         continue;
      }

      if(c==KEY_DOWN)
      {
         page++;
         page%=pagenum;
         continue;
      }

      if(c==KEY_UP)
      {
         page--;
         if(page<0)page=pagenum-1;
         page%=pagenum;
         continue;
      }

      if(c=='n')
      {
         move(23,0);
         set_color(COLOR_WHITE,COLOR_BLACK,0);
         addstr("What is the new code name?                                       ");
         move(24,0);
         addstr("                                                                    ");

         keypad(stdscr,FALSE);
         raw_output(FALSE);
         echo();
         curs_set(1);
         move(24,0);
         enter_name(activesquad->squad[p]->name,CREATURE_NAMELEN,activesquad->squad[p]->propername);

         curs_set(0);
         noecho();
         raw_output(TRUE);
         keypad(stdscr,TRUE);
         continue;
      }
      else if(c=='g')
      {
         activesquad->squad[p]->gender_liberal++;
         if(activesquad->squad[p]->gender_liberal > 2)
            activesquad->squad[p]->gender_liberal = 0;
         continue;
      }
      break;
   }while(1);
}
Example #6
0
/* daily - recruit - recruit meeting */
char completerecruitmeeting(recruitst &r,int p,char &clearformess)
{
   clearformess=1;

   

   erase();
   set_color(COLOR_WHITE,COLOR_BLACK,1);
   move(0,0);
   if(pool[p]->meetings++>5 && LCSrandom(pool[p]->meetings-5))
   {
      addstr(pool[p]->name, gamelog);
      addstr(" accidentally missed the meeting with ", gamelog);
      addstr(r.recruit->name, gamelog);
      move(1,0);
      addstr("due to multiple booking of recruitment sessions.", gamelog);
      gamelog.newline();

      move(3,0);
      addstr("Get it together, ", gamelog);
      addstr(pool[p]->name, gamelog);
      addstr("!", gamelog);
      gamelog.nextMessage();
      getch();

      return 1;
   }
   addstr("Meeting with ", gamelog);
   addstr(r.recruit->name, gamelog);
   addstr(", ", gamelog);
   char str[75];
   getrecruitcreature(str,r.recruit->type);
   addstr(str, gamelog);
   addstr(", ", gamelog);
   addstr(location[r.recruit->location]->name, gamelog);
   gamelog.newline();

   set_color(COLOR_WHITE,COLOR_BLACK,0);
   printfunds(0,1,"Money: ");

   printcreatureinfo(r.recruit);
   makedelimiter(8,0);

   move(10,0);
   addstr(r.recruit->name);
   switch(r.eagerness())
   {
   case 1:
      addstr(" will take a lot of persuading.");
      break;
   case 2:
      addstr(" is interested in learning more.");
      break;
   case 3:
      addstr(" feels something needs to be done.");
      break;
   default:
      if(r.eagerness()>=4)
         addstr(" is ready to fight for the Liberal Cause.");
      else
      {
         addstr(" kind of regrets agreeing to this.");
      }
      break;
   }
   move(11,0);
   addstr("How should ");
   addstr(pool[p]->name);
   addstr(" approach the situation?");

   move(13,0);
   if(ledger.get_funds()<50)set_color(COLOR_BLACK,COLOR_BLACK,1);
   addstr("A - Spend $50 on props and a book for them to keep afterward.");
   set_color(COLOR_WHITE,COLOR_BLACK,0);
   move(14,0);
   addstr("B - Just casually chat with them and discuss politics.");
   
   move(15,0);
   if(subordinatesleft(*pool[p]) && r.eagerness()>=4)
   {
      addstr("C - Offer to let ");
      addstr(r.recruit->name);
      addstr(" to join the LCS as a full member.");
   }
   else if(!subordinatesleft(*pool[p]))
   {
      set_color(COLOR_BLACK,COLOR_BLACK,1);
      addstr("C - ");
      addstr(pool[p]->name);
      addstr(" needs more Juice to recruit.");
      set_color(COLOR_WHITE,COLOR_BLACK,0);
   }
   else
   {
      set_color(COLOR_BLACK,COLOR_BLACK,1);
      addstr("C - ");
      addstr(r.recruit->name);
      addstr(" isn't ready to join the LCS.");
      set_color(COLOR_WHITE,COLOR_BLACK,0);
   }

   move(16,0);
   addstr("D - Break off the meetings.");

   int y=18;
   

   do
   {
      refresh();
      int c=getch();
      translategetch(c);

      if(c=='c' && subordinatesleft(*pool[p]) && r.eagerness()>=4)
      {
         move(y,0);
         addstr(pool[p]->name, gamelog);
         addstr(" offers to let ", gamelog);
         addstr(r.recruit->name, gamelog);
         addstr(" join the Liberal Crime Squad.", gamelog);
         gamelog.newline();

         refresh();
         getch();

         set_color(COLOR_GREEN,COLOR_BLACK,1);
         move(y+=2,0);
            
         addstr(r.recruit->name, gamelog);
         addstr(" accepts, and is eager to get started.", gamelog);
         gamelog.nextMessage();

         liberalize(*r.recruit,false);

         refresh();
         getch();

         erase();
         sleeperize_prompt(*r.recruit,*pool[p],6);

         r.recruit->hireid=pool[p]->id;

         pool[p]->train(SKILL_PERSUASION,25);

         pool.push_back(r.recruit);
         r.recruit = NULL;
         stat_recruits++;

         return 1;
      }
      if(c=='b' || (c=='a' && ledger.get_funds()>=50))
      {
         if(c=='a')
         {
            ledger.subtract_funds(50,EXPENSE_RECRUITMENT);
         }

         pool[p]->train(SKILL_PERSUASION,
            max(12-pool[p]->get_skill(SKILL_PERSUASION),5));
         pool[p]->train(SKILL_SCIENCE,
            max(r.recruit->get_skill(SKILL_SCIENCE)-pool[p]->get_skill(SKILL_SCIENCE),0));
         pool[p]->train(SKILL_RELIGION,
            max(r.recruit->get_skill(SKILL_RELIGION)-pool[p]->get_skill(SKILL_RELIGION),0));
         pool[p]->train(SKILL_LAW,
            max(r.recruit->get_skill(SKILL_LAW)-pool[p]->get_skill(SKILL_LAW),0));
         pool[p]->train(SKILL_BUSINESS,
            max(r.recruit->get_skill(SKILL_BUSINESS)-pool[p]->get_skill(SKILL_BUSINESS),0));
         
         int lib_persuasiveness = pool[p]->get_skill(SKILL_BUSINESS)+
                                  pool[p]->get_skill(SKILL_SCIENCE)+
                                  pool[p]->get_skill(SKILL_RELIGION)+
                                  pool[p]->get_skill(SKILL_LAW)+
                                  pool[p]->get_attribute(ATTRIBUTE_INTELLIGENCE,true);

         int recruit_reluctance = 5 +
                                  r.recruit->get_skill(SKILL_BUSINESS)+
                                  r.recruit->get_skill(SKILL_SCIENCE)+
                                  r.recruit->get_skill(SKILL_RELIGION)+
                                  r.recruit->get_skill(SKILL_LAW)+
                                  r.recruit->get_attribute(ATTRIBUTE_WISDOM,true)+
                                  r.recruit->get_attribute(ATTRIBUTE_INTELLIGENCE,true);

         if(lib_persuasiveness > recruit_reluctance)
            recruit_reluctance = 0;
         else
            recruit_reluctance -= lib_persuasiveness;

         int difficulty = recruit_reluctance;

         if(c=='a')
         {
            difficulty -= 5;

            move(y++,0);
            addstr(pool[p]->name, gamelog);
            addstr(" shares ", gamelog);
            strcpy(str,"");
            getissueeventstring(str);
            addstr(str), gamelog;
            addstr(".", gamelog);
            gamelog.newline();
            
            refresh();
            getch();
         }
         else
         {
            move(y++,0);
            addstr(pool[p]->name, gamelog);
            addstr(" explains ", gamelog);
            if(pool[p]->gender_liberal==GENDER_MALE)
               addstr("his ", gamelog);
            else if(pool[p]->gender_liberal==GENDER_FEMALE)
               addstr("her ", gamelog);
            else
               addstr("their ", gamelog);
            addstr("views on ", gamelog);
            getviewsmall(str,LCSrandom(VIEWNUM-3));
            addstr(str, gamelog);
            addstr(".", gamelog);
            gamelog.newline();
            refresh();
            getch();
         }
         
         bool success=0;

         if(pool[p]->skill_check(SKILL_PERSUASION,difficulty))
         {
            success=1;
            set_color(COLOR_CYAN,COLOR_BLACK,1);
            if(r.level<127) r.level++;
            if(r.eagerness1<127) r.eagerness1++;
            move(y++,0);
            addstr(r.recruit->name, gamelog);
            addstr(" found ", gamelog);
            addstr(pool[p]->name, gamelog);
            addstr("'s views to be insightful.", gamelog);
            gamelog.newline();
            move(y++,0);
            addstr("They'll definitely meet again tomorrow.", gamelog);
            gamelog.nextMessage();
         }
         else if(pool[p]->skill_check(SKILL_PERSUASION,difficulty)) // Second chance to not fail horribly
         {
            if(r.level<127) r.level++;
            if(r.eagerness1>-128) r.eagerness1--;
            move(y++,0);
            addstr(r.recruit->name, gamelog);
            addstr(" is skeptical about some of ", gamelog);
            addstr(pool[p]->name, gamelog);
            addstr("'s arguments.", gamelog);
            gamelog.newline();
            move(y++,0);
            addstr("They'll meet again tomorrow.", gamelog);
            gamelog.nextMessage();
         }
         else
         {
            set_color(COLOR_MAGENTA,COLOR_BLACK,1);
            move(y++,0);
            if(r.recruit->talkreceptive() && r.recruit->align==ALIGN_LIBERAL)
            {
               addstr(r.recruit->name, gamelog);
               addstr(" isn't convinced ", gamelog);
               addstr(pool[p]->name, gamelog);
               addstr(" really understands the problem.", gamelog);
               gamelog.newline();
               move(y++,0);
               addstr("Maybe ", gamelog);
               addstr(pool[p]->name, gamelog);
               addstr(" needs more experience.", gamelog);
               gamelog.nextMessage();
            }
            else
            {
               addstr(pool[p]->name, gamelog);
               addstr(" comes off as slightly insane.", gamelog);
               gamelog.newline();
               move(y++,0);
               addstr("This whole thing was a mistake. There won't be another meeting.", gamelog);
               gamelog.nextMessage();
            }
            refresh();
            getch();
            return 1;
         }
         refresh();
         getch();
         return 0;
      }
      if(c=='d')
      {
         return 1;
      }
   }while(1);
}
/* base - activate sleepers */
void activate_sleepers(void)
{
    vector<Creature *> temppool;
    // Comb the pool of Liberals for sleeper agents
    for(int p=0; p<pool.size(); p++)
    {
        // Select only sleepers that can work
        if(pool[p]->alive==true&&
                pool[p]->flag & CREATUREFLAG_SLEEPER&&
                pool[p]->align==ALIGN_LIBERAL&&
                pool[p]->hiding==false&&
                pool[p]->clinic==false&&
                pool[p]->dating==false)
        {
            temppool.push_back(pool[p]);
        }
    }

    if(temppool.size()==0)return;

    sortliberals(temppool,activesortingchoice[SORTINGCHOICE_ACTIVATESLEEPERS]);

    int page=0;

    char str[80];

    do
    {
        erase();

        set_color(COLOR_WHITE,COLOR_BLACK,0);
        printfunds(0,1,"Money: ");


        move(0,0);
        addstr("Activate Sleeper Agents");
        makedelimiter(1,0);
        move(1,4);
        addstr("CODE NAME");
        move(1,25);
        addstr("JOB");
        move(1,42);
        addstr("SITE");
        move(1,57);
        addstr("ACTIVITY");

        int y=2;
        for(int p=page*9; p<temppool.size()&&p<page*9+9; p++)
        {
            set_color(COLOR_WHITE,COLOR_BLACK,0);
            move(y,0);
            addch((y-2)/2+'A');
            addstr(" - ");
            addstr(temppool[p]->name);

            move(y,25);
            getrecruitcreature(str,temppool[p]->type);
            addstr(str);

            move(y+1,6);
            addstr("Effectiveness: ");

            if(temppool[p]->infiltration > 0.8f)
            {
                set_color(COLOR_RED,COLOR_BLACK,1);
            }
            else if(temppool[p]->infiltration > 0.6f)
            {
                set_color(COLOR_MAGENTA,COLOR_BLACK,1);
            }
            else if(temppool[p]->infiltration > 0.4f)
            {
                set_color(COLOR_YELLOW,COLOR_BLACK,1);
            }
            else if(temppool[p]->infiltration > 0.2f)
            {
                set_color(COLOR_WHITE,COLOR_BLACK,1);
            }
            else if(temppool[p]->infiltration > 0.1f)
            {
                set_color(COLOR_WHITE,COLOR_BLACK,0);
            }
            else
            {
                set_color(COLOR_GREEN,COLOR_BLACK,0);
            }
            char num[10];
            itoa(static_cast<int>(temppool[p]->infiltration*100),num,10);
            addstr(num);
            addstr("%");

            move(y,42);
            set_color(COLOR_WHITE,COLOR_BLACK,0);
            addshortname(location[temppool[p]->worklocation]);

            move(y,57);
            // Let's add some color here...
            set_activity_color(temppool[p]->activity.type);
            getactivity(str,temppool[p]->activity);
            addstr(str);

            y+=2;
        }

        set_color(COLOR_WHITE,COLOR_BLACK,0);
        move(22,0);
        addstr("Press a Letter to Assign an Activity.");
        move(23,0);
        addpagestr();
        addstr(" T to sort people.");

        set_color(COLOR_WHITE,COLOR_BLACK,0);

        refresh();

        int c=getch();
        translategetch(c);

        //PAGE UP
        if((c==interface_pgup||c==KEY_UP||c==KEY_LEFT)&&page>0)page--;
        //PAGE DOWN
        if((c==interface_pgdn||c==KEY_DOWN||c==KEY_RIGHT)&&(page+1)*9<temppool.size())page++;

        if(c>='a'&&c<='s')
        {
            int p=page*9+(int)(c-'a');
            if(p<temppool.size())
            {
                activate_sleeper(temppool[p]);
            }
        }

        if(c=='t')
        {
            sorting_prompt(SORTINGCHOICE_ACTIVATESLEEPERS);
            sortliberals(temppool,activesortingchoice[SORTINGCHOICE_ACTIVATESLEEPERS],true);
        }

        if(c==10)break;
    } while(1);
}
void Shop::browse_fullscreen(squadst& customers, int& buyer) const
{
   unsigned page = 0;

   std::vector<ShopOption*> available_options = options_;
   available_options.erase (remove_if (available_options.begin(),
				       available_options.end(),
				       not1 (mem_fun (&ShopOption::display))),
			    available_options.end());


   do
   {
      erase();
      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(0,0);
      addstr("What will ");
      addstr(customers.squad[buyer]->name);
      addstr(" buy?");
      move(1,0);
      addstr("----PRODUCT NAME-----------------------PRICE------------------------------------");
      int yline = 2;

      //Write wares and prices
      for(unsigned p = page * 19; p < available_options.size () && p < page * 19 + 19; p++)
      {
         if (available_options[p]->is_available())
            set_color(COLOR_WHITE,COLOR_BLACK,0);
         else
            set_color(COLOR_BLACK,COLOR_BLACK,1);
         move(yline,0);
         addch('A' + yline - 2);
         addstr(" - ");
         addstr(available_options[p]->get_description_fullscreen().c_str());
         ++yline;
      }

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(22,0);
      addstr("Press a Letter to select an option"); //allow customize "option"? -XML
      move(23,0);
      addpagestr();
      move(24,0);
      addstr(("Enter - " + std::string(customers.squad[buyer]->name) + " " + exit_).c_str());

      refresh();

      int c = getch();
      translategetch(c);

      //PAGE UP
      if ((c == interface_pgup || c == KEY_UP || c == KEY_LEFT) && page > 0)
         page--;
      //PAGE DOWN
      if ((c == interface_pgdn || c == KEY_DOWN || c == KEY_RIGHT)
          && (page + 1) * 19 < available_options.size())
         page++;

      if (c >= 'a' && c <= 's')
      {
         int p = page * 19 + static_cast<int>(c-'a');
         if (p < (int)available_options.size() && available_options[p]->is_available())
            available_options[p]->choose(customers, buyer);
         break;
      }

      if (c == 10)
         break;
   } while (true);
}
/* base - liberal agenda - disband */
char confirmdisband(void) // The (current) issue that the masses are most
{                         //        concerned should be (slightly) more likely
   char word[80];         //        to be the phrase. (Issue, not the CCS, etc.)
   int pos=0;             //                        -- LK

   switch(LCSrandom(22)) // or more... (preferably 44)
   {    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // Liberal Phrase                                       // Conservative Equivalent      // Stalinist Equivalent  //
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      case 0:strcpy(word,"Corporate Accountability");break;     // Deregulation                 //                       //
      case 1:strcpy(word,"Free Speech");break;                  // Child Safety                 // Thoughtcrime          //
      case 2:strcpy(word,"Gay Marriage");break;                 // Sancitity of Marriage        //                       //
      case 3:strcpy(word,"Abortion Rights");break;              // Right to Life                //                       //
      case 4:strcpy(word,"Separation Clause");break;            // Under God                    //                       //
      case 5:strcpy(word,"Racial Equality");break;              // Emmett Till                  //                       //
      case 6:strcpy(word,"Gun Control");break;                  // Second Amendment             // Firing Squad          //
      case 7:strcpy(word,"Campaign Finance Reform");break;      // Freedom to Campaign          //                       //
      case 8:strcpy(word,"Animal Rights");break;                // Animal Abuse                 //                       //
      case 9:strcpy(word,"Worker's Rights");break;              // Right to Work                // Gulag                 //
      case 10:strcpy(word,"Police Responsibility");break;       // Rodney King                  // Red Guard FIXME       // /* XXX: "Civilian" Police (Note to self) -- LK */
      case 11:strcpy(word,"Global Warming");break;              // Self-Regulation              //                       //
      case 12:strcpy(word,"Immigration Reform");break;          // Border Control FIXME         // Berlin Wall           // /* XXX: "Nicer" Term (Note to self) -- LK */
      case 13:strcpy(word,"Human Rights");break;                // National Security            // Reeducation FIXME     // /* XXX: 2+2 = 5? (Note to self) -- LK */
      case 14:strcpy(word,"Woman's Suffrage");break;            // Traditional Gender Roles     //                       //
      case 15:strcpy(word,"Right To Privacy");break;            // Wiretapping                  // Big Brother           //
      case 16:strcpy(word,"Medical Marijuana");break;           // War on Drugs                 // Soma                  //
      case 17:strcpy(word,"Flag Burning");break;                // Patriotism                   // DAILYSPEECHORW/E FIXME// /* XXX: Towards the beginning of 1984, at Winston's job. (Note to self) -- LK */
      case 18:strcpy(word,"Life Imprisonment");break;           // Zero Tolerance               // Mass Grave            //
      case 19:strcpy(word,"Conflict Resolution");break;         // Preemptive Strike            // Cuban Missile Crisis  //
      case 20:strcpy(word,"Radiation Poisoning");break;         // Nuclear Power                // Arms Race             //
      case 21:strcpy(word,"Tax Bracket");break;                 // Flat Tax                     // Proletariat           //
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
   }

   do
   {
      erase();

      set_color(COLOR_WHITE,COLOR_BLACK,1);
      move(0,0);
      addstr("Are you sure you want to disband?");

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(2,0);  addstr("Disbanding scatters the Liberal Crime Squad, sending all of its members");
      move(3,0);  addstr("into hiding, free to pursue their own lives.  You will be able to observe");
      move(4,0);  addstr("the political situation in brief, and wait until a resolution is reached.");

      move(6,0);  addstr("If at any time you determine that the Liberal Crime Squad will be needed");
      move(7,0);  addstr("again, you may return to the homeless shelter to restart the campaign.");

      move(9,0);  addstr("Do not make this decision lightly.  If you do need to return to action,");
      move(10,0); addstr("only the most devoted of your former members will return.");

      set_color(COLOR_WHITE,COLOR_BLACK,1);
      move(13,0); addstr("Type this Liberal phrase to confirm (press a wrong letter to rethink it):");

      for(int x=0;x<(int)strlen(word);x++)
      {
         move(15,x);
         if(x==pos)set_color(COLOR_GREEN,COLOR_BLACK,0);
         else if(x<pos)set_color(COLOR_GREEN,COLOR_BLACK,1);
         else set_color(COLOR_WHITE,COLOR_BLACK,0);
         addch(word[x]);
      }

      int c=getch();
      translategetch(c);

      if((c==word[pos])||((c+'A'-'a')==word[pos]))
      {
         pos++;
         if(word[pos]==' ')pos++;
         if(pos>=(int)strlen(word))
         {
            //SET UP THE DISBAND
            for(int p=pool.size()-1;p>=0;p--)
            {
               if(!pool[p]->alive)delete_and_remove(pool,p);
               else if(!(pool[p]->flag & CREATUREFLAG_SLEEPER))
               {
                  removesquadinfo(*pool[p]);
                  pool[p]->hiding=-1;
               }
            }
            cleangonesquads();
            disbandtime=year;
            return 1;
         }
      }
      else break;
   }while(1);
   return 0;
}
/* base - liberal agenda */
char liberalagenda(char won)
{
   int page=0, y;

   while(1)
   {
      erase();
      if(won==1)
      {
         set_color(COLOR_GREEN,COLOR_BLACK,1);
         move(0,0);
         addstr("The Triumph of the Liberal Agenda");
      }
      else if(won==-1)
      {
         set_color(COLOR_RED,COLOR_BLACK,1);
         move(0,0);
         addstr("The Abject Failure of the Liberal Agenda");
      }
      else
      {
         set_color(COLOR_WHITE,COLOR_BLACK,1);
         move(0,0);
         addstr("The Status of the Liberal Agenda");
      }

      if(page<0)page+=3;
      if(page>=3)page-=3;

      switch(page)
      {
      case PAGE_LEADERS:
      {

         move(1,0);
         addstr(" _________________ __________ __________ ");
         move(2,0);
         addstr("/ GENERAL SUMMARY \\ ISSUES A \\ ISSUES B \\");
         move(3,0);
         addstr("                   -------------------------------------------------------------");

         if(exec[EXEC_PRESIDENT]==-2)set_color(COLOR_RED,COLOR_BLACK,1);
         else if(exec[EXEC_PRESIDENT]==-1)set_color(COLOR_MAGENTA,COLOR_BLACK,1);
         else if(exec[EXEC_PRESIDENT]==0)set_color(COLOR_YELLOW,COLOR_BLACK,1);
         else if(exec[EXEC_PRESIDENT]==1)set_color(COLOR_CYAN,COLOR_BLACK,1);
         else set_color(COLOR_GREEN,COLOR_BLACK,1);
         move(5,0);
         if(won!=-1)
         {
            addstr("President ");
            if(execterm==1)addstr("(1st Term):");
            else addstr("(2nd Term):");
         }
         else if(won==-1)
            addstr("King: ");
         move(5,25);
         addstr(execname[EXEC_PRESIDENT]);

         if(exec[EXEC_VP]==-2)set_color(COLOR_RED,COLOR_BLACK,1);
         else if(exec[EXEC_VP]==-1)set_color(COLOR_MAGENTA,COLOR_BLACK,1);
         else if(exec[EXEC_VP]==0)set_color(COLOR_YELLOW,COLOR_BLACK,1);
         else if(exec[EXEC_VP]==1)set_color(COLOR_CYAN,COLOR_BLACK,1);
         else set_color(COLOR_GREEN,COLOR_BLACK,1);
         move(6,0);
         if(won!=-1) addstr("Vice President: ");
         else addstr("Chancellor: ");
         move(6,25);
         addstr(execname[EXEC_VP]);

         if(exec[EXEC_STATE]==-2)set_color(COLOR_RED,COLOR_BLACK,1);
         else if(exec[EXEC_STATE]==-1)set_color(COLOR_MAGENTA,COLOR_BLACK,1);
         else if(exec[EXEC_STATE]==0)set_color(COLOR_YELLOW,COLOR_BLACK,1);
         else if(exec[EXEC_STATE]==1)set_color(COLOR_CYAN,COLOR_BLACK,1);
         else set_color(COLOR_GREEN,COLOR_BLACK,1);
         move(7,0);
         if(won!=-2)
         {
            addstr("Secretary of State: ");
         }
         else
         {
            addstr("General Secretary: ");
         }
         move(7,25);
         addstr(execname[EXEC_STATE]);

         if(exec[EXEC_ATTORNEY]==-2)set_color(COLOR_RED,COLOR_BLACK,1);
         else if(exec[EXEC_ATTORNEY]==-1)set_color(COLOR_MAGENTA,COLOR_BLACK,1);
         else if(exec[EXEC_ATTORNEY]==0)set_color(COLOR_YELLOW,COLOR_BLACK,1);
         else if(exec[EXEC_ATTORNEY]==1)set_color(COLOR_CYAN,COLOR_BLACK,1);
         else set_color(COLOR_GREEN,COLOR_BLACK,1);
         move(8,0);
         addstr("Attorney General: ");
         move(8,25);
         addstr(execname[EXEC_ATTORNEY]);

         int housemake[5]={0,0,0,0,0};
         for(int h=0;h<435;h++)
         {
            housemake[house[h]+2]++;
         }
         int lsum=housemake[3]+housemake[4]
            -housemake[0]-housemake[1];
         if(lsum<=-145)set_color(COLOR_RED,COLOR_BLACK,1);
         else if(lsum<0)set_color(COLOR_MAGENTA,COLOR_BLACK,1);
         else if(lsum<145)set_color(COLOR_YELLOW,COLOR_BLACK,1);
         else if(housemake[4]<290)set_color(COLOR_CYAN,COLOR_BLACK,1);
         else set_color(COLOR_GREEN,COLOR_BLACK,1);
         char num[20];
         if(won!=-1&&won!=2)
         {
            move(10,0);
            addstr("House: ");
            itoa(housemake[4],num,10);
            addstr(num);addstr("Lib+, ");
            itoa(housemake[3],num,10);
            addstr(num);addstr("Lib, ");
            itoa(housemake[2],num,10);
            addstr(num);addstr("Mod, ");
            itoa(housemake[1],num,10);
            addstr(num);addstr("Cons, ");
            itoa(housemake[0],num,10);
            addstr(num);addstr("Cons+");
         }

         int senatemake[5]={0,0,0,0,0};
         for(int s=0;s<100;s++)
         {
            senatemake[senate[s]+2]++;
         }
         lsum=senatemake[3]+senatemake[4]
            -senatemake[0]-senatemake[1];
         if(lsum<=-33)set_color(COLOR_RED,COLOR_BLACK,1);
         else if(lsum<0)set_color(COLOR_MAGENTA,COLOR_BLACK,1);
         else if(lsum<33)set_color(COLOR_YELLOW,COLOR_BLACK,1);
         else if(senatemake[4]<67)set_color(COLOR_CYAN,COLOR_BLACK,1);
         else set_color(COLOR_GREEN,COLOR_BLACK,1);
         if(won!=-1&&won!=-2)
         {
            move(11,0);
            addstr("Senate: ");
            itoa(senatemake[4],num,10);
            addstr(num);addstr("Lib+, ");
            itoa(senatemake[3],num,10);
            addstr(num);addstr("Lib, ");
            itoa(senatemake[2],num,10);
            addstr(num);addstr("Mod, ");
            itoa(senatemake[1],num,10);
            addstr(num);addstr("Cons, ");
            itoa(senatemake[0],num,10);
            addstr(num);addstr("Cons+");
         }
         else if(won==-1)
         {
            set_color(COLOR_RED,COLOR_BLACK,1);
            move(10,0);
            addstr("The Congress consists of CEOs and televangelists.");
         }
         int elibjudge=0;
         for(int c=0;c<9;c++)
         {
            if(court[c]==2)elibjudge++;
         }

         if(won==-1)set_color(COLOR_RED,COLOR_BLACK,1);
         else if(won==-2)set_color(COLOR_RED,COLOR_BLACK,1);
         else if(won==1||elibjudge>=5)set_color(COLOR_GREEN,COLOR_BLACK,1);
         else set_color(COLOR_WHITE,COLOR_BLACK,1);

         move(4,56);addch('S');
         move(5,56);addch('U');
         move(6,56);addch('P');
         move(7,56);addch('R');
         move(8,56);addch('E');
         move(9,56);addch('M');
         move(10,56);addch('E');

         move(4,58);addch('C');
         move(5,58);addch('O');
         move(6,58);addch('U');
         move(7,58);addch('R');
         move(8,58);addch('T');

         if(won!=-1&&won!=-2)
         {
            y=4;

            for(int c=0;c<9;c++)
            {
               if(court[c]==-2)set_color(COLOR_RED,COLOR_BLACK,1);
               else if(court[c]==-1)set_color(COLOR_MAGENTA,COLOR_BLACK,1);
               else if(court[c]==0)set_color(COLOR_YELLOW,COLOR_BLACK,1);
               else if(court[c]==1)set_color(COLOR_CYAN,COLOR_BLACK,1);
               else set_color(COLOR_GREEN,COLOR_BLACK,1);

               move(y,60);
               addstr(courtname[c]);

               y++;
            }
         }
         else if(won==-1)
         {
            set_color(COLOR_RED,COLOR_BLACK,1);
            move(5,60);
            addstr("   Replaced");
            move(6,60);
            addstr(" By Corporate");
            move(7,60);
            addstr("Ethics Officers");
         }
         for(int l=0;l<LAWNUM;l++)
         {
            move(14+l/3,l%3*26);

            set_color(COLOR_BLACK,COLOR_BLACK,1);

            addstr("<-----> ");

            if(law[l]==ALIGN_ARCHCONSERVATIVE)set_color(COLOR_RED,COLOR_BLACK,1);
            else if(law[l]==ALIGN_CONSERVATIVE)set_color(COLOR_MAGENTA,COLOR_BLACK,1);
            else if(law[l]==ALIGN_MODERATE)set_color(COLOR_YELLOW,COLOR_BLACK,1);
            else if(law[l]==ALIGN_LIBERAL)set_color(COLOR_CYAN,COLOR_BLACK,1);
            else set_color(COLOR_GREEN,COLOR_BLACK,1);

            switch(l)
            {
               case LAW_WOMEN:addstr("Women's Rights");break;
               case LAW_CIVILRIGHTS:addstr("Civil Rights");break;
               case LAW_DRUGS:addstr("Drug Law");break;
               case LAW_IMMIGRATION:addstr("Immigration");break;
               case LAW_ELECTIONS:addstr("Election Reform");break;
               case LAW_MILITARY:addstr("Military Spending");break;
               case LAW_TORTURE:addstr("Human Rights");break;
               case LAW_PRISONS:addstr("Prison Regulation");break;
               case LAW_TAX:addstr("Tax Structure");break;
               case LAW_ABORTION:addstr("Abortion Rights");break;
               case LAW_ANIMALRESEARCH:addstr("Animal Rights");break;
               case LAW_POLICEBEHAVIOR:addstr("Police Regulation");break;
               case LAW_PRIVACY:addstr("Privacy Rights");break;
               case LAW_DEATHPENALTY:addstr("Death Penalty");break;
               case LAW_NUCLEARPOWER:addstr("Nuclear Power");break;
               case LAW_POLLUTION:addstr("Pollution");break;
               case LAW_LABOR:addstr("Labor Laws");break;
               case LAW_GAY:addstr("Gay Rights");break;
               case LAW_CORPORATE:addstr("Corporate Law");break;
               case LAW_FREESPEECH:addstr("Free Speech");break;
               case LAW_FLAGBURNING:addstr("Flag Burning");break;
               case LAW_GUNCONTROL:addstr("Gun Control");break;
            }

            move(14+l/3,l%3*26 + 3 - law[l]);

            addch('O');
         }
         break;
      }

      case PAGE_ISSUES_A:
      case PAGE_ISSUES_B:
      {
         move(1,0);
         addstr(" _________________ __________ __________ ");
         move(2,0);
         if(page==PAGE_ISSUES_A)
         {
            addstr("/ GENERAL SUMMARY / ISSUES A \\ ISSUES B \\");
            move(3,0);
            addstr("------------------            --------------------------------------------------");
         }
         else
         {
            addstr("/ GENERAL SUMMARY / ISSUES A / ISSUES B \\");
            move(3,0);
            addstr("-----------------------------            ---------------------------------------");
         }

         int y=4;
         int startinglaw=0;
         if(page==PAGE_ISSUES_B)startinglaw=18;
         for(int l=startinglaw;l<startinglaw+18 && l<LAWNUM;l++)
         {
            if(won==-1)set_color(COLOR_RED,COLOR_BLACK,1);
            else if(won==-2)set_color(COLOR_RED,COLOR_BLACK,1);
            else
            {
               if(law[l]==ALIGN_ARCHCONSERVATIVE)set_color(COLOR_RED,COLOR_BLACK,1);
               else if(law[l]==ALIGN_CONSERVATIVE)set_color(COLOR_MAGENTA,COLOR_BLACK,1);
               else if(law[l]==ALIGN_MODERATE)set_color(COLOR_YELLOW,COLOR_BLACK,1);
               else if(law[l]==ALIGN_LIBERAL)set_color(COLOR_CYAN,COLOR_BLACK,1);
               else set_color(COLOR_GREEN,COLOR_BLACK,1);
            }

            move(y,0);

            switch(l)
            {
               case LAW_WOMEN:
                  if(won==-2)addstr("Women are usually drafted into the armed forces to fight in place of men.");
                  else if(won==-1)addstr("Women have been stripped of the right to vote.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Women are second-class citizens.");
                  else if(law[l]==-1)addstr("Non-discrimination laws do not apply to gender.");
                  else if(law[l]==0)addstr("Women are nominally equal under law.");
                  else if(law[l]==1)addstr("Women have substantial recourse against discrimination.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Gender equality is universally respected.");
                  else addstr("Binary gender identities no longer exist, and gender segregation has ended.");
                  break;
               case LAW_CIVILRIGHTS:
                  if(won==-2)addstr("Entire ethnic groups are branded \"enemies of the state\".");
                  else if(won==-1)addstr("Segregation has been reintroduced.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Racial discrimination is prohibited in name only.");
                  else if(law[l]==-1)addstr("Civil rights laws are inconsistently enforced.");
                  else if(law[l]==0)addstr("Pervasive racial inequality exists.");
                  else if(law[l]==1)addstr("Affirmative action is in place to counteract discrimination.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Racial equality is guaranteed and vigorously enforced.");
                  else addstr("The very idea of \"race\" has been universally discarded as pseudoscience.");
                  break;
               case LAW_DRUGS:
                  if(won==-2)addstr("Vodka is the only legal recreational drug in the People's Republic of America.");
                  else if(won==-1)addstr("Talking about recreational drugs is punishable by death.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Violent criminals are released to make room for drug offenders.");
                  else if(law[l]==-1)addstr("Prisons are filled with the targets of a war on drugs.");
                  else if(law[l]==0)addstr("Recreational drugs are prohibited unless medically prescribed.");
                  else if(law[l]==1)addstr("Marijuana is regulated and taxed.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Recreational drugs are regulated and taxed.");
                  else addstr("The government distributes free recreational drugs to anyone who wants them.");
                  break;
               case LAW_IMMIGRATION:
                  if(won==-2)addstr("All Americans must carry around an internal passport, or be shot on sight.");
                  else if(won==-1)addstr("Border guards shoot suspected foreigners on sight.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Immigration is illegal, and noncitizens are shipped to Mexico at gunpoint.");
                  else if(law[l]==-1)addstr("The military has been deployed to the borders to slow immigration.");
                  else if(law[l]==0)addstr("Great expense is taken to slow immigration, without success.");
                  else if(law[l]==1)addstr("The government works to accommodate potential immigrants.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Immigration is unregulated.");
                  else addstr("There are open borders, and no distinctions between citizens and non-citizens.");
                  break;
               case LAW_ELECTIONS:
                  if(won==-2)addstr("Only Stalinist Party members may run in elections, and they all run unopposed.");
                  else if(won==-1)addstr("Only independently wealthy candidates have a chance of defeating incumbents.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                  addstr("Virtually no ethics restrictions exist on political officeholders.");
                  else if(law[l]==-1)addstr("Elections are mostly unregulated, but basic ethics restrictions are in place.");
                  else if(law[l]==0)addstr("Moderate campaign finance reform is implemented.");
                  else if(law[l]==1)addstr("Election financing is transparent and well-regulated.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Election expenses are publicly funded, and voting is by ranked list.");
                  else addstr("There is proportional representation, and over a dozen major political parties.");
                  break;
               case LAW_MILITARY:
                  if(won==-2)addstr("The military promotes Stalinism throughout the world by using force.");
                  else if(won==-1)addstr("The massive military is a tool of political oppression.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                  addstr("Ballooning military boondoggles are utterly out of control.");
                  else if(law[l]==-1)addstr("Massive investment is put into the military.");
                  else if(law[l]==0)addstr("Military spending is growing each year.");
                  else if(law[l]==1)addstr("Military strength is not a major priority.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("The military has been weakened significantly.");
                  else addstr("The military has been abolished, and the entire world is at peace.");
                  break;
               case LAW_TORTURE:
                  if(won==-2)addstr("The Cheka constantly invents new methods of torture.");
                  else if(won==-1)addstr("Torture is a prescribed practice in police interrogations.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Military and intelligence interrogators regularly engage in torture.");
                  else if(law[l]==-1)addstr("The line between standard interrogation and torture is severely blurred.");
                  else if(law[l]==0)addstr("Torture allegations still occasionally crop up.");
                  else if(law[l]==1)addstr("The government strongly enforces a ban on torture.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("The country is respected as an international leader on Moral Interrogation Practices.");
                  else addstr("Terrorism ended after the government formally apologized to terrorist leaders.");
                  break;
               case LAW_PRISONS:
                  if(won==-2)addstr("The former nation of Canada has been annexed and filled with Stalinist gulags.");
                  else if(won==-1)addstr("Prisoners aren't even considered people by the law.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Prisoners are often subject to torture and slave labor.");
                  else if(law[l]==-1)addstr("Prisoners suffer from horrible conditions and lack of basic rights.");
                  else if(law[l]==0)addstr("Prisoners receive basic rights and services.");
                  else if(law[l]==1)addstr("The prisons are regulated to protect prisoners' rights.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("The prisons are targeted at rehabilitation, rather than punishment.");
                  else addstr("Instead of prison, criminals voluntarily attend free support groups.");
                  break;
	           case LAW_TAX:
                  if(won==-2)addstr("Having any money whatsoever is punishable by 20 years in a gulag.");
                  else if(won==-1)addstr("There are no taxes, yet most people have no money.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("The tax code is a nightmare designed to maintain class structure.");
                  else if(law[l]==-1)addstr("A flat tax is in effect.");
                  else if(law[l]==0)addstr("Taxes are moderate, and the code has loop-holes.");
                  else if(law[l]==1)addstr("Taxes are very high and steeply graded.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Rich people are virtually unheard of, due to taxation.");
                  else addstr("Money no longer exists, everything is free, and everyone enjoys lives of luxury.");
                  break;
               case LAW_ABORTION:
                  if(won==-2)addstr("Mandatory abortions are carried out for population control.");
                  else if(won==-1)addstr("Use of contraception and abortion are capital offenses.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Abortion is a felony equal to murder.");
                  else if(law[l]==-1)addstr("Abortion is prohibited except in extreme circumstances.");
                  else if(law[l]==0)addstr("Abortion is limited to early pregnancy.");
                  else if(law[l]==1)addstr("Abortion is mostly legal, but discouraged by law.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Abortion is legal.");
                  else addstr("Free abortions are easily available at any time during pregnancy.");
                  break;
               case LAW_ANIMALRESEARCH:
                  if(won==-2)addstr("All forms of human experimentation on \"class enemies\" are encouraged.");
                  else if(won==-1)addstr("All forms of human experimentation on the poor are encouraged.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Animals are property that can be experimented upon freely.");
                  else if(law[l]==-1)addstr("Animal testing must be classified by purpose and suffering caused.");
                  else if(law[l]==0)addstr("Animal research is regulated with a system of licenses and certificates.");
                  else if(law[l]==1)addstr("Animal research is strictly regulated by purpose and suffering caused.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Animals are people, too.");
                  else addstr("All species of life have equal rights as people, even bacteria.");
                  break;
               case LAW_POLICEBEHAVIOR:
                  if(won==-2)addstr("Everyone lives in constant fear of the Stalinist Party's Secret Police.");
                  else if(won==-1)addstr("Policing is administered by corporations and has a draft.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Law enforcement is given free reign.");
                  else if(law[l]==-1)addstr("Even the worst police misconduct only earns slap-on-the-wrist punishments.");
                  else if(law[l]==0)addstr("Law enforcement is regulated to prevent extreme misconduct.");
                  else if(law[l]==1)addstr("Law enforcement has heavy oversight and freedom-of-information requirements.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("All law enforcement positions are subject to election and recall.");
                  else addstr("With no police, criminals follow the honor system and turn themselves in.");
                  break;
               case LAW_PRIVACY:
                  if(won==-2)addstr("Citizens have to spy on each other and report to the Stalinist Party.");
                  else if(won==-1)addstr("Files on each citizen are easily accessible to corporations.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Any corporation requesting private information is granted access.");
                  else if(law[l]==-1)addstr("Privacy laws are full of loopholes.");
                  else if(law[l]==0)addstr("Basic safeguards for medical and financial privacy are in place.");
                  else if(law[l]==1)addstr("All areas of privacy are protected with strong safeguards.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Individual privacy is sacred.");
                  else addstr("All large organizations are prohibited from keeping any data about anyone.");
                  break;
               case LAW_DEATHPENALTY:
                  if(won==-2)addstr("Class enemies receive mandatory death sentences.");
                  else if(won==-1)addstr("Poor criminals receive mandatory death sentences.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("People can be put to death for minor offenses.");
                  else if(law[l]==-1)addstr("The death penalty is actively enforced in many states.");
                  else if(law[l]==0)addstr("The death penalty is in effect but under scrutiny.");
                  else if(law[l]==1)addstr("The death penalty is not permitted in many circumstances.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("The death penalty is considered barbaric and never practiced.");
                  else addstr("The death penalty, like all other harsh punishments, has been abolished.");
                  break;
               case LAW_NUCLEARPOWER:
                  if(won==-2)addstr("Nuclear power plants routinely have meltdowns but keep getting built.");
                  else if(won==-1)addstr("Nuclear power plants are ubiquitous.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Nuclear power is proliferating with no controls.");
                  else if(law[l]==-1)addstr("Nuclear power is a preferred energy source.");
                  else if(law[l]==0)addstr("Nuclear power is often an energy source.");
                  else if(law[l]==1)addstr("Nuclear power is intensely regulated and seldom used.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Nuclear power is illegal.");
                  else addstr("A global ban on nuclear power and nuclear weapons is enforced by UN inspectors.");
                  break;
               case LAW_POLLUTION:
                  if(won==-2)addstr("State-run industries pollute so much, the workers all have cancer.");
                  else if(won==-1)addstr("Deformed children are the norm in industrial zones.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Industry may pollute as much as they like.");
                  else if(law[l]==-1)addstr("Industry voluntarily regulates pollution.");
                  else if(law[l]==0)addstr("Industry is subject to moderate pollution regulations.");
                  else if(law[l]==1)addstr("Industry is subject to strict pollution regulations.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Industry is subject to zero-tolerance pollution regulations.");
                  else addstr("Pollution is unheard of, and nature has reclaimed much of the land.");
                  break;
               case LAW_LABOR:
                  if(won==-2)addstr("The state has nationalized all industries and assigns everyone jobs.");
                  else if(won==-1)addstr("People are bred in pens to be farmed out to corporations like beasts.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("There is no weekend and children are forced to work.");
                  else if(law[l]==-1)addstr("Working conditions are miserable and the minimum wage is low.");
                  else if(law[l]==0)addstr("Workers still require some benefits.");
                  else if(law[l]==1)addstr("Workers are fairly compensated and have benefits.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("There are universal workers' rights and a high guaranteed minimum income.");
                  else addstr("Wage slavery has been abolished, and robots have been built to do all the work.");
                  break;
               case LAW_GAY:
                  if(won==-2)addstr("Homosexuals are executed regularly for their \"bourgeoisie decadence\".");
                  else if(won==-1)addstr("Homosexuals are executed regularly for \"promoting the Gay Agenda\".");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Homosexuals are routinely persecuted with no recourse.");
                  else if(law[l]==-1)addstr("Homosexuals are not tolerated.");
                  else if(law[l]==0)addstr("Homosexuals are grudgingly tolerated but have few equal rights.");
                  else if(law[l]==1)addstr("Homosexuals have many rights shared by heterosexuals.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Homosexuals have equal rights.");
                  else addstr("All sexual orientations are accepted, and most people are polyamorous.");
                  break;
               case LAW_CORPORATE:
                  if(won==-2)addstr("All forms of private enterprise are punishable by death.");
                  else if(won==-1)addstr("Corporations under the King run the country in a feudal system.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Corporations essentially run the country in a feudal system.");
                  else if(law[l]==-1)addstr("Corporate culture is corrupt and there is a great disparity in wages.");
                  else if(law[l]==0)addstr("Corporations are moderately regulated, although wages are still unfair.");
                  else if(law[l]==1)addstr("Corporations are stiffly regulated, and executives are fairly compensated.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Corporations are subject to intense regulation, and there is a maximum wage law.");
                  else addstr("Corporations have been abolished, along with the rest of capitalism.");
                  break;
               case LAW_FREESPEECH:
                  if(won==-2)addstr("Counterrevolutionary speech is a capital crime.");
                  else if(won==-1)addstr("Unacceptable speech is a capital crime.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Armored squads are tasked with suppressing unacceptable speech.");
                  else if(law[l]==-1)addstr("Some individuals are harassed because of their speech.");
                  else if(law[l]==0)addstr("Free speech is tolerated.");
                  else if(law[l]==1)addstr("Free speech is encouraged.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Free speech is universally supported.");
                  else addstr("Free speech is sacrosanct and diverse points of view are celebrated.");
                  break;
               case LAW_FLAGBURNING:
                  if(won==-2)addstr("Flags of the old American regime are burnt primarily as as fuel.");
                  else if(won==-1)addstr("Images or words describing flag burning are punished by death.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Burning the flag is a crime on par with murder.");
                  else if(law[l]==-1)addstr("Burning the flag is a felony.");
                  else if(law[l]==0)addstr("Flag-burning is a misdemeanor.");
                  else if(law[l]==1)addstr("Flag-burning is legal but stigmatized.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("Flag-burning is legal.");
                  else addstr("Flag-burning is traditionally done on July 4th to celebrate freedom.");
                  break;
               case LAW_GUNCONTROL:
                  if(won==-2)addstr("Anyone owning a gun is executed by firing squad.");
                  else if(won==-1)addstr("Gangs of young children carrying AK-47s roam the streets.");
                  else if(law[l]==ALIGN_ARCHCONSERVATIVE)
                     addstr("Machine guns can be bought and sold freely.");
                  else if(law[l]==-1)addstr("Military weapons are banned, but similar-looking guns are available.");
                  else if(law[l]==0)addstr("A comprehensive ban on military-style weapons is in effect.");
                  else if(law[l]==1)addstr("Most guns cannot be sold to anyone outside of law enforcement.");
                  else if(won!=1||wincondition!=WINCONDITION_ELITE)addstr("It is illegal to buy, sell, or carry a gun in public.");//XXX: Should guns be legal in private, too? -- LK
                  else addstr("All gun manufacturers have been shut down and all existing guns destroyed.");
                  break;
            }

            y++;
         }
         break;
      }
      }

      if(won==1)
      {
         set_color(COLOR_GREEN,COLOR_BLACK,1);
         move(23,0);
         if(wincondition==WINCONDITION_EASY)
         {
            addstr("The country has achieved Liberal status!");
         }
         else
         {
            addstr("The country has achieved Elite Liberal status!");
         }
         move(24,0);
         addstr("Press 'L' to view the high score list.");

         refresh();
         int c=getch();
         translategetch(c);

         if(c==KEY_RIGHT || c==KEY_DOWN)
         {
            page++;
            continue;
         }

         if(c==KEY_LEFT || c==KEY_UP)
         {
            page--;
            continue;
         }

         if(c=='l')break;
      }
      else if(won==-1)
      {
         set_color(COLOR_RED,COLOR_BLACK,1);
         move(23,0);
         addstr("The country has been Reaganified.");
         move(24,0);
         addstr("Press 'L' to view the high score list.");

         refresh();
         int c=getch();
         translategetch(c);

         if(c==KEY_RIGHT || c==KEY_DOWN)
         {
            page++;
            continue;
         }

         if(c==KEY_LEFT || c==KEY_UP)
         {
            page--;
            continue;
         }

         if(c=='l')break;
      }
      else
      {
         move(23,0);
         set_color(COLOR_GREEN,COLOR_BLACK,1);
         addstr("Elite Liberal ");
         set_color(COLOR_WHITE,COLOR_BLACK,0);
         addstr("-  ");
         set_color(COLOR_CYAN,COLOR_BLACK,1);
         addstr("Liberal  ");
         set_color(COLOR_WHITE,COLOR_BLACK,0);
         addstr("-  ");
         set_color(COLOR_YELLOW,COLOR_BLACK,1);
         addstr("moderate  ");
         set_color(COLOR_WHITE,COLOR_BLACK,0);
         addstr("-  ");
         set_color(COLOR_MAGENTA,COLOR_BLACK,1);
         addstr("Conservative  ");
         set_color(COLOR_WHITE,COLOR_BLACK,0);
         addstr("-  ");
         set_color(COLOR_RED,COLOR_BLACK,1);
         addstr("Arch-Conservative");
         set_color(COLOR_WHITE,COLOR_BLACK,0);
         //move(23,0);
         //addstr("Once these are Green, the country will have achieved Elite Liberal status.");
         move(24,0);
         addstr("Press D to disband and wait. Use cursors for other pages. Any other key to exit.");

         refresh();
         int c=getch();
         translategetch(c);

         if(c==KEY_RIGHT || c==KEY_DOWN)
         {
            page++;
            continue;
         }

         if(c==KEY_LEFT || c==KEY_UP)
         {
            page--;
            continue;
         }

         if(c=='d')
         {
            return confirmdisband();
         }

         break;
      }
   }

   return 0;
}
Example #11
0
/* monthly - lets the player choose a special edition for the guardian */
int choosespecialedition(char &clearformess)
{
   int page=0;

   //char havetype[LOOTNUM];
   //for(int l=0;l<LOOTNUM;l++)havetype[l]=0;
   vector<bool> havetype(loottype.size(),false);
   vector<int> loottypeindex;

   //FIND ALL LOOT TYPES
   for(int loc=0;loc<location.size();loc++)
   {
      if(location[loc]->renting==RENTING_NOCONTROL)continue;

      for(int l=0;l<location[loc]->loot.size();l++)
      {
         if(!location[loc]->loot[l]->is_loot())continue;
         //Temporary, maybe put special edition definition into an xml file. -XML
         if(location[loc]->loot[l]->get_itemtypename()!="LOOT_CEOPHOTOS"&&
            location[loc]->loot[l]->get_itemtypename()!="LOOT_CEOLOVELETTERS"&&
            location[loc]->loot[l]->get_itemtypename()!="LOOT_CEOTAXPAPERS"&&
            location[loc]->loot[l]->get_itemtypename()!="LOOT_INTHQDISK"&&
            location[loc]->loot[l]->get_itemtypename()!="LOOT_CORPFILES"&&
            location[loc]->loot[l]->get_itemtypename()!="LOOT_JUDGEFILES"&&
            location[loc]->loot[l]->get_itemtypename()!="LOOT_RESEARCHFILES"&&
            location[loc]->loot[l]->get_itemtypename()!="LOOT_PRISONFILES"&&
            location[loc]->loot[l]->get_itemtypename()!="LOOT_CABLENEWSFILES"&&
            location[loc]->loot[l]->get_itemtypename()!="LOOT_AMRADIOFILES"&&
            location[loc]->loot[l]->get_itemtypename()!="LOOT_SECRETDOCUMENTS"&&
            location[loc]->loot[l]->get_itemtypename()!="LOOT_POLICERECORDS")continue;

         if(!havetype[getloottype(location[loc]->loot[l]->get_itemtypename())])
         {
            loottypeindex.push_back(getloottype(location[loc]->loot[l]->get_itemtypename()));
            havetype[getloottype(location[loc]->loot[l]->get_itemtypename())]=true;
         }
      }
   }
   for(int sq=0;sq<squad.size();sq++)
   {
      for(int l=0;l<squad[sq]->loot.size();l++)
      {
         if(!squad[sq]->loot[l]->is_loot())continue;

         if(squad[sq]->loot[l]->get_itemtypename()!="LOOT_CEOPHOTOS"&&
            squad[sq]->loot[l]->get_itemtypename()!="LOOT_CEOLOVELETTERS"&&
            squad[sq]->loot[l]->get_itemtypename()!="LOOT_CEOTAXPAPERS"&&
            squad[sq]->loot[l]->get_itemtypename()!="LOOT_INTHQDISK"&&
            squad[sq]->loot[l]->get_itemtypename()!="LOOT_CORPFILES"&&
            squad[sq]->loot[l]->get_itemtypename()!="LOOT_JUDGEFILES"&&
            squad[sq]->loot[l]->get_itemtypename()!="LOOT_RESEARCHFILES"&&
            squad[sq]->loot[l]->get_itemtypename()!="LOOT_PRISONFILES"&&
            squad[sq]->loot[l]->get_itemtypename()!="LOOT_CABLENEWSFILES"&&
            squad[sq]->loot[l]->get_itemtypename()!="LOOT_AMRADIOFILES"&&
            squad[sq]->loot[l]->get_itemtypename()!="LOOT_SECRETDOCUMENTS"&&
            squad[sq]->loot[l]->get_itemtypename()!="LOOT_POLICERECORDS")continue;

         if(!havetype[getloottype(squad[sq]->loot[l]->get_itemtypename())])
         {
            loottypeindex.push_back(getloottype(squad[sq]->loot[l]->get_itemtypename()));
            havetype[getloottype(squad[sq]->loot[l]->get_itemtypename())]=true;
         }
      }
   }

   if(loottypeindex.size()==0)return -1;

   clearformess=1;
   
   //PICK ONE
   do
   {
      erase();

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(0,0);
      addstr("Do you want to run a special edition?");

      int x=1,y=10;
      char str[200],str2[200];

      for(int l=page*18;l<loottypeindex.size()&&l<page*18+18;l++)
      {
         str[0]=l-page*18+'A';
         str[1]='\x0';
         strcat(str," - ");
         strcat(str,loottype[loottypeindex[l]]->get_name().c_str());

         move(y,x);
         addstr(str);

         x+=26;
         if(x>53)
         {
            x=1;
            y++;
         }
      }

      //PAGE UP
      if(page>0)
      {
         move(17,1);
         addprevpagestr();
      }
      //PAGE DOWN
      if((page+1)*18<loottype.size())
      {
         move(17,53);
         addnextpagestr();
      }

      move(24,1);
      addstr("X - Not in this month's Liberal Guardian");

      refresh();

      int c=getch();
      translategetch(c);

      if(c>='a'&&c<='r')
      {
         int slot=c-'a'+page*18;

         if(slot>=0&&slot<loottypeindex.size())
         {
            //DELETE THE ITEM
            for(int loc=0;loc<location.size();loc++)
            {
               if(location[loc]->renting==RENTING_NOCONTROL)continue;

               for(int l=0;l<location[loc]->loot.size();l++)
               {
                  if(!location[loc]->loot[l]->is_loot())continue;

                  if(getloottype(location[loc]->loot[l]->get_itemtypename())==loottypeindex[slot])
                  {
                     location[loc]->loot[l]->decrease_number(1);
                     if(location[loc]->loot[l]->get_number()==0)
                     {
                        delete location[loc]->loot[l];
                        location[loc]->loot.erase(location[loc]->loot.begin() + l);
                     }
                     return loottypeindex[slot];
                  }
               }
            }
            for(int sq=0;sq<squad.size();sq++)
            {
               for(int l=0;l<squad[sq]->loot.size();l++)
               {
                  if(!squad[sq]->loot[l]->is_loot())continue;

                  if(getloottype(squad[sq]->loot[l]->get_itemtypename())==loottypeindex[slot])
                  {
                     squad[sq]->loot[l]->decrease_number(1);
                     if(squad[sq]->loot[l]->get_number()==0)
                     {
                        delete squad[sq]->loot[l];
                        squad[sq]->loot.erase(squad[sq]->loot.begin() + l);
                     }
                     return loottypeindex[slot];
                  }
               }
            }

            //WHOOPS!
            return loottypeindex[slot];
         }
      }

      if(c=='x')
      {
         return -1;
      }

      //PAGE UP
      if((c==interface_pgup||c==KEY_UP||c==KEY_LEFT)&&page>0)page--;
      //PAGE DOWN
      if((c==interface_pgdn||c==KEY_DOWN||c==KEY_RIGHT)&&(page+1)*18<loottype.size())page++;

   }while(1);

   return -1;
}
Example #12
0
void Shop::maskselect(Creature &buyer) const
{
   short maskindex=-1;

   std::vector<unsigned> masktype;
   for(unsigned a=0;a<armortype.size();a++)
   {
      if (armortype[a]->is_mask() && !armortype[a]->is_surprise_mask())
         masktype.push_back(a);
   }

   unsigned page=0;

   do
   {
      erase();

      set_color(COLOR_WHITE,COLOR_BLACK,1);
      move(0,0);
      addstr("Which mask will ");
      addstr(buyer.name);
      addstr(" buy?");
      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(1,0);
      addstr("----PRODUCT NAME-----------------------DESCRIPTION------------------------------");

      int y=2;
      for(unsigned p=page*19 ; p < masktype.size() && p < page*19+19; p++)
      {
         set_color(COLOR_WHITE,COLOR_BLACK,0);
         move(y,0);
         addch(y+'A'-2);addstr(" - ");
         addstr(armortype[masktype[p]]->get_name().c_str());
         set_color(COLOR_WHITE,COLOR_BLACK,0);
         move(y,39);
         addstr(armortype[masktype[p]]->get_description().c_str());

         y++;
      }

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(22,0);
      addstr("Press a Letter to select a Mask");
      move(23,0);
      addpagestr();
      move(24,0);
      addstr("Z - Surprise ");
      addstr(buyer.name);
      addstr(" With a Random Mask");

      refresh();

      int c = getch();
      translategetch(c);

      //PAGE UP
      if((c == interface_pgup || c == KEY_UP || c == KEY_LEFT) && page > 0)
         page--;
      //PAGE DOWN
      if((c == interface_pgdn || c == KEY_DOWN || c == KEY_RIGHT) && (page+1)*19 < masktype.size())
         page++;

      if(c >= 'a' && c <= 's')
      {
         int p = page*19+(int)(c-'a');
         if(p < (int)masktype.size())
         {
            maskindex = masktype[p];
            break;
         }
      }
      if(c == 'z')
      {
         for (int i = 0; i < (int)armortype.size(); ++i)
         {
            if (armortype[i]->is_mask() && armortype[i]->is_surprise_mask())
               masktype.push_back(i);
         }
         maskindex = masktype[LCSrandom(masktype.size())];
         break;
      }

      if (c == 10)
         break;
   }while(1);

   if (maskindex != -1 && ledger.get_funds() >= 15)
   {
      Armor a = Armor(*armortype[maskindex]);
      buyer.give_armor(a, &location[buyer.base]->loot);
      ledger.subtract_funds(15,EXPENSE_SHOPPING);
   }
}
Example #13
0
int Shop::fenceselect(squadst& customers) const
{
   int ret=0;

   consolidateloot(location[customers.squad[0]->base]->loot);

   int page=0;

   vector<int> selected(location[customers.squad[0]->base]->loot.size(),0);

   do
   {
      erase();

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(0,0);
      addstr("What will you sell?");

      if (ret > 0)
      {
         move(0,30);
         addstr("Estimated Liberal Amount: $");
         addstr(tostring(ret).c_str());
      }

      printparty();

      int x = 1, y = 10;
      std::string outstr;
      std::string itemstr;

      for (int l = page * 18;
           l < (int)location[customers.squad[0]->base]->loot.size() && l < page * 18 + 18;
           l++)
      {
         if (selected[l])
            set_color(COLOR_GREEN,COLOR_BLACK,1);
         else
            set_color(COLOR_WHITE,COLOR_BLACK,0);
         itemstr = location[customers.squad[0]->base]->loot[l]->equip_title();
         if (location[customers.squad[0]->base]->loot[l]->get_number() > 1)
         {
            if(selected[l] > 0)
            {
               itemstr += " " + tostring(selected[l]) + "/";
            }
            else
               itemstr += " x";
            itemstr += tostring(location[customers.squad[0]->base]->loot[l]->get_number());
         }

         outstr = static_cast<char>(l - page * 18 + 'A');
         outstr += " - " + itemstr;

         move(y,x);
         addstr(outstr.c_str());

         x += 26;
         if (x > 53)
         {
            x = 1;
            y++;
         }
      }

      //PAGE UP
      set_color(COLOR_WHITE,COLOR_BLACK,0);
      if (page > 0)
      {
         move(17,1);
         addprevpagestr();
      }
      //PAGE DOWN
      if((page + 1) * 18 < (int)location[customers.squad[0]->base]->loot.size())
      {
         move(17,53);
         addnextpagestr();
      }

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(23,1);
      addstr("Press a letter to select an item to sell.");
      move(24,1);
      addstr("Enter - Done");

      refresh();

      int c = getch();
      translategetch(c);

      if (c >= 'a' && c <= 'r')
      {
         int slot = c - 'a' + page * 18;

         if(slot >= 0 && slot < (int)location[customers.squad[0]->base]->loot.size())
         {
            if (selected[slot])
            {
               ret -= location[customers.squad[0]->base]->loot[slot]->get_fencevalue() * selected[slot];
               selected[slot] = 0;
            }
            else
            {
               if (!location[customers.squad[0]->base]->loot[slot]->is_good_for_sale())
               {
                  printparty();

                  move(8,15);
                  set_color(COLOR_WHITE,COLOR_BLACK,1);
                  addstr(" You can't sell damaged goods.");

                  refresh();
                  getch();
               }
               else
               {
                  if (location[customers.squad[0]->base]->loot[slot]->get_number() > 1)
                  {
                     selected[slot] = 1;

                     printparty();

                     move(8,15);
                     set_color(COLOR_WHITE,COLOR_BLACK,1);
                     addstr("       How many?          ");

                     refresh();

                     char str[100];

                     keypad(stdscr,FALSE);
                     raw_output(FALSE);
                     echo();
                     curs_set(1);
                     mvgetstr(8,32,str);
                     curs_set(0);
                     noecho();
                     raw_output(TRUE);
                     keypad(stdscr,TRUE);

                     selected[slot] = atoi(str);
                     if (selected[slot] < 0)
                        selected[slot] = 0;
                     else if (selected[slot] > location[customers.squad[0]->base]->loot[slot]->get_number())
                        selected[slot]=location[customers.squad[0]->base]->loot[slot]->get_number();
                  }
                  else
                     selected[slot]=1;
                  ret += location[customers.squad[0]->base]->loot[slot]->get_fencevalue() * selected[slot];
               }
            }
         }
      }

      if(c == 'x'||c==10||c==ESC)
         break;

      //PAGE UP
      if((c == interface_pgup || c == KEY_UP || c == KEY_LEFT) && page > 0)
         page--;
      //PAGE DOWN
      if((c == interface_pgdn || c == KEY_DOWN || c == KEY_RIGHT)
         && (page + 1) * 18 < (int)location[customers.squad[0]->base]->loot.size())
         page++;

   } while (true);

   for(int l = location[customers.squad[0]->base]->loot.size() - 1; l >= 0; l--)
   {
      if(selected[l] > 0)
      {
         location[customers.squad[0]->base]->loot[l]->decrease_number(selected[l]);
         if(location[customers.squad[0]->base]->loot[l]->get_number() <= 0)
            delete_and_remove(location[customers.squad[0]->base]->loot,l);
      }
   }

   return ret;
}
Example #14
0
void Shop::sell_loot(squadst& customers) const
{
   int partysize=0;
   for(int p=0;p<6;p++)
   {
      if(customers.squad[p]!=NULL)
      {
         partysize++;
      }
   }

   do
   {
      erase();

      locheader();
      printparty();

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(10,1);
      addstr("E - Look over Equipment");

      if (location[customers.squad[0]->base]->loot.size() > 0)
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(10,40);
      addstr("F - Pawn Selectively");

      if (location[customers.squad[0]->base]->loot.size() > 0)
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(11,1);
      addstr("W - Pawn all Weapons");

      if (location[customers.squad[0]->base]->loot.size() > 0)
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(11,40);
      addstr("A - Pawn all Ammunition");

      if (location[customers.squad[0]->base]->loot.size() > 0)
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(12,1);
      addstr("C - Pawn all Clothes");

      if (location[customers.squad[0]->base]->loot.size() > 0)
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(12,40);
      addstr("L - Pawn all Loot");

      if (party_status != -1)
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(15,1);
      addstr("0 - Show the squad's Liberal status");

      if (partysize > 0 && (party_status == -1 || partysize > 1))
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(15,40);
      addstr("# - Check the status of a squad Liberal");

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(16,40);
      addstr("Enter - Done pawning");

      int c = getch();
      translategetch(c);

      if (c == 10)
         break;

      if (c == 'e' && customers.squad[0]->base != -1)
         equip(location[customers.squad[0]->base]->loot, -1);

      if (c == 'w' || c == 'a' || c == 'c')
      {
         move(18,1);
         set_color(COLOR_WHITE,COLOR_BLACK,1);
         switch (c)
         {
            case 'w':
               addstr("Really sell all weapons? (Y)es to confirm.           ");
               break;
            case 'a':
               addstr("Really sell all ammo? (Y)es to confirm.              ");
               break;
            case 'c':
               addstr("Really sell all clothes? (Y)es to confirm.           ");
               break;
         }
         int c2 = getch();
         translategetch(c2);
         if (c2 != 'y')
         {
            c = 0;//no sale
         }
      }

      if((c == 'w' || c == 'c' || c == 'l' || c == 'a' || c == 'f') &&
         location[customers.squad[0]->base]->loot.size() > 0)
      {
         int fenceamount=0;

         if (c == 'f')
            fenceamount = fenceselect(customers);
         else
         {
            for (int l = location[customers.squad[0]->base]->loot.size() - 1; l >= 0; l--)
            {
               if (c == 'w' && location[customers.squad[0]->base]->loot[l]->is_weapon()
                   && location[customers.squad[0]->base]->loot[l]->is_good_for_sale())
               {
                  fenceamount += location[customers.squad[0]->base]->loot[l]->get_fencevalue()
                                 * location[customers.squad[0]->base]->loot[l]->get_number();
                  delete_and_remove(location[customers.squad[0]->base]->loot,l);
               }
               else if (c == 'c' && location[customers.squad[0]->base]->loot[l]->is_armor()
                        && location[customers.squad[0]->base]->loot[l]->is_good_for_sale())
               {
                  fenceamount += location[customers.squad[0]->base]->loot[l]->get_fencevalue()
                                 * location[customers.squad[0]->base]->loot[l]->get_number();
                  delete_and_remove(location[customers.squad[0]->base]->loot,l);
               }
               else if (c == 'a' && location[customers.squad[0]->base]->loot[l]->is_clip()
                        && location[customers.squad[0]->base]->loot[l]->is_good_for_sale())
               {
                  fenceamount += location[customers.squad[0]->base]->loot[l]->get_fencevalue()
                                 * location[customers.squad[0]->base]->loot[l]->get_number();
                  delete_and_remove(location[customers.squad[0]->base]->loot,l);
               }
               else if (c == 'l' && location[customers.squad[0]->base]->loot[l]->is_loot()
                        && location[customers.squad[0]->base]->loot[l]->is_good_for_sale())
               {
                  Loot* a = static_cast<Loot*>(location[customers.squad[0]->base]->loot[l]); //cast -XML
                  if(!a->no_quick_fencing())
                  {
                     fenceamount += location[customers.squad[0]->base]->loot[l]->get_fencevalue()
                                    * location[customers.squad[0]->base]->loot[l]->get_number();
                     delete_and_remove(location[customers.squad[0]->base]->loot,l);
                  }
               }
            }
         }

         if(fenceamount > 0)
         {
            set_color(COLOR_WHITE,COLOR_BLACK,1);
            move(8,1);
            addstr("You add $");
            addstr(tostring(fenceamount).c_str());
            addstr(" to Liberal Funds.");

            refresh();
            getch();

            ledger.add_funds(fenceamount,INCOME_PAWN);
         }
      }
   } while (true);
}
Example #15
0
/* prompt after you've said you want to release someone */
void releasehostage(void) {
    short kidnapper = -1;

    party_status = -1;

    int available = 0;
    char availslot[6] = {0, 0, 0, 0, 0, 0};

    for(int p = 0; p < 6; p++) {
        if(activesquad->squad[p] != NULL) {
            if(activesquad->squad[p]->alive && activesquad->squad[p]->prisoner != NULL && activesquad->squad[p]->prisoner->align != ALIGN_LIBERAL) {
                available++;
                availslot[p] = 1;
            }
        }
    }

    if(!available) {
        set_color(COLOR_WHITE, COLOR_BLACK, 1);
        move(16, 1);
        addstr("No hostages are being held.       ");
        move(17, 1);
        addstr("                                  ");

        refresh();
        getch();

        return;
    }

    do {
        printparty();

        move(8, 20);
        set_color(COLOR_WHITE, COLOR_BLACK, 1);
        addstr("Choose a Liberal squad member to release their hostage.");

        refresh();

        int c = getch();
        translategetch(c);

        if(c == 10 || c == ESC)
            return;

        if(c >= '1' && c <= '6') {
            if(availslot[c - '1']) {
                kidnapper = c - '1';
                break;
            }
        }

    } while(1);

    activesquad->squad[kidnapper]->prisoner->cantbluff = 2;
    freehostage(*(activesquad->squad[kidnapper]), 2);

    if(!sitealarm) {
        set_color(COLOR_WHITE, COLOR_BLACK, 1);
        move(16, 1);
        addstr("The hostage shouts for help!      ", gamelog);
        gamelog.nextMessage(); //Next message.
        move(17, 1);
        addstr("                                  ");

        getch();
        sitealarm = 1;
        alienationcheck(1);
    }
}
void activate_sleeper(Creature *cr)
{
    int state=0;
    int choice=0;
    char havedead=0;

    do
    {
        erase();

        set_color(COLOR_WHITE,COLOR_BLACK,0);
        printfunds(0,1,"Money: ");

        move(0,0);
        addstr("Taking Undercover Action:   What will ");
        addstr(cr->name);
        addstr(" focus on?");

        printcreatureinfo(cr);

        makedelimiter(8,0);

        set_color(COLOR_WHITE,COLOR_BLACK,state=='a');
        move(10,1);
        addstr("A - Communication and Advocacy");

        set_color(COLOR_WHITE,COLOR_BLACK,state=='b');
        move(11,1);
        addstr("B - Espionage");

        set_color(COLOR_WHITE,COLOR_BLACK,state=='d');
        move(12,1);
        addstr("C - Join the Active LCS");

        set_color(COLOR_WHITE,COLOR_BLACK,0);
        move(20,40);
        addstr("Enter - Confirm Selection");

        switch(state)
        {
        case 'a':
            set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_NONE);
            move(10,40);
            addstr("1 - Lay Low");

            set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_SLEEPER_LIBERAL);
            move(11,40);
            addstr("2 - Advocate Liberalism");

            move(12,40);
            if(subordinatesleft(*cr))
            {
                set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_SLEEPER_RECRUIT);
                addstr("3 - Expand Sleeper Network");
            }
            else
            {
                set_color(COLOR_BLACK,COLOR_BLACK,1);
                if(cr->flag & CREATUREFLAG_BRAINWASHED)
                    addstr("3 - [Enlightened Can't Recruit]");
                else
                    addstr("3 - [Need More Juice to Recruit]");
            }
            break;
        case 'b':
            set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_SLEEPER_SPY);
            move(10,40);
            addstr("1 - Uncover Secrets");

            set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_SLEEPER_EMBEZZLE);
            move(11,40);
            addstr("2 - Embezzle Funds");

            set_color(COLOR_WHITE,COLOR_BLACK,cr->activity.type==ACTIVITY_SLEEPER_STEAL);
            move(12,40);
            addstr("3 - Steal Equipment");
            break;
        }

        set_color(COLOR_WHITE,COLOR_BLACK,0);
        switch(cr->activity.type)
        {
        case ACTIVITY_NONE:
            move(22,3);
            addstr(cr->name);
            addstr(" will stay out of trouble.");
            break;
        case ACTIVITY_SLEEPER_LIBERAL:
            move(22,3);
            addstr(cr->name);
            addstr(" will build support for Liberal causes.");
            break;
        case ACTIVITY_SLEEPER_RECRUIT:
            if(subordinatesleft(*cr))
            {
                move(22,3);
                addstr(cr->name);
                addstr(" will try to recruit additional sleeper agents.");
            }
            break;
        case ACTIVITY_SLEEPER_SPY:
            move(22,3);
            addstr(cr->name);
            addstr(" will snoop around for secrets and enemy plans.");
            break;
        case ACTIVITY_SLEEPER_EMBEZZLE:
            move(22,3);
            addstr(cr->name);
            addstr(" will embezzle money for the LCS.");
            break;
        case ACTIVITY_SLEEPER_STEAL:
            move(22,3);
            addstr(cr->name);
            addstr(" will steal equipment and send it to the Shelter.");
            break;
        }

        refresh();
        int c=getch();
        translategetch(c);



        if(c>='a'&&c<='z') {
            state=c;
        }
        if((c>='a'&&c<='z') || (c>='1'&&c<='9'))
        {
            choice=c;
            switch(state)
            {
            case 'a':
                switch(choice)
                {
                default:
                case '1':
                    cr->activity.type=ACTIVITY_NONE;
                    break;
                case '2':
                    cr->activity.type=ACTIVITY_SLEEPER_LIBERAL;
                    break;
                case '3':
                    if(subordinatesleft(*cr))
                        cr->activity.type=ACTIVITY_SLEEPER_RECRUIT;
                    break;
                }
                break;
            case 'b':
                switch(choice)
                {
                default:
                case '1':
                    cr->activity.type=ACTIVITY_SLEEPER_SPY;
                    break;
                case '2':
                    cr->activity.type=ACTIVITY_SLEEPER_EMBEZZLE;
                    break;
                case '3':
                    cr->activity.type=ACTIVITY_SLEEPER_STEAL;
                    break;
                }
                break;
            }
        }

        if(state=='c')
        {
            activityst oact=cr->activity;
            cr->activity.type=ACTIVITY_SLEEPER_JOINLCS;
        }
        if(c=='x')
        {
            cr->activity.type=ACTIVITY_NONE;
            break;
        }
        if(c==10)
        {
            break;
        }
    } while(1);
}
Example #17
0
/* prompt after you've said you want to kidnap someone */
void kidnapattempt(void) {
    short kidnapper = -1;

    party_status = -1;

    int available = 0;
    char availslot[6] = {0, 0, 0, 0, 0, 0};

    for(int p = 0; p < 6; p++) {
        if(activesquad->squad[p] != NULL) {
            if(activesquad->squad[p]->alive && activesquad->squad[p]->prisoner == NULL) {
                available++;
                availslot[p] = 1;
            }
        }
    }

    if(!available) {
        set_color(COLOR_WHITE, COLOR_BLACK, 1);
        move(16, 1);
        addstr("No one can do the job.            ");
        move(17, 1);
        addstr("                                  ");

        refresh();
        getch();

        return;
    }

    do {
        printparty();

        move(8, 20);
        set_color(COLOR_WHITE, COLOR_BLACK, 1);
        addstr("Choose a Liberal squad member to do the job.");

        refresh();

        int c = getch();
        translategetch(c);

        if(c == 10 || c == ESC)
            return;

        if(c >= '1' && c <= '6') {
            if(availslot[c - '1']) {
                kidnapper = c - '1';
                break;
            }
        }

    } while(1);

    if(kidnapper >= 0) {
        vector<int> target;

        for(int e = 0; e < ENCMAX; e++) {
            if(encounter[e].exists && encounter[e].alive && encounter[e].align == -1 &&
                    (encounter[e].animalgloss == ANIMALGLOSS_NONE || law[LAW_ANIMALRESEARCH] == 2)) {
                if((encounter[e].get_weapon().protects_against_kidnapping() &&
                        encounter[e].blood > 20) || encounter[e].animalgloss == ANIMALGLOSS_TANK)
                    continue;

                target.push_back(e);
            }
        }

        if(target.size() > 0) {
            int t = target[0];

            if(target.size() > 1) {
                do {
                    clearcommandarea();
                    clearmessagearea();
                    clearmaparea();

                    set_color(COLOR_WHITE, COLOR_BLACK, 1);
                    move(9, 1);
                    addstr("Kidnap whom?");

                    int x = 1, y = 11;

                    for(int t2 = 0; t2 < (int)target.size(); t2++) {
                        move(y, x);
                        addch(t2 + 'A');
                        addstr(" - ");
                        addstr(encounter[target[t2]].name);

                        y++;

                        if(y == 17) {
                            y = 11;
                            x += 30;
                        }
                    }

                    refresh();
                    int c = getch();
                    translategetch(c);

                    if(c >= 'a' && c <= 'z') {
                        t = c - 'a';

                        if(t >= (int)target.size())
                            t = -1;
                        else
                            t = target[t];

                        break;
                    }

                    if(c == 10 || c == ESC || c == 32) {
                        t = -1;
                        break;
                    }
                } while(1);
            }

            if(t != -1) {
                char amateur = 0;

                if(kidnap(*activesquad->squad[kidnapper], encounter[t], amateur)) {
                    delenc(t, 0);

                    int time = 20 + LCSrandom(10);

                    if(time < 1)
                        time = 1;

                    if(sitealarmtimer > time || sitealarmtimer == -1)
                        sitealarmtimer = time;
                } else
                    sitealarm = 1;

                if(amateur) {
                    char present = 0;

                    for(int e = 0; e < ENCMAX; e++) {
                        if(encounter[e].exists && encounter[e].alive) {
                            present = 1;
                            break;
                        }
                    }

                    if(present) {
                        alienationcheck(1);

                        if(!sitealarm)
                            sitealarm = 1;

                        sitecrime += 5;
                        criminalizeparty(LAWFLAG_KIDNAPPING);

                        if(activesquad->squad[kidnapper]->prisoner != NULL) {
                            if(activesquad->squad[kidnapper]->prisoner->type == CREATURE_RADIOPERSONALITY)
                                offended_amradio = 1;

                            if(activesquad->squad[kidnapper]->prisoner->type == CREATURE_NEWSANCHOR)
                                offended_cablenews = 1;
                        } else {
                            if(encounter[t].type == CREATURE_RADIOPERSONALITY)
                                offended_amradio = 1;

                            if(encounter[t].type == CREATURE_NEWSANCHOR)
                                offended_cablenews = 1;
                        }
                    }
                }

                if(sitealarm)
                    enemyattack();

                creatureadvance();
            }
        } else {
            set_color(COLOR_WHITE, COLOR_BLACK, 1);
            move(16, 1);
            addstr("All of the targets are too dangerous.                ");
            move(17, 1);
            addstr("                                                     ");

            refresh();
            getch();
        }
    } else {
        set_color(COLOR_WHITE, COLOR_BLACK, 1);
        move(16, 1);
        addstr("No one can do the job.                                  ");
        move(17, 1);
        addstr("                                                        ");

        refresh();
        getch();
    }
}
Example #18
0
void Shop::browse_halfscreen(squadst& customers, int& buyer) const
{
   unsigned page = 0;
   const unsigned max_entries_per_page = 20;

   std::vector<ShopOption*> available_options = options_;

   available_options.erase (remove_if (available_options.begin(),
				       available_options.end(),
				       not1 (mem_fun (&ShopOption::display))),
			    available_options.end());

   int partysize = 0;
   for (int p = 0; p < 6; ++p)
   {
      if(customers.squad[p] != NULL)
      {
         partysize++;
      }
   }

   do
   {
      erase();
      set_color(COLOR_WHITE,COLOR_BLACK,0);

      locheader();
      printparty();

      move(8,45);
      addstr("Buyer: ");
      addstr(customers.squad[buyer]->name);

      //Write wares and prices
      int yline = 10;
      int column = 1;
      int taken_letters = 0;
      for (unsigned p = page * (max_entries_per_page - 1);
           p < available_options.size() && p < page * (max_entries_per_page - 1) + max_entries_per_page;
           ++p)
      {
         if (available_options[p]->is_available())
            set_color(COLOR_WHITE,COLOR_BLACK,0);
         else
            set_color(COLOR_BLACK,COLOR_BLACK,1);
         if (column == 1)
            move(yline,1);
         else
            move(yline,40);

         if (available_options[p]->letter_defined_)
            addch(available_options[p]->showletter());
         else
         {
            // Find an available letter to use for this ware.
            bool done = false;
            while (taken_letters < 27 && !done)
            {
               done = true;
               if ('a' + taken_letters == 'b' || // Letters used by the shop UI are disallowed.
                   'a' + taken_letters == 'e' ||
                   ('a' + taken_letters == 's' && allow_selling_) ||
                   ('a' + taken_letters == 'm' && sell_masks_))
               {
                  ++taken_letters;
                  done = false;
                  continue;
               }
               for (unsigned i = 0; i < available_options.size(); ++i)
               {
                  if (available_options[i]->letter_defined_ &&
                      'a' + taken_letters == available_options[i]->letter_)
                  {
                     ++taken_letters;
                     done = false;
                     break;
                  }
               }
            }
            available_options[p]->letter_ = 'a' + taken_letters;
            addch('A' + taken_letters);
            ++taken_letters;
         }

         addstr(" - ");
         addstr(available_options[p]->get_description_halfscreen().c_str());
         if (column == 1)
            column = 2;
         else
         {
            ++yline;
            column = 1;
         }
      }
      if (sell_masks_)
      {
         move(yline,1+(column-1)*39);
         if (ledger.get_funds() >= 15)
            set_color(COLOR_WHITE,COLOR_BLACK,0);
         else
            set_color(COLOR_BLACK,COLOR_BLACK,1);
         addstr("M - Buy a Mask                ($15)");
      }
      if (column == 2)
         ++yline;

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(yline,1);
      addstr("E - Look over Equipment");
      ++yline;

      if (allow_selling_)
      {
         move(yline,1);
         if (location[customers.squad[0]->base]->loot.size() > 0)
            set_color(COLOR_WHITE,COLOR_BLACK,0);
         else
            set_color(COLOR_BLACK,COLOR_BLACK,1);
         addstr("S - Sell something");
         ++yline;
      }

      ++yline;

      if (party_status != -1)
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(yline,1);
      addstr("0 - Show the squad's Liberal status");

      if (partysize > 0 && (party_status == -1 || partysize > 1))
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(yline++,40);
      addstr("# - Check the status of a squad Liberal");

      if (partysize >= 2)
         set_color(COLOR_WHITE,COLOR_BLACK,0);
      else
         set_color(COLOR_BLACK,COLOR_BLACK,1);
      move(yline,1);
      addstr("B - Choose a buyer");

      set_color(COLOR_WHITE,COLOR_BLACK,0);
      move(yline,40);
      addstr("Enter - ");
      addstr(exit_.c_str());



      int c = getch();
      translategetch(c);

      for (unsigned i = 0; i < available_options.size(); ++i)
      {
         if (c == available_options[i]->letter_)
         {
            available_options[i]->choose(customers, buyer);
            break;
         }
      }

      if(c == 'e' && customers.squad[0]->base != -1)
         equip(location[customers.squad[0]->base]->loot, -1);
      else if (c == 's' && allow_selling_
               && location[customers.squad[0]->base]->loot.size() > 0)
         sell_loot(customers);
      else if (c == 'm' && sell_masks_ && ledger.get_funds() >= 15)
      {
         maskselect(*customers.squad[buyer]);
      }
      else if (c == 'b')
         choose_buyer(customers, buyer);
      else if (c == '0')
         party_status=-1;
      else if ( c >= '1' && c <= '6')
      {
         if (customers.squad[c-'1'] != NULL)
         {
            if (party_status == c - '1')
               fullstatus(party_status);
            else
               party_status = c - '1';
         }
      }
      else if (c == 10)
         break;

   } while (true);
}