[56] | 1 | /* |
---|
| 2 | * Abuse - dark 2D side-scrolling platform game |
---|
| 3 | * Copyright (c) 1995 Crack dot Com |
---|
[494] | 4 | * Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net> |
---|
[56] | 5 | * |
---|
| 6 | * This software was released into the Public Domain. As with most public |
---|
[555] | 7 | * domain software, no warranty is made or implied by Crack dot Com, by |
---|
| 8 | * Jonathan Clark, or by Sam Hocevar. |
---|
[56] | 9 | */ |
---|
| 10 | |
---|
[2] | 11 | #ifndef __GO_HPP_ |
---|
| 12 | #define __GO_HPP_ |
---|
[481] | 13 | #include "objects.h" |
---|
[2] | 14 | |
---|
| 15 | class elcontrol : public game_object |
---|
| 16 | { |
---|
[124] | 17 | public: |
---|
| 18 | short allow_dir; |
---|
| 19 | elcontrol(long X, long Y); |
---|
[2] | 20 | elcontrol(FILE *fp, unsigned char *state_remap); |
---|
| 21 | virtual int size() { return game_object::size()+2; } |
---|
[124] | 22 | virtual game_objects type() { return O_elcontrol; } |
---|
[2] | 23 | virtual ifield *make_fields(int ystart, ifield *Next); |
---|
[120] | 24 | virtual void gather_input(InputManager *inm); |
---|
[2] | 25 | virtual void save(FILE *fp) { game_object::save(fp); write_short(fp,allow_dir); } |
---|
| 26 | virtual int decide() { return 1; } // not dead |
---|
[124] | 27 | virtual int move(int cx, int cy, int button) { return 0; } // not blocked |
---|
| 28 | virtual void draw(); // only show when DEV mode is on |
---|
[2] | 29 | } ; |
---|
| 30 | |
---|
| 31 | |
---|
[124] | 32 | |
---|
[2] | 33 | class elevator : public game_object |
---|
| 34 | { |
---|
| 35 | short dir,speed; |
---|
[124] | 36 | public : |
---|
[2] | 37 | elcontrol *find_stop(); |
---|
[124] | 38 | elevator(long X, long Y); |
---|
[2] | 39 | elevator(FILE *fp, unsigned char *state_remap); |
---|
| 40 | virtual int size(); |
---|
[653] | 41 | virtual void receive_signal(long signal) { (void)signal; } |
---|
[2] | 42 | virtual game_objects type() { return O_elevator; } |
---|
[124] | 43 | virtual ifield *make_fields(int ystart, ifield *Next); |
---|
| 44 | virtual void gather_input(InputManager *inm); |
---|
[2] | 45 | virtual void save(FILE *fp); |
---|
| 46 | virtual int can_block(game_object *who); |
---|
| 47 | virtual int decide(); |
---|
| 48 | virtual void draw(); // draw cables above the elevator |
---|
| 49 | } ; |
---|
| 50 | |
---|
| 51 | class sensor : public game_object |
---|
| 52 | { |
---|
[124] | 53 | short xrange,yrange,signal,activate; |
---|
[2] | 54 | public : |
---|
| 55 | sensor(long X, long Y) { defaults(); xrange=yrange=signal=0; activate=-1; } |
---|
| 56 | sensor(FILE *fp, unsigned char *state_remap); |
---|
| 57 | virtual int size(); |
---|
| 58 | virtual game_objects type() { return O_sensor; } |
---|
| 59 | virtual ifield *make_fields(int ystart, ifield *Next); |
---|
[124] | 60 | virtual void gather_input(InputManager *inm); |
---|
[2] | 61 | virtual void save(FILE *fp); |
---|
| 62 | |
---|
[124] | 63 | virtual void draw(); // only show when DEV mode is on |
---|
[2] | 64 | virtual int decide(); |
---|
[124] | 65 | virtual int move(int cx, int cy, int button) { return 0; } // not blocked |
---|
[2] | 66 | |
---|
| 67 | char *aname(); |
---|
| 68 | void get_activate(char *name); |
---|
[124] | 69 | |
---|
[2] | 70 | } ; |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | #endif |
---|
| 74 | |
---|