void plyr_act_equipped(int argc, char ** argv) { int i; wmove(dispscr, 0, 0); wprintw(dispscr, "Your equipment:\n"); for (i = 0; i < MAX_SLOTS; i++) { wprintw(dispscr, " %s: ", slot_names[i]); if (PLYR.slots[i] == NULL) wprintw(dispscr, "nothing\n"); else wprintw(dispscr, "%s\n", PLYR.slots[i]->name); } wgetch(dispscr); zone_draw(PLYR.z); wrefresh(dispscr); }
void plyr_act_enter(int argc, char ** argv) { int ox, oy; zone * oz; tile * t = tileof(&PLYR); if (t->linked) { // TODO generalize if (t->link_z == NULL) { ox = PLYR.x; oy = PLYR.y; oz = PLYR.z; // generate new zone vector_append(&world.zones, zone_new(150, 50)); // TODO why 150,50? t->link_z = world.zones.arr[world.zones.cnt - 1]; // place player randomly crtr_spawn(&PLYR, t->link_z); t->link_x = PLYR.x; t->link_y = PLYR.y; // link back t = tileof(&PLYR); t->linked = 1; t->link_x = ox; t->link_y = oy; t->link_z = oz; t->ch = '@'; t->show_ch = '@'; } else { if (!crtr_tele(&PLYR, t->link_x, t->link_y, t->link_z)) { memo("Your way appears to be blocked?"); } } update_vis(); zone_draw(PLYR.z); } else { memo("I see no visible method of doing that."); } }
// this probably should not be here static void redraw(void) { wclear(dispscr); zone_draw(PLYR.z); wrefresh(dispscr); }
static void scroll_view_down(int argc, const char ** argv) { scroll_disp(0, 1); zone_draw(PLYR.z); }
static void scroll_view_right(int argc, const char ** argv) { scroll_disp(1, 0); zone_draw(PLYR.z); }
static void scroll_view_center(int argc, const char ** argv) { scroll_center(PLYR.x, PLYR.y); zone_draw(PLYR.z); }