void draw_screen(void) { draw_view(); draw_turn(); draw_stat(); draw_slot(); wrefresh(scroll_w); /* move the cursor */ }
void reset(void) //각종 변수 초기화 { level = 1; level_goal = 1000; key = 0; crush_on = 0; cnt = 0; score = 0; speed = 100; system("cls"); //화면지움 reset_game(); draw_stat(); draw_game(); b_type_next = rand() % 7; //다음번에 나올 블록 종류를 랜덤하게 생성 new_block(); //새로운 블록을 하나 만듦 }
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; }
repair() { char c; register char *repairs; register struct shipspecs *ptr = mc; register int count; #define FIX(x, m) (m - ptr->x > count \ ? (ptr->x += count, count = 0) : (count -= m - ptr->x, ptr->x = m)) if (repaired || loaded || fired || changed || turned()) { Signal("No hands free to repair", (struct ship *)0); return; } c = sgetch("Repair (hull, guns, rigging)? ", (struct ship *)0, 1); switch (c) { case 'h': repairs = &mf->RH; break; case 'g': repairs = &mf->RG; break; case 'r': repairs = &mf->RR; break; default: Signal("Avast heaving!", (struct ship *)0); return; } if (++*repairs >= 3) { count = 2; switch (c) { case 'h': { int max = ptr->guns/4; if (ptr->hull < max) { FIX(hull, max); Write(W_HULL, ms, 0, ptr->hull, 0, 0, 0); } break; } case 'g': if (ptr->gunL < ptr->gunR) { int max = ptr->guns/5 - ptr->carL; if (ptr->gunL < max) { FIX(gunL, max); Write(W_GUNL, ms, 0, ptr->gunL, ptr->carL, 0, 0); } } else { int max = ptr->guns/5 - ptr->carR; if (ptr->gunR < max) { FIX(gunR, max); Write(W_GUNR, ms, 0, ptr->gunR, ptr->carR, 0, 0); } } break; case 'r': #define X 2 if (ptr->rig4 >= 0 && ptr->rig4 < X) { FIX(rig4, X); Write(W_RIG4, ms, 0, ptr->rig4, 0, 0, 0); } if (count && ptr->rig3 < X) { FIX(rig3, X); Write(W_RIG3, ms, 0, ptr->rig3, 0, 0, 0); } if (count && ptr->rig2 < X) { FIX(rig2, X); Write(W_RIG2, ms, 0, ptr->rig2, 0, 0, 0); } if (count && ptr->rig1 < X) { FIX(rig1, X); Write(W_RIG1, ms, 0, ptr->rig1, 0, 0, 0); } break; } if (count == 2) { Signal("Repairs completed.", (struct ship *)0); *repairs = 2; } else { *repairs = 0; blockalarm(); draw_stat(); unblockalarm(); } } blockalarm(); draw_slot(); unblockalarm(); repaired = 1; }