123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #ifndef __OTORNADO_H
- #define __OTORNADO_H
- #ifndef __OSPRITE_H
- #include <OSPRITE.h>
- #endif
- #pragma pack(1)
- class Tornado : public Sprite
- {
- public:
- float attack_damage;
- short life_time;
- short dmg_offset_x;
- short dmg_offset_y;
- public:
- void init(short startX, short startY, short lifeTime);
-
-
- void pre_process();
- void process_move();
- void hit_target();
- void hit_building();
- void hit_plant();
- void hit_fire();
- short damage_x_loc() { return (cur_x + dmg_offset_x) >> ZOOM_X_SHIFT_COUNT; }
- short damage_y_loc() { return (cur_y + dmg_offset_y) >> ZOOM_Y_SHIFT_COUNT; }
-
- int write_file(File* filePtr);
- int read_file(File* filePtr);
- };
- #pragma pack()
- class TornadoArray : public SpriteArray
- {
- public:
- TornadoArray(int initArraySize);
- short create_tornado();
- short add_tornado(int xLoc, int yLoc, short lifeTime);
-
- #ifdef DEBUG
- Tornado* operator[](int recNo);
- #else
- Tornado* operator[](int recNo) { return (Tornado*) get_ptr(recNo); }
- #endif
- void process();
- void draw_dot();
-
- int write_file(File* filePtr);
- int read_file(File* filePtr);
- };
- extern TornadoArray tornado_array;
- #endif
|