Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void iuse::nitro(game *g, player *p, item *it, bool t)
- {
- int dirx, diry;
- g->draw();
- mvprintw(0, 0, "Place where?");
- get_direction(dirx, diry, input());
- if (dirx == -2) {
- g->add_msg("Invalid direction.");
- return;
- }
- int posx = dirx + p->posx;
- int posy = diry + p->posy;
- if (g->m.move_cost(posx, posy) != 2) {
- g->add_msg("You can't place a %s there.", it->tname().c_str());
- return;
- }
- int time = query_int("Set the fuse length to (0 to cancel)?");
- if (time == 0) {
- g->add_msg("Never mind.");
- return;
- }
- g->add_msg("You set the timer to %d.", time);
- it->make(g->itypes[itm_nitrocelulose_lit]);
- it->charges = time;
- it->active = true;
- g->m.add_item(posx, posy, it->type, 1);
- it->invlet = 0;
- }
Add Comment
Please, Sign In to add comment