⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pip_special.c

📁 bbs server linux平台下软件源码
💻 C
📖 第 1 页 / 共 2 页
字号:
                                change = p[choice].addtoman;                            /*                             * 如果加上原先的之后大於所能给的所有值时                             */                            if ((change + save[choice]) >= p[choice].maxtoman)                                change = p[choice].maxtoman - save[choice];                            save[choice] += change;                            d.toman += change;                        } else if (choice == 9) {                            save[9] = 0;                            d.social -= 13 + rand() % 4;                            d.affect += 13 + rand() % 4;                        } else if (choice == 10 && d.seeroyalJ == 1) {                            save[10] += 15 + rand() % 4;                            d.seeroyalJ = 0;                        }                        if (rand() % 2 > 0)                            sprintf(buf, "%s", p[choice].words1);                        else                            sprintf(buf, "%s", p[choice].words2);                    }                } else {                    if (rand() % 2 > 0)                        sprintf(buf, "我不和你这样的鸡谈话....");                    else                        sprintf(buf, "你这只没教养的鸡,再去学学礼仪吧....");                }            }            pressanykey(buf);        }        d.royalA = save[1];        d.royalB = save[2];        d.royalC = save[3];        d.royalD = save[4];        d.royalE = save[5];        d.royalF = save[6];        d.royalG = save[7];        d.royalH = save[8];        d.royalI = save[9];        d.royalJ = save[10];    }    while ((pipkey != 'Q') && (pipkey != 'q') && (pipkey != KEY_LEFT));    pressanykey("离开星空总司令部.....");    return 0;}int pip_query(){                               /*拜访小鸡 */#ifdef MAPLE    userec muser;#endif                          // END MAPLE    int id;    char genbuf[STRLEN];    struct userec *lookupuser;#ifndef MAPLE    char *msg_uid = MSG_UID;    char *err_uid = ERR_UID;#endif                          // END MAPLE    stand_title("拜访同伴");    usercomplete(msg_uid, genbuf);    if (genbuf[0]) {        move(2, 0);        if (id = getuser(genbuf, &lookupuser)) {            pip_read(genbuf);            pressanykey("观摩一下别人的小鸡...:p");        } else {            outs(err_uid);            clrtoeol();        }    }    return 0;}int pip_read(genbuf)char *genbuf;{    FILE *fs;    struct chicken d1;    char buf[200];    /*     * char yo[14][5]={"诞生","婴儿","幼儿","儿童","青年","少年","成年",     * "壮年","壮年","壮年","更年","老年","老年","古稀"};     */    const static char yo[12][5] = { "诞生", "婴儿", "幼儿", "儿童", "少年", "青年",        "成年", "壮年", "更年", "老年", "古稀", "神仙"    };    int pc1, age1, age = 0;    int year1, month1, day1, sex1, death1, nodone1, relation1, liveagain1, dataB1, dataC1, dataD1, dataE1;    int hp1, maxhp1, weight1, tired1, sick1, shit1, wrist1, bodyA1, bodyB1, bodyC1, bodyD1, bodyE1;    int social1, family1, hexp1, mexp1, tmpA1, tmpB1, tmpC1, tmpD1, tmpE1;    int mp1, maxmp1, attack1, resist1, speed1, hskill1, mskill1, mresist1, magicmode1, fightB1, fightC1, fightD1, fightE1;    int weaponhead1, weaponrhand1, weaponlhand1, weaponbody1, weaponfoot1, weaponA1, weaponB1, weaponC1, weaponD1, weaponE1;    int toman1, character1, love1, wisdom1, art1, etchics1, brave1, homework1, charm1, manners1, speech1, cookskill1, learnA1, learnB1, learnC1, learnD1, learnE1;    int happy1, satisfy1, fallinlove1, belief1, offense1, affect1, stateA1, stateB1, stateC1, stateD1, stateE1;    int food1, medicine1, bighp1, cookie1, ginseng1, snowgrass1, eatC1, eatD1, eatE1;    int book1, playtool1, money1, thingA1, thingB1, thingC1, thingD1, thingE1;    int winn1, losee1;    int royalA1, royalB1, royalC1, royalD1, royalE1, royalF1, royalG1, royalH1, royalI1, royalJ1, seeroyalJ1, seeA1, seeB1, seeC1, seeD1, seeE1;    int wantend1, lover1;    char name1[200];    int classA1, classB1, classC1, classD1, classE1;    int classF1, classG1, classH1, classI1, classJ1;    int classK1, classL1, classM1, classN1, classO1;    int workA1, workB1, workC1, workD1, workE1;    int workF1, workG1, workH1, workI1, workJ1;    int workK1, workL1, workM1, workN1, workO1;    int workP1, workQ1, workR1, workS1, workT1;    int workU1, workV1, workW1, workX1, workY1, workZ1;#ifdef MAPLE    sprintf(buf, "home/%s/new_chicken", genbuf);    currutmp->destuid = genbuf;#else    sprintf(buf, "home/%c/%s/new_chicken", toupper(genbuf[0]), genbuf);#endif                          // END MAPLE    if (fs = fopen(buf, "r")) {        fread(&d1, sizeof(d1), 1, fs);        //fgets(buf, 80, fs);        //age = ((time_t) atol(buf))/60/30;        age = d1.bbtime / 1800;        if (age == 0)           /*诞生 */            age1 = 0;        else if (age == 1)      /*婴儿 */            age1 = 1;        else if (age >= 2 && age <= 5)  /*幼儿 */            age1 = 2;        else if (age >= 6 && age <= 12) /*儿童 */            age1 = 3;        else if (age >= 13 && age <= 15)        /*少年 */            age1 = 4;        else if (age >= 16 && age <= 18)        /*青年 */            age1 = 5;        else if (age >= 19 && age <= 35)        /*成年 */            age1 = 6;        else if (age >= 36 && age <= 45)        /*壮年 */            age1 = 7;        else if (age >= 45 && age <= 60)        /*更年 */            age1 = 8;        else if (age >= 60 && age <= 70)        /*老年 */            age1 = 9;        else if (age >= 70 && age <= 100)       /*古稀 */            age1 = 10;        else if (age > 100)     /*神仙 */            age1 = 11;/*    fscanf(fs,    "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d",    &(year1),&(month1),&(day1),&(sex1),&(death1),&(nodone1),&(relation1),&(liveagain1),&(dataB1),&(dataC1),&(dataD1),&(dataE1),    &(hp1),&(maxhp1),&(weight1),&(tired1),&(sick1),&(shit1),&(wrist1),&(bodyA1),&(bodyB1),&(bodyC1),&(bodyD1),&(bodyE1),    &(social1),&(family1),&(hexp1),&(mexp1),&(tmpA1),&(tmpB1),&(tmpC1),&(tmpD1),&(tmpE1),    &(mp1),&(maxmp1),&(attack1),&(resist1),&(speed1),&(hskill1),&(mskill1),&(mresist1),&(magicmode1),&(fightB1),&(fightC1),&(fightD1),&(fightE1),    &(weaponhead1),&(weaponrhand1),&(weaponlhand1),&(weaponbody1),&(weaponfoot1),&(weaponA1),&(weaponB1),&(weaponC1),&(weaponD1),&(weaponE1),    &(toman1),&(character1),&(love1),&(wisdom1),&(art1),&(etchics1),&(brave1),&(homework1),&(charm1),&(manners1),&(speech1),&(cookskill1),&(learnA1),&(learnB1),&(learnC1),&(learnD1),&(learnE1),    &(happy1),&(satisfy1),&(fallinlove1),&(belief1),&(offense1),&(affect1),&(stateA1),&(stateB1),&(stateC1),&(stateD1),&(stateE1),    &(food1),&(medicine1),&(bighp1),&(cookie1),&(ginseng1),&(snowgrass1),&(eatC1),&(eatD1),&(eatE1),    &(book1),&(playtool1),&(money1),&(thingA1),&(thingB1),&(thingC1),&(thingD1),&(thingE1),    &(winn1),&(losee1),    &(royalA1),&(royalB1),&(royalC1),&(royalD1),&(royalE1),&(royalF1),&(royalG1),&(royalH1),&(royalI1),&(royalJ1),&(seeroyalJ1),&(seeA1),&(seeB1),&(seeC1),&(seeD1),&(seeE1),    &(wantend1),&(lover1),    name1,    &(classA1),&(classB1),&(classC1),&(classD1),&(classE1),    &(classF1),&(classG1),&(classH1),&(classI1),&(classJ1),    &(classK1),&(classL1),&(classM1),&(classN1),&(classO1),    &(workA1),&(workB1),&(workC1),&(workD1),&(workE1),    &(workF1),&(workG1),&(workH1),&(workI1),&(workJ1),    &(workK1),&(workL1),&(workM1),&(workN1),&(workO1),    &(workP1),&(workQ1),&(workR1),&(workS1),&(workT1),    &(workU1),&(workV1),&(workW1),&(workX1),&(workY1),&(workZ1)  );*/        fclose(fs);        move(1, 0);        clrtobot();#ifdef MAPLE        prints("这是%s养的小鸡:\n", xuser.userid);#else        prints("这是%s养的小鸡:\n", genbuf);#endif                          // END MAPLE        if (d1.death == 0) {            prints                ("Name:%-10s  生日:%02d年%02d月%2d日   年龄:%2d岁  状态:%s  钱钱:%d\n"                 "生命:%3d/%-3d  快乐:%-4d  满意:%-4d  气质:%-4d  智慧:%-4d  体重:%-4d\n"                 "大补丸:%-4d   食物:%-4d  零食:%-4d  疲劳:%-4d  脏脏:%-4d  病气:%-4d\n",                 d1.name, d1.year, d1.month, d1.day, age, yo[age1],                 d1.money, d1.hp, d1.maxhp, d1.happy, d1.satisfy, d1.character, d1.wisdom, d1.weight, d1.bighp, d1.food, d1.cookie, d1.tired, d1.shit, d1.sick);            move(5, 0);            switch (age1) {            case 0:            case 1:            case 2:                if (d1.weight <= (60 + 10 * age - 30))                    show_basic_pic(1);                else if (d1.weight > (60 + 10 * age - 30)                         && d1.weight < (60 + 10 * age + 30))                    show_basic_pic(2);                else if (d1.weight >= (60 + 10 * age + 30))                    show_basic_pic(3);                break;            case 3:            case 4:                if (d1.weight <= (60 + 10 * age - 30))                    show_basic_pic(4);                else if (d1.weight > (60 + 10 * age - 30)                         && d1.weight < (60 + 10 * age + 30))                    show_basic_pic(5);                else if (d1.weight >= (60 + 10 * age + 30))                    show_basic_pic(6);                break;            case 5:            case 6:                if (d1.weight <= (60 + 10 * age - 30))                    show_basic_pic(7);                else if (d1.weight > (60 + 10 * age - 30)                         && d1.weight < (60 + 10 * age + 30))                    show_basic_pic(8);                else if (d1.weight >= (60 + 10 * age + 30))                    show_basic_pic(9);                break;            case 7:            case 8:                if (d1.weight <= (60 + 10 * age - 30))                    show_basic_pic(10);                else if (d1.weight > (60 + 10 * age - 30)                         && d1.weight < (60 + 10 * age + 30))                    show_basic_pic(11);                else if (d1.weight >= (60 + 10 * age + 30))                    show_basic_pic(12);                break;            case 9:                show_basic_pic(13);                break;            case 10:            case 11:                show_basic_pic(13);                break;            }            move(18, 0);            if (d1.shit == 0)                prints("很干净..");            if (d1.shit > 40 && d1.shit < 60)                prints("臭臭的..");            if (d1.shit >= 60 && d1.shit < 80)                prints("好臭喔..");            if (d1.shit >= 80 && d1.shit < 100)                prints("快臭死了..");            if (d1.shit >= 100) {                prints("臭死了..");                return -1;            }            pc1 = hp1 * 100 / d1.maxhp;            if (pc1 == 0) {                prints("饿死了..");                return -1;            }            if (pc1 < 20)                prints("全身无力中.快饿死了.");            if (pc1 < 40 && pc1 >= 20)                prints("体力不太够..想吃点东西..");            if (pc1 < 100 && pc1 >= 80)                prints("嗯~肚子饱饱有体力..");            if (pc1 >= 100)                prints("快撑死了..");            pc1 = d1.tired;            if (pc1 < 20)                prints("精神抖抖中..");            if (pc1 < 80 && pc1 >= 60)                prints("有点小累..");            if (pc1 < 100 && pc1 >= 80) {                prints("好累喔,快不行了..");            }            if (pc1 >= 100) {                prints("累死了...");                return -1;            }            pc1 = 60 + 10 * age;            if (d1.weight < (pc1 + 30) && d1.weight >= (pc1 + 10))                prints("有点小胖..");            if (d1.weight < (pc1 + 50) && d1.weight >= (pc1 + 30))                prints("太胖了..");            if (d1.weight > (pc1 + 50)) {                prints("胖死了...");                return -1;            }            if (d1.weight < (pc1 - 50)) {                prints("瘦死了..");                return -1;            }            if (d1.weight > (pc1 - 30) && d1.weight <= (pc1 - 10))                prints("有点小瘦..");            if (d1.weight > (pc1 - 50) && d1.weight <= (pc1 - 30))                prints("太瘦了..");            if (d1.sick < 75 && d1.sick >= 50)                prints("生病了..");            if (d1.sick < 100 && d1.sick >= 75) {                prints("病重!!..");            }            if (d1.sick >= 100) {                prints("病死了.!.");                return -1;            }            pc1 = d1.happy;            if (pc1 < 20)                prints("很不快乐..");            if (pc1 < 40 && pc1 >= 20)                prints("不快乐..");            if (pc1 < 95 && pc1 >= 80)                prints("快乐..");            if (pc1 <= 100 && pc1 >= 95)                prints("很快乐..");            pc1 = d1.satisfy;            if (pc1 < 40)                prints("不满足..");            if (pc1 < 95 && pc1 >= 80)                prints("满足..");            if (pc1 <= 100 && pc1 >= 95)                prints("很满足..");        } else if (d1.death == 1) {            show_die_pic(2);            move(14, 20);            prints("可怜的小鸡呜呼哀哉了");        } else if (d1.death == 2) {            show_die_pic(3);        } else if (d1.death == 3) {            move(5, 0);            outs("游戏已经玩到结局罗....");        } else {            pressanykey("档案损毁了....");        }    } /* 有养小鸡 */    else {        move(1, 0);        clrtobot();        pressanykey("这一家的人没有养小鸡......");    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -