pip_job.c
来自「linux/unix环境下的建站系统」· C语言 代码 · 共 849 行 · 第 1/2 页
C
849 行
/*---------------------------------------------------------------------------*//* 打工选单:家事 苦工 家教 地摊 *//* *//*---------------------------------------------------------------------------*/#include "pip.h"extern struct chicken d;extern time_t start_time;extern time_t lasttime;intpip_job_workA(){/* ├————┼——————————————————————┤*//* │家庭管理│待人接物 + N , 扫地洗衣 + N , 烹饪技巧 + N │*//* │ │和父亲的关系 + N , 疲劳 + 1 , 感受 - 2 │*//* ├————┼——————————————————————┤*//* │家庭管理│若 体 力 - RND (疲劳) >= 5 则工作成功 │*//* ├————┼——————————————————————┤*/ float class; long workmoney; workmoney = 0; class = (d.hp * 100 / d.maxhp) - d.tired; d.maxhp += rand() % 2; d.shit += rand() % 3 + 5; count_tired(3, 7, "Y", 100, 1); d.hp -= (rand() % 2 + 4); d.happy -= (rand() % 3 + 4); d.satisfy -= rand() % 3 + 4; d.affect -= 7 + rand() % 7; if (d.affect <= 0) d.affect = 0; show_job_pic(11); if (class >= 75) { d.cookskill += rand() % 2 + 7; d.homework += rand() % 2 + 7; d.family += rand() % 3 + 4; d.relation += rand() % 3 + 4; workmoney = 80 + (d.cookskill * 2 + d.homework + d.family) / 40; temppress("家事很成功喔..多一点钱给你.."); } else if (class < 75 && class >= 50) { d.cookskill += rand() % 2 + 5; d.homework += rand() % 2 + 5; d.family += rand() % 3 + 3; d.relation += rand() % 3 + 3; workmoney = 60 + (d.cookskill * 2 + d.homework + d.family) / 45; temppress("家事还蛮顺利的唷..嗯嗯.."); } else if (class < 50 && class >= 25) { d.cookskill += rand() % 3 + 3; d.homework += rand() % 3 + 3; d.family += rand() % 3 + 2; d.relation += rand() % 3 + 2; workmoney = 40 + (d.cookskill * 2 + d.homework + d.family) / 50; temppress("家事普普通通啦..可以更好的..加油.."); } else if (class < 25) { d.cookskill += rand() % 3 + 1; d.homework += rand() % 3 + 1; d.family += rand() % 3 + 1; d.relation += rand() % 3 + 1; workmoney = 20 + (d.cookskill * 2 + d.homework + d.family) / 60; temppress("家事很糟糕喔..这样不行啦.."); } d.money += workmoney; d.workA += 1; return 0;}intpip_job_workB(){/* ├————┼——————————————————————┤*//* │育幼院 │母性 + N , 感受 + 1 , 魅力 - 1 , 疲劳 + 3 │*//* ├————┼——————————————————————┤*//* │育幼院 │若 体 力 - RND (疲劳) >= 20 则工作成功 │*//* ├————┼——————————————————————┤*/ float class; long workmoney; workmoney = 0; class = (d.hp * 100 / d.maxhp) - d.tired; d.maxhp += rand() % 2 + 1; d.shit += rand() % 3 + 5; d.affect += rand() % 3 + 4; count_tired(3, 9, "Y", 100, 1); d.hp -= (rand() % 3 + 6); d.happy -= (rand() % 3 + 4); d.satisfy -= rand() % 3 + 4; d.charm -= rand() % 3 + 4; if (d.charm <= 0) d.charm = 0; show_job_pic(21); if (class >= 90) { d.love += rand() % 2 + 7; d.toman += rand() % 2 + 2; workmoney = 150 + (d.love + d.toman) / 50; temppress("当保姆很成功喔..下次再来喔.."); } else if (class < 90 && class >= 75) { d.love += rand() % 2 + 5; d.toman += rand() % 2 + 2; workmoney = 120 + (d.love + d.toman) / 50; temppress("保姆还当的不错唷..嗯嗯.."); } else if (class < 75 && class >= 50) { d.love += rand() % 2 + 3; d.toman += rand() % 2 + 1; workmoney = 100 + (d.love + d.toman) / 50; temppress("小朋友很皮喔..加油.."); } else if (class < 50) { d.love += rand() % 2 + 1; d.toman += rand() % 2 + 1; workmoney = 80 + (d.love + d.toman) / 50; temppress("很糟糕喔..你罩不住小朋友耶..."); } d.money += workmoney; d.workB += 1; return 0;}intpip_job_workC(){/* ├————┼——————————————————————┤*//* │旅馆 │扫地洗衣 + N , 战斗技术 - N , 疲劳 + 2 │*//* ├————┼——————————————————————┤*//* │旅馆 │若 体 力 - RND (疲劳) >= 30 则工作成功 │*//* ├————┼——————————————————————┤*/ float class; long workmoney; workmoney = 0; class = (d.hp * 100 / d.maxhp) - d.tired; d.maxhp += rand() % 2 + 2; d.shit += rand() % 3 + 5; count_tired(5, 12, "Y", 100, 1); d.hp -= (rand() % 4 + 8); d.happy -= (rand() % 3 + 4); d.satisfy -= rand() % 3 + 4; show_job_pic(31); if (class >= 95) { d.homework += rand() % 2 + 7; d.family += rand() % 2 + 4; d.hskill -= rand() % 2 + 7; if (d.hskill < 0) d.hskill = 0; workmoney = 250 + (d.cookskill * 2 + d.homework * 2) / 40; temppress("旅馆事业蒸蒸日上..希望你再过来..."); } else if (class < 95 && class >= 80) { d.homework += rand() % 2 + 5; d.family += rand() % 2 + 3; d.hskill -= rand() % 2 + 5; if (d.hskill < 0) d.hskill = 0; workmoney = 200 + (d.cookskill * 2 + d.homework * 2) / 50; temppress("旅馆还蛮顺利的唷..嗯嗯.."); } else if (class < 80 && class >= 60) { d.homework += rand() % 2 + 3; d.family += rand() % 2 + 3; d.hskill -= rand() % 2 + 5; if (d.hskill < 0) d.hskill = 0; workmoney = 150 + (d.cookskill * 2 + d.homework * 2) / 50; temppress("普普通通啦..可以更好的..加油.."); } else if (class < 60) { d.homework += rand() % 2 + 1; d.family += rand() % 2 + 1; d.hskill -= rand() % 2 + 1; if (d.hskill < 0) d.hskill = 0; workmoney = 100 + (d.cookskill * 2 + d.homework * 2) / 50; temppress("这个很糟糕喔..你这样不行啦.."); } d.money += workmoney; d.workC += 1; return 0;}intpip_job_workD(){/* ├————┼——————————————————————┤*//* │农场 │体力 + 1 , 腕力 + 1 , 气质 - 1 , 疲劳 + 3 │*//* ├————┼——————————————————————┤*//* │农场 │若 体 力 - RND (疲劳) >= 30 则工作成功 │*//* ├————┼——————————————————————┤*/ float class; long workmoney; workmoney = 0; class = (d.hp * 100 / d.maxhp) - d.tired; d.maxhp += rand() % 3 + 2; d.wrist += rand() % 2 + 2; d.shit += rand() % 5 + 10; count_tired(5, 15, "Y", 100, 1); d.hp -= (rand() % 4 + 10); d.happy -= (rand() % 3 + 4); d.satisfy -= rand() % 3 + 4; d.character -= rand() % 3 + 4; if (d.character < 0) d.character = 0; show_job_pic(41); if (class >= 95) { workmoney = 250 + (d.wrist * 2 + d.hp * 2) / 80; temppress("牛羊长的好好喔..希望你再来帮忙..."); } else if (class < 95 && class >= 80) { workmoney = 210 + (d.wrist * 2 + d.hp * 2) / 80; temppress("呵呵..还不错喔..:)"); } else if (class < 80 && class >= 60) { workmoney = 160 + (d.wrist * 2 + d.hp * 2) / 80; temppress("普普通通啦..可以更好的.."); } else if (class < 60) { workmoney = 120 + (d.wrist * 2 + d.hp * 2) / 80; temppress("你不太适合农场的工作 -_-..."); } d.money += workmoney; d.workD += 1; return 0;}intpip_job_workE(){/* ├————┼——————————————————————┤*//* │餐厅 │料理 + N , 战斗技术 - N , 疲劳 + 2 │*//* ├————┼——————————————————————┤*//* │餐厅 │若 烹饪技术 - RND (疲劳) >= 50 则工作成功 │*//* ├————┼——————————————————————┤*/ float class; long workmoney; workmoney = 0; class = d.cookskill - d.tired; d.maxhp += rand() % 2 + 1; d.shit += rand() % 4 + 12; count_tired(5, 9, "Y", 100, 1); d.hp -= (rand() % 4 + 8); d.happy -= (rand() % 3 + 4); d.satisfy -= rand() % 3 + 4; show_job_pic(51); if (class >= 80) { d.homework += rand() % 2 + 1; d.family += rand() % 2 + 1; d.hskill -= rand() % 2 + 5; if (d.hskill < 0) d.hskill = 0; d.cookskill += rand() % 2 + 6; workmoney = 250 + (d.cookskill * 2 + d.homework * 2 + d.family * 2) / 80; temppress("客人都说太好吃了..再来一盘吧..."); } else if (class < 80 && class >= 60) { d.homework += rand() % 2 + 1; d.family += rand() % 2 + 1; d.hskill -= rand() % 2 + 5; if (d.hskill < 0) d.hskill = 0; d.cookskill += rand() % 2 + 4; workmoney = 200 + (d.cookskill * 2 + d.homework * 2 + d.family * 2) / 80; temppress("煮的还不错吃唷..:)"); } else if (class < 60 && class >= 30) { d.homework += rand() % 2 + 1; d.family += rand() % 2 + 1; d.hskill -= rand() % 2 + 5; if (d.hskill < 0) d.hskill = 0; d.cookskill += rand() % 2 + 2; workmoney = 150 + (d.cookskill * 2 + d.homework * 2 + d.family * 2) / 80; temppress("普普通通啦..可以更好的.."); } else if (class < 30) { d.homework += rand() % 2 + 1; d.family += rand() % 2 + 1; d.hskill -= rand() % 2 + 5; if (d.hskill < 0) d.hskill = 0; d.cookskill += rand() % 2 + 1; workmoney = 100 + (d.cookskill * 2 + d.homework * 2 + d.family * 2) / 80; temppress("你的厨艺待加强喔..."); } d.money += workmoney; d.workE += 1; return 0;}intpip_job_workF(){/* ├————┼——————————————————————┤*//* │教堂 │信仰 + 2 , 道德 + 1 , 罪孽 - 2 , 疲劳 + 1 │*//* ├————┼——————————————————————┤*/ float class; long workmoney; workmoney = 0; class = (d.hp * 100 / d.maxhp) - d.tired; count_tired(5, 7, "Y", 100, 1); d.love += rand() % 3 + 4; d.belief += rand() % 4 + 7; d.etchics += rand() % 3 + 7; d.shit += rand() % 3 + 3; d.hp -= rand() % 3 + 5; d.offense -= rand() % 4 + 7; if (d.offense < 0) d.offense = 0; show_job_pic(61); if (class >= 75) { workmoney = 100 + (d.belief + d.etchics - d.offense) / 20; temppress("钱很少 但看你这麽认真 给你多一点..."); } else if (class < 75 && class >= 50) { workmoney = 75 + (d.belief + d.etchics - d.offense) / 20; temppress("谢谢你的热心帮忙..:)"); } else if (class < 50 && class >= 25) { workmoney = 50 + (d.belief + d.etchics - d.offense) / 20; temppress("你真的很有爱心啦..不过有点小累的样子..."); } else if (class < 25) { workmoney = 25 + (d.belief + d.etchics - d.offense) / 20; temppress("来奉献不错..但也不能打混ㄚ....:("); } d.money += workmoney; d.workF += 1; return 0;}intpip_job_workG(){/* ├————┼——————————————————————┤*//* │地摊 │体力 + 2 , 魅力 + 1 , 疲劳 + 3 ,谈吐 +1 │*//* ├————┼——————————————————————┤*/ long workmoney; workmoney = 0; workmoney = 200 + (d.charm * 3 + d.speech * 2 + d.toman) / 50; count_tired(3, 12, "Y", 100, 1); d.shit += rand() % 3 + 8; d.speed += rand() % 2; d.weight -= rand() % 2; d.happy -= (rand() % 3 + 7); d.satisfy -= rand() % 3 + 5; d.hp -= (rand() % 6 + 6); d.charm += rand() % 2 + 3; d.speech += rand() % 2 + 3; d.toman += rand() % 2 + 3; move(4, 0); show_job_pic(71); temppress("摆地摊要躲警察啦..:p"); d.money += workmoney; d.workG += 1; return 0;}intpip_job_workH(){/* ├————┼——————————————————————┤*//* │伐木场 │腕力 + 2 , 气质 - 2 , 疲劳 + 4 │*//* ├————┼——————————————————————┤*//* │伐木场 │若 腕 力 - RND (疲劳) >= 80 则工作成功 │*//* ├————┼——————————————————————┤*/ float class; long workmoney; if ((d.bbtime / 60 / 30) < 1) { /*一岁才行 */ temppress("小鸡太小了,一岁以后再来吧..."); return 0; } workmoney = 0; class = d.wrist - d.tired; d.maxhp += rand() % 2 + 3; d.shit += rand() % 7 + 15; d.wrist += rand() % 3 + 4; count_tired(5, 15, "Y", 100, 1); d.hp -= (rand() % 4 + 10); d.happy -= (rand() % 3 + 4); d.satisfy -= rand() % 3 + 4; d.character -= rand() % 3 + 7; if (d.character < 0) d.character = 0; show_job_pic(81); if (class >= 70) { workmoney = 350 + d.wrist / 20 + d.maxhp / 80; temppress("你腕力很好唷..:)"); } else if (class < 70 && class >= 50) { workmoney = 300 + d.wrist / 20 + d.maxhp / 80; temppress("砍了不少树喔.....:)"); } else if (class < 50 && class >= 20) { workmoney = 250 + d.wrist / 20 + d.maxhp / 80; temppress("普普通通啦..可以更好的.."); } else if (class < 20) { workmoney = 200 + d.wrist / 20 + d.maxhp / 80; temppress("待加强喔..锻炼再来吧...."); } d.money += workmoney; d.workH += 1; return 0;}intpip_job_workI(){/* ├————┼——————————————————————┤*//* │美容院 │感受 + 1 , 腕力 - 1 , 疲劳 + 3 │*//* ├————┼——————————————————————┤*//* │美容院 │若 艺术修养 - RND (疲劳) >= 40 则工作成功 │*//* ├————┼——————————————————————┤*/ float class; long workmoney; if ((d.bbtime / 60 / 30) < 1) { /*一岁才行 */ temppress("小鸡太小了,一岁以后再来吧..."); return 0; } workmoney = 0; class = d.art - d.tired; d.maxhp += rand() % 2; d.affect += rand() % 2 + 3; count_tired(3, 11, "Y", 100, 1); d.shit += rand() % 4 + 8; d.hp -= (rand() % 4 + 10); d.happy -= (rand() % 3 + 4); d.satisfy -= rand() % 3 + 4;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?