Ejemplo n.º 1
0
Archivo: scr.c Proyecto: anylonen/omega
int cinema_confirm (char * action_description)
{
  char *msg;

  switch (random_range(4))
    {
    case 0: msg = "Are you sure? [yn] "; break;
    case 1: msg = "Certain about that? [yn] "; break;
    case 2: msg = "Do you really mean it? [yn] "; break;
    default: msg = "Confirm that, would you? [yn] "; break;
    }

  return cinema_interact("ynqYNQ", action_description, msg, NULL);
}
Ejemplo n.º 2
0
void user_character_stats(void)
{
    int num;
    int iqpts = 0;
    int agipts = 0;
    int dexpts = 0;
    int powpts = 0;
    int conpts = 0;
    int numints = 0;

    cinema_scene("OK, now try to answer the following questions honestly:", 0, 0);

    Player.str = Player.maxstr = user_character_strength();

    num = user_character_iq_test();
    if (num) ++numints;
    iqpts += num;

    num = user_character_undergraduate_exam();
    if (num) ++numints;
    iqpts += num;

    num = user_character_graduate_exam();
    if (num) ++numints;
    iqpts += num;

    if (0 == numints)
        Player.iq = user_character_dumb();
    else
        Player.iq = iqpts / numints;

    Player.maxiq = Player.iq;

    agipts += user_character_dance();
    agipts += user_character_martial_art();
    agipts += user_character_field_sport();
    agipts += user_character_cave();
    agipts += user_character_skate();
    agipts += user_character_handicapped();
    agipts += user_character_accident_prone();
    agipts += user_character_bicycle();

    Player.agi = Player.maxagi = 9 + agipts / 2;

    dexpts += user_character_video_games();
    dexpts += user_character_archer();
    dexpts += user_character_picked_lock();
    dexpts += user_character_typing_speed();
    dexpts += user_character_hand_shakes();
    dexpts += user_character_ambidextrous();
    dexpts += user_character_can_cut_deck();
    dexpts += user_character_can_tie_shoes();

    Player.dex = Player.maxdex = 6 + dexpts / 2;

    conpts += user_character_colds();
    conpts += user_character_recent_accident();
    conpts += user_character_chronic_disease();
    conpts += user_character_overweight();
    conpts += user_character_high_blood_pressure();
    conpts += user_character_smoke();
    conpts += user_character_aerobics();
    conpts += user_character_miles_run();

    Player.con = Player.maxcon = 12 + conpts / 3;

    powpts += user_character_animals();
    powpts += user_character_auras();
    powpts += user_character_out_of_body();
    powpts += user_character_spell();
    powpts += user_character_esp();
    powpts += user_character_pk();
    powpts += user_character_ghosts();
    powpts += user_character_irish();

    Player.pow = Player.maxpow = 3 + powpts / 2;

    Player.preference =
        cinema_interact("mfyn", "Are you sexually interested in males or females? ", 0, 0);
}
Ejemplo n.º 3
0
Archivo: scr.c Proyecto: anylonen/omega
int cinema_ynq (char *action_description)
{
  return cinema_interact("ynqYNQ", action_description, NULL, NULL);
}
Ejemplo n.º 4
0
void l_safe(void)
{
    char response;
    pob newitem;
    int attempt = 0;
    response = cinema_interact("pfqi",
                               "You have discovered a safe!",
                               "Pick the lock [p], Force the door [f], or ignore [ESCAPE]",
                               NULL);

    if (response == 'p')
        attempt = (2*Player.dex + Player.rank[THIEVES]*10 - random_range(100))/10;
    else if (response == 'f')
        attempt = (Player.dmg - random_range(100))/10;
    if (attempt > 0) {
        Player.alignment -= 4;
        gain_experience(50);
        print2("The door springs open!");
        Level->site[Player.x][Player.y].locchar = FLOOR;
        Level->site[Player.x][Player.y].p_locf = L_NO_OP;
        lset(Player.x, Player.y, CHANGED);
        if (random_range(2) == 1) {
            print1("You find:");
            do {
                newitem = create_object(difficulty());
                print2(itemid(newitem));
                morewait();
                gain_item(newitem);
            } while (random_range(3) == 1);
        }
        else print2("The safe was empty (awwwww....)");
    }
    else {
        print3("Your attempt at burglary failed!");
        if (attempt == -1) {
            print1("A siren goes off! You see flashing red lights everywhere!");
            morewait();
            if (Last_Environment == E_CITY) {
                print2("The city guard shows up! They collar you in no time flat!");
                change_environment(E_CITY);
                morewait();
                send_to_jail();
            }
        }
        else if (attempt == -2) {
            print1("There is a sudden flash!");
            p_damage(random_range(25),FLAME,"a safe");
            print2("The safe has self-destructed.");
            Level->site[Player.x][Player.y].locchar = RUBBLE;
            Level->site[Player.x][Player.y].p_locf = L_RUBBLE;
            lset(Player.x, Player.y, CHANGED);
        }
        else if (attempt == -3) {
            print1("The safe jolts you with electricity!");
            lball(Player.x,Player.y,Player.x,Player.y,30);
        }
        else if (attempt < -3) {
            print1("You are hit by an acid spray!");
            if (Player.possessions[O_CLOAK] != NULL) {
                print2("Your cloak is destroyed!");
                conform_lost_object(Player.possessions[O_CLOAK]);
                p_damage(10,ACID,"a safe");
            }
            else if (Player.possessions[O_ARMOR] != NULL) {
                print2("Your armor corrodes!");
                Player.possessions[O_ARMOR]->dmg-=3;
                Player.possessions[O_ARMOR]->hit-=3;
                Player.possessions[O_ARMOR]->aux-=3;
                p_damage(10,ACID,"a safe");
            }
            else {
                print2("The acid hits your bare flesh!");
                p_damage(random_range(100),ACID,"a safe");
            }
        }
    }
}
Ejemplo n.º 5
0
void l_condo(void)
{
    pol ol,prev=NULL;
    int i,done=FALSE,over=FALSE,weeksleep=FALSE;
    char response;

    if (! gamestatusp(SOLD_CONDO)) {
        response = cinema_interact
                   ("rp","Rampart Arms. Weekly Condo Rentals and Purchases",
                    "Which are you interested in [r,p, or ESCAPE] ",
                    NULL);
        if (response == 'p') {
            print2("Only 50,000Au. Buy it? [yn] ");
            if (ynq2()=='y') {
                if (Player.cash < 50000)
                    print3("No mortgages, buddy.");
                else {
                    setgamestatus(SOLD_CONDO);
                    Player.cash-=50000;
                    dataprint();
                    print2("You are the proud owner of a luxurious condo penthouse.");
                    Condoitems = NULL;
                }
            }
        }
        else if (response == 'r') {
            print2("Weekly Rental, 1000Au. Pay for it? [yn] ");
            if (ynq2()=='y') {
                if (Player.cash < 1000)
                    print2("Hey, pay the rent or out you go....");
                else {
                    weeksleep = TRUE;
                    Player.cash -=1000;
                    dataprint();
                }
            }
        }
        else print2("Please keep us in mind for your housing needs.");
    }
    else {
        while (! done) {
            menuclear();
            menuprint("Home Sweet Home\n");
            menuprint("a: Leave items in your safe.\n");
            menuprint("b: Retrieve items.\n");
            menuprint("c: Take a week off to rest.\n");
            menuprint("d: Retire permanently.\n");
            menuprint("ESCAPE: Leave this place.\n");
            showmenu();
            response = (char) mcigetc();
            if (response == 'a') {
                i = getitem(NULL_ITEM);
                if (i != ABORT) {
                    if (Player.possessions[i]->blessing < 0)
                        print2("The item just doesn't want to be stored away...");
                    else {
                        ol = ((pol) checkmalloc(sizeof(oltype)));
                        ol->thing = Player.possessions[i];
                        ol->next = Condoitems;
                        Condoitems = ol;
                        conform_unused_object(Player.possessions[i]);
                        Player.possessions[i] = NULL;
                    }
                }
            }
            else if (response == 'b') {
                ol = Condoitems;
                while ((ol != NULL) && (! over)) {
                    print1("Retrieve ");
                    nprint1(itemid(ol->thing));
                    nprint1(" [ynq] ");
                    response = (char) mcigetc();
                    /* DAG -- fix memory leak where object list nodes weren't deleted */
                    if (response == 'y') {
                        gain_item(ol->thing);
                        if (ol == Condoitems)
                        {
                            ol = ol->next;
                            free( Condoitems );
                            Condoitems = ol;
                        }
                        else
                        {
                            ol=ol->next;
                            free( prev->next );
                            prev->next = ol;
                        }
                    }
                    else if (response == 'q')
                        over = TRUE;
                    else
                    {
                        prev = ol;
                        ol = ol->next;
                    }
                }
            }
            else if (response == 'c') {
                weeksleep = TRUE;
                print1("You take a week off to rest...");
                morewait();
            }
            else if (response == 'd') {
                clearmsg();
                if (cinema_confirm("You ponder settling down here for good.") == 'y') {
                    p_win();
                }
            }
            else if (response == ESCAPE) done = TRUE;
        }
        xredraw();
    }
    if (weeksleep) {
        clearmsg();
        print1("Taking a week off to rest...");
        morewait();
        toggle_item_use(TRUE);
        Player.hp = Player.maxhp;
        Player.str = Player.maxstr;
        Player.agi = Player.maxagi;
        Player.con = Player.maxcon;
        Player.dex = Player.maxdex;
        Player.iq = Player.maxiq;
        Player.pow = Player.maxpow;
        for (i=0; i<NUMSTATI; i++)
            if (Player.status[i]<1000) Player.status[i]=0;
        toggle_item_use(FALSE);
        Player.food = 36;
        print2("You're once again fit and ready to continue your adventure.");
        Time += 60*24*7;
        Date += 7;
        moon_check();
        timeprint();
    }
}