Guest User

Untitled

a guest
Apr 25th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. void iuse::nitro(game *g, player *p, item *it, bool t)
  2. {
  3. int dirx, diry;
  4. g->draw();
  5. mvprintw(0, 0, "Place where?");
  6. get_direction(dirx, diry, input());
  7. if (dirx == -2) {
  8. g->add_msg("Invalid direction.");
  9. return;
  10. }
  11. int posx = dirx + p->posx;
  12. int posy = diry + p->posy;
  13. if (g->m.move_cost(posx, posy) != 2) {
  14. g->add_msg("You can't place a %s there.", it->tname().c_str());
  15. return;
  16. }
  17. int time = query_int("Set the fuse length to (0 to cancel)?");
  18. if (time == 0) {
  19. g->add_msg("Never mind.");
  20. return;
  21. }
  22.  
  23. g->add_msg("You set the timer to %d.", time);
  24. it->make(g->itypes[itm_nitrocelulose_lit]);
  25. it->charges = time;
  26. it->active = true;
  27. g->m.add_item(posx, posy, it->type, 1);
  28. it->invlet = 0;
  29. }
Add Comment
Please, Sign In to add comment