コード例 #1
0
/* checks if your liberal activity is noticed */
void noticecheck(int exclude,int difficulty)
{
   if(sitealarm)return;

   char sneak=0;
   
   int topi=0;
   for(int i=0;i<6;++i)
   {
      if(activesquad->squad[i]&&
         activesquad->squad[i]->get_skill(SKILL_STEALTH)>sneak)
      {
         sneak=activesquad->squad[i]->get_skill(SKILL_STEALTH);
         topi=i;
      }
   }

   for(int e=0;e<ENCMAX;e++)
   {
      //Prisoners shouldn't shout for help.
      if(!strcmp(encounter[e].name,"Prisoner"))continue;
      
      if(e==exclude || encounter[e].exists==false)
         continue;
      else if(activesquad->squad[topi]->skill_check(SKILL_STEALTH,difficulty))
         continue;
      else
      {
         clearmessagearea();

         set_color(COLOR_RED,COLOR_BLACK,1);
         move(16,1);
         addstr(encounter[e].name, gamelog);
         addstr(" observes your Liberal activity ", gamelog);
         move(17,1);
         if(encounter[e].align==ALIGN_CONSERVATIVE)
            addstr("and lets forth a piercing Conservative alarm cry!", gamelog);
         else
            addstr("and shouts for help!", gamelog);
         gamelog.newline();
         
         sitealarm=1;


         refresh();
         getch();
         break;
      }
   }
}
コード例 #2
0
ファイル: haulkidnap.cpp プロジェクト: Gatleos/lcsgame
/* haul dead/paralyzed */
void squadgrab_immobile(char dead) {
    int p;
    //DRAGGING PEOPLE OUT IF POSSIBLE
    int hostslots = 0;

    for(p = 0; p < 6; p++) {
        if(activesquad->squad[p] != NULL) {
            if(activesquad->squad[p]->alive &&
                    (activesquad->squad[p]->canwalk() ||
                     (activesquad->squad[p]->flag & CREATUREFLAG_WHEELCHAIR)) &&
                    activesquad->squad[p]->prisoner == NULL)
                hostslots++;
            else if((!activesquad->squad[p]->alive ||
                     (!activesquad->squad[p]->canwalk() &&
                      !(activesquad->squad[p]->flag & CREATUREFLAG_WHEELCHAIR))) &&
                    activesquad->squad[p]->prisoner != NULL) {
                clearmessagearea();
                set_color(COLOR_YELLOW, COLOR_BLACK, 1);
                move(16, 1);
                addstr(activesquad->squad[p]->name, gamelog);
                addstr(" can no longer handle ", gamelog);
                addstr(activesquad->squad[p]->prisoner->name, gamelog);
                addstr(".", gamelog);
                gamelog.newline(); //New line.
                refresh();
                getch();

                freehostage(*activesquad->squad[p]->prisoner, 1);
            }
        }
    }

    for(p = 5; p >= 0; p--) {
        if(activesquad->squad[p] != NULL) {
            if((!activesquad->squad[p]->alive && dead) ||
                    (activesquad->squad[p]->alive &&
                     !(activesquad->squad[p]->flag & CREATUREFLAG_WHEELCHAIR) &&
                     !activesquad->squad[p]->canwalk() && !dead)) {
                if(hostslots == 0) {
                    if(!activesquad->squad[p]->alive) {
                        clearmessagearea();
                        set_color(COLOR_YELLOW, COLOR_BLACK, 1);
                        move(16, 1);
                        addstr("Nobody can carry Martyr ", gamelog);
                        addstr(activesquad->squad[p]->name, gamelog);
                        addstr(".", gamelog);
                        gamelog.newline();

                        //DROP LOOT
                        makeloot(*activesquad->squad[p], groundloot);

                        //MUST DELETE PARTY MEMBER FROM POOL COMPLETELY
                        //(that may not be the case any longer -jds)
                        for(int pl = 0; pl < (int)pool.size(); pl++) {
                            if(pool[pl] == activesquad->squad[p]) {
                                pool[pl]->die();
                                pool[pl]->location = -1;
                                //delete_and_remove(pool,pl);
                                break;
                            }
                        }

                        //Check if that was the last living squad member.
                        //bool squad_dead = true;
                        for(int i = 5; i >= 0; --i) {
                            //This check to make sure we don't look at nonexistent
                            //data, causing segfaults and the like.
                            if(activesquad->squad[i] != NULL) {
                                //Check if alive.
                                if(activesquad->squad[i]->alive) {
                                    //IT LIVES! Squad is not dead.
                                    //squad_dead = false;
                                    break; //No reason to continue
                                }
                            }
                        }
                    } else {
                        clearmessagearea();
                        set_color(COLOR_YELLOW, COLOR_BLACK, 1);
                        move(16, 1);
                        addstr(activesquad->squad[p]->name, gamelog);
                        addstr(" is left to be captured.", gamelog);
                        gamelog.newline(); //New line.

                        capturecreature(*activesquad->squad[p]);
                    }
                } else {
                    for(int p2 = 0; p2 < 6; p2++) {
                        if(p2 == p)
                            continue;

                        if(activesquad->squad[p2] != NULL) {
                            if(activesquad->squad[p2]->alive &&
                                    (activesquad->squad[p2]->canwalk() ||
                                     (activesquad->squad[p2]->flag & CREATUREFLAG_WHEELCHAIR)) &&
                                    activesquad->squad[p2]->prisoner == NULL) {
                                activesquad->squad[p2]->prisoner = activesquad->squad[p];

                                clearmessagearea();
                                set_color(COLOR_YELLOW, COLOR_BLACK, 1);
                                move(16, 1);
                                addstr(activesquad->squad[p2]->name, gamelog);
                                addstr(" hauls ", gamelog);
                                addstr(activesquad->squad[p]->name, gamelog);
                                addstr(".", gamelog);
                                gamelog.newline(); //New line.
                                break;
                            }
                        }
                    }

                    hostslots--;
                }

                //SHUFFLE SQUAD
                char flipstart = 0;

                for(int pt = 0; pt < 6; pt++) {
                    if(pt == p - 1)
                        continue;

                    if(pt == p)
                        flipstart = 1;

                    if(flipstart && pt < 5)
                        activesquad->squad[pt] = activesquad->squad[pt + 1];
                }

                if(flipstart)
                    activesquad->squad[5] = NULL;

                printparty();
                refresh();
                getch();
            }
        }
    }
}
コード例 #3
0
ファイル: haulkidnap.cpp プロジェクト: Gatleos/lcsgame
/* hostage freed due to host unable to haul */
void freehostage(Creature &cr, char situation) {
    if(cr.prisoner == NULL)
        return;

    if(cr.prisoner->alive) {
        if(situation == 0) {
            if(cr.prisoner->squadid == -1)
                addstr(" and a hostage is freed", gamelog);
            else {
                addstr(" and ", gamelog);
                addstr(cr.prisoner->name, gamelog);

                if(cr.prisoner->flag & CREATUREFLAG_JUSTESCAPED)
                    addstr(" is recaptured", gamelog);
                else
                    addstr(" is captured", gamelog);
            }

            gamelog.newline(); //New line.
        } else if(situation == 1) {
            clearmessagearea();
            set_color(COLOR_WHITE, COLOR_BLACK, 1);
            move(16, 1);

            if(cr.prisoner->squadid == -1)
                addstr("A hostage escapes!", gamelog);
            else {
                addstr(cr.prisoner->name, gamelog);

                if(cr.prisoner->flag & CREATUREFLAG_JUSTESCAPED)
                    addstr(" is recaptured.", gamelog);
                else
                    addstr(" is captured.", gamelog);
            }

            gamelog.newline(); //New line.
        } else if(situation == 2) {
            //Don't print anything.
        }

        if(cr.prisoner->squadid == -1) {
            for(int e = 0; e < ENCMAX; e++) {
                if(encounter[e].exists == 0) {
                    encounter[e] = *cr.prisoner;
                    encounter[e].exists = 1;
                    conservatise(encounter[e]);
                    break;
                }
            }

            delete cr.prisoner;
        } else
            capturecreature(*cr.prisoner);
    } else {
        if(cr.prisoner->squadid != -1) {
            //MUST DELETE PARTY MEMBER FROM POOL COMPLETELY
            //(That may not be the case any longer -jds)
            for(int pl = 0; pl < (int)pool.size(); pl++) {
                if(pool[pl] == cr.prisoner) {
                    removesquadinfo(*pool[pl]);
                    pool[pl]->die();
                    pool[pl]->location = -1;
                    //delete_and_remove(pool,pl);
                    break;
                }
            }
        }
    }

    cr.prisoner = NULL;

    if(situation == 1) {
        printparty();

        if(mode == GAMEMODE_CHASECAR ||
                mode == GAMEMODE_CHASEFOOT)
            printchaseencounter();
        else
            printencounter();

        refresh();
        getch();
    }
}
コード例 #4
0
ファイル: haulkidnap.cpp プロジェクト: Gatleos/lcsgame
/* 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();
    }
}
コード例 #5
0
ファイル: haulkidnap.cpp プロジェクト: Gatleos/lcsgame
/* roll on the kidnap attempt and show the results */
char kidnap(Creature &a, Creature &t, char &amateur) {
    if(!a.get_weapon().can_take_hostages()) {
        amateur = 1;

        //BASIC ROLL
        int aroll = a.skill_roll(SKILL_HANDTOHAND);
        int droll = t.attribute_check(ATTRIBUTE_AGILITY, true);

        a.train(SKILL_HANDTOHAND, droll);

        clearmessagearea();

        //HIT!
        if(aroll > droll) {
            set_color(COLOR_WHITE, COLOR_BLACK, 1);
            move(16, 1);
            addstr(a.name, gamelog);
            addstr(" snatches ", gamelog);
            addstr(t.name, gamelog);
            addstr("!", gamelog);
            gamelog.newline(); //New line.

            a.prisoner = new Creature;
            *a.prisoner = t;

            refresh();
            getch();

            set_color(COLOR_RED, COLOR_BLACK, 1);
            move(17, 1);
            addstr(t.name, gamelog);
            addstr(" is struggling and screaming!", gamelog);
            gamelog.newline(); //New line.

            refresh();
            getch();

            gamelog.newline();
            return 1;
        } else {
            set_color(COLOR_MAGENTA, COLOR_BLACK, 1);
            move(16, 1);
            addstr(a.name, gamelog);
            addstr(" grabs at ", gamelog);
            addstr(t.name, gamelog);
            gamelog.newline(); //New line.
            move(17, 1);
            addstr("but ", gamelog);
            addstr(t.name, gamelog);
            addstr(" writhes away!", gamelog);
            gamelog.newline(); //New line.

            refresh();
            getch();


            gamelog.newline();
            return 0;
        }
    } else {
        clearmessagearea();

        set_color(COLOR_WHITE, COLOR_BLACK, 1);
        move(16, 1);
        addstr(a.name, gamelog);
        addstr(" shows ", gamelog);
        addstr(t.name, gamelog);
        addstr(" the ", gamelog);
        addstr(a.get_weapon().get_name(2).c_str(), gamelog);
        addstr(" ", gamelog);
        move(17, 1);
        addstr("and says, ", gamelog);
        set_color(COLOR_GREEN, COLOR_BLACK, 1);

        if(law[LAW_FREESPEECH] == -2)
            addstr("\"[Please], be cool.\"", gamelog);
        else
            addstr("\"Bitch, be cool.\"", gamelog);

        a.prisoner = new Creature;
        *a.prisoner = t;

        refresh();
        getch();

        gamelog.newline();
        return 1;
    }
}
コード例 #6
0
/* run a tv broadcast */
char news_broadcast(void)
{
    sitealarm=1;
    int p;

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

    if(enemy>0)
    {
        clearmessagearea();
        set_color(COLOR_WHITE,COLOR_BLACK,1);
        move(16,1);
        addstr("The Conservatives in the room hurry the Squad, so ", gamelog);
        move(17,1);
        addstr("the broadcast never happens.", gamelog);
        gamelog.newline();

        refresh();
        getch();
        return 0;
    }

    criminalizeparty(LAWFLAG_DISTURBANCE);

    clearmessagearea();
    set_color(COLOR_WHITE,COLOR_BLACK,1);
    move(16,1);
    addstr("The Squad steps in front of the cameras and ", gamelog);
    move(17,1);
    int viewhit=LCSrandom(VIEWNUM);
    switch(viewhit)
    {
    case VIEW_GAY:
        addstr("discusses homosexual rights.", gamelog);
        break;
    case VIEW_DEATHPENALTY:
        addstr("examines the death penalty.", gamelog);
        break;
    case VIEW_TAXES:
        addstr("discusses the tax code.", gamelog);
        break;
    case VIEW_NUCLEARPOWER:
        addstr("runs down nuclear power.", gamelog);
        break;
    case VIEW_ANIMALRESEARCH:
        addstr("discusses the horrors of animal research.", gamelog);
        break;
    case VIEW_POLICEBEHAVIOR:
        addstr("goes over cases of police brutality.", gamelog);
        break;
    case VIEW_TORTURE:
        addstr("discusses prisoner abuse and torture.", gamelog);
        break;
    case VIEW_PRISONS:
        addstr("discusses the prison system's flaws.", gamelog);
        break;
    case VIEW_INTELLIGENCE:
        addstr("debates privacy law.", gamelog);
        break;
    case VIEW_FREESPEECH:
        addstr("talks about free speech.", gamelog);
        break;
    case VIEW_GENETICS:
        addstr("discusses the implications of genetic research.", gamelog);
        break;
    case VIEW_JUSTICES:
        addstr("talks about the record of a Conservative judge.", gamelog);
        break;
    case VIEW_GUNCONTROL:
        addstr("talks about gun control.", gamelog);
        break;
    case VIEW_SWEATSHOPS:
        addstr("brings details about sweatshops to light.", gamelog);
        break;
    case VIEW_POLLUTION:
        addstr("does a show on industrial pollution.", gamelog);
        break;
    case VIEW_CORPORATECULTURE:
        addstr("jokes about corporate culture.", gamelog);
        break;
    case VIEW_CEOSALARY:
        addstr("gives examples of CEO excesses.", gamelog);
        break;
    case VIEW_WOMEN:
        addstr("discusses abortion.", gamelog);
        break;// "Performs an abortion live on the air."
    // Get [LAWFLAG_SPEECH], [LAWFLAG_MURDER], [LAWFLAG_DISTURBANCE] -- LK
    case VIEW_CIVILRIGHTS:
        addstr("debates affirmative action.", gamelog);
        break;
    case VIEW_DRUGS:
        addstr("has a frank talk about drugs.", gamelog);
        break;
    case VIEW_IMMIGRATION:
        addstr("examines the issue of immigration.", gamelog);
        break;
    case VIEW_MILITARY:
        addstr("talks about militarism in modern culture.", gamelog);
        break;
    case VIEW_AMRADIO:
        addstr("discusses other AM radio shows.", gamelog);
        break;
    case VIEW_CABLENEWS:
        addstr("talks about Cable News.", gamelog);
        break;
    case VIEW_LIBERALCRIMESQUAD:
        addstr("lets people know about the Liberal Crime Squad.", gamelog);
        break;
    default:
    case VIEW_LIBERALCRIMESQUADPOS:
        addstr("extols the virtues of the Liberal Crime Squad.", gamelog);
        break;
    case VIEW_CONSERVATIVECRIMESQUAD:
        addstr("demonizes the Conservative Crime Squad.", gamelog);
        break;
    }
    gamelog.newline();

    refresh();
    getch();

    int segmentpower=0;
    int usegmentpower;
    int partysize=0;
    for(p=0; p<6; p++)
    {
        if(activesquad->squad[p]!=NULL)
        {
            if(!activesquad->squad[p]->alive)continue;

            segmentpower+=activesquad->squad[p]->get_attribute(ATTRIBUTE_INTELLIGENCE,true);
            segmentpower+=activesquad->squad[p]->get_attribute(ATTRIBUTE_HEART,true);
            segmentpower+=activesquad->squad[p]->get_attribute(ATTRIBUTE_CHARISMA,true);
            segmentpower+=activesquad->squad[p]->get_skill(SKILL_MUSIC);
            segmentpower+=activesquad->squad[p]->get_skill(SKILL_RELIGION);
            segmentpower+=activesquad->squad[p]->get_skill(SKILL_SCIENCE);
            segmentpower+=activesquad->squad[p]->get_skill(SKILL_BUSINESS);
            segmentpower+=activesquad->squad[p]->get_skill(SKILL_PERSUASION);
            activesquad->squad[p]->train(SKILL_PERSUASION,50);
            partysize++;
        }
    }

    // LCS colors enhance the broadcast significantly
    if(activesquad->stance==SQUADSTANCE_BATTLECOLORS)
        segmentpower = (segmentpower * 3) / 2;

    int segmentbonus=segmentpower/4;
    if(partysize>1)segmentpower/=partysize;
    segmentpower+=segmentbonus;

    clearmessagearea();

    set_color(COLOR_WHITE,COLOR_BLACK,1);
    move(16,1);
    if(segmentpower<25)addstr("The Squad looks completely insane.", gamelog);
    else if(segmentpower<35)addstr("The show really sucks.", gamelog);
    else if(segmentpower<45)addstr("It is a very boring hour.", gamelog);
    else if(segmentpower<55)addstr("It is mediocre TV.", gamelog);
    else if(segmentpower<70)addstr("The show was all right.", gamelog);
    else if(segmentpower<85)addstr("The Squad put on a good show.", gamelog);
    else if(segmentpower<100)addstr("It was thought-provoking, even humorous.", gamelog);
    else addstr("It was the best hour of Cable TV EVER.", gamelog);
    gamelog.newline();

    refresh();
    getch();

    //CHECK PUBLIC OPINION
    change_public_opinion(VIEW_LIBERALCRIMESQUAD,10);
    change_public_opinion(VIEW_LIBERALCRIMESQUADPOS,(segmentpower-50)/10);
    if(viewhit!=VIEW_LIBERALCRIMESQUAD)change_public_opinion(viewhit,(segmentpower-50)/5,1);
    else change_public_opinion(viewhit,segmentpower/10);

    //PRISONER PARTS
    for(p=0; p<6; p++)
    {
        if(activesquad->squad[p]!=NULL)
        {
            if(activesquad->squad[p]->prisoner!=NULL && activesquad->squad[p]->prisoner->alive)
            {
                if(activesquad->squad[p]->prisoner->type==CREATURE_NEWSANCHOR)
                {
                    viewhit=LCSrandom(VIEWNUM);
                    clearmessagearea();

                    set_color(COLOR_WHITE,COLOR_BLACK,1);
                    move(16,1);
                    addstr("The hostage ", gamelog);
                    addstr(activesquad->squad[p]->prisoner->name, gamelog);
                    addstr(" is forced on to ", gamelog);
                    move(17,1);
                    switch(viewhit)
                    {
                    case VIEW_GAY:
                        addstr("discuss homosexual rights.", gamelog);
                        break;
                    case VIEW_DEATHPENALTY:
                        addstr("examine the death penalty.", gamelog);
                        break;
                    case VIEW_TAXES:
                        addstr("discuss the tax code.", gamelog);
                        break;
                    case VIEW_NUCLEARPOWER:
                        addstr("run down nuclear power.", gamelog);
                        break;
                    case VIEW_ANIMALRESEARCH:
                        addstr("discuss the horrors of animal research.", gamelog);
                        break;
                    case VIEW_POLICEBEHAVIOR:
                        addstr("go over cases of police brutality.", gamelog);
                        break;
                    case VIEW_TORTURE:
                        addstr("discuss prisoner abuse and torture.", gamelog);
                        break;
                    case VIEW_PRISONS:
                        addstr("discusses the prison system's flaws.", gamelog);
                        break;
                    case VIEW_INTELLIGENCE:
                        addstr("debate privacy law.", gamelog);
                        break;
                    case VIEW_FREESPEECH:
                        addstr("talk about free speech.", gamelog);
                        break;
                    case VIEW_GENETICS:
                        addstr("discuss the implications of genetic research.", gamelog);
                        break;
                    case VIEW_JUSTICES:
                        addstr("talk about the record of a Conservative judge.", gamelog);
                        break;
                    case VIEW_GUNCONTROL:
                        addstr("talk about gun control.", gamelog);
                        break;
                    case VIEW_SWEATSHOPS:
                        addstr("bring details about sweatshops to light.", gamelog);
                        break;
                    case VIEW_POLLUTION:
                        addstr("do a show on industrial pollution.", gamelog);
                        break;
                    case VIEW_CORPORATECULTURE:
                        addstr("joke about corporate culture.", gamelog);
                        break;
                    case VIEW_CEOSALARY:
                        addstr("give examples of CEO excesses.", gamelog);
                        break;
                    case VIEW_WOMEN:
                        addstr("discuss abortion.", gamelog);
                        break;// "Performs an abortion live on the air."
                    // Get [LAWFLAG_SPEECH], [LAWFLAG_MURDER], [LAWFLAG_DISTURBANCE] -- LK
                    case VIEW_CIVILRIGHTS:
                        addstr("debate affirmative action.", gamelog);
                        break;
                    case VIEW_DRUGS:
                        addstr("have a frank talk about drugs.", gamelog);
                        break;
                    case VIEW_IMMIGRATION:
                        addstr("examine the issue of immigration.", gamelog);
                        break;
                    case VIEW_MILITARY:
                        addstr("talk about militarism in modern culture.", gamelog);
                        break;
                    case VIEW_AMRADIO:
                        addstr("discuss other AM radio shows.", gamelog);
                        break;
                    case VIEW_CABLENEWS:
                        addstr("talk about Cable News.", gamelog);
                        break;
                    case VIEW_LIBERALCRIMESQUAD:
                        addstr("let people know about the Liberal Crime Squad.", gamelog);
                        break;
                    default:
                    case VIEW_LIBERALCRIMESQUADPOS:
                        addstr("extol the virtues of the Liberal Crime Squad.", gamelog);
                        break;
                    case VIEW_CONSERVATIVECRIMESQUAD:
                        addstr("demonize the Conservative Crime Squad.", gamelog);
                        break;
                    }
                    gamelog.newline();

                    usegmentpower=10; //FAME BONUS
                    usegmentpower+=activesquad->squad[p]->prisoner->get_attribute(ATTRIBUTE_INTELLIGENCE,true);
                    usegmentpower+=activesquad->squad[p]->prisoner->get_attribute(ATTRIBUTE_HEART,true);
                    usegmentpower+=activesquad->squad[p]->prisoner->get_attribute(ATTRIBUTE_CHARISMA,true);
                    usegmentpower+=activesquad->squad[p]->prisoner->get_skill(SKILL_PERSUASION);

                    if(viewhit!=VIEW_LIBERALCRIMESQUAD)change_public_opinion(viewhit,(usegmentpower-10)/2);
                    else change_public_opinion(viewhit,usegmentpower/2,1);

                    segmentpower+=usegmentpower;

                    refresh();
                    getch();
                }
                else
                {
                    clearmessagearea();

                    set_color(COLOR_WHITE,COLOR_BLACK,1);
                    move(16,1);
                    addstr(activesquad->squad[p]->prisoner->name, gamelog);
                    addstr(", the hostage, is kept off-air.", gamelog);
                    gamelog.newline();

                    refresh();
                    getch();
                }
            }
        }
    }

    if(sitealienate>=1&&segmentpower>=40)
    {
        sitealienate=0;

        clearmessagearea();

        set_color(COLOR_WHITE,COLOR_BLACK,1);
        move(16,1);
        addstr("Moderates at the station appreciated the show.", gamelog);
        gamelog.newline();
        move(17,1);
        addstr("They no longer feel alienated.", gamelog);
        gamelog.newline();

        refresh();
        getch();
    }

    //POST - SECURITY BLITZ IF IT SUCKED
    if(segmentpower<85 && segmentpower>=25)
    {
        clearmessagearea();

        set_color(COLOR_WHITE,COLOR_BLACK,1);
        move(16,1);
        addstr("Security is waiting for the Squad ", gamelog);
        move(17,1);
        addstr("after the show!", gamelog);
        gamelog.newline();

        refresh();
        getch();

        int numleft=LCSrandom(8)+2;
        for(int e=0; e<ENCMAX; e++)
        {
            if(!encounter[e].exists)
            {
                makecreature(encounter[e],CREATURE_SECURITYGUARD);
                numleft--;
            }
            if(numleft==0)break;
        }
    }
    else
    {
        clearmessagearea();

        set_color(COLOR_WHITE,COLOR_BLACK,1);
        move(16,1);
        addstr("The show was so ", gamelog);
        if(segmentpower<50)
            addstr("hilarious", gamelog);
        else
            addstr("entertaining", gamelog);
        addstr(" that security watched it ", gamelog);
        move(17,1);
        addstr("at their desks.  The Squad might yet escape.", gamelog);
        gamelog.newline();

        refresh();
        getch();
    }

    return 1;
}
コード例 #7
0
/* computer hack attempt */
char hack(short type,char &actual)
{
    int difficulty=0;
    int p;

    switch(type)
    {
    case HACK_SUPERCOMPUTER:
        difficulty=DIFFICULTY_HEROIC;
        break;
    case HACK_VAULT:
        difficulty=DIFFICULTY_CHALLENGING;
        break;
    }

    int maxattack=0;
    char blind=0;
    int hacker = -1;

    for(p=0; p<6; p++)
    {
        if(activesquad->squad[p]!=NULL)
        {
            if(activesquad->squad[p]->alive && activesquad->squad[p]->get_skill(SKILL_COMPUTERS))
            {
                int roll = activesquad->squad[p]->skill_roll(SKILL_COMPUTERS);
                if(roll>maxattack)
                {
                    if(!activesquad->squad[p]->special[SPECIALWOUND_RIGHTEYE]&&
                            !activesquad->squad[p]->special[SPECIALWOUND_LEFTEYE])
                    {
                        blind=1;
                    }
                    else
                    {
                        maxattack = roll;
                        hacker = p;
                    }
                }
            }
        }
    }

    if(hacker > -1)
    {
        activesquad->squad[hacker]->train(SKILL_COMPUTERS,difficulty);

        if(maxattack>difficulty)
        {
            clearmessagearea();
            set_color(COLOR_WHITE,COLOR_BLACK,1);
            move(16,1);
            addstr(activesquad->squad[hacker]->name, gamelog);
            switch(type)
            {
            case HACK_SUPERCOMPUTER:
                addstr(" has burned a disk of top secret files!", gamelog);
                break;
            case HACK_VAULT:
                addstr(" has disabled the second layer of security!", gamelog);
                break;
            }
            gamelog.newline();
            refresh();
            getch();

            actual=1;
            return 1;
        }
        else
        {
            clearmessagearea();
            set_color(COLOR_WHITE,COLOR_BLACK,1);
            move(16,1);
            addstr(activesquad->squad[hacker]->name, gamelog);
            switch(type)
            {
            case HACK_SUPERCOMPUTER:
                addstr(" couldn't bypass the supercomputer security.", gamelog);
                break;
            case HACK_VAULT:
                addstr(" couldn't bypass the vault's electronic lock.", gamelog);
                break;
            }
            gamelog.newline();
            refresh();
            getch();

            actual=1;
            return 0;
        }
    }
    else
    {
        clearmessagearea();
        set_color(COLOR_WHITE,COLOR_BLACK,1);
        move(16,1);
        addstr("You can't find anyone to do the job.", gamelog);
        gamelog.newline();
        if(blind)
        {
            // Screen readers FTW. Honestly, it should just be a handicap
            //        instead of an impossibility, just make the chances
            //        much, much less.
            //                        -- LK
            refresh();
            getch();
            move(17,1);
            addstr("Including the BLIND HACKER you brought.", gamelog);
            gamelog.newline();
        }
        refresh();
        getch();
    }

    actual=0;
    return 0;
}
コード例 #8
0
/* unlock attempt */
char unlock(short type,char &actual)
{
    int p;
    int difficulty=0;

    switch(type)
    {
    case UNLOCK_DOOR:
        if(securityable(location[cursite]->type) == 1)
            difficulty=DIFFICULTY_CHALLENGING;
        else if(securityable(location[cursite]->type) > 1)
            difficulty=DIFFICULTY_HARD;
        else
            difficulty=DIFFICULTY_EASY;
        break;
    case UNLOCK_CAGE:
        difficulty=DIFFICULTY_VERYEASY;
        break;
    case UNLOCK_CAGE_HARD:
        difficulty=DIFFICULTY_AVERAGE;
        break;
    case UNLOCK_CELL:
        difficulty=DIFFICULTY_FORMIDABLE;
        break;
    case UNLOCK_ARMORY:
        difficulty=DIFFICULTY_HEROIC;
        break;
    case UNLOCK_SAFE:
        difficulty=DIFFICULTY_HEROIC;
        break;
    case UNLOCK_VAULT:
        difficulty=DIFFICULTY_HEROIC;
        break;
    }

    int maxattack=-1;

    for(p=0; p<6; p++)
    {
        if(activesquad->squad[p]!=NULL)
        {
            if(activesquad->squad[p]->alive)
            {
                if(activesquad->squad[p]->get_skill(SKILL_SECURITY)>maxattack)
                {
                    maxattack=activesquad->squad[p]->get_skill(SKILL_SECURITY);
                }
            }
        }
    }

    vector<int> goodp;

    for(p=0; p<6; p++)
    {
        if(activesquad->squad[p]!=NULL)
        {
            if(activesquad->squad[p]->alive)
            {
                if(activesquad->squad[p]->get_skill(SKILL_SECURITY)==maxattack)
                {
                    goodp.push_back(p);
                }
            }
        }
    }

    if(goodp.size()>0)
    {
        int p=goodp[LCSrandom(goodp.size())];

        //lock pick succeeded.
        if(activesquad->squad[p]->skill_check(SKILL_SECURITY,difficulty))
        {
            //skill goes up in proportion to the chance of you failing.
            if(maxattack<=difficulty)
            {
                activesquad->squad[p]->train(SKILL_SECURITY,1+(difficulty-maxattack));
            }
            clearmessagearea(false);
            set_color(COLOR_WHITE,COLOR_BLACK,1);
            move(16,1);
            addstr(activesquad->squad[p]->name, gamelog);
            addstr(" ", gamelog);
            switch(type)
            {
            case UNLOCK_DOOR:
                addstr("unlocks the door", gamelog);
                break;
            case UNLOCK_CAGE_HARD:
            case UNLOCK_CAGE:
                addstr("unlocks the cage", gamelog);
                break;
            case UNLOCK_SAFE:
                addstr("cracks the safe", gamelog);
                break;
            case UNLOCK_ARMORY:
                addstr("opens the armory", gamelog);
                break;
            case UNLOCK_CELL:
                addstr("unlocks the cell", gamelog);
                break;
            case UNLOCK_VAULT:
                addstr("cracks the combo locks", gamelog);
                break;
            }
            addstr("!", gamelog);
            gamelog.newline();
            for(int j=0; j<6; j++) //If people witness a successful unlock, they learn a little bit.
            {
                if(j==p) continue;
                if(activesquad->squad[j]!=NULL&&
                        activesquad->squad[j]->alive&&
                        activesquad->squad[j]->get_skill(SKILL_SECURITY)<difficulty)
                {
                    if(activesquad->squad[j]->alive)
                    {
                        activesquad->squad[j]->train(SKILL_SECURITY,difficulty-activesquad->squad[j]->get_skill(SKILL_SECURITY));
                    }
                }
            }

            refresh();
            getch();

            actual=1;
            return 1;
        }
        else
        {
            clearmessagearea(false);
            set_color(COLOR_WHITE,COLOR_BLACK,1);
            move(16,1);

            int i;
            //gain some experience for failing only if you could have succeeded.
            for (i = 0; i < 3; i++)
            {
                if(activesquad->squad[p]->skill_check(SKILL_SECURITY,difficulty))
                {
                    activesquad->squad[p]->train(SKILL_SECURITY,10);

                    addstr(activesquad->squad[p]->name, gamelog);
                    addstr(" is close, but can't quite get the lock open.", gamelog);
                    gamelog.newline();
                    break;
                }
            }

            if (i == 3)
            {
                addstr(activesquad->squad[p]->name, gamelog);
                addstr(" can't figure the lock out.", gamelog);
                gamelog.newline();
            }
            refresh();
            getch();

            actual=1;
            return 0;
        }
    }
    else
    {
        clearmessagearea();
        set_color(COLOR_WHITE,COLOR_BLACK,1);
        move(16,1);
        addstr("You can't find anyone to do the job.", gamelog);
        gamelog.newline();
        refresh();
        getch();
    }

    actual=0;
    return 0;
}
コード例 #9
0
/* bash attempt */
char bash(short type,char &actual)
{
    int difficulty=0;
    char crowable=0;
    int p = 0;

    switch(type)
    {
    case BASH_DOOR:
        if(!securityable(location[cursite]->type))
        {
            difficulty=DIFFICULTY_EASY; // Run down dump
            crowable=1;
        }
        else if(location[cursite]->type!=SITE_GOVERNMENT_PRISON&&
                location[cursite]->type!=SITE_GOVERNMENT_INTELLIGENCEHQ)
        {
            difficulty=DIFFICULTY_CHALLENGING; // Respectable place
            crowable=1;
        }
        else
        {
            difficulty=DIFFICULTY_FORMIDABLE; // Very high security
            crowable=0;
        }
        break;
    }

    if(crowable)
    {
        //if(!squadhasitem(*activesquad,ITEM_WEAPON,WEAPON_CROWBAR))
        //{
        crowable=0;

        for(int p=0; p<6; p++)
        {
            if(activesquad->squad[p]!=NULL)
            {
                if (activesquad->squad[p]->get_weapon().auto_breaks_locks())
                    crowable = 1;
            }
        }

        if(!crowable) //didn't find in hands of any squad member
        {
            for(int l=0; l<(int)activesquad->loot.size(); l++)
            {
                if(activesquad->loot[l]->is_weapon())
                {
                    Weapon *w = static_cast<Weapon*>(activesquad->loot[l]); //cast -XML
                    if (w->auto_breaks_locks())
                        crowable = 1;
                }
            }
        }
        //}
    }

    int maxattack=0, maxp=0;

    if(!crowable)
    {
        for(p=0; p<6; p++)
        {
            if(activesquad->squad[p]!=NULL)
            {
                if(activesquad->squad[p]->alive)
                {
                    if(activesquad->squad[p]->get_attribute(ATTRIBUTE_STRENGTH,true)*
                            activesquad->squad[p]->get_weapon().get_bashstrengthmod()>maxattack)
                    {
                        maxattack=static_cast<int>(activesquad->squad[p]->get_attribute(ATTRIBUTE_STRENGTH,true)*
                                                   activesquad->squad[p]->get_weapon().get_bashstrengthmod());
                        maxp = p;
                    }
                }
            }
        }
    }

    difficulty = static_cast<int>(difficulty/activesquad->squad[maxp]->get_weapon().get_bashstrengthmod());

    if(crowable||activesquad->squad[maxp]->attribute_check(ATTRIBUTE_STRENGTH,difficulty))
    {
        clearmessagearea(false);
        set_color(COLOR_WHITE,COLOR_BLACK,1);
        move(16,1);
        addstr(activesquad->squad[maxp]->name, gamelog);
        addstr(" ", gamelog);
        switch(type)
        {
        case BASH_DOOR:
            if(crowable)
                addstr("uses a crowbar on the door", gamelog);
            else if(activesquad->squad[maxp]->get_weapon().get_bashstrengthmod()>1)
                addstr("smashes in the door", gamelog);
            else if(activesquad->squad[maxp]->flag&CREATUREFLAG_WHEELCHAIR)
                addstr("rams open the door", gamelog);
            else
                addstr("kicks in the door", gamelog);
            break;
        }
        addstr("!", gamelog);
        gamelog.newline();
        refresh();
        getch();

        int timer = 5;
        if(crowable)
            timer = 20;

        if(sitealarmtimer<0 || sitealarmtimer>timer)
            sitealarmtimer=timer;
        else
            sitealarmtimer=0;

        //Bashing doors in secure areas sets off alarms
        if((location[cursite]->type==SITE_GOVERNMENT_PRISON ||
                location[cursite]->type==SITE_GOVERNMENT_INTELLIGENCEHQ) &&
                sitealarm==0)
        {
            sitealarm=1;
            move(17,1);
            set_color(COLOR_RED,COLOR_BLACK,1);
            addstr("Alarms go off!", gamelog);
            gamelog.newline();
            refresh();
            getch();
        }

        actual=1;
        return 1;
    }
    else
    {
        clearmessagearea(false);
        set_color(COLOR_WHITE,COLOR_BLACK,1);
        move(16,1);
        addstr(activesquad->squad[maxp]->name, gamelog);
        switch(type)
        {
        case BASH_DOOR:
            if(activesquad->squad[maxp]->flag&CREATUREFLAG_WHEELCHAIR)
                addstr(" rams into the door", gamelog);
            else
                addstr(" kicks the door", gamelog);
            break;
        }
        addstr("!", gamelog);
        gamelog.newline();
        refresh();
        getch();

        if(sitealarmtimer<0)
            sitealarmtimer=25;
        else if(sitealarmtimer>10)
            sitealarmtimer-=10;
        else
            sitealarmtimer=0;

        actual=1;
        return 0;
    }

    actual=0;
    return 0;
}
コード例 #10
0
/* rescues people held at the activeparty's current location */
void partyrescue(short special)
{
    int freeslots=0;
    int p, pl;
    for(p=0; p<6; p++)
    {
        if(activesquad->squad[p]==NULL)freeslots++;
    }
    int hostslots=0;
    for(p=0; p<6; p++)
    {
        if(activesquad->squad[p]!=NULL)
        {
            if(activesquad->squad[p]->alive&&activesquad->squad[p]->prisoner==NULL)
            {
                hostslots++;
            }
        }
    }

    vector<Creature*> waiting_for_rescue;
    for(pl=0; pl<(int)pool.size(); pl++)
    {
        if(pool[pl]->location==cursite&&
                !(pool[pl]->flag & CREATUREFLAG_SLEEPER)&&
                !(special==SPECIAL_PRISON_CONTROL_LOW&&!(pool[pl]->sentence>0&&!pool[pl]->deathpenalty))&& //Low is for normal time-limited sentences.
                !(special==SPECIAL_PRISON_CONTROL_MEDIUM&&!(pool[pl]->sentence<0&&!pool[pl]->deathpenalty))&& //Medium is for life sentences.
                !(special==SPECIAL_PRISON_CONTROL_HIGH&&!pool[pl]->deathpenalty)) //High is for death sentences.
            waiting_for_rescue.push_back(pool[pl]);
    }

    for(pl=0; pl<(int)waiting_for_rescue.size(); pl++)
    {
        if(LCSrandom(2)&&freeslots)
        {
            for(int p=0; p<6; p++)
            {
                if(activesquad->squad[p]==NULL)
                {
                    activesquad->squad[p]=waiting_for_rescue[pl];
                    activesquad->squad[p]->squadid=activesquad->id;
                    criminalize(*activesquad->squad[p],LAWFLAG_ESCAPED);
                    activesquad->squad[p]->flag|=CREATUREFLAG_JUSTESCAPED;
                    break;
                }
            }
            hostslots++;
            freeslots--;

            clearmessagearea();

            set_color(COLOR_WHITE,COLOR_BLACK,1);
            move(16,1);
            addstr("You've rescued ", gamelog);
            addstr(waiting_for_rescue[pl]->name, gamelog);
            addstr(" from the Conservatives.", gamelog);
            gamelog.newline();

            printparty();
            refresh();
            getch();

            waiting_for_rescue[pl]->location=-1;
            waiting_for_rescue[pl]->base=activesquad->squad[0]->base;

            waiting_for_rescue.erase(waiting_for_rescue.begin()+pl);
            --pl;
        }
    }
    for(pl=0; pl<(int)waiting_for_rescue.size(); pl++)
    {
        if(hostslots)
        {
            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=waiting_for_rescue[pl];
                        waiting_for_rescue[pl]->squadid=activesquad->id;
                        criminalize(*waiting_for_rescue[pl],LAWFLAG_ESCAPED);
                        waiting_for_rescue[pl]->flag|=CREATUREFLAG_JUSTESCAPED;

                        clearmessagearea();

                        set_color(COLOR_WHITE,COLOR_BLACK,1);
                        move(16,1);
                        addstr("You've rescued ", gamelog);
                        addstr(waiting_for_rescue[pl]->name, gamelog);
                        addstr(" from the Conservatives.", gamelog);
                        gamelog.newline();

                        refresh();
                        getch();

                        clearmessagearea();
                        move(16,1);
                        addstr(waiting_for_rescue[pl]->name, gamelog);
                        addstr(" ", gamelog);
                        switch(LCSrandom(3))
                        {
                        case 0:
                            addstr("was tortured recently ", gamelog);
                            break;
                        case 1:
                            addstr("was beaten severely yesterday ", gamelog);
                            break;
                        case 2:
                            addstr("was on a hunger strike ", gamelog);
                            break;
                        }
                        move(17,1);
                        addstr("so ", gamelog);
                        addstr(activesquad->squad[p]->name, gamelog);
                        addstr(" will have to haul a Liberal.", gamelog);
                        gamelog.newline();

                        waiting_for_rescue[pl]->location=-1;
                        waiting_for_rescue[pl]->base=activesquad->squad[p]->base;

                        printparty();
                        refresh();
                        getch();

                        waiting_for_rescue.erase(waiting_for_rescue.begin()+pl);
                        --pl;
                        break;
                    }
                }
            }

            hostslots--;
        }
        if(!hostslots)break;
    }

    if(waiting_for_rescue.size()==1)
    {
        clearmessagearea();
        set_color(COLOR_YELLOW,COLOR_BLACK,1);
        move(16,1);
        addstr("There's nobody left to carry ", gamelog);
        addstr(waiting_for_rescue[0]->name, gamelog);
        addstr(".", gamelog);
        gamelog.newline();
        set_color(COLOR_WHITE,COLOR_BLACK,1);
        move(17,1);
        addstr("You'll have to come back later.", gamelog);
        gamelog.newline();
        refresh();
        getch();
    }
    else if(waiting_for_rescue.size()>1)
    {
        clearmessagearea();
        set_color(COLOR_YELLOW,COLOR_BLACK,1);
        move(16,1);
        addstr("There's nobody left to carry the others.", gamelog);
        gamelog.newline();
        set_color(COLOR_WHITE,COLOR_BLACK,1);
        move(17,1);
        addstr("You'll have to come back later.", gamelog);
        gamelog.newline();
        refresh();
        getch();
    }
}
コード例 #11
0
/* computer hack attempt */
char hack(short type,char &actual)
{
   int difficulty=0;
   int p;

   switch(type)
   {
   case HACK_SUPERCOMPUTER:difficulty=DIFFICULTY_HEROIC;break;
   case HACK_VAULT:difficulty=DIFFICULTY_CHALLENGING;break;
   }

   int maxattack=0,maxblindattack=-3,hacker=-1,blind=-1;

   for(p=0;p<6;p++) if(activesquad->squad[p]!=NULL)
      if(activesquad->squad[p]->alive && activesquad->squad[p]->get_skill(SKILL_COMPUTERS))
      {
         int roll = activesquad->squad[p]->skill_roll(SKILL_COMPUTERS);
         if(!activesquad->squad[p]->special[SPECIALWOUND_RIGHTEYE]&&
            !activesquad->squad[p]->special[SPECIALWOUND_LEFTEYE])
         {  // we got a blind person here
            roll-=3; // blindness handicaps you by 3, highest roll you can get is 15 instead of 18
            if(roll>maxblindattack) maxblindattack=roll,blind=p; // best blind hacker so far
         }
         else
         {  // we got someone who can see here
            if(roll>maxattack) maxattack=roll,hacker=p; // best hacker with eyeballs so far
         }
      }

   if(blind>-1&&(hacker==-1||(maxblindattack>maxattack&&maxblindattack>0)))
      hacker=blind,maxattack=maxblindattack,blind=true; // the best hacker is a blind person
   else if(blind>-1&&hacker==-1&&maxblindattack<=0)
      blind=true; // we only have a blind hacker, and their roll with the handicap is 0 or less
   else blind=false; // either our hacker has eyeballs or there is no hacker at all

   if(hacker > -1)
   {
      activesquad->squad[hacker]->train(SKILL_COMPUTERS,difficulty);

      if(maxattack>difficulty)
      {
         clearmessagearea();
         set_color(COLOR_WHITE,COLOR_BLACK,1);
         move(16,1);
         addstr(activesquad->squad[hacker]->name, gamelog);
         if(!blind) addstr(" has", gamelog);
         switch(type)
         {
         case HACK_SUPERCOMPUTER:addstr(" burned a disk of top secret files", gamelog);break;
         case HACK_VAULT:addstr(" disabled the second layer of security", gamelog);break;
         }
         if(blind)
            addstr(" despite being blind", gamelog);
         addstr("!", gamelog);
         gamelog.newline();

         getkey();

         actual=1;
         return 1;
      }
      else
      {
         clearmessagearea();
         set_color(COLOR_WHITE,COLOR_BLACK,1);
         move(16,1);
         addstr(activesquad->squad[hacker]->name, gamelog);
         addstr(" couldn't", gamelog);
         if(blind) addstr(" see how to", gamelog);
         switch(type)
         {
         case HACK_SUPERCOMPUTER:addstr(" bypass the supercomputer security.", gamelog);break;
         case HACK_VAULT:addstr(" bypass the vault's electronic lock.", gamelog);break;
         }
         gamelog.newline();

         getkey();

         actual=1;
         return 0;
      }
   }
   else
   {
      clearmessagearea();
      set_color(COLOR_WHITE,COLOR_BLACK,1);
      move(16,1);
      addstr("You can't find anyone to do the job.", gamelog);
      gamelog.newline();
      if(blind)
      {  // your only hacker was blind and had a skill roll, after the handicap, of 0 or less
         getkey();

         move(17,1);
         addstr("Including the BLIND HACKER you brought.", gamelog);
         gamelog.newline();
      }

      getkey();
   }

   actual=0;
   return 0;
}
コード例 #12
0
ファイル: stealth.cpp プロジェクト: erik/liberalcrimesquad
/* checks if conservatives see through your disguise */
void disguisecheck(int timer)
{
    int weapon=0;
    int squadsize=0;
    bool forcecheck=false;
    int weaponar[6]= {0};

    bool spotted = false;
    int blew_it = -1;

    // Only start to penalize the player's disguise/stealth checks after the first turn.
    timer--;

    for(int i=0; i<6; i++)
    {
        if(activesquad->squad[i]==NULL)break;
        squadsize++;
        if(activesquad->squad[i]->is_naked() &&
                activesquad->squad[i]->animalgloss!=ANIMALGLOSS_ANIMAL)forcecheck=true;
        int thisweapon=weaponcheck(*activesquad->squad[i]);
        if(thisweapon>weapon)weapon=thisweapon;
        if(thisweapon==2)weaponar[i]=1;
    }

    // Nothing suspicious going on here
    if(sitealarmtimer==-1 && weapon<1 && !forcecheck)
    {
        if(!disguisesite(location[cursite]->type)&&
                !(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED))return;
    }

    char noticed=0;
    vector<int> noticer;
    for(int e=0; e<ENCMAX; e++)
    {
        if(encounter[e].type==CREATURE_PRISONER)continue;
        if(encounter[e].exists&&encounter[e].alive&&
                encounter[e].enemy())
        {
            noticer.push_back(e);
        }
    }

    if(noticer.size()>0)
    {
        int n,an;

        do
        {
            an=LCSrandom(noticer.size());
            n=noticer[an];
            noticer.erase(noticer.begin() + an);

            int difficulty;

            // Determine difficulty based on enemy type
            switch(encounter[n].type)
            {
            default:
                difficulty = DIFFICULTY_VERYEASY;
                break;
            case CREATURE_SWAT:
            case CREATURE_COP:
            case CREATURE_GANGUNIT:
            case CREATURE_DEATHSQUAD:
                difficulty = DIFFICULTY_EASY;
                break;
            case CREATURE_PRISONGUARD:
            case CREATURE_BOUNCER:
            case CREATURE_AGENT:
            case CREATURE_SECURITYGUARD:
                difficulty = DIFFICULTY_AVERAGE;
                break;
            case CREATURE_CORPORATE_CEO:
            case CREATURE_JUDGE_CONSERVATIVE:
            case CREATURE_CCS_ARCHCONSERVATIVE:
            case CREATURE_SCIENTIST_EMINENT:
                difficulty = DIFFICULTY_HARD;
                break;
            case CREATURE_GUARDDOG:
                difficulty = DIFFICULTY_HEROIC;
                break;
            }

            // Increase difficulty if Conservatives suspicious...
            if(sitealarmtimer==1)
                difficulty += 3;

            // Make the attempt!
            for(int i=0; i<6; i++)
            {
                if(activesquad->squad[i]==NULL)break;

                // Try to sneak.
                if(!spotted)
                {
                    int result = activesquad->squad[i]->skill_roll(SKILL_STEALTH);
                    result -= timer;
                    // Sneaking with a party is hard
                    if(result < (difficulty + squadsize - 1))
                        spotted = true;
                }

                // Spotted! Act casual.
                if(spotted)
                {
                    // Guns of death and doom are not very casual.
                    if(weaponcheck(*activesquad->squad[i]) == 2)
                    {
                        noticed = true;
                        break;
                    }
                    else
                    {
                        int result = activesquad->squad[i]->skill_roll(SKILL_DISGUISE);
                        result -= timer;

                        if(result<difficulty)
                        {
                            // That was not very casual, dude.
                            if(result<0)blew_it=i;

                            noticed = true;
                            break;
                        }
                    }
                }
            }
            if(noticed)break;
        } while(noticer.size()>0);

        // Give feedback on the Liberal Performance
        if(!spotted)
        {
            for(int i=0; i<6; i++)
            {
                if(activesquad->squad[i] == NULL) break;
                activesquad->squad[i]->train(SKILL_STEALTH, 10);
            }

            if(timer == 0)
            {
                set_color(COLOR_CYAN,COLOR_BLACK,1);
                move(16,1);

                if(squadsize > 1)
                    addstr("The squad ");
                else
                    addstr(activesquad->squad[0]->name);
                addstr(" fades into the shadows.");

                getch();
            }
        }
        else
        {
            if(blew_it == -1)
            {
                int i;
                for(i=0; i<6; i++)
                {
                    if(activesquad->squad[i] == NULL) break;
                    if(hasdisguise(*(activesquad->squad[i])))
                        activesquad->squad[i]->train(SKILL_DISGUISE, 10);
                }
            }

            if(blew_it != -1 && LCSrandom(2))
            {
                set_color(COLOR_YELLOW,COLOR_BLACK,1);
                move(16,1);

                addstr(activesquad->squad[blew_it]->name);
                switch(LCSrandom(5))
                {
                case 0:
                    addstr(" coughs.");
                    break;
                case 1:
                    addstr(" accidentally mumbles the slogan.");
                    break;
                case 2:
                    addstr(" paces uneasily.");
                    break;
                case 3:
                    addstr(" stares at the Conservatives.");
                    break;
                case 4:
                    addstr(" laughs nervously.");
                    break;
                }

                getch();
            }
            else if(!noticed)
            {
                set_color(COLOR_CYAN,COLOR_BLACK,1);
                move(16,1);

                if(squadsize > 1)
                    addstr("The squad");
                else
                    addstr(activesquad->squad[0]->name);
                addstr(" acts natural.");

                getch();
            }
        }

        if(!noticed)return;

        clearmessagearea();

        set_color(COLOR_RED,COLOR_BLACK,1);
        move(16,1);
        addstr(encounter[n].name);
        if(sitealarmtimer!=0 && weapon<1 && encounter[n].type!=CREATURE_GUARDDOG)
        {
            if((sitetype==SITE_RESIDENTIAL_TENEMENT||
                    sitetype==SITE_RESIDENTIAL_APARTMENT||
                    sitetype==SITE_RESIDENTIAL_APARTMENT_UPSCALE)&&
                    levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
                sitealarm=1;

                addstr(" shouts in alarm at the squad's Liberal Trespassing!");
            }
            else
            {
                addstr(" looks at the Squad suspiciously.");

                int time;

                time = 20 + LCSrandom(10) - encounter[n].get_attribute(ATTRIBUTE_INTELLIGENCE,true)
                       - encounter[n].get_attribute(ATTRIBUTE_WISDOM,true);

                if(time<1)time=1;

                if(sitealarmtimer>time||sitealarmtimer==-1)sitealarmtimer=time;
                else
                {
                    if(sitealarmtimer>5) sitealarmtimer-= 5;
                    if(sitealarmtimer<=5)sitealarmtimer = 0;
                }
            }
        }
        else
        {
            if(weapon&&encounter[n].type!=CREATURE_GUARDDOG)
            {
                addstr(" sees the Squad's Liberal Weapons");
                move(17,1);
                if(encounter[n].align==ALIGN_CONSERVATIVE)
                    addstr("and lets forth a piercing Conservative alarm cry!");
                else
                    addstr("and shouts for help!");

                for(int i=0; i<6; i++)
                {
                    if(activesquad->squad[i]==NULL)break;
                    //if(weaponar[i])
                    //{
                    // Illegal weapon crimes disabled
                    //criminalize(*activesquad->squad[i],LAWFLAG_GUNCARRY);
                    //}
                }
            }
            else
            {
                addstr(" looks at the Squad with Intolerance");
                move(17,1);
                if(encounter[n].align==ALIGN_CONSERVATIVE)
                {
                    if(encounter[n].type==CREATURE_GUARDDOG)
                        addstr("and launches into angry Conservative barking!");
                    else
                        addstr("and lets forth a piercing Conservative alarm cry!");

                }
                else
                    addstr("and shouts for help!");
            }

            sitealarm=1;
        }

        refresh();
        getch();
    }
}