Exemple #1
0
int
show_resultshow_pic(int i)
{    /*收获季 */
    char buf[256];

    clrchyiuan(0, 24);
#ifdef MAPLE
    sprintf(buf, "src/maple/pipgame/resultshow/pic%d", i);
#else
    sprintf(buf, "game/pipgame/resultshow/pic%d", i);
#endif    // END MAPLE
    show_file(buf, 0, 24, ONLY_COLOR);
    return 0;
}
Exemple #2
0
int 
show_file(char *filename, int y, int lines, int mode)
{
  FILE *fp;
  char buf[512], *str, shift;
  int num;


  /*
   * hialan: shift 0: no control word 1: is control word 2: change line word
   */

  clrchyiuan(y, y + lines);
  move(y, 0);
  if ((fp = fopen(filename, "r")))
  {
    while (fgets(buf, 512, fp) && lines--)
    {
      Ptt_prints(buf, mode);
      for (str = buf, shift = num = 0; *str; str++)
      {
	if (str[0] == '\033' && str[1] == '[')
	  shift = 1;

	if (*str == '\n' || *str == '\r')
	  shift = 2;

	outc(*str);

	if (!shift)
	  num++;

	if (shift && *str == 'm')
	  shift = 0;

	if (num >= 80 || shift == 2)
	{
	  if (shift != 2)
	    outc('\n');
	  break;
	}
      }
    }
    fclose(fp);
  }
  else
    return 0;

  return 1;
}
Exemple #3
0
int
show_basic_pic(int i)
{
    char buf[256];

    clrchyiuan(6, 17);
#ifdef MAPLE
    sprintf(buf, "src/maple/pipgame/basic/pic%d", i);
#else
    sprintf(buf, "game/pipgame/basic/pic%d", i);
#endif    // END MAPLE
    show_file(buf, 6, 12, ONLY_COLOR);
    return 0;
}
Exemple #4
0
int
show_job_pic(int i)
{    /* 打工的show图 */
    char buf[256];

    clrchyiuan(6, 18);
#ifdef MAPLE
    sprintf(buf, "src/maple/pipgame/job/pic%d", i);
#else
    sprintf(buf, "game/pipgame/job/pic%d", i);
#endif    // END MAPLE
    show_file(buf, 6, 12, ONLY_COLOR);
    return 0;
}
Exemple #5
0
int
show_ending_pic(int i)
{    /*结束 */
    char buf[256];

    clrchyiuan(1, 23);
#ifdef MAPLE
    sprintf(buf, "src/maple/pipgame/ending/pic%d", i);
#else
    sprintf(buf, "game/pipgame/ending/pic%d", i);
#endif    // END MAPLE
    show_file(buf, 4, 16, ONLY_COLOR);
    return 0;
}
Exemple #6
0
int
show_die_pic(int i)
{    /*死亡 */
    char buf[256];

    clrchyiuan(0, 23);
#ifdef MAPLE
    sprintf(buf, "src/maple/pipgame/die/pic%d", i);
#else
    sprintf(buf, "game/pipgame/die/pic%d", i);
#endif    // END MAPLE
    show_file(buf, 0, 23, ONLY_COLOR);
    return 0;
}
Exemple #7
0
int
show_badman_pic(int i)
{    /* 坏人 */
    char buf[256];

    clrchyiuan(6, 18);
#ifdef MAPLE
    sprintf(buf, "src/maple/pipgame/badman/pic%d", i);
#else
    sprintf(buf, "game/pipgame/badman/pic%d", i);
#endif    // END MAPLE
    show_file(buf, 6, 14, ONLY_COLOR);
    return 0;
}
Exemple #8
0
int
show_palace_pic(int i)
{    /* 参见王臣用 */
    char buf[256];

    clrchyiuan(0, 13);
#ifdef MAPLE
    sprintf(buf, "src/maple/pipgame/palace/pic%d", i);
#else
    sprintf(buf, "game/pipgame/palace/pic%d", i);
#endif    // END MAPLE
    show_file(buf, 0, 11, ONLY_COLOR);
    return 0;
}
Exemple #9
0
int
show_weapon_pic(int i)
{    /* 武器用 */
    char buf[256];

    clrchyiuan(1, 10);
#ifdef MAPLE
    sprintf(buf, "src/maple/pipgame/weapon/pic%d", i);
#else
    sprintf(buf, "game/pipgame/weapon/pic%d", i);
#endif    // END MAPLE
    show_file(buf, 1, 10, ONLY_COLOR);
    return 0;
}
Exemple #10
0
int
show_play_pic(int i)
{    /*休闲的图 */
    char buf[256];

    clrchyiuan(6, 18);
#ifdef MAPLE
    sprintf(buf, "src/maple/pipgame/play/pic%d", i);
#else
    sprintf(buf, "game/pipgame/play/pic%d", i);
#endif    // END MAPLE
    if (i == 0)
        show_file(buf, 2, 16, ONLY_COLOR);
    else
        show_file(buf, 6, 12, ONLY_COLOR);
    return 0;
}
Exemple #11
0
int
situ()
{
    clrchyiuan(19, 21);
    move(19, 0);
    prints("你:\033[44m %d胜 %d负\033[m                     \n", d.winn, d.losee);
    move(20, 0);
    prints("鸡:\033[44m %d胜 %d负\033[m                     \n", d.losee, d.winn);

    if (d.winn >= d.losee) {
        move(b_lines, 0);
        temppress("哈..赢小鸡也没多光荣");
    } else {
        move(b_lines, 0);
        temppress("笨蛋..竟输给了鸡....ㄜ...");
    }
    return 0;
}
Exemple #12
0
int /*结局画面*/
pip_ending_screen()
{
  time_t now;
  char buf[256];
  char endbuf1[50];
  char endbuf2[50];
  char endbuf3[50];
  int endgrade=0;
  int endmode=0;
  screen_clear();
  pip_ending_decide(endbuf1,endbuf2,endbuf3,&endmode,&endgrade);
  move(1,9); 
  //% prints("┏━━━┓┏━━  ┓┏━━━  ┏━━━┓┏━━  ┓  ━━━  ");
  prints("\xa9\xb3\xa9\xa5\xa9\xa5\xa9\xa5\xa9\xb7\xa9\xb3\xa9\xa5\xa9\xa5  \xa9\xb7\xa9\xb3\xa9\xa5\xa9\xa5\xa9\xa5  \xa9\xb3\xa9\xa5\xa9\xa5\xa9\xa5\xa9\xb7\xa9\xb3\xa9\xa5\xa9\xa5  \xa9\xb7  \xa9\xa5\xa9\xa5\xa9\xa5  ");
  move(2,9);
  //% prints("┃      ┃┃    ┃┃┃      ┃┃      ┃┃    ┃┃┃      ┃");
  prints("\xa9\xa7      \xa9\xa7\xa9\xa7    \xa9\xa7\xa9\xa7\xa9\xa7      \xa9\xa7\xa9\xa7      \xa9\xa7\xa9\xa7    \xa9\xa7\xa9\xa7\xa9\xa7      \xa9\xa7");
  move(3,9);
  //% prints("┃    ━  ┃    ┃┃┃      ┃┗━┓┏┛┃    ┃┃┃  ┏━┓");
  prints("\xa9\xa7    \xa9\xa5  \xa9\xa7    \xa9\xa7\xa9\xa7\xa9\xa7      \xa9\xa7\xa9\xbb\xa9\xa5\xa9\xb7\xa9\xb3\xa9\xbf\xa9\xa7    \xa9\xa7\xa9\xa7\xa9\xa7  \xa9\xb3\xa9\xa5\xa9\xb7");
  move(4,9);
  //% prints("┃    ━  ┃  ┃  ┃┃      ┃┏━┛┗┓┃  ┃  ┃┃      ┃");
  prints("\xa9\xa7    \xa9\xa5  \xa9\xa7  \xa9\xa7  \xa9\xa7\xa9\xa7      \xa9\xa7\xa9\xb3\xa9\xa5\xa9\xbf\xa9\xbb\xa9\xb7\xa9\xa7  \xa9\xa7  \xa9\xa7\xa9\xa7      \xa9\xa7");
  move(5,9);
  //% prints("┃      ┃┃  ┃  ┃┃      ┃┃      ┃┃  ┃  ┃┃      ┃");
  prints("\xa9\xa7      \xa9\xa7\xa9\xa7  \xa9\xa7  \xa9\xa7\xa9\xa7      \xa9\xa7\xa9\xa7      \xa9\xa7\xa9\xa7  \xa9\xa7  \xa9\xa7\xa9\xa7      \xa9\xa7");
  move(6,9);
  //% prints("┗━━━┛┗━  ━┛┗━━━  ┗━━━┛┗━  ━┛  ━━━  ");
  prints("\xa9\xbb\xa9\xa5\xa9\xa5\xa9\xa5\xa9\xbf\xa9\xbb\xa9\xa5  \xa9\xa5\xa9\xbf\xa9\xbb\xa9\xa5\xa9\xa5\xa9\xa5  \xa9\xbb\xa9\xa5\xa9\xa5\xa9\xa5\xa9\xbf\xa9\xbb\xa9\xa5  \xa9\xa5\xa9\xbf  \xa9\xa5\xa9\xa5\xa9\xa5  ");
  move(7,8);
  //% prints("—————————— 星空战斗鸡结局报告 ———————————");
  prints("\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa \xd0\xc7\xbf\xd5\xd5\xbd\xb6\xb7\xbc\xa6\xbd\xe1\xbe\xd6\xb1\xa8\xb8\xe6 \xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa");
  move(9,10);
  //% prints("这个时间不知不觉地还是到临了...");
  prints("\xd5\xe2\xb8\xf6\xca\xb1\xbc\xe4\xb2\xbb\xd6\xaa\xb2\xbb\xbe\xf5\xb5\xd8\xbb\xb9\xca\xc7\xb5\xbd\xc1\xd9\xc1\xcb...");
  move(11,10);
  //% prints("%s 得离开你的温暖怀抱,自己一只鸡在外面求生存了.....",d.name);
  prints("%s \xb5\xc3\xc0\xeb\xbf\xaa\xc4\xe3\xb5\xc4\xce\xc2\xc5\xaf\xbb\xb3\xb1\xa7\xa3\xac\xd7\xd4\xbc\xba\xd2\xbb\xd6\xbb\xbc\xa6\xd4\xda\xcd\xe2\xc3\xe6\xc7\xf3\xc9\xfa\xb4\xe6\xc1\xcb.....",d.name);
  move(13,10);
  //% prints("在你照顾教导他的这段时光,让他接触了很多领域,培养了很多的能力....");
  prints("\xd4\xda\xc4\xe3\xd5\xd5\xb9\xcb\xbd\xcc\xb5\xbc\xcb\xfb\xb5\xc4\xd5\xe2\xb6\xce\xca\xb1\xb9\xe2\xa3\xac\xc8\xc3\xcb\xfb\xbd\xd3\xb4\xa5\xc1\xcb\xba\xdc\xb6\xe0\xc1\xec\xd3\xf2\xa3\xac\xc5\xe0\xd1\xf8\xc1\xcb\xba\xdc\xb6\xe0\xb5\xc4\xc4\xdc\xc1\xa6....");
  move(15,10);
  //% prints("因为这些,让小鸡 %s 之後的生活,变得更多采多姿了........",d.name);
  prints("\xd2\xf2\xce\xaa\xd5\xe2\xd0\xa9\xa3\xac\xc8\xc3\xd0\xa1\xbc\xa6 %s \xd6\xae\xe1\xe1\xb5\xc4\xc9\xfa\xbb\xee\xa3\xac\xb1\xe4\xb5\xc3\xb8\xfc\xb6\xe0\xb2\xc9\xb6\xe0\xd7\xcb\xc1\xcb........",d.name);
  move(17,10);
  //% prints("对於你的关心,你的付出,你所有的爱......");
  prints("\xb6\xd4\xec\xb6\xc4\xe3\xb5\xc4\xb9\xd8\xd0\xc4\xa3\xac\xc4\xe3\xb5\xc4\xb8\xb6\xb3\xf6\xa3\xac\xc4\xe3\xcb\xf9\xd3\xd0\xb5\xc4\xb0\xae......");
  move(19,10);
  //% prints("%s 会永远都铭记在心的....",d.name);
  prints("%s \xbb\xe1\xd3\xc0\xd4\xb6\xb6\xbc\xc3\xfa\xbc\xc7\xd4\xda\xd0\xc4\xb5\xc4....",d.name);
  //% pressanykey("接下来看未来发展");
  pressanykey("\xbd\xd3\xcf\xc2\xc0\xb4\xbf\xb4\xce\xb4\xc0\xb4\xb7\xa2\xd5\xb9");
  clrchyiuan(7,19);
  move(7,8);
  //% prints("—————————— 星空战斗鸡未来发展 ———————————");
  prints("\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa \xd0\xc7\xbf\xd5\xd5\xbd\xb6\xb7\xbc\xa6\xce\xb4\xc0\xb4\xb7\xa2\xd5\xb9 \xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa");
  move(9,10);
  //% prints("透过水晶球,让我们一起来看 %s 的未来发展吧.....",d.name);
  prints("\xcd\xb8\xb9\xfd\xcb\xae\xbe\xa7\xc7\xf2\xa3\xac\xc8\xc3\xce\xd2\xc3\xc7\xd2\xbb\xc6\xf0\xc0\xb4\xbf\xb4 %s \xb5\xc4\xce\xb4\xc0\xb4\xb7\xa2\xd5\xb9\xb0\xc9.....",d.name);
  move(11,10);
  //% prints("小鸡 %s 後来%s....",d.name,endbuf1);
  prints("\xd0\xa1\xbc\xa6 %s \xe1\xe1\xc0\xb4%s....",d.name,endbuf1);
  move(13,10);
  //% prints("因为他的之前的努力,使得他在这一方面%s....",endbuf2);
  prints("\xd2\xf2\xce\xaa\xcb\xfb\xb5\xc4\xd6\xae\xc7\xb0\xb5\xc4\xc5\xac\xc1\xa6\xa3\xac\xca\xb9\xb5\xc3\xcb\xfb\xd4\xda\xd5\xe2\xd2\xbb\xb7\xbd\xc3\xe6%s....",endbuf2);
  move(15,10);
  //% prints("至於小鸡的婚姻状况,他後来%s,婚姻算是很美满.....",endbuf3);
  prints("\xd6\xc1\xec\xb6\xd0\xa1\xbc\xa6\xb5\xc4\xbb\xe9\xd2\xf6\xd7\xb4\xbf\xf6\xa3\xac\xcb\xfb\xe1\xe1\xc0\xb4%s\xa3\xac\xbb\xe9\xd2\xf6\xcb\xe3\xca\xc7\xba\xdc\xc3\xc0\xc2\xfa.....",endbuf3);
  move(17,10);
  //% prints("嗯..这是一个不错的结局唷..........");
  prints("\xe0\xc5..\xd5\xe2\xca\xc7\xd2\xbb\xb8\xf6\xb2\xbb\xb4\xed\xb5\xc4\xbd\xe1\xbe\xd6\xe0\xa1..........");
  //% pressanykey("我想  你一定很感动吧.....");
  pressanykey("\xce\xd2\xcf\xeb  \xc4\xe3\xd2\xbb\xb6\xa8\xba\xdc\xb8\xd0\xb6\xaf\xb0\xc9.....");
  show_ending_pic(0);
  //% pressanykey("看一看分数罗");
  pressanykey("\xbf\xb4\xd2\xbb\xbf\xb4\xb7\xd6\xca\xfd\xc2\xde");
  endgrade=pip_game_over(endgrade);
  //% pressanykey("下一页是小鸡资料  赶快copy下来做纪念");
  pressanykey("\xcf\xc2\xd2\xbb\xd2\xb3\xca\xc7\xd0\xa1\xbc\xa6\xd7\xca\xc1\xcf  \xb8\xcf\xbf\xeccopy\xcf\xc2\xc0\xb4\xd7\xf6\xbc\xcd\xc4\xee");
  pip_data_list();
  //% pressanykey("欢迎再来挑战....");
  pressanykey("\xbb\xb6\xd3\xad\xd4\xd9\xc0\xb4\xcc\xf4\xd5\xbd....");
  /*记录开始*/
  now=time(0);
  //% sprintf(buf, "———————————————————————————————————————\n");
  sprintf(buf, "\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\n");
  pip_log_record(buf);
  //% sprintf(buf, "在 %s 的时候,%s 的小鸡 %s 出现了结局\n", Cdate(&now), cuser.userid,d.name);
  sprintf(buf, "\xd4\xda %s \xb5\xc4\xca\xb1\xba\xf2\xa3\xac%s \xb5\xc4\xd0\xa1\xbc\xa6 %s \xb3\xf6\xcf\xd6\xc1\xcb\xbd\xe1\xbe\xd6\n", Cdate(&now), cuser.userid,d.name);
  pip_log_record(buf);
  //% sprintf(buf, "小鸡 %s 努力加强自己,後来%s\n因为之前的努力,使得在这一方面%s\n",d.name,endbuf1,endbuf2);
  sprintf(buf, "\xd0\xa1\xbc\xa6 %s \xc5\xac\xc1\xa6\xbc\xd3\xc7\xbf\xd7\xd4\xbc\xba\xa3\xac\xe1\xe1\xc0\xb4%s\n\xd2\xf2\xce\xaa\xd6\xae\xc7\xb0\xb5\xc4\xc5\xac\xc1\xa6\xa3\xac\xca\xb9\xb5\xc3\xd4\xda\xd5\xe2\xd2\xbb\xb7\xbd\xc3\xe6%s\n",d.name,endbuf1,endbuf2);
  pip_log_record(buf);
  //% sprintf(buf, "至於婚姻状况,他後来%s,婚姻算是很美满.....\n\n小鸡 %s 的总积分= %d\n",endbuf3,d.name,endgrade);
  sprintf(buf, "\xd6\xc1\xec\xb6\xbb\xe9\xd2\xf6\xd7\xb4\xbf\xf6\xa3\xac\xcb\xfb\xe1\xe1\xc0\xb4%s\xa3\xac\xbb\xe9\xd2\xf6\xcb\xe3\xca\xc7\xba\xdc\xc3\xc0\xc2\xfa.....\n\n\xd0\xa1\xbc\xa6 %s \xb5\xc4\xd7\xdc\xbb\xfd\xb7\xd6\xa3\xbd %d\n",endbuf3,d.name,endgrade);
  pip_log_record(buf);
  //% sprintf(buf, "———————————————————————————————————————\n");
  sprintf(buf, "\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\xa1\xaa\n");
  pip_log_record(buf);  
  /*记录终止*/
  d.death=3;
  //% pipdie("游戏结束罗...  ",3);
  pipdie("\xd3\xce\xcf\xb7\xbd\xe1\xca\xf8\xc2\xde...  ",3);
  return 0;
}
Exemple #13
0
int /*��ֻ���*/
pip_ending_screen()
{
  time_t now;
  char buf[256];
  char endbuf1[50];
  char endbuf2[50];
  char endbuf3[50];
  int endgrade=0;
  int endmode=0;
  clear();
  pip_ending_decide(endbuf1,endbuf2,endbuf3,&endmode,&endgrade);
  move(1,9); 
  prints("����������������  ����������  ����������������  ��  ������  ");
  move(2,9);
  prints("��      ����    ������      ����      ����    ������      ��");
  move(3,9);
  prints("��    ��  ��    ������      ��������������    ������  ������");
  move(4,9);
  prints("��    ��  ��  ��  ����      ��������������  ��  ����      ��");
  move(5,9);
  prints("��      ����  ��  ����      ����      ����  ��  ����      ��");
  move(6,9);
  prints("��������������  ������������  ��������������  ����  ������  ");
  move(7,8);
  prints("�������������������� �ǿ�ս������ֱ��� ����������������������");
  move(9,10);
  prints("���ʱ�䲻֪�����ػ��ǵ�����...");
  move(11,10);
  prints("%s ���뿪�����ů�������Լ�һֻ����������������.....",d.name);
  move(13,10);
  prints("�����չ˽̵��������ʱ�⣬�����Ӵ��˺ܶ����������˺ܶ������....");
  move(15,10);
  prints("��Ϊ��Щ����С�� %s ֮��������ø���ɶ�����........",d.name);
  move(17,10);
  prints("�����Ĺ��ģ���ĸ����������еİ�......");
  move(19,10);
  prints("%s ����Զ���������ĵ�....",d.name);
  pressanykey("��������δ����չ");
  clrchyiuan(7,19);
  move(7,8);
  prints("�������������������� �ǿ�ս����δ����չ ����������������������");
  move(9,10);
  prints("͸��ˮ����������һ������ %s ��δ����չ��.....",d.name);
  move(11,10);
  prints("�� %s ����%s....",d.name,endbuf1);
  move(13,10);
  prints("��Ϊ����֮ǰ��Ŭ����ʹ��������һ����%s....",endbuf2);
  move(15,10);
  prints("���С���Ļ���״����������%s���������Ǻ�����.....",endbuf3);
  move(17,10);
  prints("��..����һ������Ľ���..........");
  pressanykey("����  ��һ���ܸж���.....");
  show_ending_pic(0);
  pressanykey("��һ��������");
  endgrade=pip_game_over(endgrade);
  pressanykey("��һҳ��С������  �Ͽ�copy����������");
  pip_data_list();
  pressanykey("��ӭ������ս....");
  /*��¼��ʼ*/
  now=time(0);
  sprintf(buf, "������������������������������������������������������������������������������\n");
  pip_log_record(buf);
  sprintf(buf, "�� %s ��ʱ��%s ��С�� %s �����˽��\n", Cdate(&now), cuser.userid,d.name);
  pip_log_record(buf);
  sprintf(buf, "С�� %s Ŭ����ǿ�Լ�������%s\n��Ϊ֮ǰ��Ŭ����ʹ������һ����%s\n",d.name,endbuf1,endbuf2);
  pip_log_record(buf);
  sprintf(buf, "��춻���״����������%s���������Ǻ�����.....\n\nС�� %s ���ܻ��֣� %d\n",endbuf3,d.name,endgrade);
  pip_log_record(buf);
  sprintf(buf, "������������������������������������������������������������������������������\n");
  pip_log_record(buf);  
  /*��¼��ֹ*/
  d.death=3;
  pipdie("��Ϸ������...  ",3);
  return 0;
}
Exemple #14
0
int
pip_data_list()
{    /*看小鸡个人详细资料 */
    char buf[256];
    char inbuf1[20];
    char inbuf2[20];
    int tm;
    int pipkey;
    int page = 1;

    tm = (time(0) - start_time + d.bbtime) / 60 / 30;

    clear();
    move(1, 0);
    prints("       \033[1;33m┏━━━    ━━━  ┏━━━┓  ━━━  \033[m\n");
    prints("       \033[0;37m┃      ┃┃ ━   ┃┗┓┏━┛┃ ━   ┃\033[m\n");
    prints("       \033[1;37m┃      ┃┃┏┓  ┃  ┃┃    ┃┏┓  ┃\033[m\n");
    prints
    ("       \033[1;34m┗━━━  ┗┛┗━┛  ┗┛    ┗┛┗━┛\033[32m......................\033[m");
    do {
        clrchyiuan(5, 23);
        switch (page) {
            case 1:
                move(5, 0);
                sprintf(buf,
                        "\033[1;31m ┌┤\033[41;37m 基本资料 \033[0;1;31m├—————————————————————————————┐\033[m\n");
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#姓    名 :\033[37m %-10s \033[33m#生    日 :\033[37m %02d/%02d/%02d   \033[33m#年    纪 :\033[37m %-2d         \033[31m│\033[m\n",
                        d.name, d.year % 100, d.month, d.day, tm);
                prints(buf);

                sprintf(inbuf1, "%d/%d", d.hp, d.maxhp);
                sprintf(inbuf2, "%d/%d", d.mp, d.maxmp);
                sprintf(buf,
                        "\033[1;31m │\033[33m#体    重 :\033[37m %-5d(米克)\033[33m#体    力 :\033[37m %-11s\033[33m#法    力 :\033[37m %-11s\033[31m│\033[m\n",
                        d.weight, inbuf1, inbuf2);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#疲    劳 :\033[37m %-3d        \033[33m#病    气 :\033[37m %-3d        \033[33m#脏    脏 :\033[37m %-3d        \033[31m│\033[m\n",
                        d.tired, d.sick, d.shit);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#腕    力 :\033[37m %-7d    \033[33m#亲子关系 :\033[37m %-7d    \033[33m#金    钱 :\033[37m %-11d\033[31m│\033[m\n",
                        d.wrist, d.relation, d.money);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m ├┤\033[41;37m 能力资料 \033[0;1;31m├—————————————————————————————┤\033[m\n");
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#气    质 :\033[37m %-10d \033[33m#智    力 :\033[37m %-10d \033[33m#爱    心 :\033[37m %-10d \033[31m│\033[m\n",
                        d.character, d.wisdom, d.love);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#艺    术 :\033[37m %-10d \033[33m#道    德 :\033[37m %-10d \033[33m#家    事 :\033[37m %-10d \033[31m│\033[m\n",
                        d.art, d.etchics, d.homework);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#礼    仪 :\033[37m %-10d \033[33m#应    对 :\033[37m %-10d \033[33m#烹    饪 :\033[37m %-10d \033[31m│\033[m\n",
                        d.manners, d.speech, d.cookskill);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m ├┤\033[41;37m 状态资料 \033[0;1;31m├—————————————————————————————┤\033[m\n");
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#快    乐 :\033[37m %-10d \033[33m#满    意 :\033[37m %-10d \033[33m#人    际 :\033[37m %-10d \033[31m│\033[m\n",
                        d.happy, d.satisfy, d.toman);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#魅    力 :\033[37m %-10d \033[33m#勇    敢 :\033[37m %-10d \033[33m#信    仰 :\033[37m %-10d \033[31m│\033[m\n",
                        d.charm, d.brave, d.belief);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#罪    孽 :\033[37m %-10d \033[33m#感    受 :\033[37m %-10d \033[33m            \033[37m            \033[31m│\033[m\n",
                        d.offense, d.affect);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m ├┤\033[41;37m 评价资料 \033[0;1;31m├—————————————————————————————┤\033[m\n");
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#社交评价 :\033[37m %-10d \033[33m#战斗评价 :\033[37m %-10d \033[33m#魔法评价 :\033[37m %-10d \033[31m│\033[m\n",
                        d.social, d.hexp, d.mexp);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#家事评价 :\033[37m %-10d \033[33m            \033[37m            \033[33m            \033[37m            \033[31m│\033[m\n",
                        d.family);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m └————————————————————————————————————┘\033[m\n");
                prints(buf);

                move(b_lines - 1, 0);
                sprintf(buf,
                        "                                                              \033[1;36m第一页\033[37m/\033[36m共二页\033[m\n");
                prints(buf);
                break;

            case 2:
                move(5, 0);
                sprintf(buf,
                        "\033[1;31m ┌┤\033[41;37m 物品资料 \033[0;1;31m├—————————————————————————————┐\033[m\n");
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#食    物 :\033[37m %-10d \033[33m#零    食 :\033[37m %-10d \033[33m#大 补 丸 :\033[37m %-10d \033[31m│\033[m\n",
                        d.food, d.cookie, d.bighp);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#药    草 :\033[37m %-10d \033[33m#书    本 :\033[37m %-10d \033[33m#玩    具 :\033[37m %-10d \033[31m│\033[m\n",
                        d.medicine, d.book, d.playtool);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m ├┤\033[41;37m 游戏资料 \033[0;1;31m├—————————————————————————————┤\033[m\n");
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#猜 拳 赢 :\033[37m %-10d \033[33m#猜 拳 输 :\033[37m %-10d                         \033[31m│\033[m\n",
                        d.winn, d.losee);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m ├┤\033[41;37m 武力资料 \033[0;1;31m├—————————————————————————————┤\033[m\n");
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#攻 击 力 :\033[37m %-10d \033[33m#防 御 力 :\033[37m %-10d \033[33m#速 度 值 :\033[37m %-10d \033[31m│\033[m\n",
                        d.attack, d.resist, d.speed);
                prints(buf);
                sprintf(buf,
                        "\033[1;31m │\033[33m#抗魔能力 :\033[37m %-10d \033[33m#战斗技术 :\033[37m %-10d \033[33m#魔法技术 :\033[37m %-10d \033[31m│\033[m\n",
                        d.mresist, d.hskill, d.mskill);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#头部装备 :\033[37m %-10s \033[33m#右手装备 :\033[37m %-10s \033[33m#左手装备 :\033[37m %-10s \033[31m│\033[m\n",
                        weaponhead[d.weaponhead],
                        weaponrhand[d.weaponrhand],
                        weaponlhand[d.weaponlhand]);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m │\033[33m#身体装备 :\033[37m %-10s \033[33m#脚部装备 :\033[37m %-10s \033[33m            \033[37m            \033[31m│\033[m\n",
                        weaponbody[d.weaponbody],
                        weaponfoot[d.weaponfoot]);
                prints(buf);

                sprintf(buf,
                        "\033[1;31m └————————————————————————————————————┘\033[m\n");
                prints(buf);

                move(b_lines - 1, 0);
                sprintf(buf,
                        "                                                              \033[1;36m第二页\033[37m/\033[36m共二页\033[m\n");
                prints(buf);
                break;
        }
        move(b_lines, 0);
        sprintf(buf,
                "\033[1;44;37m  资料选单  \033[46m  [↑/PAGE UP]往上一页 [↓/PAGE DOWN]往下一页 [Q]离开:            \033[m");
        prints(buf);
        pipkey = igetkey();
        switch (pipkey) {
            case KEY_UP:
            case KEY_PGUP:
            case KEY_DOWN:
            case KEY_PGDN:
                if (page == 1)
                    page = 2;
                else if (page == 2)
                    page = 1;
                break;
#ifdef MAPLE
            case Ctrl('R'):
                if (currutmp->msgs[0].last_pid) {
                    show_last_call_in();
                    my_write(currutmp->msgs[0].last_pid,
                             "水球丢回去:");
                }
                break;
#endif    // END MAPLE
        }
    } while ((pipkey != 'Q') && (pipkey != 'q') && (pipkey != KEY_LEFT));
    return 0;
}
Exemple #15
0
void
clrtobot()
{
  clrchyiuan(cur_ln, scr_lns);
}
Exemple #16
0
int pip_buy_goods_new(int mode,const struct goodsofpip *p,int *oldnum)
{
    const static char *shopname[4] = { "店名", "便利商店", "星空药铺", "夜里书局" };
    char inbuf[256];
    char genbuf[20];
    long smoney;
    int oldmoney;
    int i, pipkey, choice;

    oldmoney = d.money;
    do {
        clrchyiuan(6, 18);
        move(6, 0);
        sprintf(inbuf,
                "\033[1;31m  —\033[41;37m 编号 \033[0;1;31m—\033[41;37m 商      品 \033[0;1;31m——\033[41;37m 效            能 \033[0;1;31m——\033[41;37m 价     格 \033[0;1;31m—\033[37;41m 拥有数量 \033[0;1;31m—\033[0m  ");
        prints(inbuf);
        for (i = 1; i <= oldnum[0]; i++) {
            move(7 + i, 0);
            sprintf(inbuf,
                    "     \033[1;35m[\033[37m%2d\033[35m]     \033[36m%-10s      \033[37m%-14s        \033[1;33m%-10d   \033[1;32m%-9d    \033[0m",
                    p[i].num, p[i].name, p[i].msgbuy, p[i].money,
                    oldnum[i]);
            prints(inbuf);
        }
        clrchyiuan(19, 24);
        move(b_lines, 0);
        sprintf(inbuf,
                "\033[1;44;37m  %8s选单  \033[46m  [B]买入物品  [S]卖出物品  [Q]跳出:                         \033[m",
                shopname[mode]);
        prints(inbuf);
        pipkey = igetkey();
        switch (pipkey) {
            case 'B':
            case 'b':
                move(b_lines - 1, 1);
                sprintf(inbuf,
                        "想要买入啥呢? [0]放弃买入 [1~%d]物品商号",
                        oldnum[0]);
#ifdef MAPLE
                getdata(b_lines - 1, 1, inbuf, genbuf, 3, LCECHO, "0");
#else
                getdata(b_lines-1,1,inbuf,genbuf,3,DOECHO,NULL,true);
                if ((genbuf[0] >= 'A') && (genbuf[0] <= 'Z'))
                    genbuf[0] = genbuf[0] | 32;
#endif    // END MAPLE

                choice = atoi(genbuf);
                if (choice >= 1 && choice <= oldnum[0]) {
                    clrchyiuan(6, 18);
                    if (rand() % 2 > 0)
                        show_buy_pic(p[choice].pic1);
                    else
                        show_buy_pic(p[choice].pic2);
                    move(b_lines - 1, 0);
                    clrtoeol();
                    move(b_lines - 1, 1);
                    smoney = 0;
                    if (mode == 3)
                        smoney = 1;
                    else {
                        sprintf(inbuf,
                                "你要买入物品 [%s] 多少个呢?(上限 %d)",
                                p[choice].name,
                                d.money / p[choice].money);
#ifdef MAPLE
                        getdata(b_lines - 1, 1, inbuf, genbuf,
                                6, 1, 0);
#else
                        getdata(b_lines-1,1,inbuf,genbuf,6,DOECHO,NULL,true);
#endif    // END MAPLE
                        smoney = atoi(genbuf);
                    }
                    if (smoney < 0) {
                        temppress("放弃买入...");
                    } else if (d.money < smoney * p[choice].money) {
                        temppress("你的钱没有那麽多喔..");
                    } else {
                        sprintf(inbuf,"确定买入物品 [%s] 数量 %ld 个吗?(店家卖价 %ld) [y/N]:",p[choice].name,smoney,smoney*p[choice].money);
#ifdef MAPLE
                        getdata(b_lines - 1, 1, inbuf, genbuf,
                                2, 1, 0);
#else
                        getdata(b_lines-1,1,inbuf,genbuf,2,DOECHO,NULL,true);
#endif    // END MAPLE
                        if (genbuf[0] == 'y'
                                || genbuf[0] == 'Y') {
                            oldnum[choice] += smoney;
                            d.money -=
                                smoney * p[choice].money;
                            sprintf(inbuf,"老板给了你%ld个%s",smoney,p[choice].name);
                            temppress(inbuf);
                            temppress(p[choice].msguse);
                            if (mode == 3 && choice == 1) {
                                d.happy +=
                                    rand() % 10 +
                                    20 * smoney;
                                d.satisfy +=
                                    rand() % 10 +
                                    20 * smoney;
                            }
                            if (mode == 3 && choice == 2) {
                                d.happy +=
                                    (rand() % 2 +
                                     2) * smoney;
                                d.wisdom +=
                                    (2 +
                                     10 / (d.wisdom /
                                           100 +
                                           1)) * smoney;
                                d.character +=
                                    (rand() % 4 +
                                     2) * smoney;
                                d.art +=
                                    (rand() % 2 +
                                     1) * smoney;
                            }
                        } else {
                            temppress("放弃买入...");
                        }
                    }
                } else {
                    sprintf(inbuf, "放弃买入.....");
                    temppress(inbuf);
                }
                break;

            case 'S':
            case 's':
                if (mode == 3) {
                    temppress("这些东西不能卖喔....");
                    break;
                }
                move(b_lines - 1, 1);
                sprintf(inbuf,
                        "想要卖出啥呢? [0]放弃卖出 [1~%d]物品商号",
                        oldnum[0]);
#ifdef MAPLE
                getdata(b_lines - 1, 1, inbuf, genbuf, 3, LCECHO, "0");
#else
                getdata(b_lines-1,1,inbuf,genbuf,3,DOECHO,NULL,true);
                if ((genbuf[0] >= 'A') && (genbuf[0] <= 'Z'))
                    genbuf[0] = genbuf[0] | 32;
#endif    // END MAPLE
                choice = atoi(genbuf);
                if (choice >= 1 && choice <= oldnum[0]) {
                    clrchyiuan(6, 18);
                    if (rand() % 2 > 0)
                        show_buy_pic(p[choice].pic1);
                    else
                        show_buy_pic(p[choice].pic2);
                    move(b_lines - 1, 0);
                    clrtoeol();
                    move(b_lines - 1, 1);
                    smoney = 0;
                    sprintf(inbuf,
                            "你要卖出物品 [%s] 多少个呢?(上限 %d)",
                            p[choice].name, oldnum[choice]);
#ifdef MAPLE
                    getdata(b_lines - 1, 1, inbuf, genbuf, 6, 1, 0);
#else
                    getdata(b_lines-1,1,inbuf,genbuf,6,DOECHO,NULL,true);
#endif    // END MAPLE
                    smoney = atoi(genbuf);
                    if (smoney < 0) {
                        temppress("放弃卖出...");
                    } else if (smoney > oldnum[choice]) {
                        sprintf(inbuf,
                                "你的 [%s] 没有那麽多个喔",
                                p[choice].name);
                        temppress(inbuf);
                    } else {
                        sprintf(inbuf,"确定卖出物品 [%s] 数量 %ld 个吗?(店家买价 %ld) [y/N]:",
                                p[choice].name,smoney,smoney*p[choice].money*8/10);
#ifdef MAPLE
                        getdata(b_lines - 1, 1, inbuf, genbuf,
                                2, 1, 0);
#else
                        getdata(b_lines-1,1,inbuf,genbuf,2,DOECHO,NULL,true);
#endif    // END MAPLE
                        if (genbuf[0] == 'y'
                                || genbuf[0] == 'Y') {
                            oldnum[choice] -= smoney;
                            d.money +=
                                smoney * p[choice].money *
                                8 / 10;
                            sprintf(inbuf,"老板拿走了你的%ld个%s",smoney,p[choice].name);
                            temppress(inbuf);
                        } else {
                            temppress("放弃卖出...");
                        }
                    }
                } else {
                    sprintf(inbuf, "放弃卖出.....");
                    temppress(inbuf);
                }
                break;
            case 'Q':
            case 'q':
                sprintf(inbuf, "金钱交易共 %d 元,离开 %s ",
                        d.money - oldmoney, shopname[mode]);
                temppress(inbuf);
                break;
#ifdef MAPLE
            case Ctrl('R'):
                if (currutmp->msgs[0].last_pid) {
                    show_last_call_in();
                    my_write(currutmp->msgs[0].last_pid,
                             "水球丢回去:");
                }
                break;
#endif    // END MAPLE
        }
    } while ((pipkey != 'Q') && (pipkey != 'q') && (pipkey != KEY_LEFT));
    return 0;
}
Exemple #17
0
int    /*结局画面 */
pip_ending_screen()
{
    time_t now;
    char buf[256];
    char endbuf1[50];
    char endbuf2[50];
    char endbuf3[50];
    int endgrade = 0;
    int endmode = 0;

    clear();
    pip_ending_decide(endbuf1, endbuf2, endbuf3, &endmode, &endgrade);
    move(1, 9);
    prints
    ("\033[1;33m┏━━━┓┏━━  ┓┏━━━  ┏━━━┓┏━━  ┓  ━━━  \033[0m");
    move(2, 9);
    prints
    ("\033[1;37m┃      ┃┃    ┃┃┃      ┃┃      ┃┃    ┃┃┃      ┃\033[0m");
    move(3, 9);
    prints
    ("\033[0;37m┃    ━  ┃    ┃┃┃      ┃┗━┓┏┛┃    ┃┃┃  ┏━┓\033[0m");
    move(4, 9);
    prints
    ("\033[0;37m┃    ━  ┃  ┃  ┃┃      ┃┏━┛┗┓┃  ┃  ┃┃      ┃\033[0m");
    move(5, 9);
    prints
    ("\033[1;37m┃      ┃┃  ┃  ┃┃      ┃┃      ┃┃  ┃  ┃┃      ┃\033[0m");
    move(6, 9);
    prints
    ("\033[1;35m┗━━━┛┗━  ━┛┗━━━  ┗━━━┛┗━  ━┛  ━━━  \033[0m");
    move(7, 8);
    prints
    ("\033[1;31m——————————\033[41;37m 星空战斗鸡结局报告 \033[0;1;31m———————————\033[0m");
    move(9, 10);
    prints("\033[1;36m这个时间不知不觉地还是到临了...\033[0m");
    move(11, 10);
    prints
    ("\033[1;37m\033[33m%s\033[37m 得离开你的温暖怀抱,自己一只鸡在外面求生存了.....\033[0m",
     d.name);
    move(13, 10);
    prints
    ("\033[1;36m在你照顾教导他的这段时光,让他接触了很多领域,培养了很多的能力....\033[0m");
    move(15, 10);
    prints
    ("\033[1;37m因为这些,让小鸡 \033[33m%s\033[37m 之后的生活,变得更多采多姿了........\033[0m",
     d.name);
    move(17, 10);
    prints("\033[1;36m对於你的关心,你的付出,你所有的爱......\033[0m");
    move(19, 10);
    prints("\033[1;37m\033[33m%s\033[37m 会永远都铭记在心的....\033[0m", d.name);
    temppress("接下来看未来发展");
    clrchyiuan(7, 19);
    move(7, 8);
    prints
    ("\033[1;34m——————————\033[44;37m 星空战斗鸡未来发展 \033[0;1;34m———————————\033[0m");
    move(9, 10);
    prints
    ("\033[1;36m透过水晶球,让我们一起来看 \033[33m%s\033[36m 的未来发展吧.....\033[0m",
     d.name);
    move(11, 10);
    prints("\033[1;37m小鸡 \033[33m%s\033[37m 后来%s....\033[0m", d.name, endbuf1);
    move(13, 10);
    prints("\033[1;36m因为他的之前的努力,使得他在这一方面%s....\033[0m",
           endbuf2);
    move(15, 10);
    prints("\033[1;37m至於小鸡的婚姻状况,他后来%s,婚姻算是很美满.....\033[0m",
           endbuf3);
    move(17, 10);
    prints("\033[1;36m嗯..这是一个不错的结局唷..........\033[0m");
    temppress("我想  你一定很感动吧.....");
    show_ending_pic(0);
    temppress("看一看分数罗");
    endgrade = pip_game_over(endgrade);
    temppress("下一页是小鸡资料  赶快copy下来做纪念");
    pip_data_list();
    temppress("欢迎再来挑战....");
    /*
     * 记录开始
     */
    now = time(0);
    sprintf(buf,
            "\033[1;35m———————————————————————————————————————\033[0m\n");
    pip_log_record(buf);
    sprintf(buf,
            "\033[1;37m在 \033[33m%s \033[37m的时候,\033[36m%s \033[37m的小鸡 \033[32m%s\033[37m 出现了结局\033[0m\n",
            Cdate(now), getCurrentUser()->userid, d.name);
    pip_log_record(buf);
    sprintf(buf,
            "\033[1;37m小鸡 \033[32m%s \033[37m努力加强自己,后来%s\033[0m\n\033[1;37m因为之前的努力,使得在这一方面%s\033[0m\n",
            d.name, endbuf1, endbuf2);
    pip_log_record(buf);
    sprintf(buf,
            "\033[1;37m至於婚姻状况,他后来%s,婚姻算是很美满.....\033[0m\n\n\033[1;37m小鸡 \033[32n%s\033[37m 的总积分= \033[33m%d\033[0m\n",
            endbuf3, d.name, endgrade);
    pip_log_record(buf);
    sprintf(buf,
            "\033[1;35m———————————————————————————————————————\033[0m\n");
    pip_log_record(buf);
    /*
     * 记录终止
     */
    d.death = 3;
    pipdie("\033[1;31m游戏结束罗...\033[m  ", 3);
    return 0;
}