int main(int argc, char** argv) { #ifndef TARGET_ESC64 //disable line-buffering on stdin struct termios old_tio, new_tio; assert(!tcgetattr(STDIN_FILENO, &old_tio)); new_tio = old_tio; new_tio.c_lflag &= (~ICANON & ~ECHO); assert(!tcsetattr(STDIN_FILENO, TCSANOW, &new_tio)); #endif for(;;) { fputs("\x1B[2J\x1B[H\x1B[?25l", stdout); //clear screen, cursor to home, cursor invis player1.pos.x = 16; player2.pos.x = 60; //initialize / generate gen_terrain(); init_player(&player1); init_player(&player2); curPlayer = &player1; //draw draw_static(); draw_terrain(); draw_player(&player1); draw_player(&player2); draw_stats(&player1); draw_stats(&player2); while(player1.hull > 0 && player2.hull > 0) { if(player_input()) { break; } TERM_DRAWSTR(MSG_X, MSG_Y + 1, "shot fired"); shoot(); curPlayer = curPlayer == &player1 ? &player2 : &player1; } } #ifndef TARGET_ESC64 //restore old settings line-buffering settings //tcsetattr(STDIN_FILENO, TCSANOW, &old_tio); #endif //return 0; }
extern void table_player_lost(void) { int row = MESSAGE_START_ROW; int input; printf(RED); printf("\033[%d;%dH", row++, MESSAGE_START_COL); printf("+------------------------+"); printf("\033[%d;%dH", row++, MESSAGE_START_COL); printf("| YOU LOST |"); printf("\033[%d;%dH", row++, MESSAGE_START_COL); printf("| |"); printf("\033[%d;%dH", row++, MESSAGE_START_COL); printf("| enter C to continue |"); printf("\033[%d;%dH", row++, MESSAGE_START_COL); printf("+------------------------+"); fflush(stdout); // wait do { input = table_get_input(); } while (input != 'C' && input != 'c'); // update stats ++Table_losses; draw_stats(); } // table_player_lost()
void draw_table(void) { // give us a green table printf(NORMAL); printf(CLEAR_SCREEN); // Title printf(MOVE_TOP_LEFT); printf(RED); printf(" B L A C K J A C K\n"); // menu draw_menu(); // Headings printf(BLUE); printf("\033[%d;%dH", DEALER_ROW, DEALER_COL); printf("Dealer"); printf("\033[%d;%dH", DEALER_ROW+1, DEALER_COL); printf("------"); printf("\033[%d;%dH", PLAYER_ROW, PLAYER_COL); printf("You"); printf("\033[%d;%dH", PLAYER_ROW+1, PLAYER_COL); printf("---"); // wins, losses draw_stats(); printf(MOVE_TOP_LEFT); } // draw_table()
void rogue_escape(mob_t * m) { int dir; int i; char line[DEFLEN]; int stolen; if (game->player_gold == 0) return; if (m->x < player->x) { dir = -2; m->flip = true; } else { dir = +2; m->flip = false; } for (i = 0; i < 2; i++) { m->flags = GFX_HUMAN_FALL1; draw_board(); mpause(); m->flags = GFX_HUMAN_FALL2; draw_board(); mpause(); } m->flags = 0; while (m->x > view_x - 2 && m->x <= view_x + BOARD_W + 2) { m->x += dir; draw_board(); spause(); } m->type = MOB_NONE; if (game->player_gold) { if (has_eq(EQ_SHADES) && rand() % 10 == 0) { game->equipment[EQ_SHADES] = false; snprintf(line, DEFLEN, "ROGUE STOLE YOUR SHADES AND RAN AWAY!\n\n(WHAT A JERK)"); } else { stolen = 1 + rand() % ROGUE_STEAL_GOLD; game->player_gold -= stolen; snprintf(line, DEFLEN, "ROGUE STOLE %d GOLD AND RAN AWAY!", stolen); } draw_stats(); flush_input(); pwait(line); } return; }
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; }
static void draw_game(void) { #if SDL SDL_Rect r; r.x = r.y = 0; r.w = screen->w; r.h = screen->h; uint32_t c = SDL_MapRGB(screen->format, 128, 255, 128); SDL_FillRect(screen, &r, c); #endif uint8_t i=0; for(uint8_t y=0; y<MAP_H; y++){ lcd_locate(2, y+1); for(uint8_t x=0; x<MAP_W; x++){ if(get_pos(x, y) == g_player_position_i){ lcd_print_sprite(12); } else { uint8_t t = g_map[i]; lcd_print_sprite(t); } i++; } } draw_stats(); #if SDL SDL_Flip(screen); #endif }
/** Give the player a random item suitable for the current floor or @gold if nothing useful was available. */ void give_item(char * msg, int gold, int type) { char line[DEFLEN]; if (game->weapon == WPN_UNARMED && rand() % 3 == 0) { give_weapon(WPN_BONECLUB); snprintf(line, DEFLEN, "%sYOU FIND A BONE CLUB", msg); goto print_msg; } switch (rand() % 20) { case 0: if (!has_eq(EQ_TORCH)) { give_eq(EQ_TORCH); draw_stats(); snprintf(line, DEFLEN, "%sYOU FIND A TORCH", msg); goto print_msg; } break; case 1: if (!has_eq(EQ_SHADES)) { give_eq(EQ_SHADES); draw_stats(); snprintf(line, DEFLEN, "%sYOU FIND SOME SHADES\n\nYOU LOOK REALLY COOL NOW", msg); goto print_msg; } break; default: break; } game->player_gold += gold; game->total_gold_earned += gold; draw_stats(); snprintf(line, DEFLEN, "%sYOU FIND %d GOLD", msg, gold); print_msg: pwait(line); return; }
void Renderer::Pass2(const Pipeline &pipeline, const PipelineContext &pipelineContext) { //BEGIN PASS 2 // //end of texture rendering //now we copy the texture from the FBO or framebuffer to //video texture memory and render fullscreen. /** Reset the viewport size */ #ifdef USE_FBO if (renderTarget->renderToTexture) { glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, this->renderTarget->fbuffer[1]); glViewport(0, 0, this->renderTarget->texsize, this->renderTarget->texsize); } else #endif glViewport(0, 0, this->vw, this->vh); glBindTexture(GL_TEXTURE_2D, this->renderTarget->textureID[0]); glMatrixMode(GL_PROJECTION); glLoadIdentity(); #ifdef USE_GLES1 glOrthof(-0.5, 0.5, -0.5, 0.5, -40, 40); #else glOrtho(-0.5, 0.5, -0.5, 0.5, -40, 40); #endif glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glLineWidth(this->renderTarget->texsize < 512 ? 1 : this->renderTarget->texsize / 512.0); CompositeOutput(pipeline, pipelineContext); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(-0.5, -0.5, 0); // When console refreshes, there is a chance the preset has been changed by the user refreshConsole(); draw_title_to_screen(false); if (this->showhelp % 2) draw_help(); if (this->showtitle % 2) draw_title(); if (this->showfps % 2) draw_fps(this->realfps); if (this->showpreset % 2) draw_preset(); if (this->showstats % 2) draw_stats(); glTranslatef(0.5, 0.5, 0); #ifdef USE_FBO if (renderTarget->renderToTexture) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); #endif }
void video_canvas_refresh(struct video_canvas_s *canvas, unsigned int xs, unsigned int ys, unsigned int xi, unsigned int yi, unsigned int w, unsigned int h) { BYTE *source; register int x, y; register int buf_width; register int xoff; register int yoff; if(canvas->width==0) return; if (machine_ui_done==0) return; if (xoffset_centred==0) { xoffset_centred=(canvas->draw_buffer->draw_buffer_width-320)/2; xoffset=xoffset_centred; } if (yoffset_centred==0) { yoffset_centred=(canvas->draw_buffer->draw_buffer_height-240)/2; yoffset=xoffset_centred; } xoff=xoffset; yoff=yoffset; source=canvas->draw_buffer->draw_buffer; buf_width=canvas->draw_buffer->draw_buffer_width; register unsigned long *screen32=(unsigned long *)gp2x_screen8; register unsigned long *source32=(unsigned long *)source; if(hwscaling) { for(y=0; y<272; y++) { for(x=0; x<384/4; x++) { screen32[(y*(384/4))+x]= source32[((y+(yoff-16))*(buf_width/4))+x+((xoff-32)/4)]; } } } else { for(y=0; y<240; y++) { for(x=0; x<320/4; x++) { screen32[(y*(320/4))+x]= source32[((y+yoff)*(buf_width/4))+x+(xoff/4)]; } } } gp2x_poll_input(); if(stats_open) draw_stats(gp2x_screen8); if(prefs_open) draw_prefs(gp2x_screen8); else if(vkeyb_open) draw_vkeyb(gp2x_screen8); gp2x_video_flip(); }
static void draw(state_st *state) { log_func_enter; draw_stats(state); draw_message(state); draw_level(state); log_func_exit; }
int expose_listener(void *param) { t_world *world; world = (t_world*)param; draw_reset(world); draw_map(world); draw_stats(world); return (0); }
static int loop_listener(void *data) { t_world *world; world = (t_world*)data; draw_reset(world); do_move(world); draw_map(world); draw_stats(world); return (0); }
int16_t player_hit(Player* player, int16_t x, int16_t y) { if( x < player->pos.x || x >= player->pos.x + 3 || y < player->pos.y || y >= player->pos.y + 2) { return 0; } explosion(x, y); draw_player(player); player->hull -= SHOT_DAMAGE; draw_stats(player); term_setpos(MSG_X, MSG_Y + 1); printstr("hit player "); printch(player->id); return 1; }
turn_command_t player_turn(game_t * game) { int input; while (1) { input = getch(); if(input == ERR) { draw_log(game->input_type, &(game->log), game->level); continue; } clear_msg(); if(input == '\t') { if(game->input_type == input_type_log) { timeout(-1); game->input_type = input_type_map; } else { timeout(500); game->input_type = input_type_log; } draw_map(game->input_type, game->level); draw_stats(&(game->player), game->level); draw_log(game->input_type, &(game->log), game->level); continue; } turn_command_t command; if(game->input_type == input_type_map) { command = process_input_map(game, input); } else { command = process_input_log(game, input); draw_log(game->input_type, &(game->log), game->level); } if(command == turn_command_void) { continue; } return command; } }
void _draw() { int state = statestack_top(); io::clear_screen(); view_t view; if (state == STATE_EXAMINE) { view = compute_view(target_cursor_position(), VIEW_WIDTH, VIEW_HEIGHT, current_dungeon->width, current_dungeon->height); } else { view = compute_view(player.pos, VIEW_WIDTH, VIEW_HEIGHT, current_dungeon->width, current_dungeon->height); } compute_fov(current_dungeon, player.pos.x, player.pos.y); draw_dungeon(current_dungeon, view); if (inside_view(view, player.pos)) { if (player.flag & CF_INVISIBLE) draw_symbol_hilite(player.symbol, player.pos.x - view.x, player.pos.y - view.y); else draw_symbol(player.symbol, player.pos.x - view.x, player.pos.y - view.y); } if (state == STATE_EXAMINE || state == STATE_CAST_SPELL || state == STATE_ZAP_WAND) { draw_target_cursor(view); } draw_stats(); erase_msg_buffer(); flush_turn_log(false); io::flush(); }
void draw(cairo_t* cr) { cairo_save(cr); cairo_set_source_rgb(cr, 1, 1, 1); cairo_paint(cr); cairo_scale(cr, WIN_HEIGHT / 1000.0, WIN_HEIGHT / 1000.0); for (unsigned int i = 0; i < n_robots; i++) { draw_robot(cr, robots[i], 0.4); } cairo_restore(cr); draw_stats(cr, robots); /* cairo_save (cairo_context); * cairo_set_operator (cairo_context, CAIRO_OPERATOR_SOURCE); * cairo_set_source_surface (cairo_context, cairo_get_target * (map_context), 0, * 0); * cairo_paint (cairo_context); * cairo_restore (cairo_context);*/ }
int16_t player_input(void) { int16_t ch; TERM_DRAWSTR(MSG_X, MSG_Y, "press <ENTER> to start your turn"); while(getchar() != '\n'); CLEAR_MSG; for(;;) { ch = getchar(); switch(ch) { case 'w': ++curPlayer->angle; break; case 's': --curPlayer->angle; break; case 'd': ++curPlayer->power; break; case 'a': --curPlayer->power; break; case ' ': return 0; case 'q': return -1; default: break; } curPlayer->angle = clamp(curPlayer->angle, -90, 90); curPlayer->power = clamp(curPlayer->power, 0, 100); draw_stats(curPlayer); } }
void TournamentSR::draw_statistics() { Font *font_normal = resources.get_font("normal"); int vw = subsystem.get_view_width(); int vh = subsystem.get_view_height(); int ww = ((vw - 20) / 2) + 40; int wh = vh - 20; int x = vw / 2 - ww / 2; int y = 10; int wx = x; /* set alpha */ float alpha = 0.8f; /* draw shadow */ subsystem.set_color(0.0f, 0.0f, 0.0f, 0.2f); subsystem.draw_box(x + 7, y + 7, ww, wh); /* draw window */ subsystem.set_color(0.75f, 0.5f, 0.5f, alpha); subsystem.draw_box(x, y, ww, wh); subsystem.set_color(0.25f, 0.0f, 0.0f, alpha); subsystem.draw_box(x + 1, y + 1, ww - 2, wh - 2); /* draw black bars */ subsystem.set_color(0.0f, 0.0f, 0.0f, alpha); subsystem.draw_box(x + 10, y + 15, ww - 20, 21); /* reset */ subsystem.reset_color(); /* draw screws */ subsystem.draw_icon(screw1, wx + 5, 15); subsystem.draw_icon(screw2, wx + ww - 5 - 8, 15); subsystem.draw_icon(screw3, wx + 5, vh - 15 - 8); subsystem.draw_icon(screw4, wx + ww - 5 - 8, vh - 15 - 8); /* draw title */ Font *font_big = resources.get_font("big"); std::string txt("SPEED RACE"); int tw = font_big->get_text_width(txt); subsystem.draw_text(font_big, vw / 2 - tw / 2, y + 18, txt); /* draw list */ subsystem.set_color(1.0f, 1.0f, 0.0f, 1.0f); y = 55; x = wx + 15; subsystem.draw_text(font_normal, x, y, "#"); subsystem.draw_text(font_normal, x + 20, y, "PLAYER"); subsystem.draw_text(font_normal, x + 140, y, "LAPS"); subsystem.draw_text(font_normal, x + 180, y, "BEST"); subsystem.draw_text(font_normal, x + 240, y, "LAST"); subsystem.draw_text(font_normal, x + 300, y, "PING"); subsystem.reset_color(); y = draw_stats(font_normal, wx + 15, y + 15); /* spectators */ x = wx + 15; y += 50; /* done */ subsystem.set_color(1.0f, 1.0f, 0.0f, 1.0f); subsystem.draw_text(font_normal, wx + 15, y, "SPECTACTORS:"); subsystem.reset_color(); y += font_normal->get_font_height(); for (Players::iterator it = players.begin(); it != players.end(); it++) { Player *p = *it; if (p->state.server_state.flags & PlayerServerFlagSpectating) { int w = font_normal->get_text_width(p->get_player_name()); if (x + w >= wx + ww - 15) { x = wx + 15; y += font_normal->get_font_height(); } subsystem.draw_text(font_normal, x, y, p->get_player_name()); x += w + 10; } } }
void render_stats() { draw_stats(); }
void fountain() { char line[DEFLEN]; char liquid[DEFLEN]; char * insert; int temp; int blood; int rlen; blood = (gtile(player->y, player->x) == TL_P_BLOOD_FOUNTAIN); snprintf(liquid, DEFLEN, "%s", blood ? "BLOOD" : "WATER"); stile(player->y, player->x, TL_FOUNT_BASE); stile(player->y - 1, player->x, TL_VOID); stile(player->y - 2, player->x, TL_VOID); stile(player->y - 2, player->x - 1, TL_VOID); stile(player->y - 2, player->x + 1, TL_VOID); snprintf(line, DEFLEN, "YOU DRINK FROM THE %sFOUNTAIN\n\n", (blood ? "BLOOD " : "")); rlen = strlen(line); insert = &line[rlen]; rlen = DEFLEN - rlen; draw_board(); switch (rand() % 10) { case 0: snprintf(insert, rlen, "THE %s TASTES FOUL!!", liquid); pwait(line); player->flags = GFX_HURT; draw_board(); lpause(); player->flags = 0; player->hp -= 1 + rand() % 10; draw_bars(); if (player->hp <= 0) { draw_board(); game_over("YOU DIED FROM A\n" "POISONED FOUNTAIN", false); } break; case 1: snprintf(insert, rlen, "THE %s TASTES BITTER!\n\nYOU FEEL SLOWER!", liquid); pwait(line); change_pl_sp(-1); draw_stats(); break; case 2: case 3: temp = 100 + (rand() % 5) * 100; temp += MAX(0, game->current_floor - 7) * 100; snprintf(insert, rlen, "THIS IS A FOUNTAIN OF WISDOM!\n\n" "YOU GET %d EXP", temp); pwait(line); draw_board(); give_exp(temp); break; case 4: case 5: snprintf(insert, rlen, "THE %s IS INVIGORATING!\n\nYOU FEEL STRONGER!", liquid); pwait(line); change_pl_st(+1); draw_stats(); break; default: snprintf(insert, rlen, "THE %s IS REFRESHING!", liquid); pwait(line); refill_hp(FOUNTAIN_HEAL); break; } return; }
void use_item(game_t * game, item_t ** item) { char item_n[100]; char msg[MSGLEN]; bool should_dispose; //TODO: Make sure this item is actually in the inventory.. item_name(item_n, *item); should_dispose = false; switch ((*item)->type) { case item_type_potion: switch((item_subtype_potion_t)(*item)->subtype) { case item_subtype_potion_heal: snprintf(msg, MSGLEN, "You drink %s. This stuff is great!", item_n); game->player.mob->attr[ATTR_HP] += 20; should_dispose = true; break; default: break; } break; case item_type_bibelot: switch((*item)->subtype) { case item_subtype_bibelot_magic_lamp: use_magic_lamp(game, *item); clear_msg(); return; default: break; } break; default: snprintf(msg, MSGLEN, "You do something with %s, but you're not sure what.", item_n); break; } draw_stats(&(game->player), game->level); print_msg(msg); wait(); clear_msg(); if (should_dispose) { *item = NULL; if(*(item + 1) != NULL) { for(int i = 1; ; i += 1) { item_t * next_item = *(item + i); if(next_item == NULL) { break; } *(item + i - 1) = next_item; *(item + i) = NULL; } } } return; }
void stone_tablet() { char line[DEFLEN]; int seq[15]; int inp_seq[15]; int i; int states = 7; int exp; pwait("YOU FIND A MYSTERIOUS STONE TABLET"); stile(player->y, player->x, TL_VOID); stile(player->y - 1, player->x, TL_VOID); states = game->tablet_diff; draw_tablet(-1); pwait("REPEAT THE SEQUENCE\n" "USING THE DIRECTIONAL KEYS"); draw_tablet(-1); for (i = 0; i < states; i++) { opause(); seq[i] = rand() % 4; draw_tablet(seq[i]); opause(); draw_tablet(-1); } for (i = 0; i < states; i++) { int gk; gk = getch(); if (gk == KEY_UP) inp_seq[i] = 0; else if (gk == KEY_RIGHT) inp_seq[i] = 1; else if (gk == KEY_DOWN) inp_seq[i] = 2; else if (gk == KEY_LEFT) inp_seq[i] = 3; else { snprintf(lowmsg, DEFLEN, "INVALID INPUT"); draw_lowmsg(); continue; } if (inp_seq[i] != seq[i]) { lpause(); board_attr(A_REVERSE | A_BOLD, PAIR_RED); wrefresh(board); pwait("SHIT"); draw_board(); return; } else { draw_tablet(seq[i]); opause(); draw_tablet(-1); flush_input(); } } draw_board(); switch (states) { case 7: exp = 1000; break; case 8: exp = 2000; break; case 9: exp = 3000; break; default: exp = 1000; break; } snprintf(line, DEFLEN, "YOU HAVE DECODED THE MYSTIC RUNES\n" "\nYOU GET %d EXP", exp); pwait(line); draw_board(); give_exp(exp); draw_stats(); // Make it harder next time game->tablet_diff += 1; draw_stats(); return; }
/* renders the view which so far is just a model frame */ void render_mdview() { //draw_view(); draw_viewSkeleton(); draw_stats(); }
int main() { srand( time(NULL) ); struct termios defs; //Se guarda el estado actual de termios. tcgetattr(0,&defs); //No queremos contaminar el tty del usuario //(Asi es, el tty, no solo el proceso!) int startx, starty; initscr(); /* Start curses mode */ cbreak(); /* Line buffering disabled, Pass on */ /* everty thing to me */ start_color(); use_default_colors(); init_pair(1, COLOR_GREEN, -1); init_pair(2, COLOR_RED, -1); init_pair(3, COLOR_YELLOW, COLOR_RED); init_pair(4, COLOR_YELLOW,-1); keypad(stdscr, TRUE); /* Activa las teclas de control. */ starty = (LINES - HEIGHT) / 4; /* Calcula la posición del centro de la pantalla */ startx = (COLS - WIDTH) / 2; printw("Presione Q para salir"); refresh(); my_win = create_newwin(HEIGHT, WIDTH, starty, startx); stats = create_newwin(6,30,starty, startx+60); msgs = create_newwin(9,80,starty+30,startx-13); struct Animal *player; player = (struct Animal *)malloc(sizeof(struct Animal)); draw_welcome(my_win,msgs,&player); my_win = create_newwin(HEIGHT, WIDTH, starty, startx); struct Nodo *cList = NULL; // ] struct Nodo *hList = NULL; // -> Los animales leidos se guardan en éstas listas. struct Nodo *pList = NULL; // ] int lim = loadData(&cList,&hList,&pList); //Carga las listas de animales, y devuelve el número de comidas. struct Cell matrix[9][9]; initMatrix(matrix); int px = matrix[4][4].xpos; int py = matrix[4][4].ypos; //GAME LOOP: //Primero, setear modo no-canonico //Esto permite obtener input en tiempo real //y no bloquar la ejecución mientras el usuario juega. nonCanonical(); char ch; int end = 0; int i = 0; int j = 0; while(!end) { ch = '0'; read(0,&ch,1); //Se lée el (posible) input del usuario. if(!(i % 3)) iterateMatrix(matrix,player); //Los NPC reaccionan cada 3 ticks. i++; switch(ch) { case 'a': if(!apply(matrix,player,&cList,&hList,&pList,'l')) draw_matrix(my_win,matrix,player); wrefresh(my_win); break; case 'd': if(!apply(matrix,player,&cList,&hList,&pList,'r')) draw_matrix(my_win,matrix,player); wrefresh(my_win); break; case 'w': if(!apply(matrix,player,&cList,&hList,&pList,'u')) draw_matrix(my_win,matrix,player); wrefresh(my_win); break; case 's': if(!apply(matrix,player,&cList,&hList,&pList,'d')) draw_matrix(my_win,matrix,player); wrefresh(my_win); break; case 'q': end = 1; break; default: draw_matrix(my_win,matrix,player); } if(player->eat(player,0) >= lim) { draw_msg("Limite de comidas alcanzado! Felicitaciones!",msg_buffer); draw_msg(" ",msg_buffer); draw_msg(" ",msg_buffer); canonical(&defs); getch(); end = 1; } if(player) draw_stats(stats, player, lim); if(player->getHP(player) < 1) { wattron(my_win,COLOR_PAIR(3)); for(i=-1;i<2;i++) for(j=-1;j<2;j++) mvwprintw(my_win,px+i,py+j," "); mvwprintw(my_win,px,py,"X"); wattroff(my_win,COLOR_PAIR(3)); wrefresh(my_win); draw_msg("Has sido devorado... ",msg_buffer); draw_msg(" ",msg_buffer); draw_msg(" ",msg_buffer); end = 1; canonical(&defs); getch(); } } canonical(&defs); endwin(); /* End curses mode */ return 0; }
void disco() { bool old_flip; mob_t * m; int i; pwait("THIS LOOKS LIKE A DANCE FLOOR!"); stile(player->y, player->x, TL_VOID); m = player; old_flip = m->flip; m->flip = true; m->type = MOB_DANCER; draw_board(); opause(); for (i = 0; i < 9; i++) { stile(m->y - 5 + i % 2, m->x - 4 + i, TL_DISCOLIGHT1 + i); draw_board(); lpause(); } NOW_DANCE(0); NOW_DANCE(1); NOW_DANCE(0); NOW_DANCE(1); DANCE_FLIP(); NOW_DANCE(0); NOW_DANCE(1); NOW_DANCE(0); NOW_DANCE(1); NOW_DANCE(0); NOW_DANCE(10); NOW_DANCE(11); NOW_DANCE(12); DANCE_FLIP(); NOW_DANCE(11); NOW_DANCE(10); NOW_DANCE(11); NOW_DANCE(12); DANCE_FLIP(); NOW_DANCE(11); DANCE_FLIP(); NOW_DANCE(20); NOW_DANCE(21); NOW_DANCE(20); NOW_DANCE(22); DANCE_FLIP(); NOW_DANCE(20); NOW_DANCE(21); NOW_DANCE(20); NOW_DANCE(22); // DANCE_FLIP(); m->x -= 1; NOW_DANCE(30); DANCE_FLIP(); m->x += 1; NOW_DANCE(30); DANCE_FLIP(); m->x += 1; NOW_DANCE(30); DANCE_FLIP(); m->x -= 1; NOW_DANCE(30); DANCE_FLIP(); m->x -= 1; NOW_DANCE(30); DANCE_FLIP(); m->x += 1; NOW_DANCE(30); DANCE_FLIP(); m->x += 1; NOW_DANCE(30); DANCE_FLIP(); m->x -= 1; NOW_DANCE(30); DANCE_FLIP(); Q_DANCE(31); DANCE_FLIP(); Q_DANCE(31); DANCE_FLIP(); Q_DANCE(31); DANCE_FLIP(); Q_DANCE(31); m->x += 1; DANCE_FLIP(); Q_DANCE(31); DANCE_FLIP(); Q_DANCE(31); m->x += 1; DANCE_FLIP(); Q_DANCE(31); DANCE_FLIP(); Q_DANCE(31); //DANCE_FLIP(); m->x -= 1; m->y -= 1; NOW_DANCE(40); m->x -= 1; NOW_DANCE(40); m->x -= 1; m->y += 1; NOW_DANCE(40); DANCE_FLIP(); Q_DANCE(31); DANCE_FLIP(); Q_DANCE(31); DANCE_FLIP(); Q_DANCE(31); DANCE_FLIP(); Q_DANCE(31); DANCE_FLIP(); m->x += 1; m->y -= 1; NOW_DANCE(40); m->x += 1; NOW_DANCE(40); m->x += 1; m->y += 1; NOW_DANCE(40); NOW_DANCE(50); m->x -= 1; NOW_DANCE(51); NOW_DANCE(50); m->x -= 1; NOW_DANCE(51); NOW_DANCE(50); m->x -= 1; NOW_DANCE(51); NOW_DANCE(50); m->x -= 1; NOW_DANCE(51); NOW_DANCE(50); // NOW_DANCE(51); DANCE_FLIP(); Q_DANCE(31); DANCE_FLIP(); Q_DANCE(31); m->x += 1; DANCE_FLIP(); Q_DANCE(31); DANCE_FLIP(); Q_DANCE(31); m->x += 1; DANCE_FLIP(); Q_DANCE(31); DANCE_FLIP(); Q_DANCE(31); NOW_DANCE(60); DANCE_FLIP(); NOW_DANCE(60); m->y += 1; NOW_DANCE(60); DANCE_FLIP(); m->y -= 1; NOW_DANCE(70); lpause(); NOW_DANCE(71); lpause(); NOW_DANCE(70); lpause(); NOW_DANCE(71); opause(); for (i = 0; i < 9; i++) { stile(m->y - 5, m->x - 4 + i, TL_VOID); stile(m->y - 4, m->x - 4 + i, TL_VOID); } m->type = MOB_PLAYER; m->flags = 0; m->flip = old_flip; draw_board(); lpause(); char line[DEFLEN]; snprintf(line, DEFLEN, "YOU GET %d EXPERIENCE", DISCO_EXP); pwait(line); draw_board(); give_exp(DISCO_EXP); draw_stats(); return; }
void hitFrame(frame *frm, FILE *urandom){ draw_stats(frm, urandom); return; //stub }