counter.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* $Id$
  2. * MegaZeux
  3. *
  4. * Copyright (C) 1996 Greg Janson
  5. * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6. * Copyright (C) 1999 Charles Goetzman
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. */
  22. /* Declarations for COUNTER.CPP */
  23. #ifndef __COUNTER_H
  24. #define __COUNTER_H
  25. extern int player_restart_x;
  26. extern int player_restart_y;
  27. extern char was_zapped;
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. //Get a counter. Include robot id if a robot is running.
  32. int get_counter(char far *name,unsigned char id=0);
  33. //Sets the value of a counter. Include robot id if a robot is running.
  34. void set_counter(char far *name,int value=0,unsigned char id=0);
  35. //Decrease or increase a counter.
  36. void inc_counter(char far *name,int value=1,unsigned char id=0);
  37. void dec_counter(char far *name,int value=1,unsigned char id=0);
  38. //Take a key. Returns non-0 if none of proper color exist.
  39. char take_key(char color);
  40. //Give a key. Returns non-0 if no room.
  41. char give_key(char color);
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif