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

📄 pip_fight.c

📁 one bbs source code
💻 C
📖 第 1 页 / 共 3 页
字号:
/*---------------------------------------------------------------------------*//* 战斗特区                                                                  *//*                                                                           *//*---------------------------------------------------------------------------*/#include <time.h>#include "bbs.h"#include "pip.h"extern struct chicken d;extern time_t start_time;extern time_t lasttime;//#define getdata(a, b, c , d, e, f, g) getdata(a,b,c,d,e,f,NULL,g)#ifndef MAPLEextern char BoardName[];#endif  // END MAPLEstruct playrule badmanlist[] = {"榕树怪",	 60,0,	20,0,	20,	20,	 20,	150, "11101",	0,0,"网路魔",	 60,0,	20,0,	30,	30,	 30,	200, "01111",	0,0,"蘑菇小怪",	 80,0,	40,0,	50,	35,	 60,	250, "11110",	0,0,"毒蝎",		 85,0,	30,0,	80,	90,	 80,	500, "10111",	0,0,"恶狗",		 90,0,  50,0,   75,	70,	 60,	550, "11010",	0,0,"红眼鬼猫",	130,0,	50,0,	75,	90,	 70,	500, "11011",	0,0,"紫色魔鲨",	140,0,	60,0,	80,	80,	 80,	550, "10101",	0,0,"怪物蟑螂",	150,0,	70,0,	85,	70,	 67,	500, "11110",	0,0,"蜘蛛精",	180,0,	50,0,   90,	90,	 80,	850, "00111",	0,0,"食人巫师",	175,0, 100,0,  100,	80,	 60,    800, "11010",	0,0,"大槌怪",	240,0,  80,0,  110,    100,	 70,    800, "00111",	0,0,"白色恶魔",	250,0,  60,0,  120,    110,	 80,    900, "01011",	0,0,"死神魔",	280,0,  80,0,  150,    120,	 90,   1200, "00011",   0,0,"大恐龙",	300,0,	50,0,  160,    120,	 90,   1500, "11001",	0,0,"超级喷火龙",	500,0, 100,0,  250,    250,	150,   1500, "11000",	0,0,"骷髅头怪",	600,0, 400,0,  350,    400,	250,   2000, "00110",	0,0,"阿强一号",	700,0, 500,0,  600,    900,     500,   2000, "10011",	0,0,"面具怪人",	700,0, 500,0,  800,    850,	300,   2000, "11100",	0,0,"U2外星人",	800,0, 600,0,  800,    800,	600,   2000, "11010",	0,0,"中国疆  ",	800,0, 600,0, 1000,   1000,     500,   2000, "10100",	0,0,"彩色酋长",     900,0, 800,0, 1200,   1200,     600,   3000, "11100",   0,0,"魔音吉他手",  1000,0, 850,0, 1400,   1000,     650,   3000, "11001",   0,0,"万年老龟",    1200,0,1000,0, 1300,   1500,     500,   3000, "01011",   0,0,"八神",	       1200,0, 900,0, 1500,   1300,     800,   3000, "10101",   0,0,"铁面人",      1500,0,1200,0, 1800,   1800,    1200,   4000, "00011",   0,0,"大嘴",        1600,0,1000,0, 1700,   1800,    1100,   4000, "00110",   0,0,"骷髅兵",      1700,0,1500,0, 1800,   1800,    1250,  4000, "10110",   0,0,"熔化妖",      1750,0,1300,0, 1800,   2000,    1000,   4000, "01011",	0,0,"使徒",	       2500,0,2500,0, 2500,   2500,    2500,   5000, "10001",   0,0,"埃及木乃伊",  3500,0,3000,0, 3500,   3500,    2000,   5000, "10110",	0,0,"古小兔",      5000,0,4500,0, 5000,   6000,    4000,   5000, "11100",   0,0,"十字机器人",  6000,0,5000,0, 5500,   6500,    5000,   5000, "01001",	0,0,"飞天小巫师",  6500,0,5500,0, 6500,   6000,    6000,   6000, "01101",	0,0,"炸蛋超人",    7000,0,6000,0, 8000,   7000,    6000,   6500, "00001",	0,0,"Akira",      13500,0,6000,0,15000,  12000,   13000,   8000, "00100",	0,0, "Sarah",      15000,0,6000,0,14000,  13000,   12000,   8000, "10000",	0,0, "Jacky",      13000,0,6000,0,15000,  12000,   13000,   8000, "01000",	0,0, "Wolf",       16000,0,6000,0,13000,  15000,   10000,   8000, "00010",	0,0, "Jeffery",    15000,0,6000,0,12000,  14000,   13000,   8000, "00001",	0,0, "Kage",       12000,0,6000,0,11000,  11000,   15000,   8000, "10000",	0,0, "Lau",        14000,0,6000,0,14000,  13000,   14000,   8000, "01000",	0,0, "Lion",       16000,0,6000,0,12000,  15000,   11000,   8000, "00100",	0,0, "Shun",       11000,0,6000,0,13000,  12000,   11000,   8000, "00010",	0,0, "Aoi",        14000,0,6000,0,13000,  14000,   13000,   8000, "00001",	0,0, "Taka",       15000,0,6000,0,11000,  15000,   11000,   8000, "10000",	0,0, "Pai",        11000,0,6000,0,11000,  11000,   16000,   8000, "01000",	0,0, "NULL",		  0,0,	 0,0,	 0,	 0,	  0,	  0,  "NULL",	0,0};struct magicset treatmagiclist[] = {"治疗法术",	0,	0,	0,	0,	0,	0,"气疗术",	5,	1,	20,	0,	10,	0,"凝神归元",     20,     1,	100,    0,	40,	0,"元灵归心",     50,     1,	400,    0,	60,	0,"五气朝元",     100,    2,	0,	2,	0,	0,"NULL",		0,	0,	0,	0,	0,	0};                                 struct magicset thundermagiclist[] = {"雷系法术",	0,	0,	0,	0,	0,	0,"雷咒",		10,	0,	20,	1,	5,	0,"五雷咒",	20,	0,	50,	1,	5,	0,"天雷咒",	40,	0,	100,	1,	5,	0,"雷之网",	100,	0,	250,	1,	10,	0,"疯狂之雷",	200,	0,	500,	1,	10,	0,"雷神之舞",	600,	0,	1500,	1,	10,	0,"NULL",           0,      0,      0,      0,      0,      0};struct magicset icemagiclist[] = {"冰系法术",	0,	0,	0,	0,	0,	0,"冰咒",		10,	0,	20,	1,	5,	0,"寒冰咒",	20,	0,	50,	1,	5,	0,"玄冰咒",	40,	0,	100,	1,	5,	0,"风雷冰天",	100,	0,	250,	1,	10,	0,"绝对零度之冰",	200,	0,	500,	1,	10,	0,"冰神之舞",	500,	0,	1400,	1,	10,	0,"NULL",           0,      0,      0,      0,      0,      0};struct magicset firemagiclist[] = {"炎系法术",	0,	0,	0,	0,	0,	0,"火术",		5,	0,	10,	1,	5,	0,"炎咒",		10,	0,	20,	1,	5,	0,"炎杀咒",	20,	0,	50,	1,	5,	0,"炼狱真火",	40,	0,	100,	1,	5,	0,"火龙掌",	100,	0,	250,	1,	10,	0,"火龙招唤",	200,	0,	500,	1,	10,	0,"火神之舞",	600,	0,	1600,	1,	10,	0,"NULL",           0,      0,      0,      0,      0,      0};struct magicset earthmagiclist[] = {"土系法术",	0,	0,	0,	0,	0,	0,"土咒",		10,	0,	20,	1,	5,	0,"飞岩术",	20,	0,	50,	1,	5,	0,"地裂天崩",	40,	0,	100,	1,	5,	0,"泰山压顶",	100,	0,	250,	1,	10,	0,"土龙召唤",	200,	0,	500,	1,	10,	0,"山神之舞",	450,	0,	1300,	1,	10,	0,"NULL",           0,      0,      0,      0,      0,      0};struct magicset windmagiclist[] = {"风系法术",	0,	0,	0,	0,	0,	0,"风咒",		10,	0,	20,	1,	5,	0,"旋风咒",	20,	0,	50,	1,	5,	0,"狂风术",	40,	0,	100,	1,	5,	0,"龙卷风",	100,	0,	250,	1,	10,	0,"风卷残云",	200,	0,	500,	1,	10,	0,"风神之舞",	400,	0,	1200,	1,	10,	0,"NULL",		0,	0,	0,	0,	0,	0};/*---------------------------------------------------------------------------*//* 战斗人物决定函式                                                          *//*                                                                           *//*---------------------------------------------------------------------------*//*0~1:2  2~4:3  5~9:5  10~12:3  13~14:1  15~19:5  20~23:4  24~27:4  28~33:6  34~45:12*/intpip_meet_vs_man(){  int class;  int man;  int lucky;  class=(d.maxhp*30+d.maxmp*20+d.attack*20+d.resist*15+d.mexp*5+d.hexp*5+d.speed*10)/8500+1;  if(class==1)  {    man=rand()%2;  }  else if(class==2)  {     if(rand()%4>0)    {      man=rand()%3+2;    }    else    {      man=rand()%2;    }  }  else if(class==3)  {    lucky=rand()%9;    if(lucky>3)    {      man=rand()%5+5;    }    else if(lucky<=3 && lucky>0)    {      man=rand()%3+2;    }    else    {      man=rand()%2;    }  }    else if(class==4)  {    lucky=rand()%15;    if(lucky>5)    {      man=rand()%3+10;    }    else if(lucky<=5 && lucky>3)    {      man=rand()%5+5;    }    else     {      man=rand()%5;    }  }  else if(class==5)  {    lucky=rand()%20;    if(lucky>6)    {      man=13+rand()%2;    }    else if(lucky<=6 && lucky>3)    {      man=rand()%3+10;    }    else    {      man=rand()%10;    }  }  else if(class==6)  {    lucky=rand()%25;    if(lucky>8)    {      man=15+rand()%6;    }    else if(lucky<=8 &&lucky>4)    {      man=13+rand()%2;    }    else    {      man=rand()%13;    }  }    else if(class==7)  {    lucky=rand()%40;    if(lucky>12)    {      man=21+rand()%3;        }    else if(lucky<=12 &&lucky>4)    {      man=15+rand()%6;    }    else    {      man=rand()%15;    }  }    else if(class==8)  {    lucky=rand()%50;    if(lucky>25)    {      man=24+rand()%4;    }    else if(lucky<=25 && lucky>20)    {      man=21+rand()%3;        }    else     {      man=rand()%21;    }  }          else if(class==9)  {    lucky=rand()%75;    if(lucky>20)    {      man=28+rand()%6;    }    else if(lucky<=20 && lucky>10)        {      man=24+rand()%4;    }    else if(lucky<=10 && lucky>5)    {      man=21+rand()%3;        }    else    {      man=rand()%21;    }  }            else if(class>=9)  {    lucky=rand()%100;    if(lucky>20)    {      man=34+rand()%12;    }    else if(lucky<=20 && lucky>10)    {      man=28+rand()%6;    }    else if(lucky<=10 && lucky>5)        {      man=24+rand()%4;    }    else    {      man=rand()%24;        }  }              pip_fight_bad(man);  return;}int pip_fight_bad(n)int n;{  pip_fight_main(n,badmanlist,1);  return;}intpip_fight_main(n,list,mode)int n;struct playrule list[];   int mode;{  pip_vs_man(n,list,mode);  return 0;}/*---------------------------------------------------------------------------*//* 战斗战斗函式                                                              *//*                                                                           *//*---------------------------------------------------------------------------*/int pip_vs_man(n,p,mode)int n;struct playrule *p;  int mode;{ /* p[n].name hp mp speed attack resist money special map */  struct playrule m;  char buf[256]; char inbuf1[20]; char inbuf2[20];  int pipkey;  int mankey; int lucky; int dinjure=0;		/*小鸡伤害力*/ int minjure=0;		/*对方伤害力*/ int dresistmore=0;	/*小鸡加强防御*/ int mresistmore=0;	/*对方加强防御*/ int oldhexp;		/*未战斗前格斗经验*/ int oldmexp;		/*未战斗前魔法经验*/ int oldbrave;		/*未战斗前勇敢*/ int oldhskill;		/*未战斗前战斗技术*/ int oldmskill;		/*未战斗前魔法技术*/ int oldetchics;	/*未战斗前道德*/ int oldmoney;		/*未战斗前金钱*/ int oldtired; int oldhp; int winorlose=0;		/*1:you win 0:you loss*/   /*随机产生人物 并且存好战斗前的一些数值*/ oldhexp=d.hexp; oldmexp=d.mexp; oldbrave=d.brave; oldhskill=d.hskill; oldmskill=d.mskill; oldetchics=d.etchics; oldmoney=d.money; if(mode==1) {	 m.hp=p[n].hp-rand()%10;	 m.maxhp=(m.hp+p[n].hp)/2;	 m.mp=p[n].mp-rand()%10;	 m.maxmp=(m.mp+p[n].mp)/2;	 m.speed=p[n].speed-rand()%4-1;	 m.attack=p[n].attack-rand()%10;	 m.resist=p[n].resist-rand()%10;	 m.money=p[n].money-rand()%50;	 m.death=p[n].death; } else {

⌨️ 快捷键说明

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