📄 pip_special.c
字号:
5; break; case 2: change = d. character / 8; break; case 3: change = d.charm / 5; break; case 4: change = d.wisdom / 10; break; case 5: change = d.belief / 10; break; case 6: change = d.speech / 10; break; case 7: change = d.social / 10; break; case 8: change = d.hexp / 10; break; } /* * 如果大於每次的增加最大量 */ if (change > p[choice].addtoman) 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, "你这只没教养的鸡,再去学学礼仪吧...."); } } temppress(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)); temppress("离开星空总司令部....."); return 0;}intpip_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))!=0) { pip_read(genbuf); temppress("观摩一下别人的小鸡...:p"); } else { outs(err_uid); clrtoeol(); } } return 0;}intpip_read(genbuf)char *genbuf;{ FILE *fs; struct chicken d1; char buf[200]; const static char yo[12][5] = { "诞生", "婴儿", "幼儿", "儿童", "少年", "青年", "成年", "壮年", "更年", "老年", "古稀", "神仙" }; int pc1, age1, age = 0, hp1=1;#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"))!=NULL) { fread(&d1, sizeof (d1), 1, fs); 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; else age1=0; 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 ("\033[1;32mName:%-10s\033[m 生日:%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("\033[1;34m快臭死了..\033[m"); if (d1.shit >= 100) { prints("\033[1;31m臭死了..\033[m"); return -1; } pc1 = hp1 * 100 / d1.maxhp; if (pc1 == 0) { prints("饿死了.."); return -1; } if (pc1 < 20) prints("\033[1;35m全身无力中.快饿死了.\033[m"); if (pc1 < 40 && pc1 >= 20) prints("体力不太够..想吃点东西.."); if (pc1 < 100 && pc1 >= 80) prints("嗯~肚子饱饱有体力.."); if (pc1 >= 100) prints("\033[1;34m快撑死了..\033[m"); pc1 = d1.tired; if (pc1 < 20) prints("精神抖抖中.."); if (pc1 < 80 && pc1 >= 60) prints("\033[1;34m有点小累..\033[m"); if (pc1 < 100 && pc1 >= 80) { prints("\033[1;31m好累喔,快不行了..\033[m"); } 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("\033[1;34m生病了..\033[m"); if (d1.sick < 100 && d1.sick >= 75) { prints("\033[1;31m病重!!..\033[m"); } if (d1.sick >= 100) { prints("病死了.!."); return -1; } pc1 = d1.happy; if (pc1 < 20) prints("\033[1;31m很不快乐..\033[m"); 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("\033[31;1m不满足..\033[m"); 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 { temppress("档案损毁了...."); } } /* 有养小鸡 */ else { move(1, 0); clrtobot(); temppress("这一家的人没有养小鸡......"); } return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -