コード例 #1
0
ファイル: arianrhod.c プロジェクト: ktnyt/Arianrhod-Manager
void run(char* dirname)
{
  int ch, x, y, i;

  curs_set(0);
  draw_chara(dirname);
  draw_stats(dirname);
  draw_skill(dirname);

  x = 0;
  y = 0;

  for(;;)
    {
      draw_controls(0);
      move_cursor(y);
      cbreak();
      noecho();
      ch = getch();
      for(i = 0; i < COLS; ++i) mvaddch(LINES - 1, i, ' ');
      mvaddch(LINES - 1, COLS - 1, ch);

      if(ch == 'q') break;
      if(ch == 'j') y = move_cursor(y + 1) ? y + 1 : y;
      if(ch == 'k') y = move_cursor(y - 1) ? y - 1 : y;
      if(ch == 'h') change_hp();
      if(ch == 'm') change_mp();
      if(ch == 'f') change_fate();
      if(ch == 'd') ndice();
      if(ch == '?') draw_help();
    }

  return;
}
コード例 #2
0
ファイル: stats.c プロジェクト: Adamantinus/Eternal-Lands
int display_stats_handler(window_info *win)
{
        player_attribs cur_stats = your_info;
        char str[10];
        int x,y;

        x=5;
        y=5;

        draw_string_small(x,y,attributes.base,1);
        y+=14;
        draw_stat(24,x,y,&(cur_stats.phy),&(attributes.phy));

        y+=14;
        draw_stat(24,x,y,&(cur_stats.coo),&(attributes.coo));

        y+=14;
        draw_stat(24,x,y,&(cur_stats.rea),&(attributes.rea));

        y+=14;
        draw_stat(24,x,y,&(cur_stats.wil),&(attributes.wil));

        y+=14;
        draw_stat(24,x,y,&(cur_stats.ins),&(attributes.ins));

        y+=14;
        draw_stat(24,x,y,&(cur_stats.vit),&(attributes.vit));

        //cross attributes
        glColor3f(1.0f,1.0f,0.0f);
        y+=20;

        draw_string_small(x,y,attributes.cross,1);
        y+=14;
        draw_statf(24,x,y,&(cur_stats.might),&(attributes.might));

        y+=14;
        draw_statf(24,x,y,&(cur_stats.matter),&(attributes.matter));

        y+=14;
        draw_statf(24,x,y,&(cur_stats.tough),&(attributes.tough));

        y+=14;
        draw_statf(24,x,y,&(cur_stats.charm),&(attributes.charm));

        y+=14;
        draw_statf(24,x,y,&(cur_stats.react),&(attributes.react));

        y+=14;
        draw_statf(24,x,y,&(cur_stats.perc),&(attributes.perc));

        y+=14;
        draw_statf(24,x,y,&(cur_stats.ration),&(attributes.ration));

        y+=14;
        draw_statf(24,x,y,&(cur_stats.dext),&(attributes.dext));

        y+=14;
        draw_statf(24,x,y,&(cur_stats.eth),&(attributes.eth));

        glColor3f(0.5f,0.5f,1.0f);
        y+=14;  // blank lines for spacing
        y+=14;  // blank lines for spacing

        //other attribs
        y+=20;
        safe_snprintf(str, sizeof(str), "%i",cur_stats.food_level);
        draw_stat_final(24,x,y,attributes.food.name,str);

        y+=14;
        draw_stat(24,x,y,&(cur_stats.material_points),&(attributes.material_points));

        y+=14;
        draw_stat(24,x,y,&(cur_stats.ethereal_points),&(attributes.ethereal_points));

        y+=14;
        draw_stat(24,x,y,&(cur_stats.action_points),&(attributes.action_points));

        //other info
        safe_snprintf(str, sizeof(str), "%i",cur_stats.overall_skill.base-cur_stats.overall_skill.cur);
        draw_stat_final(24,205,y,attributes.pickpoints,str);

        //nexuses here
        glColor3f(1.0f,1.0f,1.0f);
        x+=200;
        y=5;

        draw_string_small(x,y,attributes.nexus,1);

        y+=14;
        draw_stat(24,x,y,&(cur_stats.human_nex),&(attributes.human_nex));

        y+=14;
        draw_stat(24,x,y,&(cur_stats.animal_nex),&(attributes.animal_nex));

        y+=14;
        draw_stat(24,x,y,&(cur_stats.vegetal_nex),&(attributes.vegetal_nex));

        y+=14;
        draw_stat(24,x,y,&(cur_stats.inorganic_nex),&(attributes.inorganic_nex));

        y+=14;
        draw_stat(24,x,y,&(cur_stats.artificial_nex),&(attributes.artificial_nex));

        y+=14;
        draw_stat(24,x,y,&(cur_stats.magic_nex),&(attributes.magic_nex));

        y+=20;
        //skills
        glColor3f(1.0f,0.5f,0.2f);
        draw_string_small(x,y,attributes.skills,1);

        y+=14;

        check_grid_x_left=x;
        check_grid_y_top=y;

        statsinfo[0].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.attack_skill),&(attributes.attack_skill),cur_stats.attack_exp,cur_stats.attack_exp_next_lev);

        y+=14;
        statsinfo[1].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.defense_skill),&(attributes.defense_skill),cur_stats.defense_exp,cur_stats.defense_exp_next_lev);

        y+=14;
        statsinfo[2].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.harvesting_skill),&(attributes.harvesting_skill),cur_stats.harvesting_exp,cur_stats.harvesting_exp_next_lev);

        y+=14;
        statsinfo[3].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.alchemy_skill),&(attributes.alchemy_skill),cur_stats.alchemy_exp,cur_stats.alchemy_exp_next_lev);

        y+=14;
        statsinfo[4].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.magic_skill),&(attributes.magic_skill),cur_stats.magic_exp,cur_stats.magic_exp_next_lev);

        y+=14;
        statsinfo[5].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.potion_skill),&(attributes.potion_skill),cur_stats.potion_exp,cur_stats.potion_exp_next_lev);

        y+=14;
        statsinfo[6].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.summoning_skill),&(attributes.summoning_skill),cur_stats.summoning_exp,cur_stats.summoning_exp_next_lev);

        y+=14;
        statsinfo[7].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.manufacturing_skill),&(attributes.manufacturing_skill),cur_stats.manufacturing_exp,cur_stats.manufacturing_exp_next_lev);

        y+=14;
        statsinfo[8].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.crafting_skill),&(attributes.crafting_skill),cur_stats.crafting_exp,cur_stats.crafting_exp_next_lev);

        y+=14;
        statsinfo[9].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.engineering_skill),&(attributes.engineering_skill),cur_stats.engineering_exp,cur_stats.engineering_exp_next_lev);

        y+=14;
        statsinfo[10].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.tailoring_skill),&(attributes.tailoring_skill),cur_stats.tailoring_exp,cur_stats.tailoring_exp_next_lev);

        y+=14;
        statsinfo[11].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.ranging_skill),&(attributes.ranging_skill),cur_stats.ranging_exp,cur_stats.ranging_exp_next_lev);

        y+=14;
        statsinfo[12].is_selected==1?glColor3f(1.0f,0.5f,0.5f):glColor3f(1.0f,0.5f,0.2f);
        draw_skill(46,x,y,&(cur_stats.overall_skill),&(attributes.overall_skill),cur_stats.overall_exp,cur_stats.overall_exp_next_lev);

        return 1;
}