/*********************************
**
**   SLEEPERS RECRUITING
**
**********************************/
void sleeper_recruit(Creature &cr,char &clearformess,char canseethings,int (&libpower)[VIEWNUM])
{
   if(subordinatesleft(cr))
   {
      prepareencounter(location[cr.worklocation]->type,0);
      for(int e=0;e<18;e++)
      {
         if(encounter[e].exists == false)
            break;
         if(encounter[e].worklocation == cr.worklocation || !LCSrandom(5))
         {
            if(encounter[e].align!=1&&LCSrandom(5))continue;

            Creature* recruit = new Creature(encounter[e]);
            liberalize(*recruit,0);
            recruit->namecreature();
            recruit->hireid = cr.id;
            if(recruit->infiltration > cr.infiltration)
            {
               recruit->infiltration = cr.infiltration;
            }
            recruit->flag |= CREATUREFLAG_SLEEPER;
            location[recruit->worklocation]->mapped=1;
            location[recruit->worklocation]->hidden=0;
            pool.push_back(recruit);

            erase();
            move(6,1);
            addstr("Sleeper ", gamelog);
            addstr(cr.name, gamelog);
            addstr(" has recruited a new ", gamelog);
            addstr(recruit->get_type_name(), gamelog);
            addstr(".", gamelog);
            gamelog.newline();
            move(8,1);
            addstr(recruit->name, gamelog);
            addstr(" looks forward serving the Liberal cause!", gamelog);
            gamelog.nextMessage();

            getkey();

            if(!subordinatesleft(cr))cr.activity.type = ACTIVITY_NONE;
            stat_recruits++;
            break;
         }
      }
   }
   return;
}
Ejemplo n.º 2
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);
}